/** * DocumentFieldDBMapper constructor. */ public function __construct() { parent::__construct(); $this->model = 'DocumentField'; }
/** * ActionDBMapper constructor. */ public function __construct() { parent::__construct(); $this->model = 'Action'; }
/** * TargetGroupDBMapper constructor. */ public function __construct() { parent::__construct(); $this->model = 'TargetGroup'; }
protected function doFind($id, \Lysine\Service\IService $service = null, $collection = null) { if ($record = $this->getCache($id)) { return $record; } if (!($record = parent::doFind($id, $service, $collection))) { return $record; } // 值为NULL的字段不用缓存 foreach ($record as $key => $val) { if ($val === null) { unset($record[$key]); } } $this->saveCache($id, $record); return $record; }
/** * MandatoryDBMapper constructor. */ public function __construct() { parent::__construct(); $this->model = 'Mandatory'; }
/** * LinkCategoryDBMapper constructor. */ public function __construct() { parent::__construct(); $this->model = 'LinkCategory'; }
/** * Updates document in database by inserting new, returns id if success, error otherwise * @param $document_input * @return mixed */ public function update($document_input) { $document_id = parent::update($document_input); return $this->addContentToDocument($document_input->getTargetGroups(), $document_input->getLinks(), $document_input->getFields(), $document_id); }