/** * 析构函数 * * @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']; }
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]; }