public function init() { parent::init(); $this->addField('name'); $this->addField('surname'); $this->addField('gender', ['enum' => ['M', 'F']]); }
public function init() { parent::init(); // Documest is sent from one Contact to Another $this->hasOne('contact_from_id', new Contact()); $this->hasOne('contact_to_id', new Contact()); $this->addField('doc_type', ['enum' => ['invoice', 'payment']]); $this->addField('amount', ['type' => 'money']); }
public function init() { parent::init(); $this->addField('name'); $this->hasMany('SubFolder', [new self(), 'their_field' => 'parent_id'])->addField('count', ['aggregate' => 'count', 'field' => $this->expr('*')]); $this->hasOne('parent_id', new self())->addTitle(); $this->addField('is_deleted', ['type' => 'boolean']); $this->addCondition('is_deleted', false); }
public function init() { parent::init(); // Company data is stored in 3 tables actually. $j_contractor = $this->join('contractor'); $j_company = $j_contractor->join('company.contractor_id', ['prefix' => 'company_']); $j_contractor->addFields([['name', 'actual' => 'legal_name']]); $j_company->addFields([['business_start', 'type' => 'date'], ['director_name'], ['vat_calculation_type', 'enum' => ['cash', 'invoice']]]); $this->addFields([['is_vat_registered', 'type' => 'boolean']]); }
public function init() { parent::init(); $this->addField('type', ['enum' => ['client', 'supplier']]); $this->addField('name'); }
public function init() { parent::init(); $this->addField('name'); $this->hasMany('Payment', new Payment())->addField('balance', ['aggregate' => 'sum', 'field' => 'amount']); }
public function init() { parent::init(); $this->addField('name'); $this->addField('surname'); }