示例#1
0
 /**
  * 析构函数
  *
  * @param string $entityType
  */
 public function __construct($entityType)
 {
     $this->entityType = $entityType;
     $this->entityInfo = EntityConfigurator::getEntityInfo($entityType);
     $this->primaryKey = $this->entityInfo['primaryKey'];
     $this->cacheBin = $this->entityInfo['cacheBin'];
 }
示例#2
0
function entity($entityType)
{
    static $controllers = array();
    if (!isset($controllers[$entityType])) {
        $info = EntityConfigurator::getEntityInfo($entityType);
        $class = $info['controller'];
        $controllers[$entityType] = new $class($entityType);
    }
    return $controllers[$entityType];
}