public static function log(Model_List $list, $description) { $list->touch(); $t = new Model_Listtransaction(); $t->list_id = $list->id; $t->description = $description; $t->save(); }
public function __construct(Storage_Ldap $db, $filter = "", $limit = 0) { if (!$filter instanceof Storage_Ldap_Result) { $filter = $db->select($this->_pk, $filter, $limit); } parent::__construct($db, $filter); }
public function find($condition, $limit = 0, $offset = 0, $order = "", $group = "", $having = "") { if (!$condition instanceof Storage_Db_Result) { $condition = $this->_db->select($this->_view, "*", $condition, $limit, $offset, $order, $group, $having); } return parent::find($condition); }
private function getModelsList($objname, $page = 0) { $model = Model_List::create($this->_db, $objname); $table = $model->getTable(); $result = $this->_db->select(array('tag_relations', $table), "{$table}.*", "tag_relations.obj_type = '{$table}' and tag_relations.obj_id = {$table}.id and tag_relations.tag_id = " . $this->getId()); $model->find($result); return $model; }
/** Update a mailing list */ public static function updateList() { self::access('admin'); Model_List::updateBean($_REQUEST); RedView::end('message', 'List updated.'); }
public function action_subscribe() { $list_id = $this->request->param('id'); $list = new Model_List($list_id); $this->redirect_if_not_on_list(); if ($list->is_user_subscribed($this->me())) { Message::add('danger', 'You are already subscribed to this list'); Request::current()->redirect('list/friend/' . $list->id); } $me = new Model_Owner($this->me()->id); $me->subscribe_to_list($list); Message::add('success', 'Subscribed to this list'); //Request::current()->redirect('list/friend/' . $list->id); }