public function getList(array $options)
    {
        $options += array('active' => true);

        $sql = 'SELECT * FROM dashboard';

        $conditions = array();

        if (isset($options['user_id'])) {
            $sql .= ' WHERE user_id=?';
            $conditions[] = $options['user_id'];
        }

        $list = $this->db->fetch($sql, $conditions, array('unserialize' => 'data'));
        $result = $this->prepareList($list, $options);

        $this->hook->attach('dashboard.get.user', $result, $this);
        return $result;
    }
public function getList(array $options)
    {
        $options += array('active' => true);

        $sql = 'SELECT * FROM dashboard';

        $conditions = array();

        if (isset($options['user_id'])) {
            $sql .= ' WHERE user_id=?';
            $conditions[] = $options['user_id'];
        }

        $list = $this->db->fetch($sql, $conditions, array('unserialize' => 'data'));
        $result = $this->prepareList($list, $options);

        $this->hook->attach('dashboard.get.user', $result, $this);
        return $result;
    }
public function getList ( array $ options ) { $ options += array ( 'active' => true ) ; $ sql = 'SELECT * FROM dashboard' ; $ conditions = array ( ) ; if ( isset ( $ options [ 'user_id' ] ) ) { $ sql .= ' WHERE user_id=?' ; $ conditions [ ] = $ options [ 'user_id' ] ; } $ list = $ this -> db -> fetch ( $ sql , $ conditions , array ( 'unserialize' => 'data' ) ) ; $ result = $ this -> prepareList ( $ list , $ options ) ; $ this -> hook -> attach ( 'dashboard.get.user' , $ result , $ this ) ; return $ result ; }
Returns a dashboard record by a user ID
@param array $options
@return array
Returns a dashboard record by a user ID