public static function &connection()
 {
     if (static::$connection) {
         return static::$connection;
     }
     return parent::connection();
 }
示例#2
0
 public function save($entity, $data = null, array $options = array())
 {
     if ($data) {
         $entity->set($data);
     }
     if (!$entity->exists() && isset($entity->file->tmp_name)) {
         $entity->location = Geocoder::exifCoords(exif_read_data($entity->file->tmp_name));
     }
     if ($entity->tags && !is_array($entity->tags)) {
         $entity->tags = array_map('trim', explode(',', $entity->tags));
     }
     return parent::save($entity, null, $options);
 }