_idSlide = (int) $idSlide; return $this; } public function getIdSlide() { return $this->_idSlide; } protected function _initSlide() { if (null == $this->_slideObj) { $this->_slideObj = new App_Slide_AdminObj(); $this->_slideObj->setPrimaryKey($this->_idSlide); $this->_slideObj->initData(); self::$_slideData = $this->_slideObj->getData(); if (!empty(self::$_slideData)) { self::$_slideData['width'] = $this->_slideObj->imageWidth; self::$_slideData['height'] = $this->_slideObj->imageHeight; } } return $this; } public function getSlideImage() { $this->_initSlide(); $image = ''; if (!empty(self::$_slideData)) { $image = self::$_slideData['image']; } return $image; } public function getSlideTitle() { $this->_initSlide(); $title = ''; if (!empty(self::$_slideData)) { $title = self::$_slideData['title']; } return $title; } public function getSlideData($field = false) { $data = array(); $this->_initSlide(); if (!empty(self::$_slideData)) { $data = self::$_slideData; } return Qs_Array::get($data, $field); } protected function _getFromDb($key) { $select = $this->_getSelect(); $select->reset(); $select->from(array($this->_tableAlias => $this->_getTableName()), '*') ->where("{$this->_tableAlias}.idBanner = ?", (int) $this->getIdSlide()); $statement = $select->query(); $rows = $statement->fetchAll(); if (count($rows)) { return $rows; } return false; } public function getData($field = false, $forceFromDb = false) { if ($forceFromDb || null === $this->_data) { $this->_data = $this->_getFromDb($this->getPrimaryKey()); if (!$this->_data) { $this->_data = null; } } return Qs_Array::get($this->_data, $field); } }