コード例 #1
0
 /**
  * @param array|bool $data
  * @return LiteObject
  */
 protected function createInstance($data = false)
 {
     if ($this->mapper) {
         return $this->mapper->getObject($data);
     } else {
         /** @var LiteObject $instance */
         $instance = new $this->className();
         if ($data) {
             $instance->fromArray($data);
         }
         return $instance;
     }
 }
コード例 #2
0
 /**
  * @param mixed $rawValue
  * @return mixed
  */
 public function toObjectValue($rawValue)
 {
     return $this->mapper->getObject($rawValue, $this->className);
 }