dev-master
9999999-devATTENTION: EXPERIMENTAL! Amylian Utilities
BSD-3-Clause
ATTENTION: EXPERIMENTAL! Amylian Utilities
Copyright (c) 2018, Andreas Prucha (Abexto - Helicon Software Development / Amylian Project) andreas.prucha@gmail.com, (*1)
This package contains a collection of miscellaneous utility classes and functions, (*2)
To install this library, run the command below and you will get the latest version, (*3)
``` bash composer require amylian/amylian-utils --dev, (*4)
##PropertyTrait Using \Amylian\Utils\PropertyTrait in a class enables property support by getter and setter. Access to private/protected member variables are automatically redirected to methods following the getXxx and setXxx convention. Example:
/** * @property mixed $prop Property automatically getted and setted by getProp and setProp */ class ObjectWithProperties { use \Amylian\Utils\ṔropertyTrait;, (*5)
public $memb = null; private $prop = null; public function getProp() { return $this->prop; } public function setProp($value) { $this->prop = $value; }
} ```, (*6)
In this example, both $obj->memb
and $obj->prop
will be acceable from outside as the
methods getProp()
and setProp()
are public and automatically called., (*7)
NOTE: \Amylian\Utils\ṔropertyTrait implements the magic functions __get()
, __set()
, __isset()
and __unset()
., (*8)
ATTENTION: EXPERIMENTAL! Amylian Utilities
BSD-3-Clause