ICanBoogie
  • Documentation
  • API Reference
  • Prototype v2.1.0
Namespaces
  • ICanBoogie
    • Prototype
Classes
  • Object
  • Prototype
Traits
  • PrototypeTrait

Trait PrototypeTrait

ICanBoogie\PrototypeTrait uses ICanBoogie\Accessor\AccessorTrait (not available) ICanBoogie\Accessor\SerializableTrait (not available)

Direct Known Users

ICanBoogie\Object

Namespace: ICanBoogie
Located at PrototypeTrait.php

Methods summary

public __call( string $method, array $arguments ) : mixed

If a property exists with the name specified by $method and holds an object which class implements __invoke then the object is called with the arguments. Otherwise, calls are forwarded to the $prototype.

If a property exists with the name specified by $method and holds an object which class implements __invoke then the object is called with the arguments. Otherwise, calls are forwarded to the $prototype.

Parameters

$method
$arguments

Returns

mixed
public __sleep( void ) : array

The method returns an array of key/key pairs.

The method returns an array of key/key pairs.

Properties for which a lazy getter is defined are discarded. For instance, if the property next is defined and the class of the instance defines the getter lazy_get_next(), the property is discarded.

Note that façade properties are also included.

Warning: The code used to export private properties seams to produce frameless exception on session close. If you encounter this problem you might want to override the method. Don't forget to remove the prototype property!

Returns

array
public has_property( string $property ) : boolean

Checks if the object has the specified property.

Checks if the object has the specified property.

The difference with the property_exists() function is that this method also checks for getters defined by the class or the prototype.

Parameters

$property
The property to check.

Returns

boolean
true if the object has the property, false otherwise.
public has_method( string $method ) : boolean

Checks whether this object supports the specified method.

Checks whether this object supports the specified method.

The method checks for methods defined by the class and the prototype.

Parameters

$method
Name of the method.

Returns

boolean
true if the method is defined, false otherwise.
protected get_prototype( void ) : ICanBoogie\Prototype

Returns the prototype associated with the class.

Returns the prototype associated with the class.

Returns

ICanBoogie\Prototype
public accessor_get( $property )

Inheritdoc

public accessor_set( $property, $value )

Inheritdoc

protected last_chance_get( string $property, boolean & $success ) : mixed

The method is invoked as a last chance to get a property, just before an exception is thrown.

The method is invoked as a last chance to get a property, just before an exception is thrown.

The method uses the helper Prototype\last_chance_get().

Parameters

$property
Property to get.
$success
If the last chance get was successful.

Returns

mixed
protected last_chance_set( string $property, mixed $value, boolean & $success )

The method is invoked as a last chance to set a property, just before an exception is thrown.

The method is invoked as a last chance to set a property, just before an exception is thrown.

The method uses the helper Prototype\last_chance_set().

Parameters

$property
Property to set.
$value
Value of the property.
$success
If the last chance set was successful.
Prototype v2.1.0 – Check on GitHub – API documentation generated by ApiGen