コード例 #1
0
 public function __construct($whereClause = '1')
 {
     parent::__construct($whereClause);
     $sql = "\n\t\t\tSELECT `ID`\n\t\t\tFROM `" . Project::TABLE . "`\n\t\t\tWHERE {$whereClause}\n\t\t";
     $this->dbObjects = array_map(function ($id) {
         return new Project($id);
     }, DB::query($sql)->fetchFirstColumn());
 }
コード例 #2
0
ファイル: dahlen_image.php プロジェクト: elpadi/dahlen-studio
 public function __construct($slideshowID)
 {
     parent::__construct('`SlideshowID`=' . $slideshowID);
     $sql = "SELECT `zp_images`.`id` FROM `zp_images` JOIN " . SlideshowImage::TABLE . " ON `ZenphotoID`=`id` AND `SlideshowID`={$slideshowID} ORDER BY `sort_order`";
     foreach (DB::query($sql)->fetchAllAssoc() as $row) {
         $this->dbObjects[] = new SlideshowImage($slideshowID, $row['id']);
     }
     $this->hydrate();
     $this->objectColumns = $this->dbObjects[0]->editKeys;
     $this->infoKeys = array('maxWidth', 'minWidth', 'avgWidth', 'maxHeight', 'minHeight', 'avgHeight', 'maxAspectRatio', 'minAspectRatio', 'avgAspectRatio');
     $this->editActions = array('center', 'centerVertically', 'centerHorizontally');
     $this->editTitle = 'Edit Slideshow Images';
 }