Exemplo n.º 1
0
 public function moveDown()
 {
     $db = new PHPWS_DB('signup_slots');
     $db->addWhere('sheet_id', $this->sheet_id);
     $db->addColumn('id', null, null, true);
     $slot_count = $db->select('one');
     // If not already at bottom, move down one spot
     if ($this->s_order != $slot_count) {
         $db->resetColumns();
         $db->addWhere('s_order', $this->s_order + 1);
         $db->addValue('s_order', $this->s_order);
         $db->update();
         $this->s_order++;
         $this->save();
     }
 }
Exemplo n.º 2
0
 public static function getEntries(PHPWS_DB $db, $limit, $offset = 0)
 {
     $db->resetColumns();
     $db->setLimit($limit, $offset);
     $db->addOrder('sticky desc');
     $db->addOrder('publish_date desc');
     $db->loadClass('blog', 'Blog.php');
     return $db->getObjects('Blog');
 }