Example #1
0
 /**
  * retrieve an item
  *
  * @param int $id itemid of the user
  * @return mixed reference to the {@link SmartsectionItem} object, FALSE if failed
  */
 function &get($id)
 {
     if (intval($id) > 0) {
         $sql = 'SELECT * FROM ' . $this->db->prefix('smartsection_items') . ' WHERE itemid=' . $id;
         if (!($result = $this->db->query($sql))) {
             return false;
         }
         $numrows = $this->db->getRowsNum($result);
         if ($numrows == 1) {
             $item = new SmartsectionItem();
             $item->assignVars($this->db->fetchArray($result));
             $item->assignOtherProperties();
             return $item;
         }
     }
     return false;
 }