public function getMessages($uid=null, $filters=array())
	{
		$uid = $uid ?: $this->uid;

		if (!$uid)
		{
			return array();
		}

		$r = $this->getTableName();
		$m = Message::blank()->getTableName();
		$s = Seen::blank()->getTableName();

		$entries = $this->buildQuery($uid, $filters);

		return $entries
			->select($m . '.*,' . $r . '.expires,' . $r . '.actionid,' . $r . '.state,' . $s . '.whenseen')
			->order($r . '.created', 'desc')
			->limit($filters['limit'])
			->start($filters['start'])
			->rows();
	}
public function getMessages($uid=null, $filters=array())
	{
		$uid = $uid ?: $this->uid;

		if (!$uid)
		{
			return array();
		}

		$r = $this->getTableName();
		$m = Message::blank()->getTableName();
		$s = Seen::blank()->getTableName();

		$entries = $this->buildQuery($uid, $filters);

		return $entries
			->select($m . '.*,' . $r . '.expires,' . $r . '.actionid,' . $r . '.state,' . $s . '.whenseen')
			->order($r . '.created', 'desc')
			->limit($filters['limit'])
			->start($filters['start'])
			->rows();
	}
public function getMessages ( $ uid = null , $ filters = array ( ) ) { $ uid = $ uid ? : $ this -> uid ; if ( ! $ uid ) { return array ( ) ; } $ r = $ this -> getTableName ( ) ; $ m = Message :: blank ( ) -> getTableName ( ) ; $ s = Seen :: blank ( ) -> getTableName ( ) ; $ entries = $ this -> buildQuery ( $ uid , $ filters ) ; return $ entries -> select ( $ m . '.*,' . $ r . '.expires,' . $ r . '.actionid,' . $ r . '.state,' . $ s . '.whenseen' ) -> order ( $ r . '.created' , 'desc' ) -> limit ( $ filters [ 'limit' ] ) -> start ( $ filters [ 'start' ] ) -> rows ( ) ; }
Get records for a user based on filters passed

@param   integer  $uid      User ID
@param   array    $filters  Filters to build query from
@return  mixed    False if errors, array on success
Get records for a user based on filters passed