예제 #1
0
파일: Module.php 프로젝트: nhc/Umc_Base
 /**
  * __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);
 }
예제 #2
0
파일: Entity.php 프로젝트: nhc/Umc_Base
 /**
  * __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);
 }
예제 #3
0
 /**
  * @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);
 }