/** * Returns an instance of Showcase_Client * * Singleton pattern implementation * * @return Showcase_Client Provides a fluent interface */ public static function getInstance() { if (null === self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
public function getClientContent($clientId, $contentId, $contentStatus, $clientStatus = 1) { //echo $clientId, $offset, $limitJobs, $clientStatus; die; $stmt = Zend_Registry::get('dbh')->proc('load_client'); $stmt->bindParam(':id', $clientId, PDO::PARAM_INT); $stmt->bindParam(':status', $clientStatus, PDO::PARAM_INT); try { $stmt->execute(); $client = $stmt->fetch(PDO::FETCH_OBJ); $stmt->closeCursor(); } catch (Zend_Db_Statement_Exception $e) { die($e->getMessage()); } // handle empty pull if (empty($client)) { /* $redirect = new Zend_Controller_Action_Helper_Redirector; $redirect->setGotoUrl('index'); */ die; } //echo $clientId, $contentId, $contentStatus; die; $content = Zend_Controller_Action_HelperBroker::getStaticHelper('Content'); $categories = Zend_Controller_Action_HelperBroker::getStaticHelper('Category'); $status = Zend_Controller_Action_HelperBroker::getStaticHelper('Status'); $client->content = $content->direct($clientId, $contentId, $contentStatus); $client->categories = $categories->direct($clientId); $client->status = $status->getStatus($clientStatus); $client = Showcase_Client::factory($client); // pass the object to factory return $client; }