/**
 * @param null $name - table name of the entity
 * @return Entity
 */
function entity($name = null)
{
    if ($name) {
        $entity = new Entity();
        $entity->setTableName($name);
        return $entity;
    } else {
        return new Entity();
    }
}
Beispiel #2
0
 public function test_entity_table_name()
 {
     $name = 'abc';
     //
     $entity = new \of\Entity();
     test($entity instanceof Entity, 'OK', 'ERROR');
     test(entity() instanceof Entity, 'OK', 'ERROR');
     //
     $entity->setTableName($name);
     test($entity->getTableName() == entity()->adjustTableName($name), 'OK', 'ERROR - table name adjusting failed');
     test($entity->getTableName() == $this->adjustTableName($name), 'OK', 'ERROR');
     //
 }
Beispiel #3
0
 /**
  * 코드를 입력받아서 현재 object 에 로드 한 다음, 값을 리턴한다.
  *
  * @param $code
  * @return bool|mixed
  */
 public function get($code)
 {
     $meta = $this->load($code);
     if ($meta) {
         return parent::get('value');
     } else {
         return FALSE;
     }
 }
Beispiel #4
0
 public function __construct()
 {
     parent::__construct();
 }