/** * Returns formatted array containing the tags for filtering. * * @static true * @access public * @param array $arrTags * @return array * @since 1.0.0 */ public static function formatTagFilters($arrTags) { //array to store the tag filters $arrTagFilter = array(); $arrTagFilter['name'] = 'Tags'; $arrTagFilter['type'] = 'multi'; $dbResult = Self::whereIn('name', $arrTags)->select('id', 'name')->get(); if ($dbResult) { foreach ($dbResult as $row) { $arrTagFilter['options'][] = array('id' => $row->id, 'name' => $row->name); } } return $arrTagFilter; }
/** * Formats the details of the location for filtering * whose name is in the passed array. * * @static true * @access public * @param array $arrLocation * @return array * @since 1.0.0 */ public static function formatLocationFilters($arrLocation) { //array to store the locaiton details $arrLocationFilter = array(); $arrLocationFilter['name'] = 'Locations'; $arrLocationFilter['type'] = 'Multi'; //query to read the location details $queryResult = Self::whereIn('name', $arrLocation)->select('id', 'name')->get(); if ($queryResult) { foreach ($queryResult as $row) { $arrLocationFilter['options'][] = array("id" => $row->id, "name" => $row->name); } } return $arrLocationFilter; }