ICanBoogie/Accessor master
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Accessor

Classes

  • AccessorReflection

Interfaces

  • HasAccessor

Traits

  • AccessorCamelTrait
  • AccessorSnakeTrait
  • AccessorTrait
  • FormatAsCamel
  • FormatAsSnake
  • SerializableTrait

Interface HasAccessor

Interface for classes implementing the accessor pattern.

Namespace: ICanBoogie\Accessor
Located at HasAccessor.php

Methods summary

public static mixed
# accessor_format( string $property, string $type, string $lazy = self::ACCESSOR_IS_NOT_LAZY )

Formats an accessor method name.

Formats an accessor method name.

Parameters

$property
A property.
$type
One of ICanBoogie\Accessor\HasAccessor::ACCESSOR_TYPE_GETTER and ICanBoogie\Accessor\HasAccessor::ACCESSOR_TYPE_SETTER.
$lazy

One of ICanBoogie\Accessor\HasAccessor::ACCESSOR_IS_NOT_LAZY and ICanBoogie\Accessor\HasAccessor::ACCESSOR_IS_LAZY. Defaults to ICanBoogie\Accessor\HasAccessor::ACCESSOR_IS_NOT_LAZY.

Returns

mixed
public mixed
# __get( string $property )

Returns the value of a property.

Returns the value of a property.

Parameters

$property

Returns

mixed

Throws

ICanBoogie\PropertyNotDefined
when the property is not defined.
ICanBoogie\PropertyNotReadable

when the property is not accessible or is write-only (the property is not defined and only a setter is available).

public
# __set( string $property, mixed $value )

Sets the value of a property.

Sets the value of a property.

Parameters

$property
$value

Throws

ICanBoogie\PropertyNotWritable

when the property doesn't exists, has no lazy getter and is not public; or when only a getter is implemented.

public boolean
# has_property( string $property )

Whether an object has a property.

Whether an object has a property.

Parameters

$property

Returns

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

Whether an object has a method.

Whether an object has a method.

Parameters

$method

Returns

boolean
true if the object has a method, false otherwise.

Constants summary

string ACCESSOR_TYPE_GETTER
# "get"
string ACCESSOR_TYPE_SETTER
# "set"
string ACCESSOR_IS_LAZY
# 'lazy'
string ACCESSOR_IS_NOT_LAZY
# ''
ICanBoogie/Accessor master API documentation generated by ApiGen