1. Bogdan Savluk
  2. i18d-galleryManager

Commits

Bogdan Savluk  committed 753ef54

sport/albums

  • Participants
  • Parent commits 4627545
  • Branches default

Comments (0)

Files changed (1)

File GalleryBehavior.php

View file
  • Ignore whitespace
         $criteria->order = '`rank` asc';
         return GalleryPhoto::model()->findAll($criteria);
     }
+
+    /** @return int from associated gallery */
+    public function getGalleryPhotoCount()
+    {
+        $criteria = new CDbCriteria();
+        $criteria->condition = 'gallery_id = :gallery_id';
+        $criteria->params[':gallery_id'] = $this->getOwner()->{$this->idAttribute};
+        return GalleryPhoto::model()->count($criteria);
+    }
 }