public function imports($rtrn = 'list', $filters = array(), $clear = false)
	{
		$model = Import::all();

		if (isset($filters['state']) && $filters['state'])
		{
			if (!is_array($filters['state']))
			{
				$filters['state'] = array($filters['state']);
			}
			$filters['state'] = array_map('intval', $filters['state']);

			$model->whereIn('state', $filters['state']);
		}

		if (!isset($filters['type']))
		{
			$filters['type'] = $this->type;
		}

		if (isset($filters['type']) && $filters['type'])
		{
			$model->whereEquals('type', $filters['type']);
		}

		if (isset($filters['created_by']) && $filters['created_by'] >= 0)
		{
			$model->whereEquals('created_by', $filters['created_by']);
		}

		if (strtolower($rtrn) == 'count')
		{
			return $model->total();
		}

		return $model->ordered()
			->paginated()
			->rows();
	}
public function imports($rtrn = 'list', $filters = array(), $clear = false)
	{
		$model = Import::all();

		if (isset($filters['state']) && $filters['state'])
		{
			if (!is_array($filters['state']))
			{
				$filters['state'] = array($filters['state']);
			}
			$filters['state'] = array_map('intval', $filters['state']);

			$model->whereIn('state', $filters['state']);
		}

		if (!isset($filters['type']))
		{
			$filters['type'] = $this->type;
		}

		if (isset($filters['type']) && $filters['type'])
		{
			$model->whereEquals('type', $filters['type']);
		}

		if (isset($filters['created_by']) && $filters['created_by'] >= 0)
		{
			$model->whereEquals('created_by', $filters['created_by']);
		}

		if (strtolower($rtrn) == 'count')
		{
			return $model->total();
		}

		return $model->ordered()
			->paginated()
			->rows();
	}
public function imports ( $ rtrn = 'list' , $ filters = array ( ) , $ clear = false ) { $ model = Import :: all ( ) ; if ( isset ( $ filters [ 'state' ] ) && $ filters [ 'state' ] ) { if ( ! is_array ( $ filters [ 'state' ] ) ) { $ filters [ 'state' ] = array ( $ filters [ 'state' ] ) ; } $ filters [ 'state' ] = array_map ( 'intval' , $ filters [ 'state' ] ) ; $ model -> whereIn ( 'state' , $ filters [ 'state' ] ) ; } if ( ! isset ( $ filters [ 'type' ] ) ) { $ filters [ 'type' ] = $ this -> type ; } if ( isset ( $ filters [ 'type' ] ) && $ filters [ 'type' ] ) { $ model -> whereEquals ( 'type' , $ filters [ 'type' ] ) ; } if ( isset ( $ filters [ 'created_by' ] ) && $ filters [ 'created_by' ] >= 0 ) { $ model -> whereEquals ( 'created_by' , $ filters [ 'created_by' ] ) ; } if ( strtolower ( $ rtrn ) == 'count' ) { return $ model -> total ( ) ; } return $ model -> ordered ( ) -> paginated ( ) -> rows ( ) ; }
Get a list or count of imports

@param   string   $rtrn     What data to return
@param   array    $filters  Filters to apply to data retrieval
@param   boolean  $boolean  Clear cached data?
@return  mixed
Get a list or count of imports