public function getPhotos() { $photo = new Photo(); $photo->getBy("kind_id='" . constant(strtoupper($this->_class_name)) . "' AND object_id={$this->id}"); $res = $photo->fetchAll(); if (!$res) { $res = array(); } return $res; }
public static function getPhotosStatic($id) { $called_class = get_called_class(); $photo = new Photo(); $photo->getBy("kind_id='" . constant(strtoupper($called_class)) . "' AND object_id={$id}"); $res = $photo->fetchAll(); if (!$res) { $res = array(); } return $res; }