GitLab now enforces expiry dates on tokens that originally had no set expiration date. Those tokens were given an expiration date of one year later. Please review your personal access tokens, project access tokens, and group access tokens to ensure you are aware of upcoming expirations. Administrators of GitLab can find more information on how to identify and mitigate interruption in our documentation.
In PHP we have StdClass on which we can set and get any direct property
```php
$o=newStdClass();
$o->title='my title';
echo$o->title;// -> my title
```
_Class_Entity_ provides same functionality with getter and setter methods
```php
$o=newClass_Entity();
$o->setTitle('my title');
echo$o->getTitle();// -> my title
```
## Implementation
Any call to set*() will be catched to populate an internal key => value array, it will return $this to chain calls.
Any call to get*() will look for an existing key in internal array and will return its value or null if not found.
Keys of internal array are not transformed in any way
* setMyValue will produce a 'MyValue' key
* set_my_value will produce a '_my_value' key
* setmyvalue will produce a 'myvalue' key
You can define default values by setting
```php
protected$_attribs=['MyValue'=>''];
```
Then a getMyValue() call will return an empty string instead of null if not set.
## Use cases
### In tests
When you have an API relying on getter and setter methods you can provide a _Class_Entity_ as a mock and easily verify that an attribute has been set or prepare it with attributes needed by tested code.
### In general
When you are modeling an object and don't want to write all those standard getters and setters just extend Class_Entity.