public function search($params) { $query = Source::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $dataProvider->setSort(['defaultOrder' => ['updatedOn' => SORT_DESC]]); $query->andFilterWhere([source::tableName() . '.status' => '1']); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['Id' => $this->Id, 'createdOn' => $this->createdOn, 'status' => $this->status, 'updatedOn' => $this->updatedOn, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy]); $query->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; }
function _generate_sources() { global $config_q; $out = ""; $ca = new tag(); $tags = source::get_sources(array("has_alias" => true)); foreach ($tags as $key => $var) { $out .= "<url>" . "\n"; $out .= " <loc>" . $config_q["baseurl"] . "/" . _("quotes") . "/" . _("sources") . "/" . $var["url_friendly_source_name_for_url"] . "</loc>\n"; $out .= " <priority>0.80</priority>\n"; $out .= " <lastmod>" . date("Y-m-d\\T07:28:24+00:00", time()) . "</lastmod>\n"; $out .= " <changefreq>daily</changefreq>\n"; $out .= "</url>\n"; } return $out; }
public function __destruct() { parent::__destruct(); }
/** * Display a list of all of the sources * * @param Request $request * @return Response */ public function index(Request $request) { $sources = source::orderBy('name', 'asc')->get(); return view('sources.index', ['sources' => $sources]); }
/** * @return array */ public function getMapping() { return $this->_source->getMapping(); }