Webiny\Component\Entity\AbstractEntity::__construct PHP Method

__construct() public method

Entity constructor
public __construct ( )
    public function __construct()
    {
        if (!$this->attributes) {
            $this->attributes = $this->arr();
        }
        if (!$this->attributeBuilder) {
            $this->attributeBuilder = new EntityAttributeBuilder($this, $this->attributes);
        }
        /**
         * Add ID to the list of attributes
         */
        $this->attr('id')->char();
    }

Usage Example

Esempio n. 1
0
 function __construct()
 {
     parent::__construct();
     $this->attr('ip')->char();
     $this->attr('timestamp')->integer()->setDefaultValue(0);
     $this->attr('username')->char();
 }
All Usage Examples Of Webiny\Component\Entity\AbstractEntity::__construct