Ejemplo n.º 1
0
/**
 * @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();
    }
}
Ejemplo n.º 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');
     //
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
 }