Download the PHP package jinnguyen/puja-entity without Composer
On this page you can find all versions of the php package jinnguyen/puja-entity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package puja-entity
puja-entity
Puja-Entity is an abstract layer to manage a entity object and easy to get the Docblock document
Install
composer required jinnguyen/puja-entity
Usage
include '/path/to/vendor/autoload.php'; use Puja\Entity\Entity;
Examples
/** * This comment is copied from ContentEntity->getDocblock(); you should do it each time you change the ContentEntity->attributes * @method int getId() * @method setId(int $attr) * @method hasId() * @method unsetId() * @method string getName() * @method setName(string $attr) * @method hasName() * @method unsetName() * @method string getCreatedAt() * @method setCreatedAt(string $attr) * @method hasCreatedAt() * @method unsetCreatedAt() * @method string getCreatedAt() * @method setCreatedAt(string $attr) * @method hasCreatedAt() * @method unsetCreatedAt() * @method Category getCategory() * @method setCategory(Category $attr) * @method hasCategory() * @method unsetCategory() */ class ContentEntity extends Entity { protected $attributes = array( 'id' => Entity::DATATYPE_INT, 'name' => Entity::DATATYPE_STRING, 'created_at' => Entity::DATATYPE_STRING, 'price' => Entity::DATATYPE_INT, 'category' => 'Category', ); protected $defaults = array( 'price' => 5, ); } class Category { public $id = 1; public $name = 'Category 1'; } $content = new ContentEntity(array( 'id' => 1, 'name' => 'Content 1', 'created_at' => '2016-11-18 00:00:00', 'category' => new Category() )); echo $content->getId(); // 1 echo $content->getName(); // Content 1 echo $content->getCreatedAt(); // 2016-11-18 00:00:00 echo $content->getId(); // 5 $category = $content->getCategory(); echo $category->name; // Category 1 echo $content->getDocblock(); // The dockbock content is used above class ContentEntity
Note: ContentEntity is Entity, but Category is not.
All versions of puja-entity with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3
The package jinnguyen/puja-entity contains the following files
Loading the files please wait ....