/** * __call magic method * handle getEntityFlag and getHasAttributeType calls * * @param string $method * @param array $args * @return mixed */ public function __call($method, $args) { if (substr($method, 0, strlen('getEntityFlag')) == 'getEntityFlag') { $key = $this->_underscore(substr($method, strlen('getEntityFlag'))); return $this->getEntityFlag($key); } if (substr($method, 0, strlen('getHasAttributeType')) == 'getHasAttributeType') { $key = $this->_underscore(substr($method, 0, 3)); return $this->getEntityFlag($key); } return parent::__call($method, $args); }
/** * __call magic method * handle the getHasAttributeType, getHasRelationType calls * * @param string $method * @param array $args * @return bool|mixed */ public function __call($method, $args) { if (substr($method, 0, strlen('getHasAttributeTypeRequired')) == 'getHasAttributeTypeRequired') { $key = $this->_underscore(substr($method, strlen('getHasAttributeTypeRequired'))); return $this->getHasAttributeTypeRequired($key); } if (substr($method, 0, strlen('getHasAttributeType')) == 'getHasAttributeType') { $key = $this->_underscore(substr($method, strlen('getHasAttributeType'))); return $this->getHasAttributeType($key); } if (substr($method, 0, strlen('getHasRelationType')) == 'getHasRelationType') { $key = $this->_underscore(substr($method, strlen('getHasRelationType'))); return $this->hasRelationType($key); } return parent::__call($method, $args); }
/** * @param string $method * @param array $args * @return mixed */ public function __call($method, $args) { if (substr($method, 0, strlen('getE1')) == 'getE1') { $entities = $this->getEntities(); $key = $this->_underscore(substr($method, strlen('getE1'))); return $entities[0]->getDataUsingMethod($key); } if (substr($method, 0, strlen('getE2')) == 'getE2') { $entities = $this->getEntities(); $key = $this->_underscore(substr($method, strlen('getE2'))); return $entities[1]->getDataUsingMethod($key); } return parent::__call($method, $args); }