Esempio n. 1
0
 public static function find($unit, $option = array())
 {
     if ($unit == 'one') {
         return ($datas = parent::find(self::typeName(), array_merge($option, array('limit' => 1, 'offset' => 0)))) ? new self($datas[0]) : null;
     } else {
         return array_map(function ($data) {
             return new self($data);
         }, parent::find(self::typeName(), $option));
     }
 }