Yoast\WP\SEO\Presentations
Abstract_Presentation::__get() public Yoast 1.0
Magic getter for lazy loading of generate functions.
{} Это метод класса: Abstract_Presentation{}
Хуков нет.
Возвращает
Разное. The value if it could be generated.
Использование
$Abstract_Presentation = new Abstract_Presentation(); $Abstract_Presentation->__get( $name );
- $name(строка) (обязательный)
- The property to get.
Код Abstract_Presentation::__get() Abstract Presentation:: get Yoast 15.6.2
public function __get( $name ) {
if ( $this->is_prototype() ) {
throw new Exception( 'Attempting property access on prototype presentation. Use Presentation::of( $data ) to get a model presentation.' );
}
$generator = "generate_$name";
if ( \method_exists( $this, $generator ) ) {
$this->{$name} = $this->$generator();
return $this->{$name};
}
throw new Exception( "Property $name has no generator. Expected function $generator." );
}