public function title($html = FALSE) { $return = ''; if ($html) { $return .= '<i class="fa fa-home"></i> '; } $return .= parent::title(); return $return; }
public function delete($object = '', $related_field = '') { // if something is given, then just pass it over, the caller must be knowing what he's doing if ($object) { return parent::delete($object, $related_field); } else { $has = array_merge(array_keys($this->has_one), array_keys($this->has_many)); foreach ($has as $rfield) { $this->{$rfield}->get()->delete_all(); } return parent::delete(); } }
public function get($id, $bizid = 0, $uid = 0) { if (!$bizid) { return parent::get($id); } $photo = array(); $uid == 0 ? $biz_photos_stats = $this->get_biz_photo_stats($bizid) : ($biz_photos_stats = $this->get_user_photo_stats($uid, $bizid)); $biz_photos = $biz_photos_stats['photos']; if (isset($biz_photos[$id])) { $photo = $biz_photos[$id]; } return $photo; }
/** * 会员分页构造函数 * * @access public * @return void */ public function __construct() { parent::__construct(); }
public function __get($name) { switch ($name) { case 'time_id': return $this->start . '-' . $this->end; break; } return parent::__get($name); }
/** * 构造函数 * * @access public * @return void */ public function __construct() { parent::__construct(); $this->_tablename = 'sys_menu'; $this->_rolename = 'sys_role_priv'; }
public function __construct() { parent::__construct(); $this->set('table', 'messages'); }
function __construct() { parent::__construct(); $this->load->library('mongo_db'); }