/** * search according to the conditions of mail rules * @param string $condition * @return object */ function getConditionsRules($condition) { return MailContents::findAll(array('conditions' => $condition, 'join' => array('table' => MailDatas::instance()->getTableName(), 'jt_field' => 'id', 'e_field' => 'object_id'))); }
/** * This function will return paginated result. Result is an array where first element is * array of returned object and second populated pagination object that can be used for * obtaining and rendering pagination data using various helpers. * * Items and pagination array vars are indexed with 0 for items and 1 for pagination * because you can't use associative indexing with list() construct * * @access public * @param array $arguments Query argumens (@see find()) Limit and offset are ignored! * @param integer $items_per_page Number of items per page * @param integer $current_page Current page number * @return array */ function paginate($arguments = null, $items_per_page = 10, $current_page = 1, $count = null) { if (isset($this) && instance_of($this, 'MailDatas')) { return parent::paginate($arguments, $items_per_page, $current_page, $count); } else { return MailDatas::instance()->paginate($arguments, $items_per_page, $current_page, $count); //$instance =& MailDatas::instance(); //return $instance->paginate($arguments, $items_per_page, $current_page); } // if }
/** * Return manager instance * * @access protected * @param void * @return MailDatas */ function manager() { if(!($this->manager instanceof MailDatas)) $this->manager = MailDatas::instance(); return $this->manager; } // manager
/** * Return manager instance * * @access protected * @param void * @return MailDatas */ function manager() { if (!$this->manager instanceof MailDatas) { $this->manager = MailDatas::instance(); } return $this->manager; }