query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Determines whether search is set | public function hasSearchSet()
{
return true && $this->hasSearchSet;
} | [
"function is_search() {\n\t$search = SEARCH;\n\treturn(!empty($search));\n}",
"public function is_search()\n {\n }",
"function is_set($key){ return isset($this->__val[$key]);}",
"public function searchIsEmpty()\n {\n return empty($this->search);\n }",
"private function should_search_options() {\n\t\treturn ! empty( $this->option_fields[ $this->content ] ) && in_array( $this->field, $this->option_fields[ $this->content ] );\n\t}",
"private function should_search_terms() {\n\t\treturn array_key_exists( $this->field, $this->tax_fields );\n\t}",
"public function setIsSearch() {\n $component = 'path';\n $resource = $this->parseResourceIdentifier($component);\n\n $levels = explode('/', $resource);\n $levels_count = count($levels);\n\n // Not a search.\n $is_search = 0;\n\n if (count($levels_count) > 0) {\n $top_level = strtolower(trim($levels[ $levels_count - 1 ]));\n $level_below = strtolower(trim($levels[ $levels_count - 2 ]));\n\n if ($top_level == 'search' || $level_below == 'search') {\n $is_search = 1;\n }\n }\n\n $this->is_search = $is_search;\n }",
"public function hasSearchIndex()\n {\n return isset($this->search_index);\n }",
"public function is_set($key){\n\t\treturn isset($this->data[$key]);\n\t}",
"public static function find_in_set()\n\t{\n\t}",
"public function isSetKeyword(): bool;",
"public function get_use_search() {\n if (!is_bool($this->use_search)) {\n $this->use_search = TRUE;\n }\n\n return $this->use_search;\n }",
"public function isSearchRequest() : bool;",
"function CheckSearchParms() {\r\n\r\n\t\t// Check basic search\r\n\t\tif ($this->BasicSearch->IssetSession())\r\n\t\t\treturn TRUE;\r\n\t\treturn FALSE;\r\n\t}",
"public function exists()\n\t{\n\t\t$this->connectToDatabase();\n\t\t$query = \"CALL keywordLookup(\".\n\t\t\t$this->term->escapeSQL($this->mysqli).\",\".\n\t\t\t$this->type_id->escapeSQL($this->mysqli).\",\".\n\t\t\t$this->parent_id->escapeSQL($this->mysqli).\")\";\n\t\t$data = $this->fetchRecords($query);\n\t\treturn ($data[0]->match_count>0);\n\t}",
"public function hasSearchTerms()\r\n\t{\r\n\t\treturn !empty($this->searchTerms);\r\n\t}",
"public function getIsSearchable()\n {\n return (!is_null($this->searchDialog) && $this->searchMemberExpression != '');\n }",
"function CheckSearchParms() {\n\n\t\t// Check basic search\n\t\tif ($this->BasicSearch->IssetSession())\n\t\t\treturn TRUE;\n\t\treturn FALSE;\n\t}",
"public function getIsSearchable();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deinstall hook Remove all leftovers from AAM execution | public static function uninstall() {
//trigger any uninstall hook that is registered by any extension
do_action('aam-uninstall-action');
//remove aam directory if exists
$dirname = WP_CONTENT_DIR . '/aam';
if (file_exists($dirname)) {
AAM_Core_API::removeDirectory($dirname);
}
//clear all AAM settings
AAM_Core_API::clearSettings();
//clear schedules
wp_clear_scheduled_hook('aam-cron');
} | [
"public function ___uninstall() { }",
"function Uninstall()\r\n\t{\r\n\t\tglobal $gCms;\r\n\t\trequire \"method.uninstall.php\";\r\n\t}",
"public function cleanup() {\n\t\t\tset_theme_mod( 'pixassist_install_notice_dismissed', false );\n\t\t}",
"function com_uninstall() {\n\trequire_once( $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_joomap/classes/JoomapConfig.php' );\n\tJoomapConfig::backup();\n\tJoomapConfig::remove();\n}",
"public function preUninstallActions():void;",
"public function onUninstall(): void {}",
"function uninstall()\n{\n\tglobal $uninst, $db;\n\twhile ($each_query = each($uninst)) {\n\t\t$db->query($each_query[1]);\n }\n}",
"public function uninstall()\n {\n// $code_dir = Mage::getBaseDir('app') . '/code/local/Bintime/Icecatimport';\n $design_layout = Mage::getBaseDir('app') . '/design/frontend/base/default/layout/IcecatGroupAttributes.xml';\n $template_dir = Mage::getBaseDir('app') . '/design/frontend/base/default/template/icecatlive';\n// $etc_bintime_xml = Mage::getBaseDir('app') . '/etc/modules/Bintime_Icecatimport.xml';\n $package_bintime_xml = Mage::getBaseDir('var') . '/package/IcecatLive-1.5.0.xml';\n $cache_iceshop_dir = Mage::getBaseDir('var') . '/iceshop';\n\n $this->remove_dir($cache_iceshop_dir);\n// $this->remove_dir($code_dir);\n $this->remove_dir($template_dir);\n $this->remove_file($design_layout);\n// $this->remove_file($etc_bintime_xml);\n $this->remove_file($package_bintime_xml);\n }",
"function uninstall()\n {\n $query = new DB_Table_Delete(PromoCodes::getTables());\n global $application;\n $application->db->getDB_Result($query);\n }",
"function uninstall()\n {\n $query = new DB_Table_Delete(Payment_Module_Gc::getTables());\n global $application;\n $application->db->getDB_Result($query);\n }",
"function UnInstallEvents()\n\t{\n\t}",
"public function uninstall()\n\t{\n\t\treturn true;\n\t}",
"protected function _postUninstall() {\n }",
"public static function cleanUp()\n {\n self::$_aModuleMap = array();\n self::$_oOrigOxUtilsObj = null;\n foreach (self::$_addedmods as $class => $arr) {\n// foreach ($arr as $mod) {\n oxRemClassModule('allmods', $class);\n // }\n }\n self::$_addedmods = array();\n }",
"function swimteam_uninstall()\n{\n}",
"function remove_data()\n{\n\trequire('unidress_narola_uninstall.php');\n}",
"public function uninstall()\n {\n Symphony::Configuration()->remove('config_to_params', 'config_to_params');\n Symphony::Configuration()->write();\n }",
"public function uninstallHook()\n {\n $hookObserver = HookAdvancedSubscription::create();\n HookAdminBlock::create()->detach($hookObserver);\n HookWSRegistration::create()->detach($hookObserver);\n HookNotificationContent::create()->detach($hookObserver);\n HookNotificationTitle::create()->detach($hookObserver);\n }",
"public function hookUninstall()\n {\n $db = $this->_db;\n $db->query(\"DROP TABLE IF EXISTS `$db->X3d`\");\n\n $x3dDir = FILES_DIR . DIRECTORY_SEPARATOR . 'x3d';\n if (is_dir($x3dDir)) {\n $this->_recursiveRemoveDirectory($x3dDir);\n }\n $this->_uninstallOptions();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert any string to a color code. | public static function stringToColorCode(string $string): string
{
$code = dechex(crc32($string));
return mb_substr($code, 0, 6);
} | [
"public static function stringToColorCode($string)\n {\n $code = dechex(crc32($string));\n\n return substr($code, 0, 6);\n }",
"function string_color_code($string) {\n $string = md5($string);\n $string = array(\n \"R\" => hexdec(substr($string, 0, 2)),\n \"G\" => hexdec(substr($string, 2, 2)),\n \"B\" => hexdec(substr($string, 4, 2))\n );\n return 'rgb(' . implode(',', $string) . ')';\n}",
"public static function colorize( $string ) {\n }",
"public function color($str){\n$code=dechex(crc32($str));\n$code=substr($code, 0, 6);\nreturn $code;\n}",
"function hex2color($str) {\n $color = hex2bin(ltrim($str, '$'));\n return ($str[0] === '$' ? unpack('V', \"$color\\0\") : unpack('N', \"\\0$color\"))[1];\n}",
"public static function parseString($str)\n {\n $str = str_replace('#', '', $str);\n if (strlen($str) == 6) {\n $r = hexdec(substr($str, 0, 2));\n $g = hexdec(substr($str, 2, 2));\n $b = hexdec(substr($str, 4, 2));\n } else if (strlen($str) == 3) {\n $r = hexdec(str_repeat(substr($str, 0, 1), 2));\n $g = hexdec(str_repeat(substr($str, 1, 1), 2));\n $b = hexdec(str_repeat(substr($str, 2, 1), 2));\n } else {\n throw new \\InvalidArgumentException('Unrecognized color.');\n }\n\n return new Color($r, $g, $b);\n }",
"static function ParseAsColour($str, wxColour &$clr){}",
"function lpi_getcolor( $string ) {\r\n if( strlen($string)!=6 )\r\n return( null );\r\n return array(\r\n 'R' => hexdec(substr($string,0,2)),\r\n 'G' => hexdec(substr($string,2,2)),\r\n 'B' => hexdec(substr($string,4,2))\r\n );\r\n}",
"public function getColorCode();",
"public static function parseColorString($string) {\n $result = false;\n if ($string[0] === '#') {\n //hex represantation\n $result = self::parseHexColorString($string);\n } else {\n //representation in rgb, hsb, etc.\n $result = self::parseFunctionColorString($string);\n }\n return $result;\n }",
"function color($text, $color) {\n return chr(27).$color.$text.chr(27).COLOR_NORMAL;\n}",
"function str_to_rgb($str)\r\n {\r\n return array(\r\n hexdec(substr($str, 0, 2)),\r\n hexdec(substr($str, 2, 2)),\r\n hexdec(substr($str, 4, 2)),\r\n );\r\n }",
"function colorize($str, $color) {\n return \"\\e[1;34m\" . $str . \"\\033[0m\";\n}",
"function _get_color($name_color = '')\r\n {\r\n $colors = array(\r\n 'aqua' => 0x0F,\r\n 'cyan' => 0x0F,\r\n 'black' => 0x08,\r\n 'blue' => 0x0C,\r\n 'brown' => 0x10,\r\n 'magenta' => 0x0E,\r\n 'fuchsia' => 0x0E,\r\n 'gray' => 0x17,\r\n 'grey' => 0x17,\r\n 'green' => 0x11,\r\n 'lime' => 0x0B,\r\n 'navy' => 0x12,\r\n 'orange' => 0x35,\r\n 'purple' => 0x14,\r\n 'red' => 0x0A,\r\n 'silver' => 0x16,\r\n 'white' => 0x09,\r\n 'yellow' => 0x0D\r\n );\r\n\r\n // Return the default color, 0x7FFF, if undef,\r\n if($name_color == '')\r\n return(0x7FFF);\r\n\r\n // or the color string converted to an integer,\r\n if(isset($colors[$name_color]))\r\n return($colors[$name_color]);\r\n\r\n // or the default color if string is unrecognised,\r\n if(preg_match(\"/\\D/\",$name_color))\r\n return(0x7FFF);\r\n\r\n // or an index < 8 mapped into the correct range,\r\n if($name_color < 8)\r\n return($name_color + 8);\r\n\r\n // or the default color if arg is outside range,\r\n if($name_color > 63)\r\n return(0x7FFF);\r\n\r\n // or an integer in the valid range\r\n return($name_color);\r\n }",
"private function green(string $string): string\n {\n $color = new Color();\n return $color->ok($string);\n }",
"function str2color($string='',$htmlColorNames = true,$hexColorNames = true){\n\t\t$x = 5;\n\t\t$rgb = false;\n\t\tif ($htmlColorNames) {\n\t\t\t$rgb = is_html_color_name($string);\n\t\t}\n\t\tif ($hexColorNames && !$rgb) {\n\t\t\t$rgb = $rgb = is_hex_color($string);\n\t\t}\n\t\tif (!$rgb) {\n\t\t\t//String to md5\n\t\t\t$hash = md5($string);\n\n\t\t\t$rgb = [];\n\t\t\tfor($i=0;$i<3;$i++){\n\t\t\t\t$rgb[$i] = round(( hexdec(substr($hash, $x*$i, $x)) / hexdec(str_pad('',$x,'F')) )*255);\n\t\t\t}\n\t\t}\n\n\t\t$hex = '';\n\t\tfor($i=0;$i<3;$i++){\n\t\t\t$hex .= strtoupper(str_pad(dechex($rgb[$i]),2,0,STR_PAD_LEFT)); // each RGB value to HEX\n\t\t}\n\n\t\t$lightness = round( ($rgb[0]+$rgb[1]+$rgb[2])/3 );\n\t\t$text_color = ($lightness >= 255/2)? '000000' : 'FFFFFF';\n\t\t$r['rgb'] = $rgb;\n\t\t$r['rgb_string']= $rgb[0].','.$rgb[1].','.$rgb[2];\n\t\t$r['hex'] = $hex;\n\t\t$r['lightness'] = $lightness;\n\t\t$r['text_color'] = $text_color;\n\t\t$r['string'] = $string;\n\n\t\treturn $r;\n\t}",
"public function generateColorHexFromString($str)\n {\n $rgb = $this->__stringToRgb($str);\n $hex = $this->__rgbToHex($rgb);\n\n return $hex;\n }",
"public function colorize(string $string): string\n {\n $reset = $this->supportsColor ? self::COLOR_RESET : '';\n foreach ($this->highlightMap as $key => $color) {\n $pattern = sprintf('#<%s>(.*?)</%s>#s', $key, $key);\n $color = $this->supportsColor ? $color : '';\n $string = preg_replace($pattern, $color . '$1' . $reset, $string);\n }\n return $string;\n }",
"private function getColoredString(string $string): string\n {\n return self::COLOR_START . $string . self::COLOR_END;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Target : Get all order company GET orders/orderscompany | public function getAllOrderCompany(Request $request)
{
$input = $request->all();
$searchBy = [];
if($request->has('search') && $request->input('search')){
$searchValues = explode(';', $request->input('search'));
foreach ($searchValues as $val) {
$tmp = explode(':', $val);
if(count($tmp) > 1){
$searchBy[$tmp[0]] = $tmp[1];
}
}
}
$orders = $this->orderRepository->getAllOrders($input['company_id'],$searchBy);
if ($orders) {
return $this->sendResponse($orders->toArray(), 'Orders retrieved successfully');
}else{
return $this->sendError('Data not found');
}
} | [
"public function getCompanyAll();",
"public function getAllCompanyList()\n {\n return $this->model\n ->where('status', '=', '2')\n ->get();\n }",
"public function get_companies() {\n\n\t\t\t$request = $this->base_uri . '/core/companies';\n\n\t\t\treturn $this->fetch( $request );\n\n\t\t}",
"public function getCompaniesAction()\n {\n # Retrieve available companies.\n $auth = array(\n 'username' => $this->container->getParameter('soap_username'),\n 'password' => $this->container->getParameter('soap_password')\n );\n $client = new SoapClient($this->container->getParameter('soap_wsdl'));\n\n try {\n $response = $client->__soapCall(\"getCompanies\", [$auth]);\n } catch (Exception $e) {\n throw new RuntimeException(\n 'Failed to get companies.'\n );\n }\n\n if(!is_array($response)){\n throw $this->createNotFoundException();\n }\n\n # Save companies to database.\n $companies = [];\n\n foreach ($response as $data) {\n # Determine if already exists.\n $company = $this->getDoctrine()->getRepository('AppBundle:Company')\n ->findOneByName($data->name);\n\n if (!$company) {\n $company = new Company();\n $company->setName($data->name);\n $company->setSymbol($data->symbol);\n\n $em = $this->getDoctrine()->getManager();\n $em->persist($company);\n $em->flush();\n\n sleep(1);\n }\n\n array_push($companies, $company);\n }\n\n return $companies;\n }",
"public static function companies(){\n return Company::all();\n }",
"public function getAll()\n\t{\n\t\t$data=$this->Company_model->getlist_company();\t\n\t\techo json_encode($data);\n\t}",
"function getAllOrders()\n\t{\n\t\t$api = getApi();\n\t\t$orders = $api->rest( 'GET', '/admin/orders.json' );\n\n\t\tif( isset( $orders ) ) {\n\n\t\t\techo \"<br> All orders:<br>\";\n\t\t\t//var_dump($orders);\n\t\t\treturn $orders;\n\t\t}\n\t}",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => OrderCompany::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function Findallcompanies()\n {\n \treturn TblAcaCompanies::find()->joinWith('client')->where(['tbl_aca_clients.is_deleted'=>0])->All();\n }",
"private function getCompanyList() {\n\t\t/* @var $dao \\model\\database\\dao\\CompanyDAO */\n\t\t$dao = $this->context->getService('companyDAO');\n\t\t$list = $dao->getSelectboxList();\n\t\treturn $list;\n\t}",
"public function getCompanies();",
"public function get_shipping_companies()\n {\n return \\App\\Company::all();\n }",
"public function actionGetCompany(){\n\t\t$aResult = array();\n\t\t$sTerm = trim($_GET['term']);\n\t\t// set allowed instance\n\t\t$aSessionUser = unserialize(Yii::app()->session->get('app_setts'));\n\t\t$aCurrentInstanceId = $aSessionUser['current_instance_id'];\n\t\t$oCriteria = new CDbCriteria;\n\t\t$oCriteria->addCondition('t.name LIKE \"'.$sTerm.'%\"');\n\t\t$oCriteria->addCondition('t.instances_id ='.$aCurrentInstanceId);\n\t\t$oCriteria->order = 't.name ASC';\n\t\t$oCriteria->limit = 15;\n\t\t$aCompanies = Companies::model()->findAll($oCriteria);\n\t\tforeach($aCompanies as $iKey => $aCompany){\n\t\t\t$aResult[] = array(\n\t\t\t\t'item' => $aCompany['name'],\n\t\t\t\t'value' => $aCompany['name'],\n\t\t\t\t'title' => CHtml::encode(nl2br($aCompany['products']))\n\t\t\t);\n\t\t}\n\n\t\techo CJSON::encode($aResult);\n\t\tYii::app()->end();\n\t}",
"public function queryAllOCO($options = [])\n {\n return $this->client->signRequest('GET', '/api/v3/allOrderList', $options);\n }",
"public function getCompany($id = 0);",
"public function selectcompany(){\n $sql = $this->_dbcompany->select()\n ->from($this->_dbcompany,array('*'));\n return $this->_dbcompany->fetchAll($sql)->toArray();\n }",
"private function getUserCompanies()\n {\n $userId = Auth::user()->id;\n return Company::where('user', $userId)->get();\n }",
"function getCompanies() {\n\n\t\t/******************************\n\t\t* Get which fields to fetch\n\t\t******************************/\n\n\t\t$ids = array();\n\n\t\tfor($i = 0, $num = func_num_args(); $i < $num; $i++) {\n\t\t\t$arg = func_get_arg($i);\n\n\t\t\tif (is_array($arg)) {\n\t\t\t\t$ids = array_merge($ids, $arg);\n\t\t\t} else {\n\t\t\t\t$ids[] = $arg;\n\t\t\t}\n\t\t}\n\n\t\t$ids = array_unique($ids);\n\t\t$got_ids = array_keys($this->companies);\n\n\t\t// Only get the ones that aren't already cachced\n\t\t$fetch_ids = array_diff($ids, $got_ids);\n\n\n\t\t/******************************\n\t\t* Get the comps\n\t\t******************************/\n\n\t\tif ($fetch_ids) {\n\t\t\tglobal $db;\n\n\t\t\t$db->query(\"\n\t\t\t\tSELECT * FROM user_company\n\t\t\t\tWHERE id IN \" . array2sql($fetch_ids) . \"\n\t\t\t\");\n\n\t\t\twhile ($comp = $db->row_array()) {\n\t\t\t\t$this->companies[$comp['id']] = $comp;\n\t\t\t}\n\t\t}\n\n\n\t\t/******************************\n\t\t* Return them\n\t\t******************************/\n\n\t\t$ret = array();\n\n\t\tforeach ($ids as $id) {\n\t\t\t$ret[$id] = $this->companies[$id];\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public function getCustomerOrders();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the object by movieID, returns null if not found | function getObjectByMovieID($inObjectID) {
if ( $this->getCount() > 0 ) {
foreach ( $this as $oObject ) {
if ( $oObject->getMovieID() == $inObjectID ) {
return $oObject;
}
}
}
return null;
} | [
"public function getById($id){\n foreach($this->movies as $movie){\n if($movie->getId() == $id)\n return $movie;\n }\n return null;\n }",
"public function findMovieByID($id){\n \t//The specific movie we're looking at\n $query = Movies::find();\n $movie = $query -> where([\n 'id' => $id,\n ])->one();\n\n return $movie;\n }",
"public function getSingleMovie($id){\n $this->init();\n $this->movie = $this->conn->getMovieById($id);\n $this->comments = $this->conn->getCommentById($id);\n }",
"private function readMovie($id) : object\n {\n $this->app->db->connect();\n\n $sql = 'SELECT * FROM movies WHERE id = ?';\n return $this->app->db->executeFetch($sql, [ $id ]);\n }",
"public static function getById( $id ) {\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"SELECT * FROM movie WHERE id = :id\";\n $st = $conn->prepare( $sql );\n $st->bindValue( \":id\", $id, PDO::PARAM_INT );\n $st->execute();\n $row = $st->fetch();\n $conn = null;\n if ( $row ) return new Movie( $row );\n }",
"public static function getById( $id ) {\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"SELECT * FROM movies WHERE id = :id\";\n $st = $conn->prepare( $sql );\n $st->bindValue( \":id\", $id, PDO::PARAM_INT );\n $st->execute();\n $row = $st->fetch();\n $conn = null;\n if ( $row ) return new movie( $row );\n }",
"public function getById($id) {\n return $this->call(\"movie/$id\");\n }",
"public function getMovieInfo($id){\n$sql = 'SELECT * FROM Vmovie WHERE id = ?';\n$params = array($id);\n$res = $this->ExecuteSelectQueryAndFetchAll($sql, $params);\n \nif(isset($res[0])) {\n $movie = $res[0];\n $title = $movie->title;\n $year = $movie->year;\n $image = $movie->image;\n $id = $movie->id;\n $pris = $movie->pris;\n $plot = $movie->plot;\n $director = $movie->director;\n $length = $movie->length;\n $imdb = $movie->imdb;\n $youtube = $movie->youtube;\n $genre = $movie->genre;\n}\nelse {\n die('Failed: There is no movie with that id');\n}\n return $movie;\n\n }",
"public function getMovie($id){\n\t\t$movie = $this->db->query('SELECT id as Identifiant, name as Name, release_date as Release_Date, synopsis as Synopsis FROM movies WHERE movies.id = \"' . $id . '\"')->fetch(PDO::FETCH_ASSOC);\n\t\treturn $movie;\n\t}",
"public function getMovieById($id){\n $stmt = $this->getConnInstant()->prepare(\"SELECT * FROM movies WHERE id = :id\");\n $stmt->execute([\":id\" => $id]);\n // No iteration needed, use fetch instead of fetchAll\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $result;\n }",
"public\r\n \tfunction movieDetail($movie_id, $with_images = false, $with_cast = false)\r\n\t\t{\r\n\t\t $baseUrl = self::BASE_URL . '/api/v2/movie_details.json';\r\n\t\t $parameters = '?movie_id=' . $movie_id . '&with_images' . $with_images . '&with_cast=' . $with_cast;\r\n \t $movieObj = $this->getFromApi($baseUrl . $parameters);\r\n\t\t if (property_exists($movieObj, 'movie')) return $movieObj->movie;\r\n\t\t return false;\r\n\t\t}",
"function getMovie() {\n\t\tif ( !$this->_Movie instanceof mofilmMovie ) {\n\t\t\t$this->_Movie = mofilmMovieManager::getInstanceByID($this->getMovieID());\n\t\t}\n\t\treturn $this->_Movie;\n\t}",
"function getMovie($id)\r\n {\r\n $url = TMDB_URI . \"movie/$id\". '?api_key=' . API_KEY;\r\n \r\n $json = file_get_contents($url);\r\n $obj = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);\r\n \r\n //return the json obj\r\n return $obj;\r\n }",
"public function view_movie($id) {\n //the select ssql statement\n $sql = \"SELECT * FROM \" . $this->tblMovie . \",\" . $this->tblMovieRating .\n \" WHERE \" . $this->tblMovie . \".rating=\" . $this->tblMovieRating . \".rating_id\" .\n \" AND \" . $this->tblMovie . \".id='$id'\";\n\n //execute the query\n $query = $this->dbConnection->query($sql);\n\n if ($query && $query->num_rows > 0) {\n $obj = $query->fetch_object();\n\n //create a movie object\n $movie = new Movie(stripslashes($obj->title), stripslashes($obj->rating), stripslashes($obj->release_date), stripslashes($obj->director), stripslashes($obj->image), stripslashes($obj->description));\n\n //set the id for the movie\n $movie->setId($obj->id);\n\n return $movie;\n }\n\n return false;\n }",
"public function getItemById($id)\n {\n return $this->movie->with('director')->with('types')->find($id);\n }",
"static function GetMovie($videoId = -1)\n {\n $movies = VideoController::GetMovies([$videoId]);\n return count($movies) === 1 ? $movies[0] : null;\n }",
"function getMovieID() {\n\t\treturn $this->_MovieID;\n\t}",
"static function find($id)\n {\n $query = \"SELECT * FROM movies WHERE id = :id\";\n $sth = self::$app->db->prepare($query);\n $result = $sth->execute(array(\n ':id' => $id\n ));\n return self::makeFromRow($sth->fetch());\n }",
"protected function GetMovie()\n {\n $id = $_GET['id'];\n if(is_null($id))\n header('Location: '.ROOT_URL);\n\n $viewModel = new MovieModel();\n $this->ReturnView($viewModel->GetMovie($id), true);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
approveable_item Gives you true if the passed items is approveable else false | function approveable_item($approveable_item_name = ""){
$approveable_item_name = $approveable_item_name == ""?$this->controller:$approveable_item_name;
$approveable_item = $this->db->get_where('approve_item',
array('approve_item_name'=>$approveable_item_name,'approve_item_is_active'=>1))->num_rows();
$approveable_item_flag = false;
if($approveable_item > 0){
$approveable_item_flag = true;
}
return $approveable_item_flag;
} | [
"public function approveItem()\n {\n if ($this->getItem()->getType() == \\Apprecie\\Library\\Items\\ItemTypes::EVENT) {\n if ($this->getStatus() == \\Apprecie\\Library\\Items\\ApprovalState::APPROVED) {\n return true;\n }\n\n $org = Organisation::getActiveUsersOrganisation();\n $event = Event::findFirstBy('itemId', $this->getItemId());\n\n $event->setState(\\Apprecie\\Library\\Items\\ItemState::APPROVED);\n $event->update();\n\n if (!$org->addEventToVault($event)) {\n $this->appendMessageEx($org);\n $this->logActivity('Failed xx addEventToVault() inside approve method', 'messages ' . _ms($org));\n return false;\n } //@todo gh use transaction\n\n $this->setStatus(\\Apprecie\\Library\\Items\\ApprovalState::APPROVED);\n $this->setVerifiedByUserId($this->getDI()->getDefault()->get('auth')->getAuthenticatedUser()->getUserId());\n $this->update();\n } else {\n throw new \\Phalcon\\Exception('approveItem work flow not implemented for non events');\n }\n }",
"public function approved(): bool;",
"public function makeItemApproved($request_params)\n {\n $approve_item = $this->getItemModel()->updateItemByColVal('id', $request_params['item_id'], ['is_approved' => 1]);\n if ($approve_item) {\n return redirect()->route('allItem')->with('success_message', 'Your selected product is live now.');\n }\n }",
"protected function _setApprovedFlag()\n {\n $user = $this->getUser();\n\n if (!empty($user['id'])) {\n $settings = $this->getSettings();\n if ($settings['enable_listings_approval']) {\n return 0;\n }\n else if ($user['listing_approval']) {\n return 0;\n }\n }\n\n return 1;\n }",
"public function approve($user)\n {\n return $user->hasPermission('approve_stores');\n }",
"function snax_bp_item_approved_notification( $item ) {\n\tif ( ! bp_is_active( 'notifications' ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! snax_is_item( $item ) ) {\n\t\treturn;\n\t}\n\n\t$post = get_post( $item->post_parent );\n\n\t// Item can be not attached to any post but in that case we don't want to notify when such an item is added.\n\tif ( ! snax_is_format( 'list', $post ) ) {\n\t\treturn;\n\t}\n\n\t// Notify post author.\n\tbp_notifications_add_notification( array(\n\t\t'user_id' => $item->post_author, // Receiver id.\n\t\t'item_id' => $item->ID,\n\t\t'secondary_item_id' => $post->ID,\n\t\t'component_name' => snax_items_bp_component_id(),\n\t\t'component_action' => 'snax_item_approved',\n\t) );\n}",
"public function approve(Authenticatable $user, Client $client)\n {\n if ($user->canDo('user.client.approve')) {\n return true;\n }\n\n return false;\n }",
"function publisher_userIsModerator($itemObj)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation');\r\n return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted));\r\n}",
"function canApprove() {\n\n return ((($this->fields[\"users_id_recipient\"] === Session::getLoginUserID())\n && Session::haveRight('ticket', Ticket::SURVEY))\n || $this->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || (isset($_SESSION[\"glpigroups\"])\n && $this->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"])));\n }",
"function has_approval_status_been_set(String $approveable_item):Bool{\n\n $has_approval_status_been_set = false;\n\n $this->db->join('approval_flow','approval_flow.approval_flow_id=status.fk_approval_flow_id');\n $this->db->join('approve_item','approve_item_id=approval_flow.fk_approve_item_id');\n $count_of_status = $this->db\n ->get_where('status',array('approve_item_name'=>$approveable_item))\n ->num_rows();\n\n if($count_of_status > 0){\n $has_approval_status_been_set = true;\n }\n\n return $has_approval_status_been_set;\n\n}",
"function isApproved(){\n\t\treturn $this->getStatus() == 1 ? true : false;\n\t}",
"public function isApproved()\n {\n\n return false;\n }",
"function isApproved() {\n return $this->getStatus() == UserpointsTransaction::STATUS_APPROVED;\n }",
"public function isPending()\n {\n // check if model approved by all roles in the model\n return $this->pendingItem($this->approvedByRole());\n }",
"function canApprove(Member $member){\r\n\t\tif(!$member) return false;\r\n\t\tif(Permission::checkMember($member,\"ADMIN\")) return true;\r\n\t\tif($holder = $this->getParent())\r\n\t\t\treturn $holder->Moderators()->Count() > 0 && $holder->Moderators()->containsIDs(array(Controller::CurrentMember()->ID));\r\n\t\treturn false;\r\n\t}",
"public function getIsApproved();",
"public function is_allowed($action, $item, $user, $params = false);",
"public function isApproved()\n {\n if ($this->getStatus() == ReaktorArtwork::APPROVED)\n {\n return true;\n }\n return false;\n }",
"function snax_item_approved( $post ) {\n\t// Store info about action.\n\tupdate_post_meta( $post->ID, 'snax_approved_by', get_current_user_id() );\n\tupdate_post_meta( $post->ID, 'snax_approval_data', current_time( 'mysql' ) );\n\n\tdo_action( 'snax_item_approved', $post );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the component params with view override/merge | public function getComponentParams() {
if(is_object($this->cparams)) {
return $this->cparams;
}
$this->cparams = $this->app->getParams('com_jmap');
return $this->cparams;
} | [
"public function getViewParams()\r\n\t{\r\n\t\treturn $this->_viewParams;\r\n\t}",
"public function getParamsToView();",
"public function getFormViewParams();",
"public function getViewParameters() {\n return array(\n 'environment' => $this,\n 'block_mode' => $this->getBlockMode(),\n );\n }",
"private function getComponentParameters()\n\t{\n\t\tJLoader::import('joomla.registry.registry');\n\n\t\t$component = JComponentHelper::getComponent('com_akeebasubs');\n\n\t\tif ($component->params instanceof JRegistry)\n\t\t{\n\t\t\t$cparams = $component->params;\n\t\t}\n\t\telseif (!empty($component->params))\n\t\t{\n\t\t\t$cparams = new JRegistry($component->params);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$cparams = new JRegistry('{}');\n\t\t}\n\n\t\treturn $cparams;\n\t}",
"public function getViewParameters()\n {\n return $this->parameterBag->all();\n }",
"public function getParams()\n {\n if(isset($this->view)){\n $this->params['view'] = $this->view;\n }else{\n echo 'No template view defined';\n exit;\n }\n if(isset($this->elements)){\n $this->params['elements'] = $this->elements;\n }else{\n echo 'No SQL Request defined';\n exit;\n }\n if($this->addUrl)\n $this->params['addUrl'] = $this->addUrl;\n if(isset($this->form))\n $this->params['form'] = $this->form->createView();\n\n $this->params['h1'] = $this->h1;\n $this->params['filters'] = array('fields' => $this->filters);\n\n if($this->ajax){\n return $this->params;\n }else{\n return array('params' => $this->params);\n }\n }",
"protected function _get_view_parms()\n\t{\n\t\t$attributes = $this->_get_view_attributes();\n\t\t$id = trim(strval(Arr::get($attributes, 'id', '')));\n\t\t$name = trim(strval(Arr::get($attributes, 'name', '')));\n\t\tif ($name === '' AND $id !== '')\n\t\t{\n\t\t\t$attributes['name'] = $id;\n\t\t}\n\n\t\t$meta = $this->_meta;\n\t\treturn array\n\t\t(\n\t\t\t'after'\t\t\t=> Arr::get($meta, 'after', ''),\n\t\t\t'attributes'\t=> $attributes,\n\t\t\t'before'\t\t=> Arr::get($meta, 'before', ''),\n\t\t);\n\t}",
"protected function _getParams()\n {\n /** Check if admin has configured a legacy display code */\n if (strlen($this->getConfig('bv_config/display_code'))) {\n $deploymentZoneId =\n $this->getConfig('bv_config/display_code') .\n '-' . $this->getConfig('general/locale');\n }\n else {\n $deploymentZoneId =\n str_replace(' ', '_', $this->getConfig('general/deployment_zone')) .\n '-' . $this->getConfig('general/locale');\n }\n\n $product = $this->getProduct();\n\n $productUrl = $this->_urlInterface->getCurrentUrl();\n $parts = parse_url($productUrl);\n if (isset($parts['query'])) {\n parse_str($parts['query'], $query);\n unset($query['bvrrp']);\n unset($query['bvstate']);\n $baseUrl = $parts['scheme'] . '://' . $parts['host'] . $parts['path'] . '?' . http_build_query($query);\n } else {\n $baseUrl = $productUrl;\n }\n\n $params = array(\n 'seo_sdk_enabled' => TRUE,\n 'bv_root_folder' => $deploymentZoneId, /** replace with your display code (BV provided) */\n 'subject_id' => $this->getHelper()->getProductId($product), /** replace with product id */\n 'cloud_key' => $this->getConfig('general/cloud_seo_key'), /** BV provided value */\n 'base_url' => $baseUrl,\n 'page_url' => $productUrl,\n 'staging' => ($this->getConfig('general/environment') == 'staging' ? TRUE : FALSE)\n );\n\n $this->_bvLogger->debug( 'SEO Params: ' . print_r($params, 1));\n\n if ($this->_requestInterface->getParam('bvreveal') == 'debug')\n $params['bvreveal'] = 'debug';\n\n return $params;\n\n }",
"protected function _get_view_parms()\n\t{\n\t\t$attributes = $this->_get_view_attributes();\n\t\t$id = trim(strval(Arr::get($attributes, 'id', '')));\n\t\t$name = trim(strval(Arr::get($attributes, 'name', '')));\n\t\tif ($name === '' AND $id !== '')\n\t\t{\n\t\t\t$attributes['name'] = $id;\n\t\t}\n\n\t\t$meta = $this->_meta;\n\t\treturn array\n\t\t(\n\t\t\t'after'\t\t\t=> Arr::get($meta, 'after', ''),\n\t\t\t'attributes'\t=> $attributes,\n\t\t\t'before'\t\t=> Arr::get($meta, 'before', ''),\n\t\t\t'html'\t\t\t=> Arr::get($meta, 'html', ''),\n\t\t);\n\t}",
"public function getDefaultViewParams();",
"public function getParams(){\n $params = array();\n //$url = New UrlGenerator();\n //$url->generate($this->route['env'].$this->element.'_'.$this->route['action'], array()); exit;\n $params['url'] = $this->container->get('router')->generate($this->route['env'].$this->element.'_'.$this->route['action'], $this->route['params']);\n $params['view'] = $this->view;\n $params['h1'] = $this->h1;\n $params['form'] = $this->form->createView();\n $params['page'] = $this->getTemplate();\n $params['others'] = $this->extraObjects;\n $params['errors'] = $this->errors;\n $params['object'] = $this->object;\n if($this->help){ $params['help'] = $this->help; }\n $params['env'] = $this->route['env'];\n $params['extraParams'] = $this->extraParams;\n $params['formClass'] = $this->formClass;\n\n return array('params' => $params);\n }",
"function get_layout_params() {\n $params = array();\n\n // define basic params for all the pages\n // the params may be override by view params\n\n return $params;\n}",
"public function getParameters()\n\t{\n\t\treturn $this->_merged;\n\t}",
"function ff_getViewParameters()\n{\n\treturn (isset($GLOBALS['ff_viewParameters'])\n\t\t? $GLOBALS['ff_viewParameters']\n\t\t: []\n\t);\n}",
"public function getParams($merged = false): array\n {\n return $merged ? $this->ceidgApi->makeParams($this->params) : $this->params;\n }",
"public function getViewVariables();",
"private function _get_params() {\n\t\treturn $this->_params;\n\t}",
"public function getAdditionalParams()\n {\n return $this->_aViewData['additionalparams'];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$ANTLR end "statement" $ANTLR start "comparision" / VTEventConditionParser.g:35:1: comparision returns [result] : lhs= SYMBOL '==' rhs= value ; | public function comparision(){
$result = null;
$lhs=null;
$rhs = null;
try {
{
$lhs=$this->match($this->input,$this->getToken('SYMBOL'),self::$FOLLOW_SYMBOL_in_comparision78); if ($this->state->failed) return $result;
$this->match($this->input,$this->getToken('13'),self::$FOLLOW_13_in_comparision80); if ($this->state->failed) return $result;
$this->pushFollow(self::$FOLLOW_value_in_comparision84);
$rhs=$this->value();
$this->state->_fsp--;
if ($this->state->failed) return $result;
if ( $this->state->backtracking==0 ) {
$result=array('==', new VTEventConditionSymbol(($lhs!=null?$lhs->getText():null)), $rhs); echo $value;
}
}
}
catch (RecognitionException $e) {
throw $e;
}
catch(Exception $e) {
throw $e;
}
return $result;
} | [
"public function comparisonOperator()\n {\n switch ($this->lexer->lookahead['value']) {\n case '=':\n $this->match(Lexer::T_EQUALS);\n\n return '=';\n case '<':\n $this->match(Lexer::T_LOWER_THAN);\n $operator = '<';\n\n if ($this->lexer->isNextToken(Lexer::T_EQUALS)) {\n $this->match(Lexer::T_EQUALS);\n $operator .= '=';\n } else if ($this->lexer->isNextToken(Lexer::T_GREATER_THAN)) {\n $this->match(Lexer::T_GREATER_THAN);\n $operator .= '>';\n }\n\n return $operator;\n\n case '>':\n $this->match(Lexer::T_GREATER_THAN);\n $operator = '>';\n\n if ($this->lexer->isNextToken(Lexer::T_EQUALS)) {\n $this->match(Lexer::T_EQUALS);\n $operator .= '=';\n }\n\n return $operator;\n\n case '!':\n $this->match(Lexer::T_NEGATE);\n $this->match(Lexer::T_EQUALS);\n\n return '<>';\n\n default:\n $this->syntaxError('=, <, <=, <>, >, >=, !=');\n }\n\n return null;\n }",
"function mGREATER_EQUAL(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GREATER_EQUAL;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:708:3: ( '>=' ) \n // Tokenizer11.g:709:3: '>=' \n {\n $this->matchString(\">=\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"private function _parseComparison()\n {\n $this->_recurseEnter();\n $left = $this->_parseAdditive();\n while ($this->_getCurrentToken()->isComparisonOperator()) {\n $comparisonToken = clone $this->_getCurrentToken();\n $this->_lexer->nextToken();\n $right = $this->_parseAdditive();\n $left = self::_generateComparisonExpression(\n $left, $right, \n $comparisonToken, $this->_isCustomExpressionProvider\n );\n }\n\n $this->_recurseLeave();\n return $left;\n }",
"function _cond()\n\t{\n\t\t$result = $this->_expr();\n\t\tif ($this->isError($result)) return $result;\n/*\n\t\tif ($this->_cur_token == '&')\n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgConcat', $result, $result2);\n\t\t} else\n*/\n\t\tif ($this->_cur_token == '<')\n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgLT', $result, $result2);\n\t\t}\n\t\telseif ($this->_cur_token == '>') \n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgGT', $result, $result2);\n\t\t}\n\t\telseif ($this->_cur_token == '<=') \n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgLE', $result, $result2);\n\t\t}\n\t\telseif ($this->_cur_token == '>=') \n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgGE', $result, $result2);\n\t\t}\n\t\telseif ($this->_cur_token == '=') \n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgEQ', $result, $result2);\n\t\t}\n\t\telseif ($this->_cur_token == '<>') \n\t\t{\n\t\t\t$this->_advance();\n\t\t\t$result2 = $this->_expr();\n\t\t\tif ($this->isError($result2)) return $result2;\n\t\t\t$result = $this->_makeTree('ptgNE', $result, $result2);\n\t\t}\n\t\treturn $result;\n\t}",
"private function if_operation_condition_from_tok_condition($_cond) {\n\t\tswitch($_cond) {\n\t\t\tcase Token_condition::EQUALS:\n\t\t\t\treturn Operation_if::EQUALS; break;\n\t\t\tcase Token_condition::GREATER_THAN:\n\t\t\t\treturn Operation_if::GREATER_THAN; break;\n\t\t\tcase Token_condition::LESSER_THAN:\n\t\t\t\treturn Operation_if::LESSER_THAN; break;\n\t\t\tcase Token_condition::GREATER_OR_EQUAL_THAN:\n\t\t\t\treturn Operation_if::GREATER_OR_EQUAL_THAN; break;\n\t\t\tcase Token_condition::LESSER_OR_EQUAL_THAN:\n\t\t\t\treturn Operation_if::LESSER_OR_EQUAL_THAN; break;\n\t\t\tcase Token_condition::NOT_EQUALS:\n\t\t\t\treturn Operation_if::NOT_EQUALS; break;\n\t\t\tdefault:\n\t\t\t\t$this->fail('unknown if token condition!'); break;\n\t\t}\n\t}",
"public function visitComparison(Comparison $comparison);",
"public function testGreaterThanOrEqualsOperator() {\n\t\t$value1 = new Express\\LiteralExpression(0);\n\t\t$value2 = new Express\\LiteralExpression(1);\n\t\t$value3\t= new Express\\LiteralExpression(2);\n\t\t$value4 = new Express\\LiteralExpression(2);\n\n\t\t// 0 >= 1 = FALSE\n\t\t$statement1 = new Express\\BooleanGreaterThanOrEqualsOperator($value1, $value2);\n\t\t$this->assertFalse($statement1->evaluate());\n\n\t\t// 2 >= 1 = TRUE\n\t\t$statement2 = new Express\\BooleanGreaterThanOrEqualsOperator($value3, $value2);\n\t\t$this->assertTrue($statement2->evaluate());\n\n\t\t// 2 >= 2 = TRUE\n\t\t$statement3 = new Express\\BooleanGreaterThanOrEqualsOperator($value3, $value4);\n\t\t$this->assertTrue($statement3->evaluate());\n\t}",
"public function getConditionOperator();",
"protected abstract function visitComparison(ComparisonNode $node);",
"public function eq(mixed $x, mixed $y): Expr\\Comparison\n {\n return new Expr\\Comparison($x, Expr\\Comparison::EQ, $y);\n }",
"public function NullComparisonExpression()\n {\n switch (true) {\n case $this->lexer->isNextToken(Lexer::T_INPUT_PARAMETER):\n $this->match(Lexer::T_INPUT_PARAMETER);\n assert($this->lexer->token !== null);\n\n $expr = new AST\\InputParameter($this->lexer->token->value);\n break;\n\n case $this->lexer->isNextToken(Lexer::T_NULLIF):\n $expr = $this->NullIfExpression();\n break;\n\n case $this->lexer->isNextToken(Lexer::T_COALESCE):\n $expr = $this->CoalesceExpression();\n break;\n\n case $this->isFunction():\n $expr = $this->FunctionDeclaration();\n break;\n\n default:\n // We need to check if we are in a IdentificationVariable or SingleValuedPathExpression\n $glimpse = $this->lexer->glimpse();\n assert($glimpse !== null);\n\n if ($glimpse->type === Lexer::T_DOT) {\n $expr = $this->SingleValuedPathExpression();\n\n // Leave switch statement\n break;\n }\n\n assert($this->lexer->lookahead !== null);\n $lookaheadValue = $this->lexer->lookahead->value;\n\n // Validate existing component\n if (! isset($this->queryComponents[$lookaheadValue])) {\n $this->semanticalError('Cannot add having condition on undefined result variable.');\n }\n\n // Validate SingleValuedPathExpression (ie.: \"product\")\n if (isset($this->queryComponents[$lookaheadValue]['metadata'])) {\n $expr = $this->SingleValuedPathExpression();\n break;\n }\n\n // Validating ResultVariable\n if (! isset($this->queryComponents[$lookaheadValue]['resultVariable'])) {\n $this->semanticalError('Cannot add having condition on a non result variable.');\n }\n\n $expr = $this->ResultVariable();\n break;\n }\n\n $this->match(Lexer::T_IS);\n\n $not = false;\n if ($this->lexer->isNextToken(Lexer::T_NOT)) {\n $this->match(Lexer::T_NOT);\n\n $not = true;\n }\n\n $this->match(Lexer::T_NULL);\n\n return new AST\\NullComparisonExpression($expr, $not);\n }",
"protected function comparisonStatement($comparison)\n\t{\n\t\tif ($comparison instanceof InEnumComparison && count($comparison->getValue()) < 1)\n\t\t{\n\t\t\treturn 'NULL';\n\t\t}\n\t\telseif($comparison->isComparingRelationship())\n\t\t{\n\t\t\t$relationship = $comparison->getSubject();\n\t\t\t$value = $comparison->getValue();\n\n\t\t\t$targetKeys = $relationship->getInverse()->getTargetKeys();\n\n\t\t\tforeach($targetKeys AS $k => $v)\n\t\t\t{\n\t\t\t\t$targetKeys[$k] = new Path(array($relationship->getInverse()), $v->getName());\n\t\t\t}\n\n\t\t\t$conditions = Query::targetConditions($value, $relationship->getSourceKeys(), $targetKeys);\n\n\t\t\treturn $this->operationStatement($conditions);\n\t\t}\n\n\n\t\treturn '(' . $this->operand($comparison->getSubject()) . static::$comparisons[get_class($comparison)] . $this->operand($comparison->getValue()) . ')';\n\n\t}",
"private function isComparisonOperator() {\n $type = $this->nextToken[0];\n return $this->nextToken != null and $type != 'string' and $type != '!' and\n $type != '&' and $type != '|' and $type != '(' and $type != ')';\n }",
"function walkComparisonExpression($compExpr);",
"public function selectComparison($operator)\n {\n $ops = [\n 'bad_op' => function ($actual, $test_value) {\n return FALSE;\n },\n '==' => function ($actual, $test_value) {\n return $actual == $test_value;\n },\n '!=' => function ($actual, $test_value) {\n return $actual != $test_value;\n },\n '===' => function ($actual, $test_value) {\n return $actual === $test_value;\n },\n '!==' => function ($actual, $test_value) {\n return $actual !== $test_value;\n },\n '<' => function ($actual, $test_value) {\n return $actual < $test_value;\n },\n '>' => function ($actual, $test_value) {\n return $actual > $test_value;\n },\n '<=' => function ($actual, $test_value) {\n return $actual <= $test_value;\n },\n '>=' => function ($actual, $test_value) {\n return $actual >= $test_value;\n },\n 'true' => function ($actual, $test_value) {\n return $actual === TRUE;\n },\n 'false' => function ($actual, $test_value) {\n return $actual === FALSE;\n },\n 'in_array' => function ($actual, $test_values) {\n return in_array($actual, $test_values);\n },\n '!in_array' => function ($actual, $test_values) {\n return !in_array($actual, $test_values);\n },\n 'truthy' => function ($actual, $test_value) {\n return (boolean)$actual;\n }\n ];\n\n if (!array_key_exists($operator, $ops)) {\n return $ops['bad_op'];\n } else {\n return $ops[$operator];\n }\n\n }",
"public function greaterThanOrEquals(TokenConditionGreaterThanOrEquals $token, TokenBase $previous = null) {\n\t\treturn \"\\t{$token->property} >= {$token->value}\";\n\t}",
"public function lessThanOrEquals(TokenConditionLessThanOrEquals $token, TokenBase $previous = null) {\n\t\treturn \"`{$token->property}` >= '{$token->value}'\";\n\t}",
"public function lessThanOrEquals(TokenConditionLessThanOrEquals $token, TokenBase $previous = null);",
"protected function getComparisonOperator()\r\n {\r\n switch ($this->getMatchType()) {\r\n case self::MATCH_TYPE_EXACT:\r\n return '=';\r\n\r\n case self::MATCH_TYPE_WILDCARD_ANY:\r\n case self::MATCH_TYPE_WILDCARD_STARTS_WITH:\r\n case self::MATCH_TYPE_WILDCARD_ENDS_WITH:\r\n return 'LIKE';\r\n\r\n default:\r\n throw new UnexpectedValueException('Invalid match type.');\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Finds the CustomerAddressSearch model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = CustomerAddress::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('抱歉,该地址不存在');
}
} | [
"protected function findModel()\n {\n $id = Yii::$app->request->get('id');\n $id = $id ? $id : Yii::$app->request->post('id');\n if (($model = ShipAddress::findOne($id)) !== null) {\n return $model;\n }\n\n throw new HttpException('The requested page does not exist.');\n }",
"public function getAddress(CustomerModel $customer, $addressId);",
"protected function findModel($customerId)\n {\n if (($model = Customer::findOne(['id' => $customerId, 'status' => 1])) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('yii', 'Page not found.'));\n }",
"static function retrieveByAddressId($value) {\n\t\treturn Address::retrieveByPK($value);\n\t}",
"protected function findModel($id)\n {\n if (($model = CityaddrModel::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function findAddressByZipCode($zipCode);",
"protected function findModel($id)\n {\n if (($model = StoreZipCode::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\r\n {\r\n if (($model = AddressBook::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }",
"protected function findModel($id)\n {\n if (($model = Postcode::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findAddressModel($id)\n {\n if (($model = UserAddress::find()->where(['id' => $id, 'user_id' => $this->user->id])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested address does not exist.');\n }\n }",
"public function find(string $address): Address\n {\n return $this->makeAddress(\n $this->request(['q' => $address])\n );\n }",
"public function actionLookup() {\n $attrs = $_POST;\n unset($attrs['user']);\n unset($attrs['userKey']);\n $tempModel = new $this->modelClass('search');\n\n // Use only attributes that the model has\n $attrs = array_intersect_key($attrs, $tempModel->attributes);\n $model = X2Model::model($this->modelClass)->findByAttributes($attrs);\n\n // Did we find the requested model? If not, raise an error\n if (is_null($model)) {\n $this->_sendResponse(404, 'No Item found with specified attributes.');\n } else {\n $this->_sendResponse(200, $model->attributes, true);\n }\n }",
"protected function findModel($id)\n {\n if (($model = Street::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n\t\tif (($model = Customers::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"public function getById($id) {\r\n return $this->addressEntity->find($id);\r\n }",
"protected function findModel($id)\n {\n if (($model = ContentSource::findOne($id)) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = Customer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n $modelClass = $this->getModel();\n if (($model = $modelClass->findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"public function findPk($key, $con = null)\n\t{\n\t\tif ($key === null) {\n\t\t\treturn null;\n\t\t}\n\t\tif ((null !== ($obj = Oops_Db_AddressPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {\n\t\t\t// the object is alredy in the instance pool\n\t\t\treturn $obj;\n\t\t}\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(Oops_Db_AddressPeer::DATABASE_NAME, Propel::CONNECTION_READ);\n\t\t}\n\t\t$this->basePreSelect($con);\n\t\tif ($this->formatter || $this->modelAlias || $this->with || $this->select\n\t\t || $this->selectColumns || $this->asColumns || $this->selectModifiers\n\t\t || $this->map || $this->having || $this->joins) {\n\t\t\treturn $this->findPkComplex($key, $con);\n\t\t} else {\n\t\t\treturn $this->findPkSimple($key, $con);\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updates wordpress config file to use WpDeploy | function wpdeploy_activate(){
$configSettings = new WpDeployInstance($_SERVER['SERVER_NAME']);
if($configSettings->check_details_complete()){
$configFile = ABSPATH . 'wp-config.php';
$file = fopen($configFile, "r") or error_log("Unable to open file!");
//Output a line of the file until the end is reached
$newFileContent = "";
while(!feof($file))
{
$line = fgets($file);
if (
strpos($line,"define('DB_NAME',")!==false ||
strpos($line,"define('DB_USER',")!==false ||
strpos($line,"define('DB_PASSWORD',")!==false ||
strpos($line,"define('DB_HOST',")!==false ||
strpos($line,"define('WP_SITEURL',")!==false ||
strpos($line,"define('WP_HOME',")!==false
){$line = "//".$line;}
if (strpos($line,"wp-settings.php")!==false){$line = "if(file_exists(ABSPATH . 'wpdeploy-settings.php')){require_once(ABSPATH . 'wpdeploy-settings.php');}\r\n".$line;}
$newFileContent .= $line;
}
fclose($file);
if (is_writable($configFile)) {
if (!$handle = fopen($configFile, 'w')) {return;}
if (fwrite($handle, $newFileContent) === FALSE) {return;}
fclose($handle);
define('WPDEPLOY_ACTIVATE_STATUS_CHANGED',TRUE);
} else {
exit;
}
}
} | [
"public function wpConfig() {\n\n if ( !$this->SITE_CONFIG[ 'wpConfig' ] ) {\n\n $this->_LOG_MESSAGES[] = gettext( 'Skipped WordPress Configuration' );\n $this->_LAST_ACTION = 'wpConfig';\n $this->_displayMessages();\n\n\n return;\n }\n\n//check that files are available to configure\n $this->wpCheck(\n false, //$dbconnect #check connection\n false, //$dbempty #check whether database is empty\n false, //$files_overwrite #check whether download will overwrite existing files\n true//$files_available #check whether downloaded files are available for installation\n );\n\n\n\n $this->_wpCreateWPConfig( 'dev' );\n $this->_wpCreateWPConfig( 'live' );\n $this->_wpCreateWPConfig( 'stage' );\n $this->_wpCreateWPConfigHome();\n\n $this->_LOG_MESSAGES[] = gettext( 'Updated wp-config.php with database and site settings' );\n\n\n $this->_LAST_ACTION = 'wpConfig';\n $this->_displayMessages();\n }",
"public static function afterDeploy(){\n\t\tif(empty(self::$settings)) self::$settings=include APP.'config/basicSettings.php';\n\t\telse self::$settings+=include APP.'config/basicSettings.php';\n\t\tself::write();\n\t}",
"function update_config() {\n $wp_config_path = ABSPATH . 'wp-config.php';\n $wpc_h = fopen( $wp_config_path, \"r+\" );\n\n $content = stream_get_contents( $wpc_h );\n if( !$content && !flock( $wpc_h, LOCK_EX ) )\n return false;\n\n $settings = self::get_locale();\n $locale = $settings['lang'];\n\n $source = \"/define(.*)WPLANG(.*)\\'(.*)\\'(.*);(.*)/\";\n $target = \"define ('WPLANG', '$locale'); // Updated by `Localize` plugin\";\n\n $content = preg_replace( $source, $target, $content );\n\n rewind( $wpc_h );\n if( !@fwrite( $wpc_h, $content ) )\n return false;\n flock( $wpc_h, LOCK_UN );\n\n return true;\n }",
"private function publishConfig()\n {\n if (!file_exists(getcwd().'/config/lcrud.php')) {\n $this->copyDirectory(__DIR__.'/../../config', getcwd().'/config');\n $this->info(\"\\n\\nLumen config file have been published\");\n } else {\n $this->error('Lumen config files has already been published');\n }\n }",
"private function _setSiteConfig() {\n if ( !is_null( $this->SITE_CONFIG ) ) {\n return;\n }\n\n\n if ( !file_exists( $this->INSTALLER_DIRECTORY . '/site-config.php' ) ) {\n\n $this->_ERROR_MESSAGES[] = gettext( 'Cannot proceed without a site-config.php file! Create one from `site-config-sample.php`' );\n\n\n $this->_displayMessages( $this->_ERROR_MESSAGES, 'error' );\n exit();\n }\n\n include($this->SITE_CONFIG_FILE); //include site configuration\n $this->SITE_CONFIG = $site; //$site is defined in the site configuration file site-config.php . \n //set reinstall variable after $config file is read or it may be overwritten\n//reinstall is not usually found in the config file, so define it here if not already defined by the config file\n//reinstall set to true will force file and database overwrites\n if ( !isset( $this->SITE_CONFIG[ 'reinstall' ] ) ) {\n $this->SITE_CONFIG[ 'reinstall' ] = false;\n }\n\n //set admin passwords\n $this->SITE_CONFIG[ 'wp_users' ][ 'user_pass' ] = $this->getNewPassword();\n\n //replace any variables with those that are contained in the GET request (for initial page build/page refresh)\n if ( isset( $_GET[ 'SITE_CONFIG' ] ) ) {\n $this->SITE_CONFIG = $this->phpLib()->arrayMerge( $this->SITE_CONFIG, $_GET[ 'SITE_CONFIG' ] );\n }\n\n\n\n//do the same with $_POST since you'll be posting the form on submit \n if ( isset( $_POST[ 'SITE_CONFIG' ] ) ) {\n $this->SITE_CONFIG = $this->phpLib()->arrayMerge( $this->SITE_CONFIG, $_POST[ 'SITE_CONFIG' ] );\n }\n //set HTTP_HOST server variable so variable will be available when running as command line\n if ( $this->isCommandLine() ) {\n $_SERVER[ 'HTTP_HOST' ] = $this->SITE_CONFIG[ 'HTTP_HOST' ];\n }\n\n\n\n $this->SITE_CONFIG = $this->phpLib()->convertToBool( $this->SITE_CONFIG );\n }",
"private function updateConfig()\n {\n $stub = $this->stub.'/config';\n $path = config_path();\n (new Filesystem)->copyDirectory($stub, $path);\n }",
"private function publishConfig()\n {\n $this->publishes([\n __DIR__.'/../config/' => base_path('config'),\n ]);\n }",
"private function publishConfig()\n {\n $this->publishes([\n $this->basePath('config/flare/fields.php') => config_path('flare/fields.php'),\n ]);\n }",
"protected function publishConfig()\n {\n $this->publishes([\n __DIR__ . '/../resources/config/helpdesk.php' => config_path('helpdesk.php'),\n ], 'config');\n }",
"function cms_config_upgrade()\n{\n\t#Get my lazy on and just do some regex magic...\n\t$newfiledir = dirname(CONFIG_FILE_LOCATION);\n\t$newfilename = CONFIG_FILE_LOCATION;\n\t$oldconfiglines = array();\n\tif (is_writable($newfilename) || is_writable($newfiledir))\n\t{\n\t\t$handle = fopen($newfilename, \"r\");\n\t\tif ($handle)\n\t\t{\n\t\t\twhile (!feof($handle))\n\t\t\t{\n\t\t\t\tarray_push($oldconfiglines,fgets($handle, 4096));\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\t$handle = fopen($newfilename, \"w\");\n\t\t\tif ($handle)\n\t\t\t{\n\t\t\t\tforeach ($oldconfiglines as $oneline)\n\t\t\t\t{\n\t\t\t\t\t$newline = trim(preg_replace('/\\$this-\\>(\\S+)/', '$config[\"$1\"]', $oneline));\n\t\t\t\t\tif ($newline != \"?>\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$newline .= \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tfwrite($handle, $newline);\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}\n}",
"private function _configureSite() {\n\t\t$settings = ClassRegistry::init('WildSetting')->getKeyValuePairs();\n Configure::write('AppSettings', $settings); // @TODO add under Wildlfower. configure namespace\n Configure::write('Wildflower.settings', $settings); // The new namespace for WF settings\n\t}",
"private function publishConfiguration(): void\n {\n $this->publishes([\n __DIR__.'/../../config/config.php' => config_path('ping.php'),\n ], 'config');\n }",
"public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }",
"protected function publishConfig() {\n $this->publishes([\n __DIR__ . '/config/config.php' => config_path('taxonomy.config.php'),\n ], 'config');\n }",
"private function publishConfig()\n {\n $this->publishes([\n __DIR__ . '/../config/kampus.php' => config_path('kampus.php')\n ], 'config');\n }",
"public function RewriteConfig()\n\t{\n\t\tif (!defined('ISC_CONFIG_FILE') || !defined('ISC_CONFIG_DEFAULT_FILE')) {\n\t\t\tdie(\"Config sanity check failed\");\n\t\t}\n\n\t\t// Include the default config file. This will override the global settings\n\t\trequire(ISC_CONFIG_DEFAULT_FILE);\n\n\t\t// Now load the local config file to override those\n\t\trequire(ISC_CONFIG_FILE);\n\n\t\t// Now we rebuild the configuration file using the template and we should have the latest version of the settings\n\t\t$GLOBALS['ISC_CLASS_ADMIN_SETTINGS'] = GetClass('ISC_ADMIN_SETTINGS');\n\t\tif (!$GLOBALS['ISC_CLASS_ADMIN_SETTINGS']->CommitSettings()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->_deletePreUpgradeConfigFile();\n\t\treturn true;\n\t}",
"private function publishConfig()\n {\n $path = $this->getConfigPath();\n $this->publishes([$path => config_path('AtomicPanel.php')], 'atomic-config');\n }",
"protected function afterInstall()\n {\n $configSourceFile = __DIR__ . DIRECTORY_SEPARATOR . 'config.example.php';\n $configTargetFile = \\Craft::$app->getConfig()->configDir . DIRECTORY_SEPARATOR . $this->handle . '.php';\n\n if (!file_exists($configTargetFile)) {\n copy($configSourceFile, $configTargetFile);\n }\n }",
"function cms_config_upgrade()\n{\n\t#Get my lazy on and just do some regex magic...\n\t$newfiledir = dirname(CONFIG_FILE_LOCATION);\n\t$newfilename = CONFIG_FILE_LOCATION;\n\t$oldconfiglines = array();\n\t$oldconfig = cms_config_load();\n\tif (is_writable($newfilename) || is_writable($newfiledir))\n\t{\n\t\t$handle = fopen($newfilename, \"r\");\n\t\tif ($handle)\n\t\t{\n\t\t\twhile (!feof($handle))\n\t\t\t{\n\t\t\t\t$oldconfiglines[] = fgets($handle, 4096);\n\t\t\t}\n\t\t\tfclose($handle);\n\t\t\t$handle = fopen($newfilename, \"w\");\n\t\t\tif ($handle)\n\t\t\t{\n\t\t\t\tforeach ($oldconfiglines as $oneline)\n\t\t\t\t{\n\t\t\t\t\t/** from some ancient version? */\n\t\t\t\t\t$newline = trim(preg_replace('/\\$this-\\>(\\S+)/', '$config[\"$1\"]', $oneline));\n\n\t\t\t\t\t/* uploads_url, remove root url */\n\t\t\t\t\tif(preg_match( '/\\$config\\[\\'uploads_url\\'\\]/' , $oneline) ) {\n\t\t\t\t\t\t$newline = str_replace($oldconfig['root_url'], '', $oneline);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* image_uploads_url, remove root url */\n\t\t\t\t\tif(preg_match('/\\$config\\[\\'image_uploads_url\\'\\]/',$oneline)) {\n\t\t\t\t\t\t$newline = str_replace($oldconfig['root_url'], '', $oneline);\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\tif ($newline != \"?>\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$newline .= \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tfwrite($handle, $newline);\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Crea el agente y su programa agente | public function __construct()
{
$this->programa = $this->_crearProgramaAgente();
} | [
"public static function instanciate()\n {\n \t$context = Context::getCurrent();\n \t$agent = new Agent;\n \t$agent->status = 'new';\n \treturn $agent;\n }",
"private function create_agent($o)\n {\n $name = false;\n if($name = $o['Agent short']) {}\n elseif($name = $o['Agent long']) {}\n else exit(\"\\nInvestigate no agent...\\n\");\n\n $agent_ids = array();\n $r = new \\eol_schema\\Agent();\n $r->term_name = $name;\n $r->agentRole = (@$o['agent role']) ? $o['agent role'] : \"creator\";\n $r->identifier = md5(\"$r->term_name|$r->agentRole\");\n // $r->term_homepage = '';\n $agent_ids[] = $r->identifier;\n if(!isset($this->agent_ids[$r->identifier])) {\n $this->agent_ids[$r->identifier] = '';\n $this->archive_builder->write_object_to_file($r);\n }\n return $agent_ids;\n }",
"public function agent()\n {\n return new $this->agent_class();\n }",
"public function createAgent(AgentTypeInterface $agentType);",
"function device_agent()\n {\n return new Agent();\n }",
"public function createagentAction()\n {\n $request = $this->_request;\n $act = $request->getParam('act');\n $customerAccountId = $request->getParam('CustomerAccountId');\n $currentUserId = $request->getParam('CustomerUserId');// session plugin set it\n if('create' == $act){\n Streamwide_Web_Log::debug('create agent actual');\n $agentName = $request->getParam('AgentName');\n //$login = $request->getParam('Login');\n $password = $request->getParam('Password');\n $email = $request->getParam('Email');\n $phoneNumber = $request->getParam('PhoneNumber');\n $status = $request->getParam('Status');\n $disponibilityTime = $request->getParam('DisponibilityTime');\n $unlimitedDisponibility = $request->getParam('UnlimitedDisponibility');\n $userParams = array(\n 'Name'=>$agentName,// string The user name\n 'EmailAddress'=>$email,// string The user email address\n 'Password'=>$password,// string The user password\n 'ProfileId'=>self::AGENT_PROFILE_ID,// int The granted profile for agent user\n 'ParentUserId'=> $currentUserId,// int The parent user id\n 'CustomerAccountId'=>$customerAccountId,// int The customer account user belongs to\n 'AgentParameters'=>array(// struct The agent parameter structure [optional]\n 'PhoneNumber' =>$phoneNumber,// string The agent phone number\n 'DisponibilityTime' =>intval($disponibilityTime),// int The disponibility time in seconds\n 'UnlimitedDisponibility'=>(bool)$unlimitedDisponibility,// boolean The flag indicating unlimited disponibility\n )\n );\n $userId = Streamwide_Web_Model::call('User.Create', array($userParams));\n $agentParams = array(\n 'AgentId' => $userId,\n 'IsAvailable' => $status,\n 'IsOnline' => false\n );\n Streamwide_Web_Model::call('AgentGroup.SetAgentOptions', array($agentParams));\n $agentGroupIds = $request->getParam('AffectedGroups');\n $supervisorStatus = $request->getParam('SupervisorStatus');\n if (is_array($agentGroupIds) && is_array($supervisorStatus)) {\n $agentGroupIds = array_unique(array_merge($agentGroupdIds, $supervisorStatus));\n } else if (is_array($supervisorStatus)) {\n $agentGroupIds = $supervisorStatus;\n }\n if (is_array($agentGroupIds) && count($agentGroupIds)) {\n foreach ($agentGroupIds as $agentGroupId) {\n \t\t $params = array($agentGroupId, array($userId));\n $result = Streamwide_Web_Model::call('AgentGroup.AddAgent', $params);\n\n $isSupervisor = in_array($agentGroupId, $supervisorStatus);\n\n if($isSupervisor) {\n Streamwide_Web_Model::call('AgentGroup.SetSupervisor', array($agentGroupId, $userId, $isSupervisor));\n }\n \t}\n }\n\n $this->view->assign('AgentName', $agentName);\n $this->getHelper('viewRenderer')->direct('createagent-ack'); // render ack page\n } else {\n Streamwide_Web_Log::debug('create agent modal window');\n $agentGroupList = Streamwide_Web_Model::call('AgentGroup.GetByCustomer', array($customerAccountId));\n $this->view->assign('AgentGroupList', $agentGroupList);\n }\n }",
"function createAgent()\n {\n return view(\"Tenant::Client/Application/subagent\");\n }",
"function __construct( $agent_type, $args = array() ) {\n $this->agent_type = $agent_type;\n\n if ( empty( $args['executable'] ) )\n $args['executable'] = $agent_type;\n\n $this->executable = $args['executable'];\n\n }",
"public function testAddAgent()\n {\n }",
"public function testPersonalAgentCreation() {\r\n// echo \"Testing Agent Creation\";\r\n $this->assertNotNull($this->agent, \"The agent was not created\");\r\n $this->assertTrue($this->agent->getUser()->equals($this->user), \"The user in the agent is not the same as used\r\n during creation.\");\r\n $this->assertTrue($this->agent->getUser()->isStudent(), \"The user in the agent is not a regular\r\n Java.net user\");\r\n }",
"public function actionCreate()\n {\n $model = new Agent();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Agent();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function createComite()\n {\n //\n }",
"private function createMonitor()\n {\n $servico = factory(Modulos\\Integracao\\Models\\Servico::class)->create([\n 'ser_nome' => \"Monitor\",\n 'ser_slug' => \"get_tutor_online_time\"\n ]);\n\n $ambienteServico = factory(\\Modulos\\Integracao\\Models\\AmbienteServico::class)->create([\n 'asr_amb_id' => $this->ambiente->amb_id,\n 'asr_ser_id' => $servico->ser_id,\n 'asr_token' => \"abcdefgh12345\"\n ]);\n }",
"public function npcCreator()\n {\n\n Flight::render('views/syscrack/page.admin.npcreator.php');\n }",
"public function createRobot()\n\t{\n\t\t$this->robots->addRobot();\n\t\t$this->index();\n\t}",
"public static function instanciate()\n {\n \t$context = Context::getCurrent();\n \t$agentAttachment = new AgentAttachment;\n \t$agentAttachment->status = 'new';\n \treturn $agentAttachment;\n }",
"public function crear(){\n\t\t\twrite_log(\"persona\",\"crear()\",\"sin comentario\");\n\t\t\t$conexion=new Conexion();\n\t\t\t$sql=\"INSERT INTO personas (dni, nombre, apellido, fecha, direccion, telefono, correo, cuil, persona_usuario, persona_password ) VALUES ('$this->dni', '$this->nombre', '$this->apellido', '$this->fecha', '$this->direccion', '$this->telefono', '$this->correo', '$this->cuil', '$this->persona_usuario', '$this->persona_password')\";\n\t\t\t//INSERT INTO `personas`(`dni`, `nombre`, `apellido`, `fecha`, `provincia`, `localidad`, `direccion`, `telefono`, `correo`, `cuil`) VALUES (40108413,'alejandro','avellaneda','1996-12-05',1,1,'chacra 147 8',543764631054,'aleavellaneda1gmail.com',20401084135)\n\t\t\t$conexion->ejecutar($sql);\n\t\t}",
"protected function createResponder()\n {\n $this->call('make:adr:responder', [\n 'name' => ResponderResolver::resolveClassName($this->argument('name')),\n '--type' => $this->option('responder_type')\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get application repayment records | public function testRetrieveLoanApplicationRepaymentList():void
{
$token = $this->getToken();
$response = $this->loanCreation($token);
## Retrieving test
$loan_application = $response->json()['data']['application_no'];
$response = $this->withHeader('Authorization', 'Bearer ' . $token)
->json('GET', 'api/v1/user/loan-repayment-list/'.$loan_application.'/all', [], ['Accept' => 'application/json'])
->assertStatus(200)
->assertJson([
"status" => "Success",
"message" => "Successfully Fetched Loan Payment List",
]);
} | [
"public function getPayments();",
"public function getPaidLoans(){\n $option=[];\n $filter=[\"is_paid\"=>true];\n $records = $this->database->queryData($this->collection_name,$filter,$option);\n return $records;\n }",
"abstract public function getPayments();",
"public function getPayments()\n {\n $result = array();\n if ($this->hasIdentity())\n {\n $user_id = $this->getUserField('user_id');\n $res = $this->query(\n 'SELECT * FROM ?_invoice_payment\n WHERE user_id=?', $user_id);\n foreach ($res as $p_rec)\n {\n $result[] = $p_rec;\n }\n }\n return $result;\n }",
"public function getPaindingPurchasePayments(){\n\t\t\n\t\t$this->db->select('PP.*, PO.purc_order_number, S.supl_comp');\n\t\t$this->db->from('purchase_order_payments AS PP');\n\t\t$this->db->join(\"purchase_orders AS PO\", \"PP.purc_order_id = PO.purc_order_id\");\n\t\t$this->db->join(\"suppliers AS S\", \"S.supl_id = PP.supplier_id\");\n\t\t$this->db->where(\"PP.status\", 'Pending');\n\t\t$this->db->order_by('PP.reminder_date');\n\t\t$query_pending_payments = $this->db->get();\n\t\t// echo $this->db->last_query();die;\n\t\tif($query_pending_payments->num_rows()>0)\n\t\t{\n\t\t\treturn $query_pending_payments->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t}",
"public function viewReceiptList()\n {\n $pay = new paymentModel();\n $pay->Cus_ID = $_SESSION['Cus_ID'];\n return $pay->viewReceiptList();\n }",
"public function getPaymentData();",
"protected function fetchRecords(): array\n {\n // Ascending update date is the ONLY way we can be sure to get all payments.\n\n $order = 'UpdatedDateUTC';\n\n return $this->accountingApi->getBatchPayments(\n $this->ifModifiedSince,\n $this->where,\n $order\n )->batchPayments;\n }",
"function getApplicationsToResendData() {\n $query = '\n SELECT id\n , email\n , salutation\n , customized_motivation\n FROM applications\n WHERE (last_sent_date = \\'0000-00-00 00:00:00\\' \n OR last_sent_date < (NOW() - INTERVAL 10 DAY))\n AND meeting_date = \\'0000-00-00 00:00:00\\' \n AND answer_date = \\'0000-00-00 00:00:00\\' ;\n ';\n \n return pdoQuery($query);\n}",
"public function loanRepaymentDetail()\n {\n return $this->hasMany(LoanRepaymentDetail::class,'loan_application_id');\n }",
"public function repayments()\n {\n return $this->hasMany(Repayment::class, 'loan_id', 'id');\n }",
"public function getPaymentsAction()\n {\n $builder = Shopware()->Models()->createQueryBuilder();\n $data = $builder->select('a.id, a.description, a.name')\n ->from('Shopware\\Models\\Payment\\Payment', 'a')\n ->where('a.name LIKE \\'mopt_payone__%\\'')\n ->getQuery()->getArrayResult();\n\n foreach ($data as $dataKey => $dataValue) {\n $data[$dataKey]['description'] = $dataValue['description'] . ' - ' . $dataValue['name'];\n if ($this->moptDoesSeparateConfigExists($dataValue['id'])) {\n $data[$dataKey]['configSet'] = 1;\n } else {\n $data[$dataKey]['configSet'] = 0;\n }\n }\n\n array_unshift($data, array('id' => null, 'description' => 'Alle (global)', 'name' => '', 'configSet' => 1));\n $this->View()->assign(array(\n \"success\" => true,\n \"data\" => $data,\n \"totalCount\" => count($data)));\n }",
"function read_payment_record($app_reference)\r\n\t{\r\n\t\t$cond['app_reference'] = $app_reference;\r\n\t\t$data = $this->custom_db->single_table_records('payment_gateway_details', '*', $cond);\r\n\t\tif ($data['status'] == SUCCESS_STATUS) {\r\n\t\t\treturn $data['data'][0];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function getRecords();",
"public function getDetailReport() {\n $aData = [];\n if (!empty($this->approve_id) && !empty($this->date_report)) {\n $aData['PAY'] = $this->getReceipts($this->date_report, $this->date_report, array(Receipts::STATUS_RECEIPTIONIST));\n $aData['ALL_PAY'] = $this->getReceipts($this->date_report, $this->date_report, array(Receipts::STATUS_RECEIPTIONIST), true);\n $aData['UN_PAY'] = $this->getReceipts($this->date_report, $this->date_report, array(Receipts::STATUS_DOCTOR));\n }\n return $aData;\n }",
"public function get_all_office_payment_data()\n\t{\n\t\t$this->db->select('payments.*,ie_heads.head_title');\n\t\t$this->db->from('payments');\n\t\t$this->db->join('ie_heads','payments.head_id = ie_heads.id');\n\t\t$this->db->where('payments.status', 'a')->where('payment_type', 'OP');\n\t\t$result = $this->db->order_by('id', 'desc')->get()->result();\n\n\t\tif($result){\n\t\t\treturn $result;\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function listPayments(){\n return new ObtieneListadoDePagosRealizadosApi($this->client, $this->config, $this->headerSelector);\n }",
"abstract public function getPaymentData();",
"private function getPagSeguroPaymentsList()\n {\n\n $pageNumber = 1;\n $maxPageResults = 20;\n\n $timeZone = date_default_timezone_get();\n date_default_timezone_set('America/Sao_Paulo');\n\n $finalDate = date(\"Y-m-d\").\"T\".date(\"H:i\");\n\n date_default_timezone_set($timeZone);\n\n if ($this->daysRange == 0) {\n\n $initialDate = $this->subDayIntoDate($finalDate, 0);\n\n } else {\n\n $initialDate = $this->subDayIntoDate($finalDate, $this->daysRange);\n\n }\n\n\n try {\n\n $result = PagSeguroTransactionSearchService::searchByDate(\n $this->obj_credential,\n $pageNumber,\n $maxPageResults,\n $initialDate,\n $finalDate\n );\n\n $return = $this->validateRef($result);\n\n } catch (PagSeguroServiceException $e) {\n\n echo(\"Can't find informed user or token.\");\n $return = false;\n\n }\n\n return $return;\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getMetas Get meta tags using $search_metas. | public function getMetas(){
$res = array();
// print_r($this->html->saveHTML());
$nodes = select_elements($this->search_metas, $this->html);
foreach($nodes as $n){
// print_r($n);
$attributes_name = isset($n['attributes']['name'])?$n['attributes']['name']:'';
$attributes_property = isset($n['attributes']['property'])?$n['attributes']['property']:'';
$attributes_content = isset($n['attributes']['content'])?trim($n['attributes']['content']):'';
$tag = 'meta-'.(isset($attributes_name[0])?$attributes_name:$attributes_property);
if(!isset($tag[0])){continue;}
if(!isset($attributes_content[0])){continue;}
$score = isset($this->conf_scores[$tag])?$this->conf_scores[$tag]:1;
$res[]=array('tag'=>$tag,'text'=>$attributes_content,'score'=>$score);
}
return $res;
} | [
"public function listMetas() {\n $this->view = 'list_metas';\n \n $this->paginate = $this->Meta->getMetasList(true);\n $metasList = $this->paginate('Meta');\n $metasList = $this->Meta->formatMetasList($metasList, false);\n \n $this->set('metasList', $metasList);\n $this->set('shortDescriptionLength', 40);\n\t}",
"public function getMetas()\n {\n return $this->metas;\n }",
"public function get_meta();",
"private function getMetaTags(){\n return SeoTagGroup::orderBy('sort')->with(['tags' => function ($query) {\n $query->orderBy('sort', 'desc');\n }])->get();\n return Cache::rememberForever($this->cacheKeys['tags'], function() {\n return SeoTagGroup::orderBy('sort')->with(['tags' => function ($query) {\n $query->orderBy('sort', 'desc');\n }])->get();\n });\n }",
"private function extractSearchMeta($args)\n {\n $meta = self::sanitizeMetaArgs($args);\n $meta = apply_filters('cgit_member_network_search_meta', $meta);\n\n $this->meta = $meta;\n }",
"function get_form_metas($form_id) {\n\t$form_id \t= input_check($form_id);\n\t$args \t\t= _args_helper(input_check($args), 'where');\n\t$where \t\t= $args['where'];\n\n\n\t$where['form_id'] = $form_id;\n\tif($q_select = db()->query(\"SELECT * FROM \".dbname('form_meta').\" \".sql_where_string($where).\" \")) {\n\t\tif($q_select->num_rows) {\n\t\t\t$return = array();\n\t\t\twhile($list = $q_select->fetch_object()) {\n\t\t\t\tif(empty($list->taxonomy)) {\n\t\t\t\t\t$return[$list->name] = $list;\n\t\t\t\t} else {\n\t\t\t\t\t$return[$list->taxonomy][$list->name] = $list;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\treturn $return;\n\t\t} else { return false; }\n\t} else { add_mysqli_error_log(__FUNCTION__); }\n}",
"function &__searchMeta(&$query_parser,$a_type)\n\t{\n\t\tinclude_once 'Services/Search/classes/class.ilObjectSearchFactory.php';\n\n\t\t$meta_search =& ilObjectSearchFactory::_getMetaDataSearchInstance($query_parser);\n\t\tif($this->getType() == SEARCH_DETAILS)\n\t\t{\n\t\t\t$meta_search->setFilter($this->__getFilter());\n\t\t}\n\t\tswitch($a_type)\n\t\t{\n\t\t\tcase 'keyword':\n\t\t\t\t$meta_search->setMode('keyword');\n\t\t\t\tbreak;\n\n\t\t\tcase 'contribute':\n\t\t\t\t$meta_search->setMode('contribute');\n\t\t\t\tbreak;\n\n\t\t\tcase 'title':\n\t\t\t\t$meta_search->setMode('title');\n\t\t\t\tbreak;\n\n\t\t\tcase 'description':\n\t\t\t\t$meta_search->setMode('description');\n\t\t\t\tbreak;\n\t\t}\n\t return $meta_search->performSearch();\n\t}",
"public function getMetas(Criteria $criteria = null, ConnectionInterface $con = null)\n {\n $partial = $this->collMetasPartial && !$this->isNew();\n if (null === $this->collMetas || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collMetas) {\n // return empty collection\n $this->initMetas();\n } else {\n $collMetas = ChildMetaQuery::create(null, $criteria)\n ->filterByWebsiteRouting($this)\n ->find($con);\n\n if (null !== $criteria) {\n if (false !== $this->collMetasPartial && count($collMetas)) {\n $this->initMetas(false);\n\n foreach ($collMetas as $obj) {\n if (false == $this->collMetas->contains($obj)) {\n $this->collMetas->append($obj);\n }\n }\n\n $this->collMetasPartial = true;\n }\n\n return $collMetas;\n }\n\n if ($partial && $this->collMetas) {\n foreach ($this->collMetas as $obj) {\n if ($obj->isNew()) {\n $collMetas[] = $obj;\n }\n }\n }\n\n $this->collMetas = $collMetas;\n $this->collMetasPartial = false;\n }\n }\n\n return $this->collMetas;\n }",
"function get_metatags()\n\t{\n\t\tif (count($this->meta_tags) == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$output = '';\n\t\tforeach($this->meta_tags as $name => $tag)\n\t\t{\n\t\t\t$output .= meta($name, $tag['content'], $tag['type']) . \"\\n\";\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function getMetaKeywords();",
"function gogreen_search_meta(){\n get_template_part('templates/blog/search', 'meta');\n}",
"function getMetaTags($pageName){\n\t\t\t$metaTags = $this->manage_content->getValue_where('meta_tags','*','page',$pageName);\n\t\t\techo '<meta name=\"keywords\" content=\"'.$metaTags[0]['keyword'].'\" />\n<meta name=\"description\" content=\"'.$metaTags[0]['description'].'\" />';\n\t\t}",
"function get_meta_objs() {\n return $this->meta_objs;\n }",
"public function get_meta_tags( ) {\n\t\treturn $this->_meta;\n\t}",
"public function getMetasByKey($key)\n {\n return $this->getMetas()->filter(function($meta) use ($key) {\n return $meta->getKey() === $key;\n });\n }",
"public function load_all_meta(){\n \n }",
"protected function search_post_meta() {\n\t\tglobal $wpdb;\n\t\t$query = $wpdb->prepare( \"\n\t\t\tSELECT\n\t\t\t\t{$this->get_select_values( 'postmeta' )}\n\t\t\tFROM `wp_postmeta`\n\t\t\t\tLEFT JOIN `wp_posts`\n\t\t\t\tON `post_id`=`ID`\n\t\t\tWHERE\n\t\t\t\t`meta_value` LIKE '%%%s%%'\n\t\t\t\tAND `post_name` NOT LIKE '%-revision-%'\n\t\t\t\tAND `post_name` NOT LIKE '%-autosave-%'\n\t\t\t;\",\n\t\t\t$this->query\n\t\t);\n\n\t\t$this->post_results = array_merge(\n\t\t\t$this->post_results,\n\t\t\t$this->get_post_results( $query )\n\t\t);\n\t}",
"public function get_meta() : array\n {\n return $this->additional['meta'] ?? [];\n }",
"public static function getSiteMetas(){\n $siteMetas = null;\n if (Cache::has('site_metas')) {\n $siteMetas = Cache::get('site_metas');\n }\n else{\n\n $settings = SiteMeta::whereIn(\n 'meta_key', [\n 'contact_address',\n 'contact_phone',\n 'contact_email',\n 'ga_tracking_id',\n ]\n )->get();\n\n $metas = [];\n foreach ($settings as $setting){\n $metas[$setting->meta_key] = $setting->meta_value;\n }\n $siteMetas = $metas;\n Cache::forever('site_metas', $metas);\n\n }\n\n return $siteMetas;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Processes a post menu item. | private function processPostMenuItem(object $item): bool
{
if ($this->accessHandler->checkObjectAccess($item->object, $item->object_id) === false) {
if ($this->removePostFromList($item->object) === true) {
return false;
}
if ($this->mainConfig->hidePostTypeTitle($item->object) === true) {
$item->title = $this->mainConfig->getPostTypeTitle($item->object);
}
}
return true;
} | [
"function event_PostItem(&$data) {\n\t\tarray_push($this->posted_items, $data['item']->itemid);\n\t}",
"function PostProcessItemData()\n {\n parent::PostProcessItemData();\n }",
"protected function createMenuItem($postId)\n {\n // Load the target post\n $post = get_post($postId);\n $menu = $this->getMenu();\n\n // Define the item data\n $itemData = array(\n 'menu-item-title' => $post->post_title,\n 'menu-item-object-id' => $post->ID,\n 'menu-item-object' => $post->post_type,\n 'menu-item-type' => 'post_type',\n 'menu-item-status' => $post->post_status\n );\n\n // Predefine the counter arguments\n $countArgs = array(\n 'meta_key' => '_menu_item_menu_item_parent',\n 'post_type' => 'nav_menu_item',\n 'orderby' => 'menu_order',\n 'order' => 'asc',\n 'numberposts' => -1,\n 'post_status' => 'any'\n );\n\n // Set the parent data\n if ($post->post_parent > 0) {\n $parentItem = $this->getMenuItem($post->post_parent);\n if ($parentItem === false) {\n $parentItem = $this->createMenuItem($post->post_parent);\n }\n $itemData['menu-item-parent-id'] = $parentItem->db_id;\n\n $countArgs['meta_value'] = (string) $parentItem->db_id;\n $itemData['menu-item-position'] = count(get_posts($countArgs)) + 1;\n } else {\n $countArgs['meta_value'] = '0';\n $itemData['menu-item-position'] = count(get_posts($countArgs)) + 1;\n }\n\n // Save the new menu item\n $id = wp_update_nav_menu_item($menu->term_id, 0, $itemData);\n\n // Set the correct status and publish date\n wp_update_post(array(\n 'ID' => $id,\n 'post_title' => $post->post_title,\n 'post_status' => $post->post_status,\n 'post_date' => $post->post_date,\n 'post_date_gmt' => $post->post_date_gmt\n ));\n\n do_action('menu_manager_update_nav_menu', $id);\n\n // Save some additional datas\n update_post_meta($id, '_menuManagerIsManagerItem', true);\n update_post_meta($id, '_menuManagerOriginPostId', $postId);\n update_post_meta($postId, '_menuManagerNavItemId', $id);\n\n // Load the whole item and return it\n $item = wp_setup_nav_menu_item(get_post($id));\n return $item;\n }",
"function process_post()\n{\n\tglobal $g_obj_lock;\n\t\n\tif ( isset( $_POST['Command'] ) && $g_obj_lock->page_lock( PageHandler::get_post_value( 'SerialId' ) ) )\n\t{\n\t\t$str_command = $_POST['Command'];\n\t \n\t\tswitch ( $str_command )\n\t\t{\n\t\t\tcase 'Update':\n\t\t\t{\n\t\t\t\ton_update_handler();\n\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'Drop Selected Professors':\n\t\t\t{\n\t\t\t\ton_drop_selected_professors_handler();\n\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'Drop Selected TAs':\n\t\t\t{\n\t\t\t\ton_drop_selected_tas_handler();\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\tMessageHandler::add_message( MSG_ERROR, \"Unknown Command\" );\n\t\t\t}\n\t\t\tbreak;\t\n\t\t}\n\t}\n}",
"function process_post()\n{\n\tglobal $g_obj_lock;\n\t\n\tif ( isset( $_POST['Command'] ) && $g_obj_lock->page_lock( PageHandler::get_post_value( 'SerialId' ) ) )\n\t{ \n\t\t$str_command = $_POST['Command'];\n\n\t\tswitch( $str_command )\n\t\t{ \n\t\t\tcase 'Create':\n\t\t\t{\n\t\t\t\ton_create_handler();\n\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'Delete Selected Courses':\n\t\t\t{\n\t\t\t\ton_delete_handler();\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t{\n\t\t\t\tMessageHandler::add_message( MSG_ERROR, \"Unknown Command\" );\n\t\t\t}\n\t\t\tbreak;\t\n\t\t}\n\t}\n}",
"function process_menu_item($item) {\n\n if (debug) {\n echo 'Import menu...<br>';\n }\n // skip draft, orphaned menu items\n if ('draft' == $item['status'])\n return;\n\n $menu_slug = false;\n\n\n if (isset($item['terms'])) {\n // loop through terms, assume first nav_menu term is correct menu\n foreach ($item['terms'] as $term) {\n if ('nav_menu' == $term['domain']) {\n $menu_slug = $term['slug'];\n break;\n }\n }\n }\n\n if (debug) {\n echo 'Possition: ' . $term['slug'] . '<br>';\n echo 'Status: ' . $item['status'] . '<br>';\n }\n\n // no nav_menu term associated with this menu item\n if (!$menu_slug) {\n // echo('Menu item skipped due to missing menu slug');\n // echo '<br />';\n return;\n }\n\n $menu_id = term_exists($menu_slug, 'nav_menu');\n\n if (!$menu_id) {\n if (debug == true) {\n printf('Menu item skipped due to invalid menu slug: %s', esc_html($menu_slug));\n echo '<br />';\n return;\n }\n } else {\n $menu_id = is_array($menu_id) ? $menu_id['term_id'] : $menu_id;\n }\n\n foreach ($item['postmeta'] as $meta)\n $$meta['key'] = $meta['value'];\n\n if ('taxonomy' == $_menu_item_type && isset($this->processed_terms[intval($_menu_item_object_id)])) {\n $_menu_item_object_id = $this->processed_terms[intval($_menu_item_object_id)];\n } else if ('post_type' == $_menu_item_type && isset($this->processed_posts[intval($_menu_item_object_id)])) {\n $_menu_item_object_id = $this->processed_posts[intval($_menu_item_object_id)];\n } else if ('custom' != $_menu_item_type) {\n // associated object is missing or not imported yet, we'll retry later\n $this->missing_menu_items[] = $item;\n return;\n }\n\n if (isset($this->processed_menu_items[intval($_menu_item_menu_item_parent)])) {\n $_menu_item_menu_item_parent = $this->processed_menu_items[intval($_menu_item_menu_item_parent)];\n } else if ($_menu_item_menu_item_parent) {\n $this->menu_item_orphans[intval($item['post_id'])] = (int) $_menu_item_menu_item_parent;\n $_menu_item_menu_item_parent = 0;\n }\n\n // wp_update_nav_menu_item expects CSS classes as a space separated string\n $_menu_item_classes = maybe_unserialize($_menu_item_classes);\n if (is_array($_menu_item_classes))\n $_menu_item_classes = implode(' ', $_menu_item_classes);\n\n foreach ($item['postmeta'] as $meta) {\n if ($meta['key'] == 'jaw-menu-item-options') {\n $jaw_menu_item_options = $meta['value'];\n }\n }\n\n\n $args = array(\n 'menu-item-object-id' => $_menu_item_object_id,\n 'menu-item-object' => $_menu_item_object,\n 'menu-item-parent-id' => $_menu_item_menu_item_parent,\n 'menu-item-position' => intval($item['menu_order']),\n 'menu-item-type' => $_menu_item_type,\n 'menu-item-title' => $item['post_title'],\n 'menu-item-url' => $_menu_item_url,\n 'menu-item-description' => $item['post_content'],\n 'menu-item-attr-title' => $item['post_excerpt'],\n 'menu-item-target' => $_menu_item_target,\n 'menu-item-classes' => $_menu_item_classes,\n 'menu-item-xfn' => $_menu_item_xfn,\n 'menu-item-status' => $item['status']\n );\n\n\n if (isset($menu_id)) {\n $id = wp_update_nav_menu_item($menu_id, 0, $args);\n if ($_menu_item_object == 'category') {\n $this->_ids_nav_menu[$id] = $_menu_item_object_id;\n }\n }\n\n\n\n\n if (isset($id) && $id && !is_wp_error($id)) {\n $this->processed_menu_items[intval($item['post_id'])] = (int) $id;\n if (isset($jaw_menu_item_options)) {\n update_post_meta($id, 'jaw-menu-item-options', maybe_unserialize($jaw_menu_item_options));\n }\n }\n }",
"protected\n function execute_post_item( $post_item, $num_args )\n {\n $this->debug_print('executing post_item');\n // match again to be able to access groups by name...\n preg_match($this->grammar_rule('post_item'), $post_item, $matches);\n $post_object = $this->wp_post($matches);\n if ( ! $post_object instanceof WP_Post ) {\n return null;\n }\n $code = $this->wp_post_field($post_object, $matches);\n $arguments = $num_args > 0\n ? $this->catalyzed->pop($num_args)\n : array();\n $result = $this->execute_code($code, $arguments, $post_object);\n return $result;\n }",
"public function visitMenuItem(MenuItem $item);",
"function custom_post_menu_item() {\n $labels = array(\n 'name' => _x( 'Menu items', 'post type general name' ),\n 'singular_name' => _x( 'Menu item', 'post type singular name' ),\n 'add_new' => _x( 'Add New', 'item' ),\n 'add_new_item' => __( 'Add New Item to Menu' ),\n 'edit_item' => __( 'Edit Item' ),\n 'new_item' => __( 'New Item' ),\n 'all_items' => __( 'All Menu Items' ),\n 'view_item' => __( 'View Menu Item' ),\n 'search_items' => __( 'Search Menu Items' ),\n 'not_found' => __( 'No items found' ),\n 'not_found_in_trash' => __( 'No items found in the Trash' ), \n 'parent_item_colon' => ’,\n 'menu_name' => 'Menu Items'\n );\n $args = array(\n 'labels' => $labels,\n 'description' => 'All menu items',\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'revisions', 'page-attributes', 'thumbnail', 'custom-fields'),\n 'has_archive' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_menu_bar' => true,\n );\n register_post_type( 'menu_item', $args ); \n }",
"function PostProcessItemData()\n {\n $this->AddEventQuestDatas();\n $this->ItemDataGroups();\n }",
"function PostProcess($item)\n {\n $module=$this->GetGET(\"ModuleName\");\n if (!preg_match('/(Submissions|Friends|Inscriptions)/',$module))\n {\n return $item;\n }\n\n if (!isset($item[ \"ID\" ]) || $item[ \"ID\" ]==0) { return $item; }\n\n $updatedatas=\n array_merge\n (\n $this->PostProcess_Friends($item),\n $this->MyMod_Item_Language_Data_Defaults($item,\"Title\")\n );\n \n if\n (\n !empty($item[ \"Title\" ])\n &&\n empty( $item[ \"Title_UK\" ])\n )\n {\n $item[ \"Title_UK\" ]=$item[ \"Title\" ];\n array_push($updatedatas,\"Title_UK\");\n }\n\n $this->PostProcess_Certificate_TimeLoad($item,$updatedatas);\n $this->PostProcess_Code($item,$updatedatas);\n\n \n $this->PostProcess_Certificate($item);\n $updatedatas=$this->PostProcess_Results($item,$updatedatas);\n \n if (count($updatedatas)>0 && !empty($item[ \"ID\" ]))\n {\n $this->Sql_Update_Item_Values_Set($updatedatas,$item);\n }\n \n \n return $item;\n }",
"function PostProcessItemData()\n {\n $this->ItemData[ \"State\" ][ \"Values\" ]=$this->ApplicationObj()->States_Short;\n $this->ItemData[ \"State\" ][ \"Default\" ]=9;//GO...\n \n $this->InscriptionsObj()->ItemData(\"ID\");\n $this->InscriptionsObj()->ItemDataGroups(\"Basic\");\n $this->InscriptionsObj()->Actions(\"Search\");\n\n\n $this->Unit2ItemData();\n $this->Today2ItemData();\n \n $this->ItemData[ \"HtmlIcon1\" ][ \"Coordinator\" ]=2;\n $this->ItemData[ \"HtmlIcon2\" ][ \"Coordinator\" ]=2;\n $this->ItemData[ \"Initials\" ][ \"Coordinator\" ]=2;\n }",
"function PostProcess($item)\n {\n $module=$this->GetGET(\"ModuleName\");\n if ($module!=\"Dates\")\n {\n return $item;\n }\n\n if (!isset($item[ \"ID\" ]) || $item[ \"ID\" ]==0) { return $item; }\n\n $updatedatas=array();\n\n if (!empty($item[ \"Name\" ]))\n {\n $title=$this->MyTime_Sort2Date($item[ \"Name\" ]);\n if (empty($item[ \"Title\" ]) || $item[ \"Title\" ]!=$title)\n {\n $item[ \"Title\" ]=$title;\n array_push($updatedatas,\"Title\");\n }\n }\n \n if (count($updatedatas)>0)\n {\n $this->Sql_Update_Item_Values_Set($updatedatas,$item);\n }\n \n return $item;\n }",
"public function updateFromMenuItem($data)\n\t{\n\t\t$updated_post = [\n\t\t\t'ID' => sanitize_text_field($data['post_id']),\n\t\t\t'menu_order' => sanitize_text_field($data['menu_order']),\n\t\t\t'post_parent' => sanitize_text_field($data['post_parent'])\n\t\t];\n\t\tif ( isset($data['content']) ){\n\t\t\t$updated_post['post_content'] = $data['content'];\n\t\t\t$updated_post['post_title'] = $data['np_nav_title'];\n\t\t}\n\t\twp_update_post($updated_post);\n\n\t\t// Menu Options\n\t\t$this->updateLinkTarget($data);\n\t\t$this->updateNavTitle($data);\n\t\t$this->updateTitleAttribute($data);\n\n\t\tif ( $data['np_nav_css_classes'][0] !== \"\" ){\n\t\t\t$data['np_nav_css_classes'] = implode(' ', $data['np_nav_css_classes']);\n\t\t\t$this->updateNavCSS($data);\n\t\t}\n\t}",
"function PostProcess($item)\n {\n $module=$this->GetGET(\"ModuleName\");\n if ($module!=\"Lots\")\n {\n return $item;\n }\n\n if (!isset($item[ \"ID\" ]) || $item[ \"ID\" ]==0) { return $item; }\n\n $updatedatas=array();\n\n if (count($updatedatas)>0)\n {\n $this->Sql_Update_Item_Values_Set($updatedatas,$item);\n }\n \n return $item;\n }",
"public function value_as_wp_post_nav_menu_item() {}",
"function prism_singlepost() {\n\tdo_action('prism_singlepost');\n}",
"function PostProcessItemData()\n {\n $this->ItemData[ \"State\" ][ \"Values\" ]=$this->ApplicationObj->States_Short;\n $this->ItemData[ \"State\" ][ \"Default\" ]=9;//GO...\n\n $this->AddMails2ItemData(\"../EventApp/System/Units/Data.Mails.php\");\n $this->AddMailTypes2ItemData(\"../EventApp/System/Units/Emails/Data.php\");\n\n $this->MailTypesObj()->Sql_Table_Structure_Update();\n }",
"public function add_to_one_page_nav() {\n\n\t\t// Check if menu even exists\n\t\tif( empty( $this->menu_id ) ) {\n\n\t\t\techo json_encode( $this->message['no-menu'] );\n\t\t\tdie();\n\t\t}\n\n\t\t// update premise_add_post_to_one_page post meta\n\t\tif ( isset( $_POST['premise_add_post_to_one_page'] )\n\t\t\t&& isset( $_POST['premise_post_object_id'] ) ) {\n\n\t\t\tupdate_post_meta(\n\t\t\t\t$_POST['premise_post_object_id'],\n\t\t\t\t'premise_add_post_to_one_page',\n\t\t\t\t$_POST['premise_add_post_to_one_page']\n\t\t\t);\n\t\t}\n\n\n\t\t// if adding post to OPN\n\t\tif ( isset( $_POST['premise_add_post_to_one_page'] )\n\t\t\t&& $_POST['premise_add_post_to_one_page'] == '1' ) {\n\n\t\t\t$r = true;\n\n\t\t\tif( !$this->premise_nav_item_exists() )\n\t\t\t\t$r = wp_update_nav_menu_item( $this->menu_id, 0, $this->menu_args );\n\n\t\t\techo $r ? json_encode( $this->message['success-add-post'] ) : json_encode( $this->message['failure-add-post'] );\n\t\t\tdie();\n\t\t}\n\n\t\t// If deleting post from OPN\n\t\t$item_id = \"\";\n\t\tforeach( $this->menu as $item ){\n\n\t\t\tif( $item->object_id == $this->menu_args['menu-item-object-id'] )\n\t\t\t\t$item_id = $item->ID;\n\t\t}\n\n\t\t$menuObject = wp_get_nav_menu_object( $this->menu_id );\n\t\t$menu_objects = get_objects_in_term( $menuObject->term_id, 'nav_menu' );\n\n\t\tif ( !empty( $item_id ) && !empty( $menu_objects ) ) {\n\n\t\t\tforeach ( $menu_objects as $item ) {\n\n\t\t\t\tif( $item == $item_id ){\n\n\t\t\t\t\t$r = wp_delete_post( $item );\n\n\t\t\t\t\techo $r ? json_encode( $this->message['success-delete-post'] ) : json_encode( $this->message['failure-delete-post'] );\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo json_encode( $this->message['success-delete-post'] );\n\n\t\tdie();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds a regex child node to $node with values specified in $regex_info. $node must be a HTTP request node. $regex_info must be a map with entries for each of the required regex children (see the MeterMaid readme). Returns the regex node. | function addRegex($node, $regex_info) {
$regex = $node->addChild('regex', '');
foreach ($regex_info as $nodename=>$val) {
$regex->addChild($nodename, $val);
}
return $regex;
} | [
"public function AddDynamic($regex, Route\\RouteNode $node, array $args = array()) {\n // check regex is string and is not empty\n if (is_string($regex) && $regex !== '') {\n $routeNode = new Route\\RouteNodeArguments($node, $args);\n $this->dynamics[$regex] = $routeNode;\n } else {\n throw new Exception\\RouteCreateException('A dynamic path cannot be empty and must be a string');\n }\n }",
"public function addRoute($regex, $parsingInfo = array()) {\n\t\t$this->routes[$regex] = $parsingInfo;\n\t}",
"public function setRegex($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2\\CustomInfoType\\Regex::class);\n $this->writeOneof(2, $var);\n\n return $this;\n }",
"public function setRegex($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Dlp\\V2\\CustomInfoType\\Regex::class);\n $this->writeOneof(3, $var);\n\n return $this;\n }",
"public function append($regex)\n {\n $this->expression .= $regex;\n\n return $this;\n }",
"public function addPattern(string $placeholder, string $regex): RoutePathProcessor;",
"public function addregexner($array, $regex, $type, $override = null)\r\n\t{\r\n\t\tarray_push($array, new regexner(array($regex, $type, $override)));\r\n\t\treturn $array;\r\n\t}",
"public function addNode($expression);",
"public function setCustomRegex(string $regex): void\n {\n $this->customRegex = $regex;\n }",
"public function add_rewrite_tag($tag, $regex, $query)\n {\n }",
"protected function __construct ($key, $regex, $value=null) {\n\t\t\n\t\t\tparent::__construct($key,$value);\n\t\t\t\n\t\t\t$this->regex=$regex;\n\t\t\n\t\t}",
"protected function setCustomRegexForView(): void\n {\n $post = $this->request->request;\n $regex = $post->get('regex');\n $regexDesc = $post->get('regex_desc');\n if (is_array($regex) && is_array($regexDesc) && count($regex) === count($regexDesc)) {\n $this->set('customRegex', array_combine($regex, $regexDesc));\n }\n }",
"public function add_rewrite_tag($tag, $regex, $query)\n {\n }",
"private function write_node($node_attributes) {\n $this -> xmlw -> startElement('rule');\n $this -> xmlw -> writeAttribute('regex', $node_attributes['rule']);\n $this -> xmlw -> writeAttribute('replace', $node_attributes['replace']);\n $this -> xmlw -> endElement();\n }",
"public function add_rewrite_rule( $regex, $query, $after = 'bottom' ) {\n $this->rc_rewrite->add_rule( $regex, $query, $after );\n }",
"private function getRegexRoute(string $route, array $info): string {\n if (isset($info['params'])) {\n foreach ($info['params'] as $name => $type) {\n $route = str_replace(':' . $name, self::$regexPatters[$type], $route);\n }\n }\n return $route;\n }",
"public function __construct($regex) {}",
"public function add_rule($regex, $query, $after = 'bottom')\n {\n }",
"private function makeRegex()\n\t{\n\t\tif (is_array($this->pattern_search)) {\n\t\t\tforeach($this->pattern_search as $type=>$values) {\n\t\t\t\tif (is_array($this->pattern_search[$type])) {\n\t\t\t\t\tforeach($this->pattern_search[$type] as $key=>$val) {\n\t\t\t\t\t\t$regex = $val;\n\t\t\t\t\t\t$regex = $this->appendSearchPath($regex);\n\t\t\t\t\t\t$regex = $this->cleanRegex($regex);\n\t\t\t\t\t\tif (isset($this->rewrite_code[$type]) && isset($this->rewrite_replace[$type])) {\n\t\t\t\t\t\t\t$regex = str_replace($this->rewrite_code[$type], $this->rewrite_replace[$type], $regex);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//$regex = $this->appendDirPath($regex,$type);\n\t\t\t\t\t\t$regex = $this->wrapQuotes($regex);\n\t\t\t\t\t\t$this->patterns_regex[$type][$key] = \"#\".$regex.\"#s\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation putPdfInStorageToDocAsync Converts PDF document (located on storage) to DOC format and uploads resulting file to storage. | public function putPdfInStorageToDocAsync($name, $out_path, $add_return_to_line_end = null, $format = null, $image_resolution_x = null, $image_resolution_y = null, $max_distance_between_text_lines = null, $mode = null, $recognize_bullets = null, $relative_horizontal_proximity = null, $folder = null, $storage = null, $password = null)
{
return $this->putPdfInStorageToDocAsyncWithHttpInfo($name, $out_path, $add_return_to_line_end, $format, $image_resolution_x, $image_resolution_y, $max_distance_between_text_lines, $mode, $recognize_bullets, $relative_horizontal_proximity, $folder, $storage, $password)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function putPdfInStorageToTeXAsync($name, $out_path, $folder = null, $storage = null)\n {\n return $this->putPdfInStorageToTeXAsyncWithHttpInfo($name, $out_path, $folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPclInStorageToPdfAsync($name, $src_path, $dst_folder = null, $storage = null)\n {\n return $this->putPclInStorageToPdfAsyncWithHttpInfo($name, $src_path, $dst_folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPdfInStorageToEpubAsync($name, $out_path, $content_recognition_mode = null, $folder = null, $storage = null)\n {\n return $this->putPdfInStorageToEpubAsyncWithHttpInfo($name, $out_path, $content_recognition_mode, $folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPdfInStorageToDocAsyncWithHttpInfo($name, $out_path, $add_return_to_line_end = null, $format = null, $image_resolution_x = null, $image_resolution_y = null, $max_distance_between_text_lines = null, $mode = null, $recognize_bullets = null, $relative_horizontal_proximity = null, $folder = null, $storage = null, $password = null)\n {\n $returnType = '\\Aspose\\PDF\\Model\\AsposeResponse';\n $request = $this->putPdfInStorageToDocRequest($name, $out_path, $add_return_to_line_end, $format, $image_resolution_x, $image_resolution_y, $max_distance_between_text_lines, $mode, $recognize_bullets, $relative_horizontal_proximity, $folder, $storage, $password);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putPsInStorageToPdfAsync($name, $src_path, $dst_folder = null, $storage = null)\n {\n return $this->putPsInStorageToPdfAsyncWithHttpInfo($name, $src_path, $dst_folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putXpsInStorageToPdfAsync($name, $src_path, $dst_folder = null, $storage = null)\n {\n return $this->putXpsInStorageToPdfAsyncWithHttpInfo($name, $src_path, $dst_folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getPdfInStorageToDocAsync($name, $add_return_to_line_end = null, $format = null, $image_resolution_x = null, $image_resolution_y = null, $max_distance_between_text_lines = null, $mode = null, $recognize_bullets = null, $relative_horizontal_proximity = null, $folder = null, $storage = null, $password = null)\n {\n return $this->getPdfInStorageToDocAsyncWithHttpInfo($name, $add_return_to_line_end, $format, $image_resolution_x, $image_resolution_y, $max_distance_between_text_lines, $mode, $recognize_bullets, $relative_horizontal_proximity, $folder, $storage, $password)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPdfInStorageToXpsAsync($name, $out_path, $folder = null, $storage = null)\n {\n return $this->putPdfInStorageToXpsAsyncWithHttpInfo($name, $out_path, $folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPdfInStorageToMobiXmlAsync($name, $out_path, $folder = null, $storage = null)\n {\n return $this->putPdfInStorageToMobiXmlAsyncWithHttpInfo($name, $out_path, $folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putXmlInStorageToPdfAsync($name, $src_path, $xsl_file_path = null, $dst_folder = null, $storage = null)\n {\n return $this->putXmlInStorageToPdfAsyncWithHttpInfo($name, $src_path, $xsl_file_path, $dst_folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putExportFieldsFromPdfToFdfInStorageAsync($name, $fdf_output_file_path, $storage = null, $folder = null)\n {\n return $this->putExportFieldsFromPdfToFdfInStorageAsyncWithHttpInfo($name, $fdf_output_file_path, $storage, $folder)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPdfInRequestToMobiXmlAsync($out_path, $storage = null, $file = null)\n {\n return $this->putPdfInRequestToMobiXmlAsyncWithHttpInfo($out_path, $storage, $file)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putPclInStorageToPdfAsyncWithHttpInfo($name, $src_path, $dst_folder = null, $storage = null)\n {\n $returnType = '\\Aspose\\PDF\\Model\\AsposeResponse';\n $request = $this->putPclInStorageToPdfRequest($name, $src_path, $dst_folder, $storage);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putPdfInRequestToTeXAsyncWithHttpInfo($out_path, $storage = null, $file = null)\n {\n $returnType = '\\Aspose\\PDF\\Model\\AsposeResponse';\n $request = $this->putPdfInRequestToTeXRequest($out_path, $storage, $file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putExportFieldsFromPdfToXmlInStorageAsync($name, $xml_output_file_path, $storage = null, $folder = null)\n {\n return $this->putExportFieldsFromPdfToXmlInStorageAsyncWithHttpInfo($name, $xml_output_file_path, $storage, $folder)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function getEpubInStorageToPdfAsync($src_path, $storage = null)\n {\n return $this->getEpubInStorageToPdfAsyncWithHttpInfo($src_path, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putSvgInStorageToPdfAsync($name, $src_path, $adjust_page_size = null, $height = null, $width = null, $is_landscape = null, $margin_left = null, $margin_bottom = null, $margin_right = null, $margin_top = null, $dst_folder = null, $storage = null)\n {\n return $this->putSvgInStorageToPdfAsyncWithHttpInfo($name, $src_path, $adjust_page_size, $height, $width, $is_landscape, $margin_left, $margin_bottom, $margin_right, $margin_top, $dst_folder, $storage)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function putMarkdownInStorageToPdfAsyncWithHttpInfo($name, $src_path, $storage = null, $dst_folder = null)\n {\n $returnType = '\\Aspose\\PDF\\Model\\AsposeResponse';\n $request = $this->putMarkdownInStorageToPdfRequest($name, $src_path, $storage, $dst_folder);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function putPdfInRequestToXmlAsyncWithHttpInfo($out_path, $storage = null, $file = null)\n {\n $returnType = '\\Aspose\\PDF\\Model\\AsposeResponse';\n $request = $this->putPdfInRequestToXmlRequest($out_path, $storage, $file);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return array of Core Modules boot status | public function getCoreModulesStatus(): Collection; | [
"public function allCoreModulesBooted(): bool;",
"protected function getBootstraps(): array\n {\n $modules = [\n EnvironmentDetection::class,\n ConfigurationLoading::class,\n Logging::class,\n ErrorHandling::class,\n ];\n\n // Here we can add environment dependant modules.\n //if ($this->getEnvironment() === \\Venta\\Contracts\\Kernel\\Kernel::ENV_LOCAL) {\n // $modules[] = 'KernelModule';\n //}\n\n return $modules;\n }",
"public function status(): array\n {\n return $this->get('loader/status');\n }",
"private function getModulesStatuses(): array\n {\n if (!$this->config->get('modules.cache.enabled')) {\n return $this->readJson();\n }\n\n return $this->cache->remember($this->cacheKey, $this->cacheLifetime, function () {\n return $this->readJson();\n });\n }",
"public static function getCores() {\n self::$core = self::getCodeFilesInDir(BASEPATH . 'core');\n return array_keys(self::$core);\n }",
"public static function get_boot_module()\n {\n return self::$_boot_module;\n }",
"protected function defineBootloaders(): array\n {\n return static::LOAD;\n }",
"public function getLoadedModules() {}",
"public static function getNpe5__Status__cList(): array\n {\n return static::getClassConstantsFromPrefix('STATUS');\n }",
"protected function getModulesStatuses(): array\n {\n if (!$this->config->get('modules.cache.enabled')) {\n return $this->readJson();\n }\n\n return $this->cache->remember($this->cacheKey, $this->cacheLifetime, function () {\n return $this->readJson();\n });\n }",
"static function getAllModules(){\n\t\tself::init();\n\t\treturn self::$we_available_modules;\n\t}",
"public static function machineCheckStatus()\n\t{\n\t\treturn array(\n\t\t\t-1 => A11YC_LANG_CHECKLIST_MACHINE_CHECK_FAILED,\n\t\t\t1 => A11YC_LANG_CHECKLIST_MACHINE_CHECK_DONE,\n\t\t\t2 => A11YC_LANG_CHECKLIST_MACHINE_CHECK_PASSED,\n\t\t\t3 => A11YC_LANG_CHECKLIST_MACHINE_CHECK_EXIST,\n\t\t\t4 => A11YC_LANG_CHECKLIST_MACHINE_CHECK_NONEXIST,\n\t\t\t5 => A11YC_LANG_CHECKLIST_MACHINE_CHECK_SKIPED,\n\t\t);\n\t}",
"public static function states() {\n return array(\n self::STATUS_OK, \n self::STATUS_FAILED, \n self::STATUS_EXCEPTION,\n self::STATUS_FATAL\n );\n }",
"public static function getInstalled() {\n\t\t$modules = \\go\\modules\\core\\modules\\model\\Module::find()->where(['enabled' => true])->all();\n\t\t\n\t\t$available = [];\n\t\tforeach($modules as $module) {\n\t\t\tif($module->isAvailable()) {\n\t\t\t\t$available[] = $module;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $available;\n\t}",
"public function getLoadedModules();",
"public function getModuleStatus()\n {\n return $this->configProvider->getModuleStatus();\n }",
"public static function getEnabledModules() {\n\t\treturn static::loaded();\n\t}",
"protected function getBootable()\r\n\t{\r\n\t\treturn array(new \\example\\ExamplePackage());\r\n\t}",
"private function getInstalledModules(): array\n {\n return $this->services->get(ServiceProvider::CENTREON_LEGACY_MODULE_INFORMATION)\n ->getInstalledList();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Permet d'obtenir le modele Animal (pour les tests). | public function getAnimalModele()
{
return $this->_mdlAnimal;
} | [
"public function editaAnimal()\n {\n }",
"public function testGetAnimalByAnimalGender() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"animal\");\n\t\t//create a new Animal and insert into mySQL\n\t\t$animalId = generateUuidV4();\n\t\t$animal = new Animal($animalId, $this->profile->getProfileId(),$this->VALID_ANIMAL_COLOR, $this->VALID_ANIMAL_DATE, $this->VALID_ANIMAL_DESCRIPTION, $this->VALID_ANIMAL_GENDER,$this->VALID_ANIMAL_IMAGE_URL, $this->VALID_ANIMAL_LOCATION, $this->VALID_ANIMAL_NAME, $this->VALID_ANIMAL_SPECIES, $this->VALID_ANIMAL_STATUS);\n\t\t$animal->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce that the fields match expectations\n\t\t$results = Animal::getAnimalByAnimalGender($this->getPDO(),$animal->getAnimalGender());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"animal\"));\n\t\t$this->assertCount(1, $results);\n\t\t//enforce that no other objects are bleeding into the test\n\t\t$this->assertContainsOnlyInstancesOf(\"Jisbell347\\LostPaws\\Animal\", $results);\n\t\t//grab the result from the array and validate it\n\t\t$pdoAnimal = $results[0];\n\t\t$this->assertEquals($pdoAnimal->getAnimalId(), $animalId);\n\t\t$this->assertEquals($pdoAnimal->getAnimalProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoAnimal->getAnimalColor(), $this->VALID_ANIMAL_COLOR);\n\t\t$this->assertEquals($pdoAnimal->getAnimalDescription(),$this->VALID_ANIMAL_DESCRIPTION);\n\t\t$this->assertEquals($pdoAnimal->getAnimalGender(), $this->VALID_ANIMAL_GENDER);\n\t\t$this->assertEquals($pdoAnimal->getAnimalImageUrl(),$this->VALID_ANIMAL_IMAGE_URL);\n\t\t$this->assertEquals($pdoAnimal->getAnimalLocation(), $this->VALID_ANIMAL_LOCATION);\n\t\t$this->assertEquals($pdoAnimal->getAnimalName(),$this->VALID_ANIMAL_NAME);\n\t\t$this->assertEquals($pdoAnimal->getAnimalSpecies(), $this->VALID_ANIMAL_SPECIES);\n\t\t$this->assertEquals($pdoAnimal->getAnimalStatus(), $this->VALID_ANIMAL_STATUS);\n\t\t//format the date to seconds since the beginning of time to avoid round off error.\n\t\t$this->assertEquals($pdoAnimal->getAnimalDate()->getTimestamp(), $this->VALID_ANIMAL_DATE->getTimestamp());\n\t}",
"public function testGetAnimalByAnimalDescription() : void {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"animal\");\n\t\t//create a new Animal and insert into mySQL\n\t\t$animalId = generateUuidV4();\n\t\t$animal = new Animal($animalId, $this->profile->getProfileId(),$this->VALID_ANIMAL_COLOR, $this->VALID_ANIMAL_DATE, $this->VALID_ANIMAL_DESCRIPTION, $this->VALID_ANIMAL_GENDER,$this->VALID_ANIMAL_IMAGE_URL, $this->VALID_ANIMAL_LOCATION, $this->VALID_ANIMAL_NAME, $this->VALID_ANIMAL_SPECIES, $this->VALID_ANIMAL_STATUS);\n\t\t$animal->insert($this->getPDO());\n\t\t// grab the data from mySQL and enforce that the fields match expectations\n\t\t$results = Animal::getAnimalByAnimalDescription($this->getPDO(), $animal->getAnimalDescription());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"animal\"));\n\t\t$this->assertCount(1, $results);\n\t\t//enforce that no other objects are bleeding into the test\n\t\t$this->assertContainsOnlyInstancesOf(\"Jisbell347\\LostPaws\\Animal\", $results);\n\t\t//grab the result from the array and validate it\n\t\t$pdoAnimal = $results[0];\n\t\t$this->assertEquals($pdoAnimal->getAnimalId(), $animalId);\n\t\t$this->assertEquals($pdoAnimal->getAnimalProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoAnimal->getAnimalColor(), $this->VALID_ANIMAL_COLOR);\n\t\t$this->assertEquals($pdoAnimal->getAnimalDescription(),$this->VALID_ANIMAL_DESCRIPTION);\n\t\t$this->assertEquals($pdoAnimal->getAnimalGender(), $this->VALID_ANIMAL_GENDER);\n\t\t$this->assertEquals($pdoAnimal->getAnimalImageUrl(),$this->VALID_ANIMAL_IMAGE_URL);\n\t\t$this->assertEquals($pdoAnimal->getAnimalLocation(), $this->VALID_ANIMAL_LOCATION);\n\t\t$this->assertEquals($pdoAnimal->getAnimalName(),$this->VALID_ANIMAL_NAME);\n\t\t$this->assertEquals($pdoAnimal->getAnimalSpecies(), $this->VALID_ANIMAL_SPECIES);\n\t\t$this->assertEquals($pdoAnimal->getAnimalStatus(), $this->VALID_ANIMAL_STATUS);\n\t\t//format the date to seconds since the beginning of time to avoid round off error.\n\t\t$this->assertEquals($pdoAnimal->getAnimalDate()->getTimestamp(), $this->VALID_ANIMAL_DATE->getTimestamp());\n\t}",
"public function excluiAnimal()\n {\n }",
"function getAnimals(){ return $this->allAnimals; }",
"public function getAnimal(): Animal\n {\n return $this->animal;\n }",
"public function cargarTiposAnimal() {\n\n $dao = new DaoAnimal();\n return $dao->consultarTipoAnimal();\n }",
"public function getAnimals()\n {\n return $this->hasMany(Animal::class, ['animal_type_id' => 'id']);\n }",
"public function __construct()\n {\n parent::__construct();\n\n // load model\n $this->load->model('AnimalModel');\n }",
"function getAnimalId(){ return $this->animalId; }",
"public function animal()\n {\n return $this->belongsTo('App\\Models\\Animal');\n }",
"public function insertAnimal()\n {\n $animal = R::dispense('animal');\n\n $animal->name = $this->_name;\n $animal->type = $this->_type;\n $animal->breed = $this->_breed;\n $animal->gender = $this->_gender;\n $animal->size = $this->_size;\n $animal->birth_date = $this->_birthDate;\n $animal->entrance_date = $this->_entranceDate;\n $animal->adoption_date = $this->_adoptionDate;\n $animal->status = $this->_status;\n $animal->description = $this->_description;\n\n $id = R::store($animal);\n\n $this->setId($id);\n }",
"public function testGetInvalidAnimalByAnimalSpecies() : void {\n\t\t//grab an animal by species that does not exist for an animal\n\t\t$animal = Animal::getAnimalByAnimalSpecies($this->getPDO(),\"Fish\");\n\t\t$this->assertCount(0, $animal);\n\t}",
"public static function find(){\n return new AnimalQuery(get_called_class());\n }",
"public function getNome(){\n return $this->nome_animal;\n }",
"public function testInsertValidAnimal(): void {\n //count the number of rows and save it for later\n $numRows = $this->getConnection()->getRowCount(\"animal\");\n\n //create a new animal and insert it into mySQL\n $animalId = generateUuidv4();\n $animal = new Animal($animalId, $this->shelter->getShelterId(), $this->VALID_ANIMAL_ADOPTION_STATUS, $this->VALID_ANIMAL_BREED, $this->VALID_ANIMAL_GENDER, $this->VALID_ANIMAL_NAME, $this->VALID_ANIMAL_PHOTO_URL, $this->VALID_ANIMAL_SPECIES);\n $animal->insert($this->getPDO());\n\n // grab the data from mySQL and enforce the fields match our expectations\n $pdoAnimal = Animal::getAnimalByAnimalId($this->getPDO(), $animal->getAnimalid());\n $this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"animal\"));\n $this->assertEquals($pdoAnimal->getAnimalId()->toString(), $animalId->toString());\n $this->assertEquals($pdoAnimal->getAnimalShelterId(), $this->shelter->getShelterId()->toString());\n $this->assertEquals($pdoAnimal->getAnimalAdoptionStatus(), $this->VALID_ANIMAL_ADOPTION_STATUS);\n $this->assertEquals($pdoAnimal->getAnimalBreed(), $this->VALID_ANIMAL_BREED);\n $this->assertEquals($pdoAnimal->getAnimalGender(), $this->VALID_ANIMAL_GENDER);\n $this->assertEquals($pdoAnimal->getAnimalName(), $this->VALID_ANIMAL_NAME);\n $this->assertEquals($pdoAnimal->getAnimalPhotoUrl(), $this->VALID_ANIMAL_PHOTO_URL);\n $this->assertEquals($pdoAnimal->getAnimalSpecies(), $this->VALID_ANIMAL_SPECIES);\n }",
"static function createAnimal()\n {\n return new Dog();\n }",
"public function testGetInvalidAnimalByAnimalDescription() : void {\n\t\t//grab an animal by a description that does not exist for an animal\n\t\t$animal = Animal::getAnimalByAnimalDescription($this->getPDO(), \"Salvage Title but it just needs a bumper, Low Miles, A/C needs recharge, Owned by a Non-Smoker. $10,000. No low ballers. I know what I have!\");\n\t\t$this->assertCount(0, $animal);\n\t}",
"public function getType_animal()\n {\n return $this->Type_animal;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
STAR FUNCTIONS // Define a function for checking is a prototype star has been unlocked | function mmrpg_game_star_unlocked($star_token){
$session_token = mmrpg_game_token();
if (empty($_SESSION[$session_token]['values']['battle_stars'])){ return false; }
elseif (empty($_SESSION[$session_token]['values']['battle_stars'][$star_token])){ return false; }
else { return true; }
} | [
"public static function isUnguarded();",
"public function testFlagPrototypeGetOwner()\n {\n\n }",
"public function isProtectingTheKing(): bool;",
"public function isLocked();",
"public function testProfilePrototypeCountQuarantines()\n {\n\n }",
"function is_unlocked() {\n\tif ( current_user_can('administrator') )\n\t\treturn true;\n\n\t//* if there's a cookie, it's unlocked\n\tif ( $_COOKIE[\"novicontentgate\"] )\n\t\treturn true;\n\n\t//* if there's a URL parameter, it's unlocked\n\tif ( htmlspecialchars($_GET[\"unlock\"]) )\n\t\treturn true;\n\n\t//* if we haven't met one of those conditions, it's still locked\n\treturn null;\n\n}",
"static function supprimable() {\n\t\treturn true;\n\t}",
"public function testProfilePrototypeGetQuarantines()\n {\n\n }",
"public function testProfilePrototypeDeleteQuarantines()\n {\n\n }",
"function userIsGuard() {\r\n\t\treturn false;\r\n\t}",
"public function hasLock() {}",
"public function isProtectingTheKing(): bool\r\n {\r\n // TODO...\r\n return FALSE;\r\n }",
"public function canVoid()\n {\n }",
"public function isCompulsory();",
"function lock()\n{\n}",
"public function is_acquired() : bool ;",
"public function isPro();",
"public function testPostPrototypeExistsLikes()\n {\n\n }",
"public function isSuspend();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check source and destination folders to exists and to be writable to allow copy to continue | private function do_tests() {
// Test source folder to exists and to be a folder
if ( !$this->exists($this->source) || !$this->isFolder($this->source) ) return false;
// "clear" sync method will destroy dest folder
if ( $this->sync === 'clear' && $this->exists($this->dest) ) {
@self::rrmdir( $this->dest );
if ( $this->exists($this->dest) ) return false;
}
// Optional creates dest folder
if ( !$this->exists($this->dest) ) $this->createFolder($this->dest);
// Test dest folder to exists and to be a writeable folder
if ( !$this->exists($this->dest) || !$this->isWritableFolder($this->dest) ) return false;
return true;
} | [
"private function checkDestinationWritable()\n {\n $destination = $this->getDestination();\n $dirName = dirname($destination);\n\n if (@is_writable($dirName) && @is_executable($dirName)) {\n // all is well\n return;\n }\n\n // The above might fail on Windows, even though dir is writable\n // So, to be absolute sure that we cannot write, we make an actual write test (writing a dummy file)\n // No harm in doing that for non-Windows systems either.\n if (file_put_contents($destination, 'dummy') !== false) {\n // all is well, after all\n unlink($destination);\n return;\n }\n\n throw new CreateDestinationFileException(\n 'Cannot create file: ' . basename($destination) . ' in dir:' . dirname($destination)\n );\n }",
"function err_copy($source, $dest) {\n\t $ret = false;\n\t set_error_handler(\"report_errors\");\n\t //if were copying a directory, just mkdir the directory\n\t if(is_dir($source)){\n\t\t $ret=mkdir($dest,0754);\n\t }elseif(copy($source, $dest)) {\n\t\t $ret = chmod($dest,0754);\n\t }\n\t restore_error_handler();\n\t return $ret;\n }",
"private function destination_exist()\n {\n return is_writable($this->_destination);\n }",
"protected function destination_exist() {\r\n\r\n\t\treturn is_writable($this->root . $this->destination);\r\n\r\n\t}",
"protected function destination_exist()\n {\n\n return is_writable($this->root . $this->destination);\n }",
"function check_permissions() {\n \n if (!is_writable(Config::get('basedir') . \"/public/upload/\")) {\n $this->error['permissions'][] = _(sprintf(\"Path %s is not writeable\", _(Config::get('basedir') . \"/public/upload/\")));\n }\n\n if (!is_writable(Config::get('basedir') . \"/public/video/\")) {\n $this->error['permissions'][] = _(sprintf(\"Path %s is not writeable\", _(Config::get('basedir') . \"/public/video/\")));\n }\n }",
"private static function smartCopy($source, $dest, $options = array('folderPermission' => 0755, 'filePermission' => 0755)) {\r\n\t\t$result = false;\r\n\r\n\t\tif (is_file($source)) {\r\n\t\t\tif ($dest[strlen($dest) - 1] == '/') {\r\n\t\t\t\tif (!file_exists($dest)) {\r\n\t\t\t\t\tcmfcDirectory::makeAll($dest, $options['folderPermission'], true);\r\n\t\t\t\t}\r\n\t\t\t\t$__dest = $dest . \"/\" . basename($source);\r\n\t\t\t} else {\r\n\t\t\t\t$__dest = $dest;\r\n\t\t\t}\r\n\t\t\t$result = copy($source, $__dest);\r\n\t\t\tchmod($__dest, $options['filePermission']);\r\n\t\t} elseif (is_dir($source)) {\r\n\t\t\tif ($dest[strlen($dest) - 1] == '/') {\r\n\t\t\t\tif ($source[strlen($source) - 1] == '/') {\r\n\t\t\t\t\t//Copy only contents\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Change parent itself and its contents\r\n\t\t\t\t\t$dest = $dest . basename($source);\r\n\t\t\t\t\t@mkdir($dest);\r\n\t\t\t\t\tchmod($dest, $options['filePermission']);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($source[strlen($source) - 1] == '/') {\r\n\t\t\t\t\t//Copy parent directory with new name and all its content\r\n\t\t\t\t\t@mkdir($dest, $options['folderPermission']);\r\n\t\t\t\t\tchmod($dest, $options['filePermission']);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t//Copy parent directory with new name and all its content\r\n\t\t\t\t\t@mkdir($dest, $options['folderPermission']);\r\n\t\t\t\t\tchmod($dest, $options['filePermission']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$dirHandle = opendir($source);\r\n\t\t\twhile ($file = readdir($dirHandle)) {\r\n\t\t\t\tif ($file != \".\" && $file != \"..\") {\r\n\t\t\t\t\tif (!is_dir($source . \"/\" . $file)) {\r\n\t\t\t\t\t\t$__dest = $dest . \"/\" . $file;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$__dest = $dest . \"/\" . $file;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//echo \"$source/$file ||| $__dest<br />\";\r\n\t\t\t\t\t$result = self::smartCopy($source . \"/\" . $file, $__dest, $options);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($dirHandle);\r\n\t\t} else {\r\n\t\t\t$result = false;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function smartCopy( $source, $dest, $options = array('folderPermission' => 0777, 'filePermission' => 0777) )\n{\n $result=false;\n $file_paths = array();\n\n if (is_file($source)) {\n if ($dest[strlen($dest)-1]=='/') {\n if (!file_exists($dest)) {\n cmfcDirectory::makeAll($dest,$options['folderPermission'],true);\n }\n $__dest=$dest.\"/\".basename($source);\n } else {\n $__dest=$dest;\n }\n\n $f = \"\";\n $tmp = $__dest;\n $sp = array_filter(explode('/', $tmp), 'strlen');\n\n if ($dest[strlen($dest)-1]!='/') {\n array_pop($sp);\n }\n\n foreach($sp as $sub) {\n $f .= \"/\" . $sub;\n if(!is_dir($f)) {\n mkdir($f);\n }\n }\n\n $result=copy($source, $__dest);\n if($result)\n $file_paths[] = $__dest;\n chmod($__dest,$options['filePermission']);\n\n } elseif(is_dir($source)) {\n if ($dest[strlen($dest)-1]=='/') {\n if ($source[strlen($source)-1]=='/') {\n //Copy only contents\n } else {\n //Change parent itself and its contents\n $dest=$dest.basename($source);\n @force_mkdir($dest);\n chmod($dest,$options['filePermission']);\n }\n } else {\n if ($source[strlen($source)-1]=='/') {\n //Copy parent directory with new name and all its content\n @force_mkdir($dest,$options['folderPermission']);\n chmod($dest,$options['filePermission']);\n } else {\n //Copy parent directory with new name and all its content\n @force_mkdir($dest,$options['folderPermission']);\n chmod($dest,$options['filePermission']);\n }\n }\n\n $files=scandir($source);\n foreach($files as $file)\n {\n if($file!=\".\" && $file!=\"..\")\n {\n $file_paths = array_merge($file_paths, smartCopy($source.\"/\".$file, $dest.\"/\".$file, $options));\n }\n }\n\n } else {\n $result=false;\n }\n return $file_paths;\n}",
"protected function writableFolderCheck()\n {\n $fileName = '/configtester_' . date('Y-m-d-h-i-s') . '.txt';\n\n $fileSystems = [\n ['name' => 'files', 'folder' => '', 'label' => '<code>files/</code> in the webroot'],\n ['name' => 'extensions', 'folder' => '', 'label' => '<code>extensions/</code> in the webroot'],\n ['name' => 'config', 'folder' => ''],\n ['name' => 'cache', 'folder' => ''],\n ];\n if ($this->app['config']->get('general/database/driver') === 'pdo_sqlite') {\n $fileSystems[] = ['name' => 'app', 'folder' => 'database'];\n }\n $fileSystems = Bag::fromRecursive($fileSystems);\n\n foreach ($fileSystems as $fileSystem) {\n $contents = $this->isWritable($fileSystem, $fileName);\n if ($contents != 'ok') {\n $folderName = $this->getFoldername($fileSystem);\n $notice = json_encode([\n 'severity' => 1,\n 'notice' => 'Bolt needs to be able to <strong>write files to</strong> the folder <code>' . $folderName . \"</code>, but it doesn't seem to be writable.\",\n 'info' => 'Make sure the folder exists, and is writable to the webserver.',\n ]);\n $this->app['logger.flash']->configuration($notice);\n }\n }\n }",
"public function testCopy_DirExists()\n {\n mkdir(\"{$this->file}.x\");\n $this->setExpectedException(\"Q\\Fs_Exception\", \"Unable to copy '{$this->file}' to '{$this->file}.x': Target already exists\");\n $this->Fs_Node->copy(\"{$this->file}.x\");\n\n $this->assertTrue(is_dir(\"{$this->file}.x\"));\n $this->assertTrue(file_exists($this->file));\n }",
"public function it_should_allow_copying_dirs_to_the_uploads_dir()\n {\n $sut = $this->make_instance();\n\n $src = codecept_data_dir('folder-structures/folder1');\n $dest = $this->config['wpRootFolder'] . $this->config['uploads'] . '/folder2';\n\n $this->assertFileExists($src);\n Assert::assertFileDoesNotExist($dest);\n\n $sut->copyDirToUploads($src, 'folder2');\n\n $this->assertFileExists($src);\n $this->assertFileExists($dest);\n }",
"public function testCopy_FileExists()\n {\n \tif (function_exists('posix_getuid') && posix_getuid() == 0) $this->markTestSkipped(\"Won't test this as root for safety reasons.\");\n \t\n \tfile_put_contents(\"{$this->file}.x\", \"Another file\");\n $this->setExpectedException(\"Q\\Fs_Exception\", \"Unable to copy '{$this->file}' to '{$this->file}.x': Target already exists\");\n $this->Fs_Node->copy(\"{$this->file}.x\");\n\n $this->assertTrue(file_exists(\"{$this->file}.x\"));\n $this->assertEquals(\"Another file\", file_exists(\"{$this->file}.x\"));\n \n $this->assertTrue(is_dir($this->file));\n $this->assertTrue(file_exists(\"{$this->file}/\" . basename($this->file)));\n }",
"public function testCopyDirectoryReturnsFalseIfSourceIsntDirectory()\n {\n $origin = self::$temp.DS.'breeze'.DS.'boom'.DS.'foo'.DS.'bar'.DS.'baz';\n $this->assertFalse(File::cpdir($origin, self::$temp));\n }",
"public function testCopy_throwsInvalidArgumentException_ifDestinationDNEAndModeIsFalse()\n\t{\n\t\t$source = $this->cwd.DIRECTORY_SEPARATOR.'foo';\n\t\t$destination = $this->cwd.DIRECTORY_SEPARATOR.'bar';\n\t\t\n\t\t// create the source directory\n\t\tmkdir($source);\n\t\t$this->assertTrue(is_dir($source));\n\t\t\n\t\t// try to copy the directory with mode set to false\n\t\t// the method will throw an InvalidArgumentException\n\t\t// catch it, remove the source directory, and re-throw it\n\t\t//\n\t\t$this->setExpectedException('InvalidArgumentException');\n\t\ttry {\n\t\t\tDir::copy($source, $destination, false);\n\t\t} catch (Exception $e) {\n\t\t\trmdir($source);\n\t\t\tthrow $e;\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"public function test_xcopy()\n {\n\n // Take care when the $temp parameter is changed\n $temp = self::$resources . DS . '..' . DS . 'temp';\n\n mkdir($temp);\n\n // Copy files recursively\n $this->assertTrue(File::xcopy(self::$resources . DS . '*', $temp, 0755));\n\n // Check files\n $source_files = File::ls(self::$resources, false, File::EXCLUDE_BLOCK | File::LIST_RECURSIVE);\n $dest_files = File::ls($temp, false, File::EXCLUDE_BLOCK | File::LIST_RECURSIVE);\n\n $this->assertEquals($source_files, $dest_files);\n\n // Remove temporal folder\n $dest_files = File::ls($temp, true, File::EXCLUDE_BLOCK | File::LIST_RECURSIVE);\n $this->assertTrue(File::delTree($temp, true));\n\n foreach ($dest_files as $dest_file)\n $this->assertFalse(file_exists($dest_file));\n\n }",
"function checkPermissions()\n {\n // Check for permissions (on platforms that support it):\n if ($this->get('CheckConfigurationPermissions')) {\n $perms = @fileperms($this->getSource());\n if (!($perms === false) && ($perms & 2)) {\n // This check is normally done after loading configuration\n $this->checkWebServerOs();\n if ($this->get('PMA_IS_WINDOWS') == 0) {\n $this->source_mtime = 0;\n die('Wrong permissions on configuration file, should not be world writable!');\n }\n }\n }\n }",
"public function testCopy_returnsTrue_ifDirectoryIsEmpty()\n\t{\n\t\t// create the source directory\n\t\t$source = $this->cwd.DIRECTORY_SEPARATOR.'foo';\n\t\tmkdir($source);\n\t\t$this->assertTrue(is_dir($source));\n\t\t\n\t\t// create the destination directory\n\t\t$destination = $this->cwd.DIRECTORY_SEPARATOR.'bar';\n\t\tmkdir($destination);\n\t\t$this->assertTrue(is_dir($destination));\n\t\t\n\t\t// copy source to destination\n\t\t$this->assertTrue(Dir::copy($source, $destination));\n\t\t\n\t\t// remove the source and destination directories\n\t\trmdir($source);\n\t\trmdir($destination);\n\t\t\n\t\treturn;\n\t}",
"abstract protected function copyTargetsToStagingFolder();",
"public function testCopy_returnsTrue_ifDirectoryIsNotEmpty()\n\t{\n\t\t// create the source \"<cwd>/foo\" directory\n\t\t$foo = $this->cwd.DIRECTORY_SEPARATOR.'foo';\n\t\tmkdir($foo);\n\t\t$this->assertTrue(is_dir($foo));\n\t\t// create the \"<cwd>/foo/bar\" directory\n\t\t$bar1 = $foo.DIRECTORY_SEPARATOR.'bar';\n\t\tmkdir($bar1);\n\t\t$this->assertTrue(is_dir($bar1));\n\t\t// create the \"<cwd>/foo/bar/baz\" directory\n\t\t$baz1 = $bar1.DIRECTORY_SEPARATOR.'baz';\n\t\tmkdir($baz1);\n\t\t$this->assertTrue(is_dir($baz1));\n\t\t// create a file\n\t\t$qux1 = $baz1.DIRECTORY_SEPARATOR.'qux.txt';\n\t\tfile_put_contents($qux1, 'hello world');\n\t\t$this->assertTrue(is_file($qux1));\n\t\t\n\t\t// create the destination \"<cwd>/qux\" directory\n\t\t$quux = $this->cwd.DIRECTORY_SEPARATOR.'quux';\n\t\tmkdir($quux);\n\t\t$this->assertTrue(is_dir($quux));\n\t\t\n\t\t// copy \"<cwd>/foo\" to \"<cwd>/quux\"\n\t\t$this->assertTrue(Dir::copy($foo, $quux));\n\t\t\n\t\t// set the paths of quux's sub-directories\n\t\t$bar2 = $quux.DIRECTORY_SEPARATOR.'bar';\n\t\t$baz2 = $bar2.DIRECTORY_SEPARATOR.'baz';\n\t\t$qux2 = $baz2.DIRECTORY_SEPARATOR.'qux.txt';\n\t\t\n\t\t// test to be sure the old files still exist\n\t\t$this->assertTrue(is_dir($foo));\n\t\t$this->assertTrue(is_dir($bar1));\n\t\t$this->assertTrue(is_dir($baz1));\n\t\t$this->assertTrue(is_file($qux1));\n\t\t\n\t\t// test to be sure the new files exist\n\t\t$this->assertTrue(is_dir($quux));\n\t\t$this->assertTrue(is_dir($bar2));\n\t\t$this->assertTrue(is_dir($baz2));\n\t\t$this->assertTrue(is_file($qux2));\n\t\t\n\t\t// delete old files\n\t\tunlink($qux1);\n\t\trmdir($baz1);\n\t\trmdir($bar1);\n\t\trmdir($foo);\n\t\t\n\t\t// delete new files\n\t\tunlink($qux2);\n\t\trmdir($baz2);\n\t\trmdir($bar2);\n\t\trmdir($quux);\n\t\t\n\t\treturn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of returnOrderKey | public function getReturnOrderKey()
{
return $this->returnOrderKey;
} | [
"public function getOrderKey()\n {\n return $this->orderKey;\n }",
"public function getReturnOrderID()\n {\n return $this->returnOrderID;\n }",
"public function getReturnOrder()\n {\n return $this->returnOrder;\n }",
"public function orderingKey()\n {\n return $this->message['orderingKey'];\n }",
"public function getResponseKey();",
"public function getExistingOrderKey()\n {\n return $this->existingOrderKey;\n }",
"public function get_order_id_by_order_key($order_key);",
"public function get_order_value() {\n return $this->order_value;\n }",
"public function getOrderNumber();",
"public function getUnfiOrderId();",
"public function getOrder()\r\n {\r\n return $this->fields['Order']['value'];\r\n }",
"public function getReturnOrderId($return_id = 0)\t{\n\t\tif ($return_id) {\n\t\t\treturn $this->db->query(\"SELECT DISTINCT order_id,product FROM \".DB_PREFIX.\"return WHERE return_id = \".(int)$return_id)->row;\n\t\t}\n\t}",
"function get_order_number() {\r\n $conn = $this->db->conn_id;\r\n $stmt = oci_parse($conn, \"BEGIN :v_Return := PRODUCT_ACTIONS.NEXT_ORDER_NUMBER(); END;\");\r\n oci_bind_by_name($stmt, ':v_Return', $result, SQLT_STR);\r\n\r\n if (!oci_execute($stmt)) {\r\n return oci_error($stmt);\r\n }\r\n return $result;\r\n }",
"public function getKeyVal()\n {\n return $this->originalKeyVal;\n }",
"abstract public function getResultKey();",
"public function getOrderCode(){\n\t\tif($this->mOrderCode){\n\t\t\treturn $this->mOrderCode;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function fetchKey(): string;",
"public function getProductKey($orderId) {\n return $this->fetchRow('order_id = '.$orderId);\n }",
"public function getOrderFromKey()\n {\n if (isset($_GET['key'])) {\n $order_id = wc_get_order_id_by_order_key($_GET['key']);\n return wc_get_order($order_id);\n }\n\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the domains with the IDs specified, with the properties in the properties object. | public function update(array $ids, ?object $properties = null): void; | [
"public function update($domain, $record, array $properties = []);",
"public function updateProperties($properties) {\n $didntExist = false;\n\n // Create cookie if it doesnt exist\n if (!$this->exists) {\n $didntExist = true;\n $this->create();\n }\n \n $dbChanges = array();\n \n $query = \"UPDATE `cookies` SET \";\n $types = \"\";\n $params = array();\n \n $queryitems = array();\n foreach ($properties as $name => $value) {\n $infoValue = $value;\n $dbValue = $value;\n \n // Special handling for different types\n switch ($name) {\n case \"timeout\":\n $newval = strtotime($value);\n $infoValue = new DateTime(\"@\" . $newval);\n $dbValue = date(\"Y-m-d H:i:s\", $newval);\n break;\n case \"value\":\n $dbValue = serialize($value);\n break;\n }\n \n \n array_push($queryitems, \"`$name` = ?\");\n if (is_string($dbValue)) $types .= \"s\";\n else $types .= \"i\";\n array_push($params, $dbValue);\n \n $this->info[$name] = $infoValue;\n }\n \n $query .= implode(\", \", $queryitems);\n \n // Update cookie\n $names = array_keys($properties);\n if ($didntExist || in_array(\"name\", $names) || in_array(\"uniqid\", $names) || in_array(\"timeout\", $names) || in_array(\"domain\", $names) || in_array(\"http\", $names)) $this->updateCookie();\n \n // Update database\n if (count($params)) {\n $query .= \" WHERE `id` = ?\";\n $types .= \"i\";\n array_push($params, $this->info[\"id\"]);\n\n Connection::query($query, $types, $params);\n }\n }",
"#[API\\Input(type: '?DomainID[]')]\n public function setDomains(?array $domains): void\n {\n if (null === $domains) {\n return;\n }\n\n $this->setEntireCollection($domains, $this->domains, Domain::class);\n }",
"protected function updateProperties() {\n\t\tglobal $ilDB;\n\t\tforeach ($this->property as $key => $value) {\n\t\t\t$ilDB->update('il_dcl_field_prop', array(\n\t\t\t\t'value' => array( 'integer', $value ),\n\t\t\t), array(\n\t\t\t\t'field_id' => array( 'integer', $this->getId() ),\n\t\t\t\t'datatype_prop_id' => array( 'integer', $key ),\n\t\t\t));\n\t\t}\n\t}",
"public function putDomains()\n {\n return [\n 'method' => 'PUT',\n 'path' => 'domains',\n 'jsonKey' => 'domains',\n 'params' => [\n 'comment' => $this->params->commentJson(),\n 'domains' => $this->params->domainsJson(),\n 'emailAddress' => $this->params->emailAddressJson(),\n 'id' => $this->params->idJson(),\n 'ttl' => $this->params->ttlJson(),\n ],\n ];\n }",
"private function populate($properties)\n {\n foreach ( $properties as $name => $value )\n $this->create_property($name, $value);\n }",
"public function setMultipleProperties($properties) {\n $this->properties = array_merge($this->properties, $properties);\n }",
"public function setProperties($properties) {\n\t\tforeach ($properties as $newpropertyk => $newpropertyv) {\n\t\t\t$cmd = \"zfs set \" . $newpropertyk . \"=\" . $newpropertyv . \" \\\"\" . $this->name . \"\\\" 2>&1\";\n\t\t\t$this->exec($cmd,$out,$res);\n\t\t\t$this->updateProperty($newpropertyk);\n\t\t}\n\t}",
"public function updateSpecificProductIds($ids);",
"public static function loop_properties_by_ids($ids) {\n \n global $paged;\n if ( is_front_page() ) {\n $paged = (get_query_var('page')) ? get_query_var('page') : 1;\n }\n\n $tax_query = array();\n\n if ( isset( $_GET['tab'] ) && !empty($_GET['tab']) && $_GET['tab'] != \"reviews\") {\n $tax_query[] = array(\n 'taxonomy' => 'property_status',\n 'field' => 'slug',\n 'terms' => $_GET['tab']\n );\n }\n\n $args = array(\n 'post_type' => 'property',\n 'posts_per_page' => houzez_option('num_of_agency_listings', 9),\n 'paged' => $paged,\n 'post__in' => $ids,\n 'post_status' => 'publish'\n );\n\n $count = count($tax_query);\n if($count > 0 ) {\n $args['tax_query'] = $tax_query;\n }\n\n $args = houzez_prop_sort($args);\n\n $agency_qry = new WP_Query( $args );\n return $agency_qry;\n }",
"public function updated(Service $domains)\n {\n //\n }",
"public function getPropertyByIds($ids, $property);",
"public function update($modelId, $properties);",
"public function setDomainUsers($domain_id, $users) {\n $user_array = array();\n foreach ($users as $user) {\n array_push($user_array, array(\n 'username' => $user->getUsername(),\n 'name' => $user->getName(),\n 'email' => $user->getEmail()\n ));\n }\n $body = json_encode($user_array);\n\n try {\n $response = $this->jsonResponse($this->adminRestClient->put('/api/domains/' . $domain_id . '/users', $body));\n } catch (Exception $e) {\n throw $this->createException($e);\n }\n }",
"function Update( $strClass, $id, $properties )\n\t{\n\t\tif($object = MyActiveRecord::FindById($strClass, $id)){\n\t\t\t$object->populate($properties);\n\t\t\treturn $object->save();\n\t\t}\n\t\treturn false;\n\t}",
"public function setProperties($uri, $properties);",
"function updateProperties($mutations) {\n\n global $DOCMGR;\n\n $resourceData = $this->getProperties(array());\n \n $result = array();\n\n foreach($mutations as $mutation) {\n\n switch($mutation[0]){ \n case Sabre_DAV_Server::PROP_SET :\n if (isset($resourceData[$mutation[1]])) {\n $result[] = array($mutation[1],200);\n } else {\n $result[] = array($mutation[1],201);\n }\n $resourceData[$mutation[1]] = $mutation[2];\n break;\n case Sabre_DAV_Server::PROP_REMOVE :\n if (isset($resourceData[$mutation[1]])) {\n unset($resourceData[$mutation[1]]);\n }\n // Specifying the deletion of a property that does not exist, is _not_ an error\n $result[] = array($mutation[1],200);\n break;\n\n }\n\n }\n\n $opt = null;\n $opt[\"command\"] = \"docmgr_object_saveproperties\";\n $opt[\"properties\"] = $resourceData;\n $opt[\"path\"] = $this->path;\n $arr = $DOCMGR->call($opt);\n\n return $result;\n\n }",
"public function UpdateAllDevicePropertiesByDeviceID( $nDeviceID, $arAllProperties )\n {\n $this->log(__METHOD__);\n\n $this->_doRequest('properties', $nDeviceID, array('properties'=>$arAllProperties), 'PUT');\n\n return ( $this->_handleResponse() );\n }",
"public function setRemoteDomainsCache($domains) {\n $this->cache->forever($this->cacheKey, $domains);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is used for get sample upload url | function SAMPLES_UPLOAD_URL()
{
return STATIC_SITE_URL().'admin/samples'."/";
} | [
"public function get_upload_url()\n { \n if(isset(Application::$config['global']['URL']['Upload'])) return Application::$config['global']['URL']['Upload'];\n else return '';\n }",
"public static function uploadUrl() {\n return file_create_url(self::uploadDir(FALSE));\n }",
"public function getUploadUrl()\n {\n return $this->upload_url;\n }",
"function edd_upload_file_get_upload_url() {\n\t$upload_dir = wp_upload_dir();\n\n\treturn $upload_dir['baseurl'] . '/edd-upload-files';\n}",
"public function getFileUploadUrl()\n\t{\n\t\treturn Mage::helper('wordpress')->getFileUploadUrl();\n\t}",
"public function getUploadUri() {\n return @$this->attributes['upload_uri'];\n }",
"public static function getTrackUploadURL(): string {\n return Helper::getUploadDirectoryURL(self::TRACK_UPLOAD_PATH);\n }",
"public function getBaseMediaUrl();",
"function SAMPLES_UPLOAD_PATH()\n\t{\n\t\treturn STATIC_SITE_PATH().'admin/samples/';\n\t}",
"public function get_uploadBaseUrl()\n {\n return $this->_uploadBaseUrl;\n }",
"public function getUrl()\n {\n return phpb_full_url(phpb_config('general.uploads_url') . '/' . $this->public_id . '/' . $this->original_file);\n }",
"public function getUploadUri()\n {\n return 'upload/templates/template_'.$this->uid;\n }",
"public function url()\n {\n return $this->file->get_file_url();\n }",
"public function getImageUploadURL() {\n $dir = $this->getImageUploadDir();\n return str_replace('/admin', '', $this->getRootURL() . '/' . IMG_UPLOAD_FOLDER);\n }",
"public function getFileUploadUrl()\n {\n $frontUrl = UsniAdaptor::app()->getFrontUrl();\n $route = str_replace(APPLICATION_PATH, '', $this->fileUploadPath);\n return StringUtil::replaceBackSlashByForwardSlash($frontUrl . $route);\n }",
"function get_url_file() {\n\t\treturn basename(preg_replace(\"|^(.*)://|\",\"\",$this->url));\n\t}",
"public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'sitereview'.'/'.'file';\n }",
"private function set_front_upload_url() {\n $wp_upload_dir = wp_upload_dir();\n $upload_url = $wp_upload_dir['baseurl'];\n $http = 'http://';\n $https = 'https://';\n if ( $_SERVER['SERVER_PORT'] == 443 || strpos(get_option('home'), $https) > -1 ) {\n $upload_url = str_replace($http, $https, $wp_upload_dir['baseurl']);\n }\n\n return $upload_url;\n }",
"protected function getTestFileUri() {\n \\Drupal::service('file_system')->copy(drupal_get_path('module', 'imce') . '/tests/files/ciandt.jpg', PublicStream::basePath());\n return 'public://ciandt.jpg';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Listen to the Department deleted event. | public function deleted(Department $department)
{
//code...
$department->tickets()->delete();
} | [
"public function deleted(Departmentfeedback $departmentfeedback)\n {\n //\n }",
"public function deleted()\n {\n // do something after delete\n }",
"public function postDeleteEvent()\n {\n $this->elementPostDelete();\n }",
"public function on_delete() {}",
"public function deleted(Defect $defect)\n {\n Event::fire(new DefectDeleted($defect));\n }",
"public function deleted(Event $event)\n {\n //\n }",
"public\n function deleted(Event $event)\n {\n //\n }",
"function getDeletedEventName() {\n \treturn $this->getEventNamesPrefix() . '_deleted';\n }",
"protected function afterDelete()\n {\n $this->fireMapperEvent(static::EVENT_DELETED, false);\n }",
"public function deleteById($departmentId);",
"public static function deleted($callback)\n {\n static::registerModelEvent('deleted', $callback);\n }",
"public function deleted(Equipment $equipment)\n {\n event(new EDelete($equipment));\n }",
"protected function afterDeletion() {}",
"function on_delete_handler()\n{\n\tglobal $g_obj_problem_manager;\n\t\n\t$arr_problem_list = PageHandler::get_post_value( 'ProblemId' );\n\t\n\tif ( $arr_problem_list == null )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, \"Please select at least one problem\" );\n\t\treturn;\n\t}\n\t\n\t$arr_success = array();\n\t$arr_fail = array();\n\t\n\tforeach( $arr_problem_list as $int_problem_id )\n\t{\n\t\tif ( $g_obj_problem_manager->delete_problem( $int_problem_id ) )\n\t\t{\n\t\t\tarray_push( $arr_success, $int_problem_id );\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\tarray_push( $arr_fail, $int_problem_id );\n\t\t}\n\t}\n\t\n\tif ( count( $arr_success ) != 0 )\n\t{\n\t\tMessageHandler::add_message( MSG_SUCCESS, 'Successfully deleted ' . count( $arr_success ) . ' problem(s)' );\n\t}\n\t\n\tif ( count( $arr_fail ) != 0 )\n\t{\n\t\tMessageHandler::add_message( MSG_FAIL, 'Failed to delete ' . count( $arr_fail ) . ' problem(s)' );\n\t}\n}",
"public function deleted(Consultation $consultation)\n {\n //\n }",
"protected function afterDelete () {}",
"protected function afterDelete()\n {\n }",
"public function after_delete() {}",
"function calendarDeleted($cal_id){\n\t\t$this->cal_del_count++;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove prices from frontend | public function removeUnusedPrices() {
$this->query = self::DELETE_UNUSED_PRICES;
return $this->execute( $this->query);
} | [
"public function remove_frontend_prices($price): string\n {\n return '';\n }",
"public function restore_price_template() {\r\n\t\tadd_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );\r\n\t\tremove_action( 'woocommerce_before_add_to_cart_form', array( $this, 'display_suggested_price' ) );\r\n\t}",
"function cleanupPrices() {\n\n DB::table('cmc_prices')->where('created_at', '<', date(\"Y-m-d G:i:s\", strtotime(\"24 hours ago\")))->where(DB::raw(\"DATE_FORMAT(created_at, '%i-%S')\"), \"!=\", \"00-00\")->delete();\n DB::table('exchanges_prices')->where('created_at', '<', date(\"Y-m-d G:i:s\", strtotime(\"24 hours ago\")))->where(DB::raw(\"DATE_FORMAT(created_at, '%i-%S')\"), \"!=\", \"00-00\")->delete();\n\n }",
"public function wpsc_reset_prices() {\n\t\t\n\t\tglobal $wpsc_cart;\n\t\t\n\t\t$wpsc_cart->use_currency_converter = false;\n\t\t$wpsc_cart->total_price = null;\n\t\t$wpsc_cart->subtotal = null;\n\t\t\n\t\t\n\t\tforeach ( (array) $wpsc_cart->cart_items as $item )\n\t\t\t$item->refresh_item();\t\n\t}",
"public function remove_retail_price()\n\t{\n\t\treturn $this->remove_exth_record(self::EXTH_RECORD_TYPE_RETAILPRICE);\n\t}",
"private function clear_custom_prices()\n\t{\n\t\tif( !empty($_POST[\"clear_custom_prices\"]) && $_POST[\"clear_custom_prices\"] )\n\t\t{\n\t\t\tif( !check_admin_referer( 'clear_custom_prices_form') ){\n\t\t\t\tdie('Security Check!');\n\t\t\t}\n\n\t\t\tglobal $wpdb;\n\n\t\t\t$result = $wpdb->query('TRUNCATE TABLE '.$this->table_name);\n\t\t\tif(false === $result)\n\t\t\t{\n\t\t\t\tadd_settings_error(\n\t\t\t 'clear_custom_prices',\n\t\t\t 'settings_updated',\n\t\t\t \"An error occured when truncating the table, please try again\",\n\t\t\t 'error'\n\t\t\t );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tadd_settings_error(\n\t\t\t 'clear_custom_prices',\n\t\t\t 'settings_updated',\n\t\t\t \"Custom Prices table cleared\",\n\t\t\t 'updated'\n\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}",
"function gnj_remove_price_filter_query_args( $filter_value ) {\n foreach ( array( 'min_price', 'max_price' ) as $remove ) {\n unset( $filter_value[$remove] );\n }\n\n return $filter_value;\n}",
"function wc_remove_variation_stock_display( $data ) {\n unset( $data['availability_html'] );\n return $data;\n}",
"function wc_ap_delete_attribute_prices($term_id, $tt_id) {\n $term_prices = get_option('_woo_ap_term_prices');\n\n if (isset($term_prices[$term_id])) {\n unset($term_prices[$term_id]);\n update_option('_woo_ap_term_prices', $term_prices);\n }\n}",
"public function resetCartPrices()\n {\n $cart = \\Cart::content();\n\n foreach($cart as $item)\n {\n $product = $this->product->find($item->id);\n\n if($product)\n {\n \\Cart::update($item->rowid, array('price' => $product->price_cents));\n }\n }\n }",
"protected function _removeColumnPrice($block)\n {\n $this->_removeColumnsFromGrid($block, ['price']);\n }",
"function move_woo_price() {\n\tremove_Action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );\n\tadd_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 20 );\n}",
"function hide_free_price_notice( $price, $product ){\n\tif ( $product->price > 0 ) {\n\t\treturn '$'.$product->price;\n\t} else {\n\t\treturn 'POA';\n\t}\n}",
"public function removePrice($id){\n /*\n * check if id is empty\n */\n if(!empty($id)){\n $sql = $this->db->delete(\"price\")->where(\"price_id={$id}\");\n $this->execute($sql);\n }\n }",
"public function remove_retail_price_currency()\n\t{\n\t\treturn $this->remove_exth_record(self::EXTH_RECORD_TYPE_RETAILPRICECUR);\n\t}",
"function wcvv_custom_price_templates() {\n\tif ( has_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price' ) ) {\n\t\t// Archive prices\n\t\tremove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price' );\n\t\tadd_action( 'woocommerce_after_shop_loop_item_title', 'wcvv_template_loop_price' );\n\n\t\t// Singular prices\n\t\tremove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' );\n\t\tadd_action( 'woocommerce_single_product_summary', 'wcvv_template_loop_single_price' );\n\t}\n}",
"protected function loadWithoutPriceFilterWithoutPriceSorting() {}",
"public function remove_dynamic_pricing_data( LaterPay_Core_Event $event ) {\n $event->set_result(\n array(\n 'success' => false,\n )\n );\n\n if ( ! isset( $_POST['post_id'] ) || empty( $_POST['post_id'] ) ) { // phpcs:ignore\n throw new LaterPay_Core_Exception_InvalidIncomingData( 'post_id' );\n }\n\n $post_id = absint( $_POST['post_id'] ); // phpcs:ignore\n $post_price = get_post_meta( $post_id, LaterPay_Helper_Pricing::META_KEY, true );\n\n $keys_to_unset = [\n 'price_range_type',\n 'start_price',\n 'end_price',\n 'reach_end_price_after_days',\n 'change_start_price_after_days',\n 'transitional_period_end_after_days',\n ];\n\n foreach ( $keys_to_unset as $key ) {\n if ( isset( $post_price[ $key ] ) ) {\n unset( $post_price[ $key ] );\n }\n }\n\n $this->set_post_meta(\n 'laterpay_post_prices',\n $post_price,\n $post_id\n );\n\n $event->set_result(\n array(\n 'success' => true,\n )\n );\n return;\n }",
"public function onDeleteTokenPrice(){\n if (post('delete_id')) {\n $data = post();\n $keys = array_keys($data);\n foreach ($keys as $key){\n if (strpos($key, 'price_id') !== false ){\n $pos[] = str_replace('price_id', '', $key);\n }\n }\n if (isset($pos)) {\n foreach ($pos as $p){\n $tokens_prices[$p]['id'] = $p;\n $tokens_prices[$p]['start_date'] = $data['start_date'.$p];\n $tokens_prices[$p]['end_date'] = $data['end_date'.$p];\n $tokens_prices[$p]['bonus'] = $data['bonus'.$p];\n $tokens_prices[$p]['value'] = $data['value'.$p];\n $tokens_prices[$p]['nomination'] = $data['nomination'.$p];\n }\n }\n $price = IcoTokenPrice::find(post('delete_id'));\n $price->delete();\n unset($tokens_prices[post('delete_id')]);\n return ['#_tokenPrice' => $this->renderPartial('@_tokens_price.htm',['tokens_prices' => $tokens_prices])];\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get actual debt pallets number of the credit account and debit account | public function actualTheoricalDebtPalletsNumber($creditAccount, $debitAccount)
{
if (strpos($debitAccount, '-') == 5 && explode('-', $debitAccount)[0] == 'truck') {
//truck account
$actualTheoricalDebtDebitPalletsNumber = Truck::where('id', explode('-', $debitAccount)[1])->value('theoricalPalletsDebt');
} elseif (strpos($debitAccount, '-') == 7 && explode('-', $debitAccount)[0] == 'account') {
//others accounts (network, other)
$actualTheoricalDebtDebitPalletsNumber = Palletsaccount::where('id', explode('-', $debitAccount)[1])->value('theoricalPalletsDebt');
}
if (strpos($creditAccount, '-') == 5 && explode('-', $creditAccount)[0] == 'truck') {
//truck account
$actualTheoricalDebtCreditPalletsNumber = Truck::where('id', explode('-', $creditAccount)[1])->value('theoricalPalletsDebt');
} elseif (strpos($creditAccount, '-') == 7 && explode('-', $creditAccount)[0] == 'account') {
//others accounts (network, other)
$actualTheoricalDebtCreditPalletsNumber = Palletsaccount::where('id', explode('-', $creditAccount)[1])->value('theoricalPalletsDebt');
}
return [$actualTheoricalDebtDebitPalletsNumber, $actualTheoricalDebtCreditPalletsNumber];
} | [
"public function getCreditDebit();",
"function getPotentialAmount(){\n\t\t\t$account_no = \"potentialMoney\";\n\t\t\t//getting money transfer details from database\n\t\t\t$transaction = $this->manageContent->getValueWhere_descending(\"money_transfer_log\",\"*\",\"membership_id\",$account_no);\n\t\t\tif(!empty($transaction))\n\t\t\t{\n\t\t\t\t//initialize the variables\n\t\t\t\t$sl_no = 1;\n\t\t\t\t$total_amount = 0;\n\t\t\t\tforeach($transaction as $transactions){\n\t\t\t\t\t//checking for only debited amount\n\t\t\t\t\tif(!empty($transactions['debit']))\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//checking for membership product or not\n\t\t\t\t\t\tif(substr($transactions['product_id'],0,2) == 'M_')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fetching the name of product from product table\n\t\t\t\t\t\t\t$product_details = $this->manageContent->getValueWhere(\"membership_product\",\"*\",\"product_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $product_details[0]['product_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(substr($transactions['product_id'],0,1) == 'C')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$coupon_details = $this->manageContent->getValueWhere(\"coupon_table\",\"*\",\"coupon_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $coupon_details[0]['coupon_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fetching the name of product from product table\n\t\t\t\t\t\t\t$product_details = $this->manageContent->getValueWhere(\"product_table\",\"*\",\"product_id\",$transactions['product_id']);\n\t\t\t\t\t\t\t$product_name = $product_details[0]['product_name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//getting member details\n\t\t\t\t\t\t$memberDetails = $this->manageContent->getValueWhere(\"member_table\",\"*\",\"membership_id\",$transactions['notes']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//showing the details of money debited in detail\n\t\t\t\t\t\techo '<tr>\n\t\t\t\t\t\t\t\t<td>'.$sl_no.'</td>\n\t\t\t\t\t\t\t\t<td>'.$memberDetails[0]['name'].'</td>\n\t\t\t\t\t\t\t\t<td>'.$product_name.'</td>\n\t\t\t\t\t\t\t\t<td>'.$transactions['product_quantity'].'</td>\n\t\t\t\t\t\t\t\t<td>'.$this->changeDateFormat($transactions['date']).'</td>\n\t\t\t\t\t\t\t\t<td> € '.$transactions['debit'].'</td>\n\t\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// total amount calculation\n\t\t\t\t\t\t\t$total_amount = $total_amount + $transactions['debit'];\n\t\t\t\t\t\t\t//increment of serial_no variable\n\t\t\t\t\t\t\t$sl_no++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $total_amount;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}",
"private function get_bank_deposit(){\n\t\t\n\t\t/**\n\t\t* The commented code below works similarly as the returned part of this method\n\t\t*\t$bank = 0;\t\n\t\t*\t\tforeach($this->construct_journal() as $row){\n\t\t*\t\t\t$bank+=$row['bank']['bank_inc'];\n\t\t*\t\t}\n\t\t*\t\t\n\t\t*\treturn $bank;\n\t\t* */\n\t\t\n\t\treturn array_sum(array_column(array_column($this->construct_journal(), \"bank\"),\"bank_inc\"));\n\t}",
"public function get_balance(){\n\t\t// get all deposits\n\t\t$query = $this->db->query('SELECT sum(amount) as deposits FROM transaction WHERE type = 1');\n\t\t$deposits = $query->row()->deposits;\n\n\t\t// get all withdras\n\t\t$query = $this->db->query('SELECT sum(amount) as withdraws FROM transaction WHERE type = 2');\n\t\t$withdraws = $query->row()->withdraws;\n\n\t\t// balance\n\t\t$balance = $deposits - $withdraws;\n\t\treturn $balance;\n\t}",
"function debitersAccountNumber($collectionRow){\n if(strlen($collectionRow->account_number)>11){\n $accountNumber = sprintf('%020d',$collectionRow->account_number);\n }else{\n $accountNumber = sprintf('%011d', $collectionRow->account_number);\n }\n \n return $accountNumber;\n }",
"public function get_card_balance()\n\t {\n\t\t$card_ubc \t= $this->input->post('gcubn');\n\t\t$gift_card \t= $this->gift_cards_model->get_card_data($card_ubc); \n\t\t\n\t\techo $gift_card->GIFT_CARD_AMOUNT;\n\t }",
"public static function getCashInBank()\n\t{\n\t\t$exist_account = Tbl_chart_of_account::where(\"account_shop_id\", Accounting::getShopId())->where(\"account_code\", \"accounting-cash-in-bank\")->first();\n if(!$exist_account)\n {\n $insert[\"account_shop_id\"] = Accounting::getShopId();\n $insert[\"account_type_id\"] = 1;\n $insert[\"account_number\"] = \"00000\";\n $insert[\"account_name\"] = \"Cash In Bank\";\n $insert[\"account_description\"] = \"Default Bank\";\n $insert[\"account_protected\"] = 1;\n $insert[\"account_code\"] = \"accounting-cash-in-bank\";\n \n return Tbl_chart_of_account::insertGetId($insert);\n }\n\n return $exist_account->account_id;\n\t}",
"public function getItemAccountDebit()\n {\n $value = $this->get(self::ITEMACCOUNTDEBIT);\n return $value === null ? (string)$value : $value;\n }",
"public function getAccountNumber();",
"public function getAccountBudget()\n {\n return $this->account_budget;\n }",
"public function getDebitoCredito()\n {\n return $this->debitoCredito;\n }",
"public function getBankAcctNumber()\n {\n return $this->bankAcctNumber;\n }",
"public function buildContractNumberWalletList()\r\n {\r\n $storeId = Mage::app()->getStore()->getStoreId();\r\n $contractCollection = $this->getContractWalletList($storeId);\r\n $contractsNumber = array();\r\n foreach ($contractCollection as $contract) {\r\n $contractsNumber[] = $contract['number'];\r\n }\r\n return sizeof($contractsNumber) > 0 ? $contractsNumber : null;\r\n }",
"public function balance() {\n return $this->cash;\n }",
"public function getTotalDebitAmount()\n {\n return $this->totalDebitAmount;\n }",
"public function getLessonBalance()\n {\n return Yii::$app->user->isPatient() ? number_format($this->lesson->getClientPrice(), 2) : $this->getAmountWithFee();\n }",
"function bill_pay_card_with_wallet() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t$wt_category = $_REQUEST['wt_category'];\n\t\t// wt_category = 11 pay bill\n\t\t$bill_category_id = $_REQUEST['bill_category_id'];\n\t\t// 1- Water, 2- Movies etc\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\t$bill_amount = $_REQUEST['bill_amount'];\n\t\t$bill_consumer_no = $_REQUEST['bill_consumer_no'];\n\t\t$card_no = $_REQUEST['card_number'];\n\t\t$cvv_no = $_REQUEST['cvv_no'];\n\t\t$wallet_type = 2;\n\t\t// 1- Credit, 2-Debit\n\t\t$bill_pay_status = 1;\n\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_desc = 'PaY Bill';\n\t\tif (!empty($bill_consumer_no) && !empty($biller_id) && !empty($bill_amount) && !empty($recharge_user_id)) {\n\t\t\t//$bill_records = $this -> conn -> get_table_row_byidvalue('biller_user', 'biller_customer_id_no', $bill_consumer_no);\n\t\t\t$bill_records = $this -> conn -> get_table_field_doubles('biller_user', 'biller_customer_id_no', $bill_consumer_no, 'biller_id', $biller_id);\n\t\t\tif (!empty($bill_records)) {\n\t\t\t\t$bill_user_id = $bill_records['0']['biller_user_id'];\n\t\t\t\t$bill_pay_status = $bill_records['0']['bill_pay_status'];\n\t\t\t\tif ($bill_pay_status == '2') {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$wallet_used_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t\t$card_deduct_amount = $bill_amount - $wallet_amount;\n\n\t\t\t\t\t$admin = $this -> conn -> get_all_records('admin');\n\t\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,user_wallet_rec_amount,user_card_card_rec_amount', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $bill_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $wallet_amount . '\",\"' . $card_deduct_amount . '\"');\n\n\t\t\t\t\tif ($recharge) {\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('bill_recharge', 'bill_user_id,bill_transaction_id,bill_category_id, biller_id,bill_consumer_no,bill_amount,bill_pay_date,bill_pay_status', '\"' . $recharge_user_id . '\",\"' . $transaction_id . '\",\"' . $bill_category_id . '\",\"' . $biller_id . '\",\"' . $bill_consumer_no . '\",\"' . $bill_amount . '\",\"' . $current_date . '\",\"' . $bill_pay_status . '\"');\n\n\t\t\t\t\t\tif (!empty($walletrecharge)) {\n\n\t\t\t\t\t\t\t$data_frnd['bill_paid_date'] = $current_date;\n\t\t\t\t\t\t\t$data_frnd['bill_pay_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('biller_user', 'biller_user_id', $bill_user_id, $data_frnd);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\t\tif ($reffer_status == '2') {\n\t\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$wt_type = 2;\n\t\t\t\t\t\t\t// credit in frnd acconnt\n\t\t\t\t\t\t\t$refferamount = $refferal_amount;\n\t\t\t\t\t\t\t// reffer amount\n\t\t\t\t\t\t\t$wt_category = 9;\n\t\t\t\t\t\t\t// refferal amount recieved in wallet\n\t\t\t\t\t\t\t$wt_desc = \"Refferal amount add in your wallet using by \" .$mobile;\n\n\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records', 'refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t\t$data_frnd['wallet_amount'] = $wallet + $refferal_amount;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user11_id, $data_frnd);\n\n\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t$data12['reffer_amount_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data12);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cashback_record_id = $recharge_number;\n\t\t\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\tif (!empty($coupon_apply)) {\n\n\t\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' . $transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\n\t\t\t\t\t\t\t\t// wallet amont set zero\n\t\t\t\t\t\t\t\t$wallet_amount = 0;\n\t\t\t\t\t\t\t\t$user_wallet = $wallet_amount + $coupon_amount;\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$wallet_amount = 0;\n\t\t\t\t\t\t\t$user_wallet = $wallet_amount + $coupon_amount;\n\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t\t$admin_update_wallet = $admin_wallet + $recharge_amount;\n\t\t\t\t\t\t$data_admin['admin_wallet'] = $admin_update_wallet;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('admin', 'admin_id', 1, $data_admin);\n\t\t\t\t\t\t$res = file_get_contents(SITE_URL . \"/createpdf/pdf/\" . $bill_consumer_no);\n\t\t\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Recharge Successfully\", \"recharge_id\" => $recharge, 'recharge_number' => $rec_number, 'bill_amount' => $bill_amount, 'wallet_used_amount' => $wallet_used_amount, 'card_used_amount' => $card_deduct_amount, 'wallet_amount' => $wallet_amount, 'recharge_date' => $current_date, 'transaction_id' => $transaction_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"bill pay failed\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"These Bill already paid\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $recharge_user_id, 'bill_category_id' => $bill_category_id, 'biller_id' => $biller_id, 'wt_category' => $wt_category, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}",
"function next_deposit() {\n\t\t$this->current_deposit++;\n\t\t$this->deposit = $this->deposits[ $this->current_deposit ];\n\t\treturn $this->deposit;\n\t}",
"protected function getDeposit()\r\n\t{\r\n\t\t$query = \"SELECT deposito FROM \".XNAME.\"_viviendas WHERE id = {$this->id}\";\r\n\t\t$sql = record($query);\r\n\r\n\t\t$deposito = ($sql['deposito']) ? $sql['deposito'] : $this->depositCost;\r\n\r\n\t\treturn $deposito;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
5.44 Operation: 04.08 Fare Option My Search Fare Families The example below illustrates a Lowest Fare request including 6 parameterized fare families defined by many attributes sets, each attribute has many occurrences: Itinerary: Round Trip : NCEAMS Date: 01OCT09 08OCT09 1 ADT 6 Fare Families 1st Parameterized fare family: name: FFAMILY1 ranking 10 not combinable (NCO) Attributes Set 1: publishing carrier AF fare basis NAP30 Public fare or Atp Nego fare 2nd Parameterized fare family: name: FFAMILY2 ranking 50 Attributes Set 1: publishing carriers AF or KL fare basis NCD or NRT or NRF or LCO or LCD 3rd Parameterized fare family: FFAMILY3 ranking 80 Attributes Set 1: publishing carrier AF Corporate Fares Cabin Y Attributes Set 2: publishing carrier AF NonCorporate Fares Cabin Y or C Expanded Parameter NAP (Fares with no advance purchase) Expanded Parameter NPE (Fares with no penalty) Attributes Set 3: publishing carrier KL Cabin M, W, C 4th Parameterized fare family: FFAMILY4 ranking 60 Attributes Set 1: publishing carrier AF fare basis NCD Attributes Set 2: publishing carriers AF,KL fare basis NRT Attributes Set 3: publishing carrier KL any fare basis including JUNIOR 5th Parameterized fare family: name: FFAMILY5 ranking 100 Attributes Set 1: Booking code L, M, N, O, P, Q, R, S, T or U 6th Parameterized fare family: OTHERS Ranking 0 | public function testCanMakeMassageWithParametrizedFareFamilies()
{
$opt = new FareMasterPricerExSearchOptions([
'nrOfRequestedResults' => 200,
'nrOfRequestedPassengers' => 1,
'passengers' => [
new MPPassenger([
'type' => MPPassenger::TYPE_ADULT,
'count' => 1
])
],
'itinerary' => [
new MPItinerary([
'departureLocation' => new MPLocation(['city' => 'NCE']),
'arrivalLocation' => new MPLocation(['city' => 'AMS']),
'date' => new MPDate(['dateTime' => new \DateTime('2009-10-01T00:00:00+0000', new \DateTimeZone('UTC'))])
]),
new MPItinerary([
'departureLocation' => new MPLocation(['city' => 'AMS']),
'arrivalLocation' => new MPLocation(['city' => 'NCE']),
'date' => new MPDate(['dateTime' => new \DateTime('2009-10-08T00:00:00+0000', new \DateTimeZone('UTC'))])
])
],
'flightOptions' => [
FareMasterPricerExSearchOptions::FLIGHTOPT_PUBLISHED,
FareMasterPricerExSearchOptions::FLIGHTOPT_UNIFARES,
FareMasterPricerExSearchOptions::FLIGHTOPT_CORPORATE_UNIFARES,
],
'corporateCodesUnifares' => ['000001'],
'fareFamilies' => [
new MPFareFamily([
'name' => 'FFAMILY1',
'ranking' => 10,
'criteria' => new FFCriteria([
'combinable' => false,
'carriers' => ['AF'],
'fareBasis' => ['NAP30'],
'fareType' => [
FFCriteria::FARETYPE_PUBLISHED_FARES,
FFCriteria::FARETYPE_ATPCO_NEGO_FARES_CAT35
]
])
]),
new MPFareFamily([
'name' => 'FFAMILY2',
'ranking' => 50,
'criteria' => new FFCriteria([
'carriers' => ['AF', 'KL'],
'fareBasis' => ['NCD', 'NRT', 'NRF', 'LCO', 'LCD']
])
]),
new MPFareFamily([
'name' => 'FFAMILY3',
'ranking' => 80,
'criteria' => new FFCriteria([
'carriers' => ['AF'],
'corporateCodes' => ['CORP'],
'cabins' => ['Y']
]),
'otherCriteria' => [
new FFOtherCriteria([
'criteria' => new FFCriteria([
'carriers' => ['AF'],
'corporateCodes' => ['NONCORP'],
'cabins' => ['Y', 'C'],
'expandedParameters' => ['NAP', 'NPE']
])
]),
new FFOtherCriteria([
'criteria' => new FFCriteria([
'carriers' => ['KL'],
'cabins' => ['M', 'W', 'C']
])
])
]
]),
new MPFareFamily([
'name' => 'FFAMILY4',
'ranking' => 60,
'criteria' => new FFCriteria([
'carriers' => ['AF'],
'fareBasis' => ['NCD']
]),
'otherCriteria' => [
new FFOtherCriteria([
'criteria' => new FFCriteria([
'carriers' => ['AF', 'KL'],
'fareBasis' => ['NRT']
])
]),
new FFOtherCriteria([
'criteria' => new FFCriteria([
'carriers' => ['KL'],
'fareBasis' => ['-JUNIOR']
])
])
]
]),
new MPFareFamily([
'name' => 'FFAMILY5',
'ranking' => 100,
'criteria' => new FFCriteria([
'bookingCode' => ['L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U']
])
]),
new MPFareFamily([
'name' => 'OTHERS',
'ranking' => '0'
])
]
]);
$message = new MasterPricerExpertSearch($opt);
$this->assertCount(6, $message->fareFamilies);
$this->assertEquals('FFAMILY1', $message->fareFamilies[0]->familyInformation->fareFamilyname);
$this->assertEquals(10, $message->fareFamilies[0]->familyInformation->hierarchy);
$this->assertEquals(FareFamilyInfo::QUAL_NON_COMBINABLE_FARE_FAMILY, $message->fareFamilies[0]->familyCriteria->fareFamilyInfo->fareFamilyQual);
$this->assertCount(0, $message->fareFamilies[0]->familyCriteria->corporateInfo);
$this->assertCount(1, $message->fareFamilies[0]->familyCriteria->carrierId);
$this->assertEquals('AF', $message->fareFamilies[0]->familyCriteria->carrierId[0]);
$this->assertCount(3, $message->fareFamilies[0]->familyCriteria->fareProductDetail);
$this->assertEquals('NAP30', $message->fareFamilies[0]->familyCriteria->fareProductDetail[0]->fareBasis);
$this->assertEmpty($message->fareFamilies[0]->familyCriteria->fareProductDetail[0]->fareType);
$this->assertEquals('RP', $message->fareFamilies[0]->familyCriteria->fareProductDetail[1]->fareType[0]);
$this->assertNull($message->fareFamilies[0]->familyCriteria->fareProductDetail[1]->fareBasis);
$this->assertEquals('RA', $message->fareFamilies[0]->familyCriteria->fareProductDetail[2]->fareType[0]);
$this->assertNull($message->fareFamilies[0]->familyCriteria->fareProductDetail[2]->fareBasis);
$this->assertNull($message->fareFamilies[0]->familyCriteria->cabinProcessingIdentifier);
$this->assertEmpty($message->fareFamilies[0]->familyCriteria->cabinProduct);
$this->assertEmpty($message->fareFamilies[0]->familyCriteria->dateTimeDetails);
$this->assertEmpty($message->fareFamilies[0]->familyCriteria->otherCriteria);
$this->assertEmpty($message->fareFamilies[0]->familyCriteria->rdb);
$this->assertEmpty($message->fareFamilies[0]->otherPossibleCriteria);
$this->assertEmpty($message->fareFamilies[0]->fareFamilySegment);
$this->assertEquals('FFAMILY2', $message->fareFamilies[1]->familyInformation->fareFamilyname);
$this->assertEquals(50, $message->fareFamilies[1]->familyInformation->hierarchy);
$this->assertNull($message->fareFamilies[1]->familyCriteria->fareFamilyInfo);
$this->assertCount(0, $message->fareFamilies[1]->familyCriteria->corporateInfo);
$this->assertCount(2, $message->fareFamilies[1]->familyCriteria->carrierId);
$this->assertEquals('AF', $message->fareFamilies[1]->familyCriteria->carrierId[0]);
$this->assertEquals('KL', $message->fareFamilies[1]->familyCriteria->carrierId[1]);
$this->assertCount(5, $message->fareFamilies[1]->familyCriteria->fareProductDetail);
$this->assertEquals('NCD', $message->fareFamilies[1]->familyCriteria->fareProductDetail[0]->fareBasis);
$this->assertEquals('NRT', $message->fareFamilies[1]->familyCriteria->fareProductDetail[1]->fareBasis);
$this->assertEquals('NRF', $message->fareFamilies[1]->familyCriteria->fareProductDetail[2]->fareBasis);
$this->assertEquals('LCO', $message->fareFamilies[1]->familyCriteria->fareProductDetail[3]->fareBasis);
$this->assertEquals('LCD', $message->fareFamilies[1]->familyCriteria->fareProductDetail[4]->fareBasis);
$this->assertNull($message->fareFamilies[1]->familyCriteria->cabinProcessingIdentifier);
$this->assertEmpty($message->fareFamilies[1]->familyCriteria->cabinProduct);
$this->assertEmpty($message->fareFamilies[1]->familyCriteria->dateTimeDetails);
$this->assertEmpty($message->fareFamilies[1]->familyCriteria->otherCriteria);
$this->assertEmpty($message->fareFamilies[1]->familyCriteria->rdb);
$this->assertEmpty($message->fareFamilies[1]->otherPossibleCriteria);
$this->assertEmpty($message->fareFamilies[1]->fareFamilySegment);
$this->assertEquals('FFAMILY3', $message->fareFamilies[2]->familyInformation->fareFamilyname);
$this->assertEquals(80, $message->fareFamilies[2]->familyInformation->hierarchy);
$this->assertNull($message->fareFamilies[2]->familyCriteria->fareFamilyInfo);
$this->assertCount(1, $message->fareFamilies[2]->familyCriteria->corporateInfo);
$this->assertEquals('CORP', $message->fareFamilies[2]->familyCriteria->corporateInfo[0]->corporateNumberIdentifier);
$this->assertCount(1, $message->fareFamilies[2]->familyCriteria->carrierId);
$this->assertEquals('AF', $message->fareFamilies[2]->familyCriteria->carrierId[0]);
$this->assertCount(1, $message->fareFamilies[2]->familyCriteria->cabinProduct);
$this->assertEquals('Y', $message->fareFamilies[2]->familyCriteria->cabinProduct[0]->cabinDesignator);
$this->assertEmpty($message->fareFamilies[2]->familyCriteria->otherCriteria);
$this->assertCount(2, $message->fareFamilies[2]->otherPossibleCriteria);
$this->assertEquals(BooleanExpression::CODE_OR_OPERATOR, $message->fareFamilies[2]->otherPossibleCriteria[0]->logicalLink->booleanExpression->codeOperator);
$this->assertEquals('AF', $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->carrierId[0]);
$this->assertEquals('NONCORP', $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->corporateInfo[0]->corporateNumberIdentifier);
$this->assertCount(2, $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->cabinProduct);
$this->assertEquals('Y', $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->cabinProduct[0]->cabinDesignator);
$this->assertEquals('C', $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->cabinProduct[1]->cabinDesignator);
$this->assertCount(2, $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->otherCriteria);
$this->assertEquals(OtherCriteria::NAME_EXPANDED_PARAMETERS, $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->otherCriteria[0]->name);
$this->assertEquals('NAP', $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->otherCriteria[0]->value);
$this->assertEquals(OtherCriteria::NAME_EXPANDED_PARAMETERS, $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->otherCriteria[1]->name);
$this->assertEquals('NPE', $message->fareFamilies[2]->otherPossibleCriteria[0]->familyCriteria->otherCriteria[1]->value);
$this->assertEquals(BooleanExpression::CODE_OR_OPERATOR, $message->fareFamilies[2]->otherPossibleCriteria[1]->logicalLink->booleanExpression->codeOperator);
$this->assertEmpty($message->fareFamilies[2]->otherPossibleCriteria[1]->familyCriteria->corporateInfo);
$this->assertCount(3, $message->fareFamilies[2]->otherPossibleCriteria[1]->familyCriteria->cabinProduct);
$this->assertEquals('M', $message->fareFamilies[2]->otherPossibleCriteria[1]->familyCriteria->cabinProduct[0]->cabinDesignator);
$this->assertEquals('W', $message->fareFamilies[2]->otherPossibleCriteria[1]->familyCriteria->cabinProduct[1]->cabinDesignator);
$this->assertEquals('C', $message->fareFamilies[2]->otherPossibleCriteria[1]->familyCriteria->cabinProduct[2]->cabinDesignator);
$this->assertEmpty($message->fareFamilies[2]->otherPossibleCriteria[1]->familyCriteria->otherCriteria);
$this->assertEmpty($message->fareFamilies[2]->familyCriteria->fareProductDetail);
$this->assertNull($message->fareFamilies[2]->familyCriteria->cabinProcessingIdentifier);
$this->assertEmpty($message->fareFamilies[2]->familyCriteria->dateTimeDetails);
$this->assertEmpty($message->fareFamilies[2]->familyCriteria->rdb);
$this->assertEmpty($message->fareFamilies[2]->fareFamilySegment);
$this->assertEquals('FFAMILY4', $message->fareFamilies[3]->familyInformation->fareFamilyname);
$this->assertEquals(60, $message->fareFamilies[3]->familyInformation->hierarchy);
$this->assertNull($message->fareFamilies[3]->familyCriteria->fareFamilyInfo);
$this->assertEmpty($message->fareFamilies[3]->familyCriteria->corporateInfo);
$this->assertCount(1, $message->fareFamilies[3]->familyCriteria->carrierId);
$this->assertEquals('AF', $message->fareFamilies[3]->familyCriteria->carrierId[0]);
$this->assertCount(1, $message->fareFamilies[3]->familyCriteria->fareProductDetail);
$this->assertEquals('NCD', $message->fareFamilies[3]->familyCriteria->fareProductDetail[0]->fareBasis);
$this->assertEmpty($message->fareFamilies[3]->familyCriteria->fareProductDetail[0]->fareType);
$this->assertEmpty($message->fareFamilies[3]->familyCriteria->cabinProduct);
$this->assertEmpty($message->fareFamilies[3]->familyCriteria->otherCriteria);
$this->assertNull($message->fareFamilies[3]->familyCriteria->cabinProcessingIdentifier);
$this->assertEmpty($message->fareFamilies[3]->familyCriteria->dateTimeDetails);
$this->assertEmpty($message->fareFamilies[3]->familyCriteria->rdb);
$this->assertEmpty($message->fareFamilies[3]->fareFamilySegment);
$this->assertCount(2, $message->fareFamilies[3]->otherPossibleCriteria);
$this->assertEquals(BooleanExpression::CODE_OR_OPERATOR, $message->fareFamilies[3]->otherPossibleCriteria[0]->logicalLink->booleanExpression->codeOperator);
$this->assertCount(2, $message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->carrierId);
$this->assertEquals('AF', $message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->carrierId[0]);
$this->assertEquals('KL', $message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->carrierId[1]);
$this->assertCount(1, $message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->fareProductDetail);
$this->assertEquals('NRT', $message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->fareProductDetail[0]->fareBasis);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->fareProductDetail[0]->fareType);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->rdb);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->corporateInfo);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->cabinProduct);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[0]->familyCriteria->otherCriteria);
$this->assertEquals(BooleanExpression::CODE_OR_OPERATOR, $message->fareFamilies[3]->otherPossibleCriteria[1]->logicalLink->booleanExpression->codeOperator);
$this->assertCount(1, $message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->carrierId);
$this->assertEquals('KL', $message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->carrierId[0]);
$this->assertCount(1, $message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->fareProductDetail);
$this->assertEquals('-JUNIOR', $message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->fareProductDetail[0]->fareBasis);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->fareProductDetail[0]->fareType);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->rdb);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->corporateInfo);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->cabinProduct);
$this->assertEmpty($message->fareFamilies[3]->otherPossibleCriteria[1]->familyCriteria->otherCriteria);
$this->assertEquals('FFAMILY5', $message->fareFamilies[4]->familyInformation->fareFamilyname);
$this->assertEquals(100, $message->fareFamilies[4]->familyInformation->hierarchy);
$this->assertCount(10, $message->fareFamilies[4]->familyCriteria->rdb);
$this->assertEquals(['L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U'], $message->fareFamilies[4]->familyCriteria->rdb);
$this->assertNull($message->fareFamilies[4]->familyCriteria->fareFamilyInfo);
$this->assertEmpty($message->fareFamilies[4]->familyCriteria->corporateInfo);
$this->assertEmpty($message->fareFamilies[4]->familyCriteria->carrierId);
$this->assertEmpty($message->fareFamilies[4]->familyCriteria->fareProductDetail);
$this->assertEmpty($message->fareFamilies[4]->familyCriteria->cabinProduct);
$this->assertEmpty($message->fareFamilies[4]->familyCriteria->otherCriteria);
$this->assertNull($message->fareFamilies[4]->familyCriteria->cabinProcessingIdentifier);
$this->assertEmpty($message->fareFamilies[4]->familyCriteria->dateTimeDetails);
$this->assertEmpty($message->fareFamilies[4]->fareFamilySegment);
$this->assertEmpty($message->fareFamilies[4]->otherPossibleCriteria);
$this->assertEquals('OTHERS', $message->fareFamilies[5]->familyInformation->fareFamilyname);
$this->assertEquals(0, $message->fareFamilies[5]->familyInformation->hierarchy);
$this->assertNull($message->fareFamilies[5]->familyCriteria);
$this->assertEmpty($message->fareFamilies[5]->fareFamilySegment);
$this->assertEmpty($message->fareFamilies[5]->otherPossibleCriteria);
} | [
"public function testPricePnrCallWithMultipleFareFamily()\n {\n $opt = new FarePricePnrWithBookingClassOptions([\n 'fareFamily' => [\n new FareFamily([\n 'fareFamily' => 'FLEX',\n 'paxSegRefs' => [\n new PaxSegRef([\n 'type' => PaxSegRef::TYPE_SEGMENT,\n 'reference' => 1\n ]),\n new PaxSegRef([\n 'type' => PaxSegRef::TYPE_SEGMENT,\n 'reference' => 2\n ])\n ]\n ]),\n new FareFamily([\n 'fareFamily' => 'ECOFLEX',\n 'paxSegRefs' => [\n new PaxSegRef([\n 'type' => PaxSegRef::TYPE_SEGMENT,\n 'reference' => 3\n ]),\n new PaxSegRef([\n 'type' => PaxSegRef::TYPE_SEGMENT,\n 'reference' => 4\n ])\n ]\n ])\n ]\n ]);\n\n $msg = new PricePNRWithBookingClass13($opt);\n\n $this->assertCount(2, $msg->pricingOptionGroup);\n $this->assertEquals(PricingOptionKey::OPTION_FARE_FAMILY, $msg->pricingOptionGroup[0]->pricingOptionKey->pricingOptionKey);\n $this->assertCount(1, $msg->pricingOptionGroup[0]->optionDetail->criteriaDetails);\n $this->assertEquals('FF', $msg->pricingOptionGroup[0]->optionDetail->criteriaDetails[0]->attributeType);\n $this->assertEquals('FLEX', $msg->pricingOptionGroup[0]->optionDetail->criteriaDetails[0]->attributeDescription);\n $this->assertCount(1, $msg->pricingOptionGroup[1]->optionDetail->criteriaDetails);\n $this->assertEquals('FF', $msg->pricingOptionGroup[1]->optionDetail->criteriaDetails[0]->attributeType);\n $this->assertEquals('ECOFLEX', $msg->pricingOptionGroup[1]->optionDetail->criteriaDetails[0]->attributeDescription);\n }",
"function tfs_get_product_spec_tool_tip( $spec ) {\n \n $tool_tips = array(\n \n /**********************************************\n ****************** FANS *******************\n *********************************************/\n \n 'attribute_pa_air-flow-efficiency' => 'The amount of air the fan moves per watt, rated in cubic feet. The higher the airflow efficiency, the more efficient the fan is in terms of power consumption.',\n 'attribute_pa_blade-pitch' => 'The angle at the fan\\'s blades are set when attached to the fan. The steeper the blade pitch, the more air the fan moves.',\n 'attribute_pa_blade-span' => 'The span (length) of the fan\\'s individual blades in inches',\n 'attribute_pa_blade-sweep' => 'The diameter of the fan when the blades are attached to it in inches',\n 'attribute_pa_cfm-cubic-feet-per-minute' => 'The amount of air the fan circulates, measured in Cubic Feet Per Minute (CFM)',\n 'attribute_pa_fan-airflow' => 'Airflow is measured in Cubic Feet Per Minute (CFM) - a U.S Government-mandated standard. The higher the airflow number, the more air the fan is ciculating.',\n 'attribute_pa_fan-airflow-efficiency' => 'Airflow is measured in Cubic Feet Per Minute (CFM) - a U.S Government-mandated standard. The higher the airflow number, the more air the fan is ciculating.',\n 'attribute_pa_fan-bulb-base' => 'The type of light bulbs or lamp the fan uses according to its socket(s)',\n 'attribute_pa_fan-control-included' => 'Whether or not a control is included with the fan by its manufacturer',\n 'attribute_pa_fan-light-kit-included' => 'Whether or not a light kit is included with the fan by its manufacturer',\n 'attribute_pa_fan-power-usage-watts' => 'The amount of power in watts the fan consumes while running as delineated by its manufacturer',\n 'attribute_pa_fan-rpm' => 'The amount of revolutions per minute while the fan is on. The higher the RPM, the more airflow the fan has.',\n 'attribute_pa_fan-speeds' => 'The speed settings of the fan',\n 'attribute_pa_light-kit-included' => 'Whether or not a light kit (light that attaches to the fan) is included with the fan by its manufacturer.',\n 'attribute_pa_motor-size' => 'The size of the motor included with the fan by its manufacturer',\n 'attribute_pa_primary-control-system' => 'The primary system that controls the fan included by its manufacturer',\n 'attribute_pa_remote-included' => 'Whether or not a remote that controls the fan is included by the manufacturer',\n 'attribute_pa_reverse-motion-capable' => 'Whether or not the fan is capable of spinning both clockwise and counterclockwise',\n 'attribute_pa_reversible-blades' => 'Whether or not the fans blades have reversible finishes',\n 'attribute_pa_wall-control-included' => 'Whether or not a wall control is included with the fan by its manufacturer',\n 'attribute_pa_motor-type' => 'The type of motor used to power the fan. This can be either AC (Alternating Current) or DC (Direct Current)',\n \n /*********************************************\n ************* GENERAL SPECS *****************\n ********************************************/\n \n 'weight' => 'The total weight of the fixture (does not include packaging)',\n 'dimensions' => 'The dimensions of the fixture. Length x Width x Height',\n 'attribute_pa_adjustable-height' => \"The range of adjustable height of the fixture\",\n 'attribute_pa_back-plate-dimensions' => 'The dimensions of the fixture\\'s back plate (inches)',\n 'attribute_pa_back-plate-dimensions-inches' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_back-plate-width-inches' => 'The width of the fixture\\'s back plate in inches',\n 'attribute_pa_back-plate-height-inches' => 'The height of the fixture\\'s back plate in inches',\n 'attribute_pa_backplate-dimensions' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_backplate-dimensions-inches' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_backplate-height' => 'The height of the fixture\\'s back plate in inches',\n 'attribute_pa_backplate-size' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_backplate-width' => 'The width of the fixture\\'s back plate in inches',\n 'attribute_pa_base-backplate' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_base-backplate-dimensions' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_base-backplate-size' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_base-dimensions' => 'The dimensions of the fixture\\'s back plate in inches',\n 'attribute_pa_blade-finish' => 'The finish of the currently selected fan\\'s blades (based on the selected finish)',\n 'attribute_pa_bulb-included' => 'The light bulb(s) included with the fixture by its manufacturer',\n 'attribute_pa_bulb-type' => 'The type of the light bulb(s) the fixture uses according to it\\'s socket(s)',\n 'attribute_pa_bulb-type-alternate' => 'The other light bulb type required by the fixture',\n 'attribute_pa_bulb-type-primary' => 'The primary light bulb type required by the fixture',\n 'attribute_pa_bulbs-included' => 'Whether or not bulbs are included by the fixture\\'s manufacturer. If so, the type included',\n 'attribute_pa_canopy-backplate-size' => 'The dimensions of the fixture\\'s canopy/back plate in inches',\n 'attribute_pa_canopy-diameter' => 'The diameter of the fixture\\'s canopy in inches',\n 'attribute_pa_canopy-dimensions' => 'The dimensions of the fixture\\'s canopy in inches',\n 'attribute_pa_canopy-height' => 'The height of the fixture\\'s canopy in inches',\n 'attribute_pa_canopy-size' => 'The dimensions of the fixture\\'s canopy in inches',\n 'attribute_pa_canopy-width' => 'The width of the fixture\\'s canopy in inches',\n 'attribute_pa_chain-finish' => 'The finish of the fixture\\'s chain',\n 'attribute_pa_chain-length' => 'The length of the chain included with the fixture by its manufacturer',\n 'attribute_pa_connection-type' => 'The type of power connection of the fixture',\n 'attribute_pa_control-included' => 'Whether or not a control is included with the fan by its manufacturer',\n 'attribute_pa_cord-length' => 'The length of the fixture\\'s wiring or power cord',\n 'attribute_pa_delivered-lumens' => 'The total amount of visible light from the fixture. The higher the lumens, the brighter the light will be.',\n 'attribute_pa_depth' => 'The length of which the fixture extends from the surface it is attached to in inches',\n 'attribute_pa_diameter' => 'The diameter of the fixture (the width from one side to the other) in inches',\n 'attribute_pa_dimmable' => 'Whether or not the bulbs included with the fixture by its manufacturer (if applicable) are dimmable',\n 'attribute_pa_down-rod-diameter' => 'The diameter of the fixture\\'s downrod in inches. The down rod hangs the fixture from its canopy',\n 'attribute_pa_down-rod-dimensions' => 'The dimensions of the fixture\\'s downrod in inches. The down rod hangs the fixture from its canopy',\n 'attribute_pa_electrical-requirements\t' => 'The electrical requirements of the fixture',\n 'attribute_pa_extension' => 'The length of which the fixture extends from the surface it is attached to in inches',\n 'attribute_pa_extension-inches' => 'The length of which the fixture extends from the surface it is attached to in inches',\n 'attribute_pa_finish' => 'The color finish of the fixture',\n 'attribute_pa_fixture-extends' => 'The length of which the fixture extends from the surface it is attached to in inches',\n 'attribute_pa_flush-mount' => 'Whether or not the fixture is a flush mount or can be converted to one',\n 'attribute_pa_glass' => 'The type of or finish of the glass, diffuser, or shade included with the fixture',\n 'attribute_pa_glass-description' => 'The details of the glass, diffuser or shade included with the fixture',\n 'attribute_pa_glass-shade' => 'The type of or finish of the glass, diffuser, or shade included with the fixture',\n 'attribute_pa_glass-shade-color' => 'The finish or color of the glass, diffuser or shade included with the fixture',\n 'attribute_pa_glass-shade-dimension' => 'The dimensions of the glass, diffuser or shade included with the fixture in inches',\n 'attribute_pa_glass-shade-dimensions' => 'The dimensions of the glass, diffuser or shade included with the fixture in inches',\n 'attribute_pa_glass-shade-height' => 'The height of the glass, diffuser or shade included with the fixture in inches',\n 'attribute_pa_glass-shade-material' => 'The material glass, diffuser or shade included with the fixture is derived from',\n 'attribute_pa_glass-shade-width-bottom' => 'The width of the bottom of the glass, diffuser or shade included with the fixture in inches',\n 'attribute_pa_glass-shade-width-top' => 'The width of the top of the glass, diffuser or shade included with the fixture in inches',\n 'attribute_pa_install-direction' => 'The direction the fixture can be mounted in - up, down or reversible (both)',\n 'attribute_pa_install-glass-up-or-down' => 'Whether or not the glass, diffuser(s) or shade(s) can be installed up and down',\n 'attribute_pa_integrated-led' => 'Whether or not fixture contains an integrated LED Module for its light source',\n 'attribute_pa_kelvin-temperature' => 'The color temperature of the fixture\\'s integrated LED. The higher the Kelvin temperature, the whiter the light will be.',\n 'attribute_pa_led-color-temperature' => 'The color temperature of the fixture\\'s integrated LED rated in Kelvins. The higher the Kelvin temperature, the whiter the light will be.',\n 'attribute_pa_led-kelvins' => 'The color temperature of the fixture\\'s integrated LED rated in Kelvins. The higher the Kelvin temperature, the whiter the light will be.',\n 'attribute_pa_led-lumens' => 'The total amount of visible light from the fixture\\'s integrated LED. The higher the lumens, the brighter the light will be.',\n 'attribute_pa_led-watts' => 'The wattage of the fixture\\'s integrated LED and the amount of power it consumes. An Integrated LED or LED Light Bulb with 10 watts of power is equivalent to a 60W incandescent light bulb.',\n 'attribute_pa_light-source' => 'The type of lamp the fixture uses',\n 'attribute_pa_low-ceiling-adaptable' => 'Whether or not the fixture can be used with low ceilings (lower than 8 feet)',\n 'attribute_pa_lumens' => 'The total amount of visible light from the fixture\\'s integrated LED. The higher the lumens, the brighter the light will be.',\n 'attribute_pa_material' => 'The material(s) the fixture is made from',\n 'attribute_pa_materials' => 'The material(s) the fixture is made from',\n 'attribute_pa_max-wattage' => 'The maximum wattage light bulb or lamp the fixture can safely handle per socket as delineated by the fixture\\'s manufacturer',\n 'attribute_pa_max-watts' => 'The maximum wattage light bulb or lamp the fixture can safely handle per socket as delineated by the fixture\\'s manufacturer',\n 'attribute_pa_maximum-wattage' => 'The maximum wattage light bulb or lamp the fixture can safely handle per socket as delineated by the fixture\\'s manufacturer',\n 'attribute_pa_maximum-wattage-alternate' => 'The maximum wattage light bulb or lamp the fixture\\'s alternate sockets can safely handle as delineated by the fixture\\'s manufacturer',\n 'attribute_pa_maximum-wattage-primary' => 'The maximum wattage light bulb or lamp the fixture\\'s primary sockets can safely handle as delineated by the fixture\\'s manufacturer',\n 'attribute_pa_mount-up-or-down' => 'Whether or not the fixture can be mounted both up or down',\n 'attribute_pa_mount-vertical-or-horizontal' => 'Whether or not the fixture can be mounted both vertically or horizontally',\n 'attribute_pa_mountable-up-or-down' => 'Whether or not the fixture can be mounted both up or down',\n 'attribute_pa_mounting-procedure' => 'The mounting kit included with the fixture by its manufacturer',\n 'attribute_pa_number-of-blades' => 'The number of blades the fan uses',\n 'attribute_pa_number-of-bulbs' => 'The number of light bulbs or lamps the fixture uses based on the number of sockets it has',\n 'attribute_pa_number-of-bulbs-alternate' => 'The number of alternate light bulbs or lamps the fixture\\'s uses based on the number of alternate sockets it has. This specification only applies to products that have two different types of sockets.',\n 'attribute_pa_number-of-bulbs-and-type' => 'The number of light bulbs or lamps the fixture uses and the type based on its sockets',\n 'attribute_pa_number-of-bulbs-primary' => 'The number of number light bulbs or lamps the fixture\\'s uses based on the number of primary sockets it has',\n 'attribute_pa_overall-height' => 'The overall height of the fixture', \n 'attribute_pa_safety-rated' => 'The electrical safety rating of the fixture. This determines where the fixture can be mounted safely. Dry is for dry locations only, Damp is for locations such as a bathroom, and Wet is safe for outdoor use.',\n 'attribute_pa_safety-rating' => 'The electrical safety rating of the fixture. This determines where the fixture can be mounted safely. Dry is for dry locations only, Damp is for locations such as a bathroom, and Wet is safe for outdoor use.',\n 'attribute_pa_shade' => 'The type of or finish of the glass, diffuser, or shade included with the fixture', \n 'attribute_pa_shade-diameter' => 'The diameter of the glass, diffuser, or shade included with the fixture in inches',\n 'attribute_pa_shade-dimensions' => 'The dimensions of the glass, diffuser, or shade included with the fixture in inches',\n 'attribute_pa_shade-glass' => 'The type of or finish of the glass, diffuser, or shade included with the fixture',\n 'attribute_pa_shade-glass-description' => 'The type of or finish of the glass, diffuser, or shade included with the fixture',\n 'attribute_pa_shade-height' => 'The height of the glass, diffuser, or shade included with the fixture in inches',\n 'attribute_pa_shade-material' => 'The material the glass, diffuser, or shade included with the fixture is derived from',\n 'attribute_pa_size' => 'The dimensions of the fixture in inches',\n 'attribute_pa_slope-ceiling-kit' => 'Whether or not a sloped ceiling mounting kit is included witht he fixture by its manufacturer',\n 'attribute_pa_slope-ceiling-kit-included' => 'Whether or not a sloped ceiling mounting kit is included witht he fixture by its manufacturer',\n 'attribute_pa_sloped-ceiling-compatible\t' => 'Whether or not the canopy included with the fixture is compatible with a sloped ceiling',\n 'attribute_pa_socket-type' => 'The type of sockets the fixture has',\n 'attribute_pa_style' => 'The design style of the fixture',\n 'attribute_pa_suitable-for-damp-locations' => 'Whether or not it is safe to the mount the fixture in damp locations according to its electrical components',\n 'attribute_pa_suitable-for-dry-locations' => 'Whether or not it is safe to the mount the fixture in dry locations according to its electrical components',\n 'attribute_pa_suitable-for-wet-locations' => 'Whether or not it is safe to the mount the fixture in wet locations according to its electrical components',\n 'attribute_pa_switch' => 'The type of switch included with the fixture',\n 'attribute_pa_switch-type' => 'The type of switch included with the fixture',\n 'attribute_pa_voltage' => 'The power voltage of the fixture',\n 'attribute_pa_wattage' => 'The maximum wattage light bulb or lamp the fixture can safely handle per socket as delineated by the fixture\\'s manufacturer',\n 'attribute_pa_wire-color' => 'The color of the power cord or wire included with the fixture by its manufacturer',\n 'attribute_pa_wire-cord-length' => 'The length of the wiring or power cord included with the fixture by its manufacturer',\n 'attribute_pa_wire-length' => 'The length of the wiring or power cord included with the fixture by its manufacturer'\n \n );\n \n if ( array_key_exists( $spec, $tool_tips ) ) {\n \n return $tool_tips[$spec];\n \n } else {\n \n return false;\n \n }\n \n }",
"public function extract_flight_segment_fare_details($flights, $currency_obj, $search_id, $module, $ins_token = false, & $token = array(), $flight_index = 0, $booking_source='') {\r\n \r\n //debug($flights);exit;\r\n $flights = force_multple_data_format($flights);\r\n\r\n //Airline blocking start\r\n $blocked_airlines = $this->CI->flight_model->manage_blocked_airlines(PROVAB_FLIGHT_BOOKING_SOURCE);\r\n $blocked_airline_code = json_decode($blocked_airlines[0]['airline_attr'],1);\r\n // debug($blocked_airline_code);exit;\r\n $flight_list = array();\r\n foreach ($flights as $list_k => $list_v) {\r\n \r\n //Airline blocking start\r\n // if( get_client_ip() != '27.59.138.155'){\r\n if(isset($list_v['FlightDetails']['Details'][0][0]['OperatorCode'])){\r\n $op_code = $list_v['FlightDetails']['Details'][0][0]['OperatorCode'];\r\n if(in_array($op_code,$blocked_airline_code)){\r\n continue ;\r\n }\r\n }\r\n // }\r\n //End\r\n \r\n //Pushing data into the Token\r\n if ($ins_token === true) {\r\n $tkn_key = $flight_index . $list_k;\r\n $this->push_token($list_v, $token, $tkn_key);\r\n }\r\n $flight_list[$list_k]['AirlineRemark'] = $this->filter_airline_remark(@$list_v['Attr']['AirlineRemark'], $module);\r\n $flight_list[$list_k]['FareDetails'] = $this->get_fare_object($list_v, $currency_obj, $search_id, $module, $booking_source);\r\n $flight_list[$list_k]['api_original_price_details'] = $list_v['api_original_price_details'];\r\n $flight_list[$list_k]['PassengerFareBreakdown'] = $list_v['PassengerFareBreakdown'];\r\n $segments = $this->extract_segment_details($list_v['FlightDetails']['Details']);\r\n $flight_list[$list_k]['SegmentSummary'] = $segments['segment_summary'];\r\n $flight_list[$list_k]['SegmentDetails'] = $segments['segment_full_details'];\r\n $flight_list[$list_k]['ProvabAuthKey'] = $list_v['ResultToken'];\r\n\r\n $flight_list[$list_k]['booking_source'] = PROVAB_FLIGHT_BOOKING_SOURCE;\r\n\r\n //Hold Ticket\r\n if (isset($list_v['HoldTicket']) == true) {\r\n $hold_ticket = $list_v['HoldTicket'];\r\n } else {\r\n $hold_ticket = false;\r\n }\r\n $flight_list[$list_k]['HoldTicket'] = $hold_ticket;\r\n\r\n if (isset($list_v['Token']) == true) {\r\n $flight_list[$list_k]['Token'] = $list_v['Token'];\r\n }\r\n if (isset($list_v['TokenKey']) == true) {\r\n $flight_list[$list_k]['TokenKey'] = $list_v['TokenKey'];\r\n }\r\n if (isset($list_v['Attr']) == true) {\r\n $flight_list[$list_k]['Attr'] = $list_v['Attr'];\r\n }\r\n }\r\n \r\n return $flight_list;\r\n }",
"function _parseFamilies()\n {\n for ($i = 0; $i < count($this->_GedcomFamiliesTree); $i++) {\n $Family = array(@preg_replace(\n '/0 @(F\\d*)@ FAM/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][0]),\n @preg_replace(\n '/\\d HUSB @(I\\d*)@/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_tag(\n $this->_GedcomFamiliesTree[$i],'HUSB')]),\n @preg_replace('/\\d WIFE @(I\\d*)@/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_tag(\n $this->_GedcomFamiliesTree[$i],'WIFE')]),\n @preg_replace('/\\d NCHI (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_tag(\n $this->_GedcomFamiliesTree[$i],'NCHI')]),\n $this->_arrayTag($this->_GedcomFamiliesTree[$i], 'CHIL'),\n @preg_replace('/\\d DATE (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_subTag(\n $this->_GedcomFamiliesTree[$i],'MARR', 'DATE')]),\n @preg_replace('/\\d TIME (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_subTag(\n $this->_GedcomFamiliesTree[$i],'MARR', 'TIME')]),\n @preg_replace('/\\d PLAC (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_subTag(\n $this->_GedcomFamiliesTree[$i],'MARR', 'PLAC')]),\n $this->_arrayWitnessTag($this->_GedcomFamiliesTree[$i]),\n $this->_contTag($this->_GedcomFamiliesTree[$i], 'NOTE'),\n @preg_replace('/\\d SOUR (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_subTag(\n $this->_GedcomFamiliesTree[$i],'MARR', 'SOUR')]),\n array('Identifier' => @preg_replace('/\\d ASSO @(I\\d*)@/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_tag(\n $this->_GedcomFamiliesTree[$i], 'ASSO')]),\n 'Relationship' => @preg_replace('/\\d RELA (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_subTag(\n $this->_GedcomFamiliesTree[$i],'ASSO', 'RELA')])\n ),\n @preg_replace('/\\d DATE (.*)/US',\n '$1',\n $this->_GedcomFamiliesTree[$i][$this->_subTag(\n $this->_GedcomFamiliesTree[$i],'DIV', 'DATE')])\n );\n\n $this->GedcomFamiliesTreeObjects[] =& new Genealogy_Family($Family);\n }\n unset($Family);\n }",
"function callFed($good_data)\n{\n\t$key = 'HeKXEq5FlFY08sYf';\n\t$password = 'K69h7qMT9YiWMAB3RfAGHjptV';\n\t$account_number = '100816008';\n\t$meter_number = '103526242';\n\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns1=\"http://fedex.com/ws/rate/v13\"><SOAP-ENV:Body><ns1:RateRequest>\n <ns1:WebAuthenticationDetail>\n <ns1:UserCredential>\n <ns1:Key>'.$key.'</ns1:Key>\n <ns1:Password>'.$password.'</ns1:Password>\n </ns1:UserCredential></ns1:WebAuthenticationDetail>\n <ns1:ClientDetail>\n <ns1:AccountNumber>'.$account_number.'</ns1:AccountNumber>\n <ns1:MeterNumber>'.$meter_number.'</ns1:MeterNumber>\n </ns1:ClientDetail>\n <ns1:TransactionDetail><ns1:CustomerTransactionId> *** Rate Request v13 using PHP ***</ns1:CustomerTransactionId></ns1:TransactionDetail><ns1:Version><ns1:ServiceId>crs</ns1:ServiceId><ns1:Major>13</ns1:Major><ns1:Intermediate>0</ns1:Intermediate><ns1:Minor>0</ns1:Minor></ns1:Version><ns1:ReturnTransitAndCommit>true</ns1:ReturnTransitAndCommit><ns1:RequestedShipment>\n <ns1:DropoffType>REGULAR_PICKUP</ns1:DropoffType>\n <ns1:PackagingType>YOUR_PACKAGING</ns1:PackagingType>\n <ns1:TotalInsuredValue><ns1:Currency>USD</ns1:Currency></ns1:TotalInsuredValue>\n <ns1:Shipper><ns1:Contact><ns1:PersonName>TJ REID</ns1:PersonName><ns1:CompanyName>Vincent Printing</ns1:CompanyName><ns1:PhoneNumber></ns1:PhoneNumber></ns1:Contact><ns1:Address><ns1:StreetLines>1512 Sholar Avenue</ns1:StreetLines><ns1:City>Chattanooga</ns1:City><ns1:StateOrProvinceCode>TN</ns1:StateOrProvinceCode>\n <ns1:PostalCode>37406</ns1:PostalCode><ns1:CountryCode>US</ns1:CountryCode></ns1:Address></ns1:Shipper>\n <ns1:Recipient><ns1:Contact><ns1:PersonName>Recipient Name</ns1:PersonName><ns1:CompanyName>Company Name</ns1:CompanyName><ns1:PhoneNumber></ns1:PhoneNumber></ns1:Contact><ns1:Address><ns1:StreetLines></ns1:StreetLines><ns1:City></ns1:City><ns1:StateOrProvinceCode></ns1:StateOrProvinceCode>\n <ns1:PostalCode>'.$good_data['zipno'].'</ns1:PostalCode>\n <ns1:CountryCode>US</ns1:CountryCode><ns1:Residential>false</ns1:Residential></ns1:Address></ns1:Recipient><ns1:ShippingChargesPayment><ns1:PaymentType>SENDER</ns1:PaymentType><ns1:Payor>\n <ns1:ResponsibleParty>\n <ns1:AccountNumber>'.$account_number.'</ns1:AccountNumber>\n </ns1:ResponsibleParty>\n </ns1:Payor></ns1:ShippingChargesPayment>\n <ns1:RateRequestTypes>ACCOUNT</ns1:RateRequestTypes><ns1:PackageCount>1</ns1:PackageCount><ns1:RequestedPackageLineItems><ns1:SequenceNumber>1</ns1:SequenceNumber>\n <ns1:GroupPackageCount>'.$good_data['boxes'].'</ns1:GroupPackageCount>\n <ns1:Weight><ns1:Units>LB</ns1:Units><ns1:Value>'.$good_data['Weight'].'</ns1:Value></ns1:Weight>\n <ns1:Dimensions>\n <ns1:Length>'.$good_data['Length'].'</ns1:Length>\n <ns1:Width>'.$good_data['Width'].'</ns1:Width>\n <ns1:Height>'.$good_data['Height'].'</ns1:Height>\n <ns1:Units>IN</ns1:Units>\n </ns1:Dimensions>\n </ns1:RequestedPackageLineItems>\n </ns1:RequestedShipment></ns1:RateRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>';\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://ws.fedex.com:443/web-services');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n $result_xml = curl_exec($ch);\n \n // remove colons and dashes to simplify the xml\n $result_xml = str_replace(array(':','-'), '', $result_xml);\n $result = @simplexml_load_string($result_xml);\n \n\t$arr = $result->SOAPENVBody->RateReply->RateReplyDetails;\n\t\n\tprint '<hr />';\n\tprint '<h3>Rates for ' . $good_data['zipno'] . ':</h3><ul>';\n\t\n\tforeach($arr as $item)\n\t{\n\t\tif ($item->ServiceType == \"FEDEX_EXPRESS_SAVER\")\n\t\t{\n\t\t\tprint '<li>'.$item->ServiceType . ' = $'. bcdiv($item->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount, '.63', 2) . '</li>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprint '<li>'.$item->ServiceType . ' = $'. bcdiv($item->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount, '.75', 2) . '</li>';\n\t\t}\n\t}\n\tprint '</ul>';\n\tprint '<pre>';\n\tprint '<hr/>';\n\tprint_r($result);\n\tprint '</pre>';\n}",
"public function test_result_group_specimen_detail ()\n {\n $expected = <<<CDA\n<!-- Begin CDA Body -->\n<component>\n\t<structuredBody>\n\t\t<!-- Begin DIAGNOSTIC INVESTIGATIONS -->\n\t\t<component typeCode=\"COMP\">\n\t\t\t<section classCode=\"DOCSECT\" moodCode=\"EVN\">\n\t\t\t\t<!-- Begin PATHOLOGY TEST RESULT -->\n\t\t\t\t<component>\n\t\t\t\t\t<section classCode=\"DOCSECT\" moodCode=\"EVN\">\n\t\t\t\t\t\t<entry>\n\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t<!-- Begin Result Group (PATHOLOGY TEST RESULT GROUP) -->\n\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"COMP\">\n\t\t\t\t\t\t\t\t\t<organizer classCode=\"BATTERY\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t<!-- Begin Result (INDIVIDUAL PATHOLOGY TEST RESULT) -->\n\t\t\t\t\t\t\t\t\t\t<component>\n\t\t\t\t\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\"></observation>\n\t\t\t\t\t\t\t\t\t\t</component>\n\t\t\t\t\t\t\t\t\t\t<!-- Begin Result (INDIVIDUAL PATHOLOGY TEST RESULT) -->\n\t\t\t\t\t\t\t\t\t\t<!-- Begin Test Specimen Detail (SPECIMEN) -->\n\t\t\t\t\t\t\t\t\t\t<component>\n\t\t\t\t\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- ID is used for system purposes such as matching -->\n\t\t\t\t\t\t\t\t\t\t\t\t<id root=\"CCC0D55C-EFD0-11DF-BEA2-A6CCDFD72085\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<code code=\"102.16156.136.2.2\" codeSystem=\"1.2.36.1.2001.1001.101\" codeSystemName=\"NCTIS Data Components\" displayName=\"Specimen\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Date and Time of Collection (Collection DateTime) -->\n\t\t\t\t\t\t\t\t\t\t\t\t<effectiveTime value=\"201310201235+1000\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Collection Procedure -->\n\t\t\t\t\t\t\t\t\t\t\t\t<methodCode code=\"48635004\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"Fine needle biopsy\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Anatomical Site (ANATOMICAL LOCATION) :: Examples provided of all three allowed variants. These variants are mutually exclusive -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Example with complete SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Name of Location (Anatomical Location Name) -->\n\t\t\t\t\t\t\t\t\t\t\t\t<targetSiteCode code=\"51185008\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"thorax\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Side -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t<qualifier>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<name code=\"272741003\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"Laterality\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<value code=\"7771000\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"left\" xsi:type=\"CD\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</qualifier>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Side -->\n\t\t\t\t\t\t\t\t\t\t\t\t</targetSiteCode>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Example with complete SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Example with partial SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Name of Location (Anatomical Location Name) -->\n\t\t\t\t\t\t\t\t\t\t\t\t<targetSiteCode code=\"51185008\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"thorax\" />\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Example with partial SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Example with Description -->\n\t\t\t\t\t\t\t\t\t\t\t\t<targetSiteCode>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Description (Anatomical Location Description) -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t<originalText>Chest/Thorax</originalText>\n\t\t\t\t\t\t\t\t\t\t\t\t</targetSiteCode>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End SPECIFIC LOCATION -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Example with Description -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Anatomical Site (ANATOMICAL LOCATION) -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Physical Details -->\n\t\t\t\t\t\t\t\t\t\t\t\t<specimen>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<specimenRole>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Specimen Identifier -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id root=\"1538103e-845b-4f86-95ed-33b62e7589d0\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Physical Details (PHYSICAL PROPERTIES OF AN OBJECT) -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<specimenPlayingEntity>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Specimen Tissue Type -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<code code=\"258442002\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"Fluid sample\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Weight/Volume -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<quantity unit=\"mL\" value=\"5\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Weight/Volume -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Description (Object Description) -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<desc xsi:type=\"ST\">5 mL</desc>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Description (Object Description) -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Container Identifier -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ext:asSpecimenInContainer classCode=\"CONT\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ext:container>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ext:id extension=\"CNH45218964\" root=\"CA54FD22-76B8-11E0-AC87-0EE34824019B\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ext:container>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ext:asSpecimenInContainer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Container Identifier -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</specimenPlayingEntity>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Physical Details (PHYSICAL PROPERTIES OF AN OBJECT) -->\n\t\t\t\t\t\t\t\t\t\t\t\t\t</specimenRole>\n\t\t\t\t\t\t\t\t\t\t\t\t</specimen>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Physical Details -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Anatomical Location Image -->\n\t\t\t\t\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"SPRT\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<observationMedia classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id root=\"3953A078-0365-11E1-B90D-41D04724019B\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<value mediaType=\"image/jpeg\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference value=\"location.jpeg\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</value>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</observationMedia>\n\t\t\t\t\t\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Anatomical Location Image -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Image -->\n\t\t\t\t\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"SPRT\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<observationMedia classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id root=\"1d64bb51-c5b3-4048-9a9f-e753f4e3c203\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<value mediaType=\"image/jpeg\" >\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<reference value=\"specimen.jpeg\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</value>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</observationMedia>\n\t\t\t\t\t\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Image -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Sampling Preconditions -->\n\t\t\t\t\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"COMP\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<code code=\"103.16171\" codeSystem=\"1.2.36.1.2001.1001.101\" codeSystemName=\"NCTIS Data Components\" displayName=\"Sampling Preconditions\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<value code=\"16985007\" codeSystem=\"2.16.840.1.113883.6.96\" codeSystemName=\"SNOMED CT\" displayName=\"Fasting\" xsi:type=\"CD\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</observation>\n\t\t\t\t\t\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Sampling Preconditions -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Collection Setting -->\n\t\t\t\t\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"COMP\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<code code=\"103.16529\" codeSystem=\"1.2.36.1.2001.1001.101\" codeSystemName=\"NCTIS Data Components\" displayName=\"Collection Setting\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<value xsi:type=\"ST\">Pathology Clinic</value>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</observation>\n\t\t\t\t\t\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Collection Setting -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Date and Time of Receipt (DateTime Received) -->\n\t\t\t\t\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"COMP\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<code code=\"103.11014\" codeSystem=\"1.2.36.1.2001.1001.101\" codeSystemName=\"NCTIS Data Components\" displayName=\"DateTime Received\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<value value=\"201112141120+1000\" xsi:type=\"TS\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</observation>\n\t\t\t\t\t\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- End Date and Time of Receipt (DateTime Received) -->\n\t\t\t\t\t\t\t\t\t\t\t\t<!-- Begin Parent Specimen Identifier -->\n\t\t\t\t\t\t\t\t\t\t\t\t<entryRelationship typeCode=\"COMP\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<observation classCode=\"OBS\" moodCode=\"EVN\">\n <code code=\"103.16187\" codeSystem=\"1.2.36.1.2001.1001.101\" codeSystemName=\"NCTIS Data Components\" displayName=\"Parent Specimen Identifier\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t<specimen>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<specimenRole>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<id root=\"7013b12a-f9d0-4197-9726-88a6803d4d13\" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</specimenRole>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</specimen>\n\t\t\t\t\t\t\t\t\t\t\t\t</observation>\n\t\t\t\t\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t\t\t\t\t<!-- End Parent Specimen Identifier -->\n\t\t\t\t\t\t\t\t\t\t</observation>\n\t\t\t\t\t\t\t\t\t</component>\n\t\t\t\t\t\t\t\t\t<!-- End Test Specimen Detail (SPECIMEN) -->\n\t\t\t\t\t\t\t\t</organizer>\n\t\t\t\t\t\t\t</entryRelationship>\n\t\t\t\t\t\t\t<!-- End Result Group (PATHOLOGY TEST RESULT GROUP) -->\n\t\t\t\t\t\t</observation>\n\t\t\t\t\t</entry>\n\t\t\t\t</section>\n\t\t\t</component>\n\t\t\t<!-- End PATHOLOGY TEST RESULT -->\n\t\t</section>\n\t</component>\n\t<!-- End DIAGNOSTIC INVESTIGATIONS -->\n</structuredBody>\n</component>\n<!-- End CDA Body -->\nCDA;\n $organizer = (new Organizer())\n ->addComponent(new OrganizerComponent(\n (new Observation())\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ))\n ->addComponent(new OrganizerComponent(\n (new Observation(Code::NCTIS('102.16156.136.2.2', 'Specimen')))\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->addId(Id::fromString('CCC0D55C-EFD0-11DF-BEA2-A6CCDFD72085'))\n ->setEffectiveTime(TimeStamp::fromString('2013-10-20 12:35', '+1000'))\n ->returnObservation()\n ->addMethodCode(MethodCode::SNOMED('48635004', 'Fine needle biopsy'))\n ->addTargetSiteCode(\n TargetSiteCode::SNOMED('51185008', 'thorax')\n ->setQualifier(new Qualifier(\n Name::SNOMED('272741003', 'Laterality'),\n Value::SNOMED('7771000', 'left', XSITypeInterface::CONCEPT_DESCRIPTOR)\n ))\n )\n ->addTargetSiteCode(TargetSiteCode::SNOMED('51185008', 'thorax'))\n ->addTargetSiteCode(\n (new TargetSiteCode())\n ->setOriginalText(OriginalText::fromString('Chest/Thorax'))\n ->returnTargetSiteCode()\n )\n ->addSpecimen(new Specimen(\n (new SpecimenRole(\n (new SpecimenPlayingEntity())\n ->setClassCode('')\n ->setCode(Code::SNOMED('258442002', 'Fluid sample'))\n ->addQuantity(Quantity::fromString('mL', '5'))\n ->setDesc(Desc::fromString('5 mL', XSITypeInterface::CHARACTER_STRING))\n ->returnSpecimenPlayingEntity()\n ->setExtAsSpecimenInContainer(\n (new ExtAsSpecimenInContainer(\n new ExtContainer(\n ExtId::fromString('CA54FD22-76B8-11E0-AC87-0EE34824019B', 'CNH45218964')\n )\n ))\n ->setClassCode(ClassCodeInterface::CONTAINER)\n )\n ))->addId(Id::fromString('1538103e-845b-4f86-95ed-33b62e7589d0'))\n ->returnSpecimenRole()\n\n ))\n ->addEntryRelationship(\n (new EntryRelationship(\n (new ObservationMedia())\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->addId(Id::fromString('3953A078-0365-11E1-B90D-41D04724019B'))\n ->setValue((new Value())\n ->setMediaType(MediaTypeInterface::IMAGE_JPEG)\n ->setReferenceElement(new ReferenceElement('location.jpeg'))\n )\n ))->setTypeCode(TypeCodeInterface::HAS_SUPPORT)\n )\n ->addEntryRelationship(\n (new EntryRelationship(\n (new ObservationMedia())\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->addId(Id::fromString('1d64bb51-c5b3-4048-9a9f-e753f4e3c203'))\n ->setValue((new Value())\n ->setMediaType(MediaTypeInterface::IMAGE_JPEG)\n ->setReferenceElement(new ReferenceElement('specimen.jpeg'))\n )\n ))->setTypeCode(TypeCodeInterface::HAS_SUPPORT)\n )\n ->addEntryRelationship(\n (new EntryRelationship(\n (new Observation(\n Code::NCTIS('103.16171', 'Sampling Preconditions'),\n Value::SNOMED('16985007', 'Fasting', TRUE)\n ))\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n\n ))->setTypeCode(TypeCodeInterface::COMPONENT)\n )\n ->addEntryRelationship(\n (new EntryRelationship(\n (new Observation(\n Code::NCTIS('103.16529', 'Collection Setting'),\n (new Value())\n ->setXSIType(XSITypeInterface::CHARACTER_STRING)\n ->setContent('Pathology Clinic')\n ))\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n\n ))->setTypeCode(TypeCodeInterface::COMPONENT)\n )\n ->addEntryRelationship(\n (new EntryRelationship(\n (new Observation(\n Code::NCTIS('103.11014', 'DateTime Received'),\n new Value('201112141120+1000', XSITypeInterface::TIMESTAMP)\n ))\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n\n ))->setTypeCode(TypeCodeInterface::COMPONENT)\n )\n ->addEntryRelationship(\n (new EntryRelationship(\n (new Observation(\n Code::NCTIS('103.16187', 'Parent Specimen Identifier')\n ))\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->addSpecimen(\n new Specimen(\n (new SpecimenRole())\n ->addId(Id::fromString('7013b12a-f9d0-4197-9726-88a6803d4d13'))\n ->returnSpecimenRole()\n ))\n ))->setTypeCode(TypeCodeInterface::COMPONENT)\n )\n\n )\n );\n\n $section = (new Section())\n ->setClassCode(ClassCodeInterface::DOCUMENT_SECTION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->addComponent(\n (new SingleComponent(\n (new Section())\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->setClassCode(ClassCodeInterface::DOCUMENT_SECTION)\n ->addEntry((new Entry(\n (new Observation())\n ->setClassCode(ClassCodeInterface::OBSERVATION)\n ->setMoodCode(MoodCodeInterface::EVENT)\n ->addEntryRelationship(\n (new EntryRelationship())\n ->setTypeCode(TypeCodeInterface::COMPONENT)\n ->setOrganizer($organizer)\n )\n ))->setTypeCode(''))\n ))->setTypeCode(''));\n $tag = new RootBodyComponent( //component\n (new XMLBodyComponent( // structured body\n new SingleComponent($section) // component\n )\n )->setClassCode('')\n );\n $dom = new \\DOMDocument('1.0', 'UTF-8');\n $doc = $tag->toDOMElement($dom);\n $dom->appendChild($doc);\n $dom->formatOutput = TRUE;\n $cda = $dom->saveXML();\n $this->assertXmlStringEqualsXmlString($expected, $cda);\n }",
"public function getFareInfo()\n {\n return $this->fareInfo;\n }",
"private function phenotype_association_F()\t{\n\t\t$wbg= '/(WBGene[0-9]+)/';\n \t\t$phe='/(WBPhenotype:[0-9]+)/';\n\t\t$WBvar='/(WBVar[0-9]+)/';\n\t\t$rnai='/(WBRNAi[0-9]+)/';\n\t\t$Dicto=array('WBG'=>'','fenotipo'=>array(),'variante'=>array(),'ARNi'=>array()); //\n\t\t$gen_actual='primero';\n\t\twhile($aLine = $this->GetReadFile()->Read(200000)):\n\t\t\tif (preg_match($wbg,$aLine,$matches)==1):\n\t\t\t\tif ($matches[1]==$Dicto['WBG'] or $gen_actual=='primero'):\n\t\t\t\t\t$Dicto['WBG']=$matches[1];\n\t\t\t\t\t$gen_actual='basura';\n\t\t\t\telse:\n\t\t\t\t\t$this->Resource_relations($Dicto,\"Phenotype\");\n\t\t\t\t\t$Dicto=array('WBG'=>'','fenotipo'=>array(),'variante'=>array(),'ARNi'=>array()); //new gen, we clean the array/\n\t\t\t\t\t$Dicto['WBG']=$matches[1];\n\t\t\t\tendif;\t\n\t\t\tendif;\n\t\t\tif\t(preg_match($phe,$aLine,$matches)==1): ##aqio\n\t\t\t\tif (preg_match($WBvar,$aLine,$matches_var)==1):\n\t\t\t\t\tif (preg_match('/\\s+NOT\\s+/',$aLine)==1):\n\t\t\t\t\t\t$Dicto['fenotipo'][]=\"NOT \".$matches[1].\"|\".$matches_var[1];\n\t\t\t\t\telse:\n\t\t\t\t\t\t$Dicto['fenotipo'][]=$matches[1].\"|\".$matches_var[1];\n\t\t\t\t\tendif;\n \t\t\telseif \t(preg_match($rnai,$aLine,$matches_rnai)==1):\n\t\t\t\t\tif (preg_match('/\\s+NOT\\s+/',$aLine)==1):\n\t\t\t\t\t\t$Dicto['fenotipo'][]=\"NOT \".$matches[1].\"|\".$matches_rnai[1];\n\t\t\t\t\telse:\n\t\t\t\t\t\t$Dicto['fenotipo'][]=$matches[1].\"|\".$matches_rnai[1];\n\t\t\t\t\tendif;\n\t\t\t\tendif;\t\n\t\t\tendif;\t\n\t\t\tif\t(preg_match($WBvar,$aLine,$matches)==1):\n\t\t\t\tif (in_array($matches[1], $Dicto[\"variante\"])): \n\t\t\t\telse:\n\t\t\t\t\t$Dicto['variante'][]=$matches[1];\n\t\t\t\tendif;\n\t\t\tendif;\n\t\t\tif\t(preg_match($rnai,$aLine,$matches)==1):\n\t\t\t\tif (in_array($matches[1], $Dicto[\"ARNi\"])): \n\t\t\t\telse:\n\t\t\t\t\t$Dicto['ARNi'][]=$matches[1];\n\t\t\t\tendif;\n\t\t\tendif;\t\t\n\t\tendwhile;\n\t$this->Resource_relations($Dicto,\"Phenotype\");\n\techo \"Done! file phenotype_association.rdf wrote \\n\";\n\t}",
"function get_occurrence_data($gbif_xml, $occurrence_records = Array()){\n\n foreach ( $gbif_xml->xpath('//dataProvider') as $data_provider){\n # print \"==========> \".$data_provider->name;\n # print \"\\n\";\n $data_resources = $data_provider->xpath('dataResources');\n foreach( $data_resources[0] as $data_resource){\n # print $data_resource->name;\n # print \"\\n\";\n #\n if( ! isset($occurrence_records[(String)$data_provider->name]) ){\n $occurrence_records[(String)$data_provider->name] = Array();\n }\n\n if( ! isset($occurrence_records[(String)$data_provider->name][(String)$data_resource->name] ) ){\n $occurrence_records[(String)$data_provider->name][(String)$data_resource->name] = Array();\n }\n\n foreach ( $data_resource->occurrenceRecords->TaxonOccurrence as $current_item){\n\n $array_format = Array(\n 'gbif_key' => (String) $current_item['gbifKey'],\n 'basis_of_record' => (String) $current_item->basisOfRecordString,\n 'catalog_number' => (String)$current_item->catalogNumber,\n 'collection_code' => (String) $current_item->collectionCode,\n 'collector' => (String) $current_item->collector,\n 'continent' => (String) $current_item->continent,\n 'coordinate_uncertainty_in_meters' => (String) $current_item->coordinateUncertaintyInMeters,\n 'country'=> (String)$current_item->country,\n 'decimal_latitude' => (String)$current_item->decimalLatitude,\n 'decimal_longitude' => (String)$current_item->decimalLongitude,\n 'institution_code' => (String) $current_item->institutionCode,\n 'maximum_elevation_in_meters' => (String) $current_item->maximumElevationInMeters,\n 'maximum_elevation_in_meters' => (String) $current_item->maximumElevationInMeters,\n 'state_province' => (String) $current_item->stateProvince,\n 'county' => (String) $current_item->county,\n 'earliest_date_collected' => (String)$current_item->earliestDateCollected,\n 'latest_date_collected' => (String)$current_item->latestDateCollected,\n 'scientific_name' => (String)$current_item->identifiedTo->Identification->taxon->TaxonConcept->hasName->TaxonName->nameComplete,\n 'locality' => (String) $current_item->locality\n );\n\n array_push(\n $occurrence_records[(String)$data_provider->name][(String)$data_resource->name],\n $array_format);\n }\n\n # var_dump($data_resource->occurrenceRecords->TaxonOccurrence);\n # var_dump($current_item->identifiedTo->Identification->taxon);\n\n }\n }\n return $occurrence_records;\n}",
"function gene_parse($pepXML, $fasta_db, $gene_map_file, $searchEngine='TPP', $fdr=0.01, $pep_cutoff=0.85){\n echo \"pepXML=$pepXML\\nfasta_db=$fasta_db\\ngene_map_file=$gene_map_file\\n\";\n \n \n $fasta_dir = dirname($gene_map_file);\n $pepXML_basename = basename($pepXML);\n $outfile_name = $fasta_dir.\"/\".$pepXML_basename.\"_geneResults.txt\"; \n\n\t$pep_list = array();\t#initialize peptide array\n\t$pep_file = fopen($pepXML, \"r\");\n\tif($pep_file){ \n\t\t$count_hits = -1;\n \n $Peptide_index = '';\n $SpecFile_index = '';\n $SpecProb_index = '';\n $counter = 0; \n \n \twhile (($line = fgets($pep_file)) !== false) {\n $line = trim($line);\n if(!$line) continue;\n \n\t\t\tif($searchEngine == \"TPP\"){\n if(strpos($line, '<search_hit ')===0){\n \t\t\t\tif(preg_match(\"/ peptide=\\\"([^\\\"]+)/\", $line, $match)){\n \t\t\t\t\t$count_hits ++;\n \t\t\t\t\t$curr_pep = $match[1];\n \t\t\t\t\t$init_peps[$count_hits] = $curr_pep;\n \t\t\t\t\t$init_peps_mod[$count_hits] = $curr_pep;\n \t\t\t\t\t$init_peps_decoy[$count_hits] = 0;\n \t\t\t\t\tif(preg_match(\"/protein=\\\"DECOY/\", $line)){\n \t\t\t\t\t\t$init_peps_decoy[$count_hits] = 1;\n \t\t\t\t\t}\n \t\t\t\t}\n }else if(preg_match(\"/^<modification_info modified_peptide=\\\"([^\\\"]+)\\\"/\", $line, $match)){\n\t\t\t\t\t$init_peps_mod[$count_hits] = $match[1];\n\t\t\t\t}else if(preg_match(\"/^<peptideprophet_result probability=\\\"([0-9\\.]+)/\", $line, $match)){\n\t\t\t\t\t$init_peps_prob[$count_hits] = $match[1];\n\t\t\t\t}\n\t\t\t}elseif($searchEngine == \"MSPLIT_DDA\"){\n\t\t\t\tif(preg_match(\"/[^\\w]Peptide[^\\w]/\", $line, $match)){\n $title_arr = explode(\"\\t\", trim($line));\n foreach($title_arr as $key => $val){\n if($val == 'Peptide'){\n $Peptide_index = $key;\n }elseif($val == '#SpecFile'){\n $SpecFile_index = $key;\n }elseif($val == 'PepFDR'){\n $PepFDR_index = $key;\n }\n }\n if($Peptide_index === '' || $SpecFile_index === '' || $PepFDR_index === ''){\n echo \"File format error__________\";\n return false;\n }\n continue; \n\t\t\t\t} \n \n $val_arr = explode(\"\\t\", trim($line));\n\n $pep_length = strlen($val_arr[$Peptide_index]);\n $mod_pep = substr($val_arr[$Peptide_index], 1, $pep_length-2);\n $obs_fdr = $val_arr[$PepFDR_index];\n \n\t\t\t\t$mod_pep = substr($mod_pep, 1, $pep_length-4);\n $curr_pep = preg_replace(\"/[\\+\\-\\.0-9]/\", \"\", $mod_pep);\n\n if($obs_fdr <= $fdr){\n//-------------------------------------------------------------------------------------------------------\n//if($obs_fdr == '3.4831068E-4' || $obs_fdr == '6.5210304E-4' || $obs_fdr == '9.759271E-4') continue;\n//-------------------------------------------------------------------------------------------------------\n//echo \"$obs_fdr<br>\";\n if(array_key_exists($curr_pep, $pep_list)){\n \t$pep_list[$curr_pep] += 1;\n \tif(array_key_exists($mod_pep, $pep_list_mods[$curr_pep])){\n \t\t$pep_list_mods[$curr_pep][$mod_pep] += 1;\n \t}else{\n \t\t$pep_list_mods[$curr_pep][$mod_pep] = 1;\n \t}\n }else{\n \t$pep_list[$curr_pep] = 1;\n \t$pep_list_mods[$curr_pep][$mod_pep] = 1;\n }\n } \n\t\t\t}else{ \n if(preg_match(\"/[^\\w]Peptide[^\\w]/\", $line, $match)){\n $title_arr = explode(\"\\t\", trim($line));\n $Peptide_index = '';\n foreach($title_arr as $key => $val){\n if($val == 'Peptide'){\n $Peptide_index = $key;\n break;\n }\n }\n if(!$Peptide_index){\n echo \"File format error__________\";\n return false;\n }\n continue; \n\t\t\t\t}\n \n $val_arr = explode(\"\\t\", trim($line));\n $mod_pep = $val_arr[$Peptide_index];\n $curr_pep = preg_replace(\"/\\[.*?\\]/\", \"\", $mod_pep);\n \t\t\tif(array_key_exists($curr_pep, $pep_list)){\n \t\t\t\t$pep_list[$curr_pep] += 1;\n \t\t\t\tif(array_key_exists($mod_pep, $pep_list_mods[$curr_pep])){\n \t\t\t\t\t$pep_list_mods[$curr_pep][$mod_pep] += 1;\n \t\t\t\t}else{\n \t\t\t\t\t$pep_list_mods[$curr_pep][$mod_pep] = 1;\n \t\t\t\t}\n \t\t\t}else{\n \t\t\t\t$pep_list[$curr_pep] = 1;\n \t\t\t\t$pep_list_mods[$curr_pep][$mod_pep] = 1;\n \t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($pep_file);\n\t} else {\n \tdie(\"Unable to open .pepXML file.\");\n\t}\n\n\t#Prob filter TPP results\n\tif($searchEngine == \"TPP\"){\n\t\t//$decoys = 0;\n\t\t//$total = 0;\n\t\tarsort($init_peps_prob, SORT_NUMERIC);\n\t\tforeach($init_peps_prob as $key => $value) {\n\t\t\tif($value < $pep_cutoff) {\n\t\t\t\tunset($init_peps[$key]);\n\t\t\t\tunset($init_peps_decoy[$key]);\n\t\t\t\tunset($init_peps_mod[$key]);\n\t\t\t}\n\t\t}\n\n\t\t#reset indices\n \n\t\t$init_peps = array_values($init_peps);\n\t\t$init_peps_mod = array_values($init_peps_mod);\n\n\t\t#get peptides passing desired FDR\n\n\t\tfor($i = 0; $i < count($init_peps); $i++){\n\t\t\t$curr_pep = $init_peps[$i];\n\t\t\t$mod_pep = $init_peps_mod[$i];\n\t\t\tif(array_key_exists($curr_pep, $pep_list)){\n\t\t\t\t$pep_list[$curr_pep] += 1;\n\t\t\t\tif(array_key_exists($mod_pep, $pep_list_mods[$curr_pep])){\n\t\t\t\t\t$pep_list_mods[$curr_pep][$mod_pep] += 1;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$pep_list_mods[$curr_pep][$mod_pep] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$pep_list[$curr_pep] = 1;\n\t\t\t\t$pep_list_mods[$curr_pep] = array();\n\t\t\t\t$pep_list_mods[$curr_pep][$mod_pep] = 1;\n\t\t\t}\n\t\t}\n\t}\n \n\tksort($pep_list);\n \n\t#Read in database\n\n\t$prot_list = array();\n\t$db_file = fopen($fasta_db, \"r\");\n\tif ($db_file) {\n \twhile (($line = fgets($db_file)) !== false) {\n//-----------------------------------------------------------------\n if(preg_match('/^>(.+)/', $line, $match)){\n $tmp_arr = explode(\" \", $match[1]);\n $protein_info_arr = explode(\"|\", $tmp_arr[0]);\n if(count($protein_info_arr)>1){\n if(strlen($protein_info_arr[0]) > 4){\n $protein_id = $protein_info_arr[0];\n }else if(strlen($protein_info_arr[1]) > 4){\n $protein_id = $protein_info_arr[1];\n }\n }else{\n $protein_id = $protein_info_arr[0];\n }\n $prot_list[$protein_id] = '';\n\t\t\t\t$current_key = $protein_id;\n }\n//------------------------------------------------------------------\n\t\t\telse{\n\t\t\t\t$prot_list[$current_key] .= rtrim($line);\n\t\t\t}\n\t\t}\n\t\tfclose($db_file);\n\t} else {\n \tdie(\"Unable to open fasta databse.\");\n\t}\n//echo \"prot_list=\".count($prot_list).\"<br>\";\n\n\t#Read in protein to gene map\n\n\t$gene_map = array();\n\t$geneid_gene = array();\n\t$map_file = fopen($gene_map_file, \"r\");\n\tif ($map_file) {\n \twhile (($line = fgets($map_file)) !== false) {\n $line = trim($line);\n $tmp_map_arr = explode(\",\", $line);\n $gene_map[$tmp_map_arr[2]] = $tmp_map_arr[0];\n\t\t\t$geneid_gene[$tmp_map_arr[0]] = $tmp_map_arr[1];\n\t\t\t/*if(preg_match(\"/^([A-Za-z_\\-0-9]+),([^\\,]+),([a-zA-Z0-9\\]+)/\", $line, $match)){\n\t\t\t\t$gene_map[$match[3]] = $match[1];\n\t\t\t\t$geneid_gene[$match[1]] = $match[2];\n\t\t\t}*/\n\t\t}\n\t\tfclose($map_file);\n\t} else {\n \tdie(\"Unable to open protein to gene map.\");\n\t}\n\n\t#Match peptides to proteins and genes\n\n\t$pep_list_length = $pep_list_match = array();\n\t$pep_gene_length = $pep_gene_match = array();\n\t$prot_peps = $prot_pep_counts = $prot_no_peps = array();\n\t$prot_unique_peps = $prot_total_unique_peps = $prot_total_peps = array();\n\t$red_peps = array();\n\t$red_peps_length = 0;\n\t$gene_peps = $gene_pep_counts = $gene_no_peps = array();\n\t$gene_unique_peps = $gene_total_unique_peps = $gene_total_peps = array();\n\t$red_gene_peps = array();\n\t$red_gene_peps_length = 0;\n\n\tforeach($pep_list as $pep_key => $value) {\n\t\t# protein matching\n\n\t\t$pep_list_length[$pep_key] = 0;\n\t\tforeach($prot_list as $prot_key => $value2) {\n\t\t\tif(strpos($prot_list[$prot_key], $pep_key)) {\n\t\t\t\t$pep_list_match[$pep_key][$pep_list_length[$pep_key]] = $prot_key;\n\t\t\t\t$pep_list_length[$pep_key]++;\n\t\t\t}\n\t\t}\n\t\tif($pep_list_length[$pep_key] == 1){\n\t\t\t$prot = $pep_list_match[$pep_key][0];\n\t\t\tif(array_key_exists($prot, $prot_no_peps)) {\n\t\t\t\t$prot_peps[$prot][$prot_no_peps[$prot]] = $pep_key;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$prot_no_peps[$prot] = 0;\n\t\t\t\t$prot_unique_peps[$prot] = 0;\n\t\t\t\t$prot_total_unique_peps[$prot] = 0;\n\t\t\t\t$prot_total_peps[$prot] = 0;\n\t\t\t\t$prot_peps[$prot][$prot_no_peps[$prot]] = $pep_key;\n\t\t\t}\n\t\t\t$prot_pep_counts[$prot][$pep_key] = $pep_list[$pep_key];\n\t\t\t$prot_no_peps[$prot] += 1;\n\t\t\t$prot_unique_peps[$prot] += 1;\n\t\t\t$prot_total_unique_peps[$prot] += $pep_list[$pep_key];\n\t\t\t$prot_total_peps[$prot] += $pep_list[$pep_key];\n\t\t}\n\t\telse{\n\t\t\t$red_peps[$red_peps_length] = $pep_key;\n \n\t\t\t$red_peps_length++;\n\t\t}\n\n\t\t#gene matching\n\n\t\t$pep_gene_length[$pep_key] = 0;\n\t\tfor($i = 0; $i < $pep_list_length[$pep_key]; $i++) {\n\t\t\tif(array_key_exists($pep_list_match[$pep_key][$i], $gene_map)) {\n\t\t\t\t$pep_gene_match[$pep_key][$pep_gene_length[$pep_key]] = $gene_map[$pep_list_match[$pep_key][$i]];\n\t\t\t\t$pep_gene_length[$pep_key]++;\n\t\t\t}\n\t\t}\n \n\t\tif($pep_gene_length[$pep_key] > 0){\n\t\t\t$pep_gene_match[$pep_key] = array_values(array_unique($pep_gene_match[$pep_key]));\n\t\t\t$pep_gene_length[$pep_key] = count($pep_gene_match[$pep_key]);\n\t\t\tif($pep_gene_length[$pep_key] == 1) {\n\t\t\t\t$gene = $pep_gene_match[$pep_key][0];\n\t\t\t\tif(array_key_exists($gene, $gene_no_peps)) {\n\t\t\t\t\t$gene_peps[$gene][$gene_no_peps[$gene]] = $pep_key;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$gene_no_peps[$gene] = 0;\n\t\t\t\t\t$gene_unique_peps[$gene] = 0;\n\t\t\t\t\t$gene_total_unique_peps[$gene] = 0;\n\t\t\t\t\t$gene_total_peps[$gene] = 0;\n\t\t\t\t\t$gene_peps[$gene][$gene_no_peps[$gene]] = $pep_key;\n\t\t\t\t}\n\t\t\t\t$gene_pep_counts[$gene][$pep_key] = $pep_list[$pep_key];\n\t\t\t\t$gene_no_peps[$gene] += 1;\n\t\t\t\t$gene_unique_peps[$gene] += 1;\n\t\t\t\t$gene_total_unique_peps[$gene] += $pep_list[$pep_key];\n\t\t\t\t$gene_total_peps[$gene] += $pep_list[$pep_key];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$red_gene_peps[$red_gene_peps_length] = $pep_key;\n\t\t\t\t$red_gene_peps_length++;\n\t\t\t}\n\t\t}\n\t}\n\n\t#Match degenerate peptides to proteins\n\n\tfor($i=0; $i < $red_peps_length; $i++) {\n\t\t$un_pep_sum = $check_in_unique_list = $weight = 0;\n\t\tfor($j=0; $j < $pep_list_length[$red_peps[$i]]; $j++) {\n\t\t\t$prot = $pep_list_match[$red_peps[$i]][$j];\n\t\t\tif(array_key_exists($prot, $prot_unique_peps)) {\n\t\t\t\t$un_pep_sum += $prot_total_unique_peps[$prot];\n\t\t\t\t$check_in_unique_list = 1;\n\t\t\t}\n\t\t}\n\t\tif($check_in_unique_list == 1) {\n\t\t\tfor($j=0; $j < $pep_list_length[$red_peps[$i]]; $j++) {\n\t\t\t\t$prot = $pep_list_match[$red_peps[$i]][$j];\n\t\t\t\tif(array_key_exists($prot, $prot_unique_peps)) {\n\t\t\t\t\t$weight = $prot_total_unique_peps[$prot] / $un_pep_sum;\n\t\t\t\t\t$prot_peps[$prot][$prot_no_peps[$prot]] = $red_peps[$i];\n\t\t\t\t\t$prot_pep_counts[$prot][$red_peps[$i]] = $weight*$pep_list[$red_peps[$i]];\n\t\t\t\t\t$prot_no_peps[$prot]++;\n\t\t\t\t\t$prot_total_peps[$prot] += $weight*$pep_list[$red_peps[$i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor($j=0; $j < $pep_list_length[$red_peps[$i]]; $j++) {\n\t\t\t\t$prot = $pep_list_match[$red_peps[$i]][$j];\n\t\t\t\t$weight = 1 / $pep_list_length[$red_peps[$i]];\n\t\t\t\tif(array_key_exists($prot, $prot_no_peps)) {\n\t\t\t\t\t$prot_peps[$prot][$prot_no_peps[$prot]] = $red_peps[$i];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$prot_no_peps[$prot] = 0;\n\t\t\t\t\t$prot_total_peps[$prot] = 0;\n\t\t\t\t\t$prot_peps[$prot][$prot_no_peps[$prot]] = $red_peps[$i];\n\t\t\t\t}\n\t\t\t\t$prot_pep_counts[$prot][$red_peps[$i]] = $weight*$pep_list[$red_peps[$i]];\n\t\t\t\t$prot_no_peps[$prot]++;\n\t\t\t\t$prot_total_peps[$prot] += $weight*$pep_list[$red_peps[$i]];\n\t\t\t}\n\t\t}\n\t}\n\n\t#Match degenerate peptides to genes\n\n\tfor($i=0; $i < $red_gene_peps_length; $i++) {\n\t\t$un_pep_sum = $check_in_unique_list = $weight = 0;\n\t\tfor($j=0; $j < $pep_gene_length[$red_gene_peps[$i]]; $j++) {\n\t\t\t$gene = $pep_gene_match[$red_gene_peps[$i]][$j];\n\t\t\tif(array_key_exists($gene, $gene_unique_peps)) {\n\t\t\t\t$un_pep_sum += $gene_total_unique_peps[$gene];\n\t\t\t\t$check_in_unique_list = 1;\n\t\t\t}\n\t\t}\n\t\tif($check_in_unique_list == 1) {\n\t\t\tfor($j=0; $j < $pep_gene_length[$red_gene_peps[$i]]; $j++) {\n\t\t\t\t$gene = $pep_gene_match[$red_gene_peps[$i]][$j];\n\t\t\t\tif(array_key_exists($gene, $gene_unique_peps)) {\n\t\t\t\t\t$weight = $gene_total_unique_peps[$gene] / $un_pep_sum;\n\t\t\t\t\t$gene_peps[$gene][$gene_no_peps[$gene]] = $red_gene_peps[$i];\n\t\t\t\t\t$gene_pep_counts[$gene][$red_gene_peps[$i]] = $weight*$pep_list[$red_gene_peps[$i]];\n\t\t\t\t\t$gene_no_peps[$gene]++;\n\t\t\t\t\t$gene_total_peps[$gene] += $weight*$pep_list[$red_gene_peps[$i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor($j=0; $j < $pep_gene_length[$red_gene_peps[$i]]; $j++){\n\t\t\t\t$gene = $pep_gene_match[$red_gene_peps[$i]][$j];\n\t\t\t\t$weight = 1 / $pep_gene_length[$red_gene_peps[$i]];\n\t\t\t\tif(array_key_exists($gene, $gene_no_peps)) {\n\t\t\t\t\t$gene_peps[$gene][$gene_no_peps[$gene]] = $red_gene_peps[$i];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$gene_no_peps[$gene] = 0;\n\t\t\t\t\t$gene_total_peps[$gene] = 0;\n\t\t\t\t\t$gene_peps[$gene][$gene_no_peps[$gene]] = $red_gene_peps[$i];\n\t\t\t\t}\n\t\t\t\t$gene_pep_counts[$gene][$red_gene_peps[$i]] = $weight*$pep_list[$red_gene_peps[$i]];\n\t\t\t\t$gene_no_peps[$gene]++;\n\t\t\t\t$gene_total_peps[$gene] += $weight*$pep_list[$red_gene_peps[$i]];\n\t\t\t}\n\t\t}\n\t}\n\n\t#Merge redundant genes\n\n\t$red_genes = array();\t# list of genes with no unique peptides\t\n\t$red_gene_no = 0;\t# number of such genes\n\tforeach($gene_no_peps as $key => $value) {\n\t\tif(!array_key_exists($key, $gene_unique_peps)) {\n\t\t\t$red_genes[$red_gene_no] = $key;\n\t\t\t$red_gene_no++;\n\t\t}\n\t}\n\n\t$red_shared = array();\t\t\t\t#stores information on which non-unique genes/proteins perfectly share all peptides\n\t$red_partial = array();\t\t\t#stores which non-unique genes/proteins share some peptides\n\t$red_subsumed = array();\t\t\t#if a gene/protein is contained within another, its entry in this hash will be 1\n\t$red_subsumed_list = array();\t#for genes/protein that have subsumed others, the other will be listed in this hash array\n\tfor($i = 0; $i < $red_gene_no; $i++) {\n\t\t$red_array = array();\n\t\t$red_array_l = 0;\n\t\t$gene1 = $red_genes[$i];\n\t\tfor($j = 0; $j < $red_gene_no; $j++) {\n\t\t\t$gene2 = $red_genes[$j];\n\t\t\tlist($red_score, $shared) = redundancy_score($gene_peps[$gene1], $gene_peps[$gene2]);\n\t\t\tif($red_score == 0){\n\t\t\t\t$red_array[$red_array_l] = $gene2;\n\t\t\t\t$red_array_l++;\n\t\t\t}\n\t\t\telseif($red_score == -1 && ($gene1 != $gene2)){\n\t\t\t\t$red_shared[$gene1][] = $gene2;\n\t\t\t}\n\t\t\telseif($shared > 0 && $gene1 != $gene2){\n\t\t\t\t$red_partial[$gene1][$gene2] = $shared;\n\t\t\t}\n\t\t}\n\t\tif($red_array_l > 0){\n\t\t\t$red_subsumed[$gene1] = 1;\n\t\t\tfor($j = 0; $j < $red_array_l; $j++){\n\t\t\t\t$gene2 = $red_array[$j];\n\t\t\t\t$red_subsumed_list[$gene2][] = $gene1;\n\t\t\t\tif(array_key_exists($gene1, $red_subsumed_list) && count($red_subsumed_list[$gene1]) > 0) {\n\t\t\t\t\t$red_subsumed_list[$gene2] = array_merge($red_subsumed_list[$gene2], $red_subsumed_list[$gene1]);\n\t\t\t\t}\n\t\t\t\tfor($k = 0; $k < count($gene_peps[$gene1]); $k++){\n\t\t\t\t\t$gene_pep_counts[$gene2][$gene_peps[$gene1][$k]] += $gene_pep_counts[$gene1][$gene_peps[$gene1][$k]]/$red_array_l;\n\t\t\t\t}\n\t\t\t\t$gene_total_peps[$gene2] += $gene_total_peps[$gene1]/$red_array_l;\n\t\t\t}\n\t\t}\n\t}\n\n\t#Remove redundant entries in subsumed list\n\n\tfor($i = 0; $i < $red_gene_no; $i++) {\n\t\t$gene = $red_genes[$i];\n\t\tif(array_key_exists($gene, $red_subsumed_list)) {\n\t\t\t$red_subsumed_list[$gene] = array_values(array_unique($red_subsumed_list[$gene]));\n\t\t}\n\t}\n\n\t#Remove subsumed entries from other partial matches\n\n\t$subsumed_list = array();\t#contains a list of all genes that are subsumed within others\n\tforeach($red_subsumed as $gene_key => $value) {\n\t\t$subsumed_list[] = $gene_key;\n\t}\n\t$subsumed_list = array_values(array_unique($subsumed_list));\n\n\t#Output summary\n\n\t$omit = array();\t\t\t\t\t#array containing redundant genes to omit printing full entries for\n\t$curr_gene_list = array();\t#array containing a list of redundant genes\n\t$hit_count = 0;\t\t\t# counts the number of gene hits\n\n\tksort($gene_peps);\n\n\t$outfile = fopen($outfile_name, \"w\");\n\n\tfwrite($outfile, \"HitNumber;;Gene;;GeneID;;SpectralCount;;Unique;;Subsumed\\n\");\n\tfwrite($outfile, \"Peptide;;SpectralCount;;IsUnique\\n\\n\");\n\tksort($gene_peps);\n \n\tforeach($gene_peps as $gene_key => $value) {\n\t\tif(!array_key_exists($gene_key, $red_subsumed) && !array_key_exists($gene_key, $omit)) {\n\t\t\t$hit_count++;\n\t\t\t$write_string = \"Hit_\" . $hit_count . \";;\";\n\t\t\t$gene_string = $gene_key;\n\t\t\t$curr_gene_list = array();\n\t\t\t$curr_gene_list = array();\n\t\t\t$curr_gene_list[0] = $gene_key;\n\n\t\t\t#check for and print out redundant gene entries\n\n\t\t\tif(array_key_exists($gene_key, $red_shared)) {\n\t\t\t\t$gene_string .= \", \";\n\t\t\t\tsort($red_shared[$gene_key]);\n\t\t\t\t$gene_string .= implode(\", \", $red_shared[$gene_key]);\n\t\t\t\t$curr_gene_list = array_merge($curr_gene_list, $red_shared[$gene_key]);\n\t\t\t\t$curr_omit = array_fill_keys($red_shared[$gene_key], 1);\n\t\t\t\t$omit = $omit + $curr_omit;\n\t\t\t}\n\t\t\t$gene_string .= \";;\";\n\n\t\t\t#print Genes for GeneIDs\n\n\t\t\tfor($i=0; $i < count($curr_gene_list); $i++){\n\t\t\t\tif($i > 0) {\n\t\t\t\t\t$write_string .= \", \";\n\t\t\t\t}\n\t\t\t\t$print_var = $geneid_gene[$curr_gene_list[$i]];\n\t\t\t\t$write_string .= $print_var;\n\t\t\t}\n\t\t\t$write_string .= \";;\";\n\t\t\t$write_string .= $gene_string;\n\t\t\t$print_var = round($gene_total_peps[$gene_key]); // Print total spectral count, rounded to nearest int\n\t\t\tif($print_var == 0) {\t\t// if less than one spectral count, omit hit\n\t\t\t\t$hit_count --;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$write_string .= $print_var . \";;\";\n\n\t\t\t#count unique peptides (i.e. peptides that belong to redundant or subsumed genes are also unique)\n\n\t\t\tif(array_key_exists($gene_key, $red_subsumed_list)) {\n\t\t\t\t$curr_gene_list = array_merge($curr_gene_list, $red_subsumed_list[$gene_key]);\n\t\t\t}\n\n\t\t\t$curr_uniq = 0;\n\t\t\t$curr_pep_list = $gene_peps[$gene_key];\n\t\t\tsort($curr_gene_list);\n\n\t\t\tfor($i = 0; $i < count($curr_pep_list); $i++){\n\t\t\t\tsort($pep_gene_match[$curr_pep_list[$i]]);\n\t\t\t\tif($pep_gene_match[$curr_pep_list[$i]] == $curr_gene_list){\n\t\t\t\t\t$curr_uniq++;\n\t\t\t\t} \n\t\t\t}\n\t\t\n\t\t\t$write_string .= $curr_uniq . \";;\";\n\n\t\t\t#print subsumed genes\n\n\t\t\tif(array_key_exists($gene_key, $red_subsumed_list)) {\n\t\t\t\tfor($i = 0; $i < count($red_subsumed_list[$gene_key]); $i++) {\n\t\t\t\t\t$print_var = $red_subsumed_list[$gene_key][$i];\n\t\t\t\t\t$write_string .= $print_var;\n\t\t\t\t\tif($i != count($red_subsumed_list[$gene_key]) - 1) {\n\t\t\t\t\t\t$write_string .= \", \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$write_string .= \"-\";\n\t\t\t}\n\n\t\t\t$write_string .= \"\\n\";\n\t\t\tfwrite($outfile, $write_string);\n\t\t\n\t\t\t#Print Peptides\n\n\t\t\tfor($i = 0; $i < $gene_no_peps[$gene_key]; $i++){\n\t\t\t\tsort($pep_gene_match[$gene_peps[$gene_key][$i]]);\n\t\t\t\tif($pep_gene_length[$gene_peps[$gene_key][$i]] == 1 || $pep_gene_match[$gene_peps[$gene_key][$i]] == $curr_gene_list){\n\t\t\t\t\t$yes_no = 'yes';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$yes_no = 'no';\t\t\t\n\t\t\t\t}\n\n\t\t\t\tforeach($pep_list_mods[$gene_peps[$gene_key][$i]] as $mod_keys => $value2) {\n\t\t\t\t\t$print_var = round($pep_list_mods[$gene_peps[$gene_key][$i]][$mod_keys]);\t// round peptide spectral counts\n\t\t\t\t\tif($print_var > 0) {\n\t\t\t\t\t\t$write_string = $mod_keys . \";;\" . $print_var . \";;\" . $yes_no . \"\\n\";\n\t\t\t\t\t\tfwrite($outfile, $write_string);\n\t\t\t\t\t\t$write_string = \"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfwrite($outfile, \"\\n\");\n\t\t}\n\t}\n\tfclose($outfile);\n\t$outfile_name = $outfile_name;\n\treturn $outfile_name;\n}",
"function format_fare_rule_response1($fare_rule_response) {\r\n $fare_rules = array();\r\n foreach ($fare_rule_response['Response']['FareRules'] as $k => $v) {\r\n $fare_rules[$k]['Origin'] = $v['Origin'];\r\n $fare_rules[$k]['Destination'] = $v['Destination'];\r\n $fare_rules[$k]['Airline'] = $v['Airline'];\r\n $fare_rules[$k]['FareRules'] = $v['FareRuleDetail'];\r\n }\r\n return $fare_rules;\r\n }",
"function get_fare_details($data_row, $search_session_key) {\r\n $response['data'] = array();\r\n $response['status'] = FAILURE_STATUS;\r\n $api_request = $this->fare_details_request($data_row, $search_session_key);\r\n //get data\r\n if ($api_request['status']) {\r\n $header_info = $this->get_header();\r\n $api_response = $this->CI->api_interface->get_json_response($api_request['data']['service_url'], $api_request['data']['request'], $header_info);\r\n\r\n //$this->CI->custom_db->generate_static_response(json_encode($api_response));\r\n //$api_response = $this->CI->flight_model->get_static_response(35);\r\n if ($this->valid_api_response($api_response)) {\r\n $response['data'] = $api_response['FareRule']['FareRuleDetail'];\r\n $response['status'] = SUCCESS_STATUS;\r\n }\r\n }\r\n return $response;\r\n }",
"private function lowFareSearchProcessOneWay()\n {\n $airAirPricePointList = $this->lowFareResponse['airAirPricePointList']['airAirPricePoint'];\n // $airFareInfoList=$this->lowFareResponse['airLowFareSearchRsp']['airFareInfoList'];\n\n $count=0;\n $flightList = [];\n foreach ($airAirPricePointList as $out=> $airItem) {\n $count++;\n\n $airOptionlistOut=$airItem['airAirPricingInfo']['airFlightOptionsList']['airFlightOption']['airOption'];\n// $airOptionlistIn=$airItem['airAirPricingInfo']['airFlightOptionsList']['airFlightOption'][1]['airOption'];\n $airAirPricingInfo=$airItem['airAirPricingInfo']['@attributes'];\n $air['outBound']=$this->getAirBeanList($airOptionlistOut,$airAirPricingInfo);\n // $air['inBound']=$this->getAirBeanList($airOptionlistIn,$airAirPricingInfo);\n $flightList[] = $air;\n }\n return $flightList;\n\n }",
"function tripal_feature_load_gff3_derives_from($feature, $cvterm, $object,\n $organism, $fmin, $fmax) {\n\n $type = $cvterm->name;\n\n // First look for the object feature in the temp table to get it's type.\n $values = array(\n 'organism_id' => $organism->organism_id,\n 'uniquename' => $object,\n );\n $result = chado_select_record('tripal_gff_temp', array('type_name'), $values);\n $type_id = NULL;\n if (count($result) > 0) {\n $otype = tripal_get_cvterm(array(\n 'name' => $result[0]->type_name,\n 'cv_id' => array(\n 'name' => 'sequence'\n )\n ));\n if ($otype) {\n $type_id = $otype->cvterm_id;\n }\n }\n\n // If the object wasn't in the temp table then look for it in the\n // feature table and get it's type.\n if (!$type_id) {\n $result = chado_select_record('feature', array('type_id'), $values);\n if (count($result) > 1) {\n watchdog(\"tripal_feature\", \"Cannot find feature type for, '%subject' , in 'derives_from' relationship. Multiple matching features exist with this uniquename.\",\n array('%subject' => $object), WATCHDOG_WARNING);\n return '';\n }\n else if (count($result) == 0) {\n watchdog(\"tripal_feature\", \"Cannot find feature type for, '%subject' , in 'derives_from' relationship.\",\n array('%subject' => $object), WATCHDOG_WARNING);\n return '';\n }\n else {\n $type_id = $result->type_id;\n }\n }\n\n // Get the object feature.\n $match = array(\n 'organism_id' => $organism->organism_id,\n 'uniquename' => $object,\n 'type_id' => $type_id,\n );\n $ofeature = chado_select_record('feature', array('feature_id'), $match);\n if (count($ofeature) == 0) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Could not add 'Derives_from' relationship \" .\n \"for %uniquename and %subject. Subject feature, '%subject', \" .\n \"cannot be found\", array('%uniquename' => $feature->uniquename, '%subject' => $subject));\n return;\n }\n\n // If this feature is a protein then add it to the tripal_gffprotein_temp.\n if ($type == 'protein' or $type == 'polypeptide') {\n $values = array(\n 'feature_id' => $feature->feature_id,\n 'parent_id' => $ofeature[0]->feature_id,\n 'fmin' => $fmin,\n 'fmax' => $fmax\n );\n $result = chado_insert_record('tripal_gffprotein_temp', $values);\n if (!$result) {\n tripal_report_error('tripal_feature', TRIPAL_ERROR, \"Cound not save record in temporary protein table, Cannot continue.\", array());\n exit;\n }\n }\n\n // Now check to see if the relationship already exists. If it does\n // then just return.\n $values = array(\n 'object_id' => $ofeature[0]->feature_id,\n 'subject_id' => $feature->feature_id,\n 'type_id' => array(\n 'cv_id' => array(\n 'name' => 'sequence'\n ),\n 'name' => 'derives_from',\n ),\n 'rank' => 0\n );\n $rel = chado_select_record('feature_relationship', array('*'), $values);\n if (count($rel) > 0) {\n return;\n }\n\n // finally insert the relationship if it doesn't exist\n $ret = chado_insert_record('feature_relationship', $values);\n if (!$ret) {\n tripal_report_error(\"tripal_feature\", TRIPAL_WARNING, \"Could not add 'Derives_from' relationship for $feature->uniquename and $subject\",\n array());\n }\n}",
"function find_taxon_names(&$document)\n{\n/*\n\tif (1)\n\t{\n\t\t//echo $document->current_paragraph_node->content . \"\\n\";\t\n\t\t$response = get_names_from_text($document->current_paragraph_node->content);\n\n\t\t// Result\n\t\t//echo \"GNRD response\\n\";\n\t\t//print_r($response);\n\t}\n\telse\n\t{\n\t\t// canned example\n\t\n\t\t$json = '{\"token_url\":\"http://gnrd.globalnames.org/name_finder.json?token=e4xi1MjGTFug9fjyb4ssDA\",\"input_url\":null,\"file\":\"\",\"status\":200,\"engines\":[\"TaxonFinder\",\"NetiNeti\"],\"unique\":false,\"verbatim\":true,\"english\":true,\"execution_time\":{\"find_names_duration\":0.080698861,\"total_duration\":0.571075043},\"agent\":\"\",\"created\":\"2014-05-29T17:19:04Z\",\"total\":4,\"names\":[{\"verbatim\":\"Potamotrygon boesemani\",\"scientificName\":\"Potamotrygon boesemani\",\"offsetStart\":1,\"offsetEnd\":22,\"identifiedName\":\"Potamotrygon boesemani\"},{\"verbatim\":\"(Chondrichthyes:\",\"scientificName\":\"Chondrichthyes\",\"offsetStart\":24,\"offsetEnd\":39,\"identifiedName\":\"Chondrichthyes\"},{\"verbatim\":\"Myliobatiformes:\",\"scientificName\":\"Myliobatiformes\",\"offsetStart\":41,\"offsetEnd\":56,\"identifiedName\":\"Myliobatiformes\"},{\"verbatim\":\"Potamotrygonidae),\",\"scientificName\":\"Potamotrygonidae\",\"offsetStart\":58,\"offsetEnd\":75,\"identifiedName\":\"Potamotrygonidae\"}]}';\n\t\t$response = json_decode($json);\n\t}\n\t\n\tif (isset($response->names))\n\t{\n\t\tforeach ($response->names as $name)\n\t\t{\n\t\t\t$annotation = new_annotation($document, 'name', false);\n\t\t\t\n\t\t\t// text with name may have leading and/or trailing cruff to trim off\n\t\t\t\n\t\t\t$found_name = $name->identifiedName;\n\t\t\t\n\t\t\t$name_length = mb_strlen($found_name, mb_detect_encoding($found_name));\n\t\t\t\n\t\t\t// trim start\n\t\t\t$offsetStart = $name->offsetStart;\n\t\t\t\n\t\t\t$name_start = mb_substr($found_name, 0, 1);\t\t\t\n\t\t\twhile(mb_substr($document->current_paragraph_node->content, $offsetStart, 1) != $name_start)\n\t\t\t{\n\t\t\t\t$offsetStart++;\n\t\t\t}\n\t\t\t// trim end\n\t\t\t$offsetEnd = $name->offsetEnd;\n\t\t\t\n\t\t\t$name_end = mb_substr($found_name, $name_length - 1, 1);\t\t\t\n\t\t\twhile(mb_substr($document->current_paragraph_node->content, $offsetEnd, 1) != $name_end)\n\t\t\t{\n\t\t\t\t$offsetEnd--;\n\t\t\t}\n\t\t\t\n\t\t\t$annotation->range = array($offsetStart, $offsetEnd);\n\t\t\tadd_annotation($document, $annotation);\t\n\t\t}\n\t}\n\t\n\t//print_r($document);\n\t//exit();\n*/\n}",
"protected function parseFamilyAttributes()\n {\n $attributes = $this->doc->getElementsByTagName(\"attributes\")->item(0);\n if ($attributes) {\n foreach ( $attributes->childNodes as $currentChild ) {\n if ($currentChild->nodeName == \"attribute\") {\n $this->parseFamilyElement(\"attribute\", \"ATTR\", $currentChild);\n }\n }\n }\n }",
"function lookup_WoRMS_mismapped_subgenera() //utility\n { \n /* Part 1 */\n $source = '/opt/homebrew/var/www/eol_php_code/tmp2/26/taxon.tab'; $i = 0;\n foreach(new FileIterator($source) as $line_number => $line) {\n $line = explode(\"\\t\", $line); $i++; if(($i % 100000) == 0) echo \"\\n\".number_format($i);\n if($i == 1) $fields = $line;\n else {\n if(!$line[0]) break;\n $rec = array(); $k = 0;\n foreach($fields as $fld) {\n $rec[$fld] = $line[$k]; $k++;\n }\n // print_r($rec); exit;\n /*Array(\n [taxonID] => 1\n [source] => http://www.marinespecies.org/aphia.php?p=taxdetails&id=1\n [referenceID] => WoRMS:citation:1\n [acceptedNameUsageID] => \n [scientificName] => Biota\n [namePublishedIn] => \n [kingdom] => \n [phylum] => \n [class] => \n [order] => \n [family] => \n [genus] => \n [taxonRank] => kingdom\n [taxonomicStatus] => accepted\n [taxonRemarks] => \n [rightsHolder] => WoRMS Editorial Board\n )*/\n if($rec['taxonRank'] == 'subgenus') $scinames[$rec['scientificName']] = $rec;\n if($rec['taxonRank'] == 'family') $scinames[$rec['scientificName']] = $rec;\n if($rec['taxonRank'] == 'genus') $scinames[$rec['scientificName']] = $rec;\n }\n }\n // print_r($scinames); exit;\n /* Part 2 */\n $subgenus_names = array(\"Dichelyne subgen. Dichelyne Jägerskiöld 1902\", \"Flustrellidra subgen. Flustrellidrella d'Hondt 1983\", \"Aglaophenia subgen. Pachyrhynchia Kirchenpauer 1872\", \"Dicranomyia subgen. Idiopyga Savchenko 1987\", \"Entomozoe subgen. Nandania Wang\", \"Halliella subgen. Halliella Ulrich 1891\", \"Nodobythere subgen. Cristobythere Schornikov 1987\", \"Ophiosema subgen. Sinophiosema Zhang\", \"Parydra subgen. Chaetoapnaea Hendel 1930\", \"Dicranomyia subgen. Glochina Meigen 1830\", \"Paralvinella subgen. Nautalvinella Desbruyères & Laubier 1993\", \"Paralvinella subgen. Miralvinella Desbruyères & Laubier 1993\", \"Leptoconops subgen. Holoconops Kieffer 1918\", \"Chaperiopsis subgen. Clipeochaperia Uttley & Bullivant 1972\", \"Alcyonidium subgen. Paralcyonidium Okada 1925\", \"Melicerita subgen. Henrimilnella d'Hondt & Gordon 1999\", \"Amphiblestrum subgen. Aviculamphiblestrum Rosso 1999\", \"Clitellio subgen. Clitelloides Finogenova 1985\", \"Olavius subgen. Coralliodriloides Erséus 1984\", \"Schizoperopsis subgen. Psammoschizoperopsis Apostolov 1982\", \"Macellicephala subgen. Sinantenna Hartmann-Schröder 1974\", \"Amphiporus subgen. Naredopsis Verrill 1892\", \"Nemertes subgen. Nemertes Johnston 1837\", \"Gyrodes subgen. Sohlella Popenoe, Saul & Susuki 1987\", \"Grammatodon subgen. Cosmetodon Branson 1942\", \"Rhopalodiaceae subgen. Karsten Topachevs'kyj & Oksiyuk 1960\", \"Culicoides subgen. Monoculicoides Khalaf 1954\", \"Coelopa subgen. Fucomyia Haliday 1938\", \"Cunnolites subgen. Cunnolites Alloiteau 1952\", \"Cunnolites subgen. Plesiocunnolites Alloiteau 1957\", \"Cunnolites subgen. Paracunnolites Beauvais 1964\", \"Ceratotrochus subgen. Edwardsotrochus Chevalier 1961\", \"Caligus subgen. Subcaligus Heegaard 1943\", \"Castanopora subgen. Castanoporina Voigt 1993\", \"Urceolipora subgen. Cureolipora Gordon 2000\", \"Fenestella subgen. Loculiporina Elias & Condra 1957\", \"Lepidopleurus subgen. Xiphiozona Berry 1919\", \"Drepanochilus subgen. Tulochilus Finlay & Marwick 1937\", \"Puncturiella subgen. Puncturiellina Voigt 1987\", \"Celleporaria subgen. Sinuporaria Pouyet 1973\", \"Eridopora subgen. Discotrypella Elias 1957\", \"Hederella subgen. Basslederella Solle 1968\", \"Hederella subgen. Rhenanerella Solle 1952\", \"Glycymeris subgen. Manaia Finlay & Marwick 1937\", \"Hederella subgen. Paralhederella Solle 1952\", \"Webbinelloidea subgen. Apsiphora Langer 1991\", \"Hederella subgen. Magnederella Solle 1952\", \"Tylopathes subgen. Paratylopathes Roule 1905\", \"Aljutovella subgen. Elongatella Solovieva ex Rauzer-Chernousova et al. 1996\", \"Vitta subgen. Vitta Mörch 1852\", \"Xestoleberis subgen. Pontoleberis Krstic & Stancheva 1967\", \"Himantozoum subgen. Beanodendria d'Hondt & Gordon 1996\");\n $i = 0;\n foreach($subgenus_names as $name) { $i++;\n $rek = self::find_subgenus_rek($name, $scinames); // print_r($rek);\n // echo \"\\n$i. $name -> \".$rek['scientificName']. \" [\".$rek['taxonID'].\"]\"; //good debug\n echo \"\\n\".$rek['taxonID'];\n }\n }",
"function book_flight_multiflight(\n $depFlightEquip = \"\", $arvFlightEquip = \"\",\n $departureDateFromString, $departureTimeFromString,\n $departureDateToString, $departureTimeToString,\n $departureCityCodeFromString, $departureCityCodeToString,\n $departureFlightCodeString,\n $departureFlightresBookDesigCodeString,\n $departureFlightAirEquipTypeString,\n $departureFlightMarriageGrpString,\n\n $arrivalDateFromString = \"\", $arrivalTimeFromString = \"\",\n $arrivalDateToString = \"\", $arrivalTimeToString = \"\",\n $arrivalCityCodeFromString = \"\", $arrivalCityCodeToString = \"\",\n $arrivalFlightCodeString = \"\",\n $arrivalFlightresBookDesigCodeString = \"\",\n $arrivalFlightAirEquipTypeString = \"\",\n $arrivalFlightMarriageGrpString = \"\",\n\n $totalAdult, $totalChild, $totalInfant,\n $contactPerson_email,\n $contactPerson_phone,\n $contactPerson_nationality,\n $passengerDetails,\n $remarks = \"\"\n )\n{\n /* departure part */\n $DepDateFromArray = explode(\"~\", $departureDateFromString);\n $DepTimeFromArray = explode(\"~\", $departureTimeFromString);\n $DepEquipArr = explode(\"~\", $depFlightEquip);\n $ArvEquipArr = explode(\"~\", $arvFlightEquip);\n\n $DepDateToArray = explode(\"~\", $departureDateToString);\n $DepTimeToArray = explode(\"~\", $departureTimeToString);\n\n $DepCityCodeFromArray = explode(\"~\", $departureCityCodeFromString);\n $DepCityCodeToArray = explode(\"~\", $departureCityCodeToString);\n $DepFlightCodeArray = explode(\"~\", $departureFlightCodeString);\n\n $DepFlightCode = array();\n $DepFlightNo = array();\n\n for ($idxCode = 0; $idxCode < count($DepFlightCodeArray); $idxCode++)\n {\n $codeExplodeArr = explode(\" \", $DepFlightCodeArray[$idxCode]);\n $DepFlightCode[$idxCode] = $codeExplodeArr[0];\n $DepFlightNo[$idxCode] = $codeExplodeArr[1];\n }\n $DepFlightrResBookDesigCodeArray = explode(\"~\", $departureFlightresBookDesigCodeString);\n $DepFlightAirEquipTypeArray = explode(\"~\", $departureFlightAirEquipTypeString);\n $DepFlightMarriageGrpArray = explode(\"~\", $departureFlightMarriageGrpString);\n\n /* arrival part */\n $ArvDateFromArray = explode(\"~\", $arrivalDateFromString);\n $ArvTimeFromArray = explode(\"~\", $arrivalTimeFromString);\n\n $ArvDateToArray = explode(\"~\", $arrivalDateToString);\n $ArvTimeToArray = explode(\"~\", $arrivalTimeToString);\n\n $ArvCityCodeFromArray = explode(\"~\", $arrivalCityCodeFromString);\n $ArvCityCodeToArray = explode(\"~\", $arrivalCityCodeToString);\n $ArvFlightCodeArray = explode(\"~\", $arrivalFlightCodeString);\n\n if(count($ArvFlightCodeArray) >= 1 && $ArvFlightCodeArray[0] != \"\") {\n $ArvFlightCode = array();\n $ArvFlightNo = array();\n for ($idxCode = 0; $idxCode < count($ArvFlightCodeArray); $idxCode++)\n {\n $codeExplodeArr = explode(\" \", $ArvFlightCodeArray[$idxCode]);\n $ArvFlightCode[$idxCode] = $codeExplodeArr[0];\n $ArvFlightNo[$idxCode] = $codeExplodeArr[1];\n }\n $ArvFlightrResBookDesigCodeArray = explode(\"~\", $arrivalFlightresBookDesigCodeString);\n $ArvFlightAirEquipTypeArray = explode(\"~\", $arrivalFlightAirEquipTypeString);\n $ArvFlightMarriageGrpArray = explode(\"~\", $arrivalFlightMarriageGrpString);\n }\n\n //header(\"Content-type: text/xml\");\n $childExist = \"\";\n $infantExist = \"\";\n if( $totalChild != 0 ) {\n $childExist = '<PassengerType Code=\"CNN\" Quantity=\"'.$totalChild.'\" />';\n }\n if( $totalInfant != 0 )\n {\n /* INF = infant without seat\n INS = infant with seat*/\n $infantExist = '<PassengerType Code=\"INF\" Quantity=\"'.$totalInfant.'\" />';\n }\n\n /* we don't count infant with code INF for number of party*/\n $numberInParty = $totalAdult+$totalChild;//+$totalInfant;\n\n $service = new SWSWebService(\"ihsan.tay@ctc.com.sg\",\"8888\",\"CTC78866\",\"8HYD\",\"https://webservices.sabre.com/websvc\");\n if($service->SessionCreate())\n {\n if($service->SessionValidate())\n {\n $flightSegmentString = \"\";\n /* make a flight segment for departure */\n $flgCode = \"\";\n for($idxSeg = 0; $idxSeg < count($DepFlightCodeArray); $idxSeg++) {\n /* just take 1 code airflight, all same */\n $flgCode = $DepFlightCode[$idxSeg];\n\n $flightSegmentString .= '\n <FlightSegment DepartureDateTime=\"'.$DepDateFromArray[$idxSeg].'T'.$DepTimeFromArray[$idxSeg].'\" ArrivalDateTime=\"'.$DepDateToArray[$idxSeg].'T'.$DepTimeToArray[$idxSeg].'\" FlightNumber=\"'.$DepFlightNo[$idxSeg].'\" NumberInParty=\"'.$numberInParty.'\" ResBookDesigCode=\"'.$DepFlightrResBookDesigCodeArray[$idxSeg].'\" Status=\"NN\">\n <DestinationLocation LocationCode=\"'.$DepCityCodeToArray[$idxSeg].'\" />';\n if($DepEquipArr[$idxSeg] != \"\") {\n $flightSegmentString .= '<Equipment AirEquipType=\"'.$DepEquipArr[$idxSeg].'\"/>';\n }\n $flightSegmentString .= '\n <MarketingAirline Code=\"'.$DepFlightCode[$idxSeg].'\" FlightNumber=\"'.$DepFlightNo[$idxSeg].'\" />\n <MarriageGrp>'.$DepFlightMarriageGrpArray[$idxSeg].'</MarriageGrp>\n <OperatingAirline Code=\"'.$DepFlightCode[$idxSeg].'\" />\n <OriginLocation LocationCode=\"'.$DepCityCodeFromArray[$idxSeg].'\"/>\n </FlightSegment>';\n }\n\n /* next, is to, make a flight segment for arrival */\n if(count($ArvFlightCodeArray) >= 1 && $ArvFlightCodeArray[0] != \"\") {\n for($idxSeg = 0; $idxSeg < count($ArvFlightCodeArray); $idxSeg++) {\n $flightSegmentString .= '\n <FlightSegment DepartureDateTime=\"'.$ArvDateFromArray[$idxSeg].'T'.$ArvTimeFromArray[$idxSeg].'\" ArrivalDateTime=\"'.$ArvDateToArray[$idxSeg].'T'.$ArvTimeToArray[$idxSeg].'\" FlightNumber=\"'.$ArvFlightNo[$idxSeg].'\" NumberInParty=\"'.$numberInParty.'\" ResBookDesigCode=\"'.$ArvFlightrResBookDesigCodeArray[$idxSeg].'\" Status=\"NN\">\n <DestinationLocation LocationCode=\"'.$ArvCityCodeToArray[$idxSeg].'\" />';\n\n if($ArvEquipArr[$idxSeg] != \"\") {\n $flightSegmentString .= '<Equipment AirEquipType=\"'.$ArvEquipArr[$idxSeg].'\"/>';\n }\n $flightSegmentString .= '\n <MarketingAirline Code=\"'.$ArvFlightCode[$idxSeg].'\" FlightNumber=\"'.$ArvFlightNo[$idxSeg].'\" />\n <MarriageGrp>'.$ArvFlightMarriageGrpArray[$idxSeg].'</MarriageGrp>\n <OperatingAirline Code=\"'.$ArvFlightCode[$idxSeg].'\" />\n <OriginLocation LocationCode=\"'.$ArvCityCodeFromArray[$idxSeg].'\"/>\n </FlightSegment>';\n }\n }\n\n $EnhancedAirBookRQ = '\n <EnhancedAirBookRQ HaltOnError=\"true\" version=\"3.7.0\" xmlns=\"http://services.sabre.com/sp/eab/v3_7\">\n <OTA_AirBookRQ>\n <HaltOnStatus Code=\"NO\"/>\n <HaltOnStatus Code=\"NN\"/>\n <HaltOnStatus Code=\"UC\"/>\n <HaltOnStatus Code=\"US\"/>\n <HaltOnStatus Code=\"UN\"/>\n <HaltOnStatus Code=\"LL\"/>\n <HaltOnStatus Code=\"HL\"/>\n <HaltOnStatus Code=\"WL\"/>\n <OriginDestinationInformation>\n '.$flightSegmentString.'\n </OriginDestinationInformation>\n <RedisplayReservation NumAttempts=\"3\" WaitInterval=\"5000\" />\n </OTA_AirBookRQ>\n <OTA_AirPriceRQ>\n <PriceRequestInformation Retain=\"true\">\n <OptionalQualifiers>\n <PricingQualifiers>\n <PassengerType Code=\"ADT\" Quantity=\"'.$totalAdult.'\" />'\n .$childExist.$infantExist.'\n </PricingQualifiers>\n </OptionalQualifiers>\n </PriceRequestInformation>\n </OTA_AirPriceRQ>\n <PostProcessing IgnoreAfter=\"false\" xmlns=\"http://services.sabre.com/sp/eab/v3_7\">\n <RedisplayReservation WaitInterval=\"1000\"/>\n </PostProcessing>\n <PreProcessing xmlns=\"http://services.sabre.com/sp/eab/v3_7\" />\n </EnhancedAirBookRQ>';\n /*die();*/\n $xml = $service->Execute(\"EnhancedAirBookRQ\",$EnhancedAirBookRQ,'OTA', 'Air');\n\n if( $xml ) {\n /*$parseResult = simplexml_load_string($xml);\n $arrayFinal = json_decode(json_encode($parseResult), true);\n $countArrayFinal = count($arrayFinal);*/\n\n /*echo $xml;\n echo '<pre>';\n var_dump($parseResult);\n var_dump($arrayFinal);*/\n /* get passenger detail */\n /* init data */\n $priceQuoteInfo = ''; $isInfant = '';\n $remarksPassenger = \"\";\n\n if( $passengerDetails == TRUE ) {\n $counter_number = 1;\n\n /* every detail PD is different */\n $specialServicePassengerInfo = '';\n $secureServicePassengerInfo ='';\n $serviceAdultInfo = '';\n $serviceChildrenInfo = '';\n $serviceInfantInfo = '';\n $infantParentNameNumber = '1.1';\n $tempIPNN = '';\n $contactNumberInfo = '';\n $contactEmailInfo = '';\n $personInfo = '';\n $passengerRemarksInfo = \"\";\n\n foreach ( $passengerDetails AS $passenger ) {\n $psgTitle = strtoupper($passenger->passengerTitle);\n $rec = 1;\n switch($passenger->passengerType) {\n case 'ADULT' :$rec = 1; break;\n case 'CHILD' : $rec = 2; break;\n case 'INFANT' :\n if($totalChild > 0) {\n $rec = 3;\n } else {\n $rec = 2;\n }\n break;\n default: break;\n }\n\n $priceQuoteInfo .= '<Link NameNumber=\"'.$counter_number.'.1\" Record=\"'.$rec.'\" />';\n $isInfant = 'Infant=\"false\"'; /* used for adult and children */\n $dob = $passenger->passengerDOB;\n $pdtype = 'ADT'; /* use to define passenger type in PD */\n $passengerType = $passenger->passengerType;\n $nameRef = '';\n\n /* get passenger age, especially children and infant, very very need this */\n $today = new DateTime('today');\n $birthdate = new DateTime($dob);\n $passengerAge = $birthdate->diff($today)->y;\n $passengerAge = $passengerAge < 10 ? '0'.$passengerAge : $passengerAge;\n\n $passName = strtoupper(trim($passenger->passengerName));\n $passNameArr = explode (\" \", $passName);\n\n if(count($passNameArr) == 1) {\n $surname = $passName;\n $givenName = $passName;\n } else {\n $givenName = array_shift($passNameArr);\n if(count($passNameArr) > 0) {\n $surname = implode(\"\", $passNameArr);\n } else {\n $surname = $givenName;\n }\n }\n\n $remarksPassenger .= \"Name : \".$givenName. \" \".$surname;\n $remarksPassenger .= \"; Passport No : \".$passenger->passengerPassportNo.\", Passport Expiry Date: \". $passenger->passengerPassportExpiryDate.\";\";\n\n\n\n /*$givenName = strtoupper(trim($passenger->passenger_givenname));\n $surname = strtoupper(trim($passenger->passenger_surname));\n $arrGN = explode(\" \", $givenName);\n if (count($arrGN)) {\n $givenName = implode(\"\", $arrGN);\n }\n $arrSN = explode(\" \", $surname);\n if (count($arrSN)) {\n $surname = implode(\"\", $arrSN);\n }*/\n\n /* get country code of passport and citizenship */\n $nationalitycountryCode = \"\";\n $passissuecountryCode = \"\";\n $connection = mysqli_connect(DB_LOCALHOST, DB_USERNAME, DB_PASSWORD, DB_NAME);\n\n //query mysql\n $queryRes = mysqli_query(\n $connection,\n \"\n SELECT * FROM country WHERE country_name = '\".$passenger->passengerPassportIssueCountry.\"' LIMIT 0,1\n \"\n );\n if( mysqli_num_rows($queryRes) > 0 ) {\n $queryRow = mysqli_fetch_array($queryRes, MYSQL_ASSOC);\n $nationalitycountryCode = $queryRow[\"country_code\"];\n }\n\n //query mysql\n $queryRes = mysqli_query(\n $connection,\n \"\n SELECT * FROM country WHERE country_name = '\".$passenger->passengerNationality.\"' LIMIT 0,1\n \"\n );\n if( mysqli_num_rows($queryRes) > 0 ) {\n $queryRow = mysqli_fetch_array($queryRes, MYSQL_ASSOC);\n $passissuecountryCode = $queryRow[\"country_code\"];\n }\n /* END */\n\n $gender = strtolower($passenger->passengerTitle) == 'mr' || strtolower($passenger->passengerTitle) == 'master' || strtolower($passenger->passengerTitle) == 'mstr' ? 'M' : 'F';\n\n\n switch($passenger->passengerType) {\n case 'ADULT' :\n $passengerRemarksInfo.= '<Remark Code=\"H\" SegmentNumber=\"A\" Type=\"General\">\n <Text>'.($passenger->passenger_remarks != ''? $passenger->passenger_remarks.'-'.$counter_number.'.1' : 'No Remarks').'</Text>\n </Remark>';\n\n if ($tempIPNN == '') {\n $tempIPNN = $counter_number.'.1';\n $infantParentNameNumber = $tempIPNN;\n }\n /* get contact person country phone code based nationality */\n /*$queryRes = mysqli_query(\n $connection,\n \"\n SELECT * FROM countries WHERE nicename = '\".$contactPerson_nationality.\"' LIMIT 0,1\n \"\n );\n if( mysqli_num_rows($queryRes) > 0 ) {\n $queryRow = mysqli_fetch_array($queryRes, MYSQL_ASSOC);\n $phoneCodeArea = $queryRow[\"phonecode\"];\n }*/\n\n $specialServicePassengerInfo .= '<AdvancePassenger SegmentNumber=\"A\">\n <Document ExpirationDate=\"'.$passenger->passengerPassportExpiryDate.'\" Number=\"'.$passenger->passengerPassportNo.'\" Type=\"P\">\n <IssueCountry>'.$passissuecountryCode.'</IssueCountry>\n <NationalityCountry>'.$nationalitycountryCode.'</NationalityCountry>\n </Document>\n <PersonName DateOfBirth=\"'.$dob.'\" Gender=\"'.$gender.'\" NameNumber=\"'.$counter_number.'.1\" DocumentHolder=\"true\">\n <GivenName>'.$givenName.$psgTitle.'</GivenName>';\n /*if($middleName != \"\") {\n $specialServicePassengerInfo .= '<MiddleName>'.$middleName.'</MiddleName>';\n }*/\n $specialServicePassengerInfo .= '<Surname>'.$surname.'</Surname>\n </PersonName>\n </AdvancePassenger>';\n $secureServicePassengerInfo .= '<SecureFlight SegmentNumber=\"A\">\n <PersonName DateOfBirth=\"'.$dob.'\" Gender=\"'.$gender.'\" NameNumber=\"'.$counter_number.'.1\">\n <GivenName>'.$givenName.'</GivenName>\n <Surname>'.$surname.'</Surname>\n </PersonName>\n <VendorPrefs>\n <Airline Hosted=\"false\"/>\n </VendorPrefs>\n </SecureFlight>';\n\n /*$serviceAdultInfo .= '\n <Service SSR_Code=\"OSI\" >\n <PersonName NameNumber=\"'.$counter_number.'.1\" />\n <Text>PASSENGER NAME SHOULD BE '.$surname.'/'.$givenName.' '.$psgTitle.'</Text>\n\n <VendorPrefs>\n <Airline Code=\"'.$flgCode.'\" Hosted=\"false\"/>\n </VendorPrefs>\n </Service>';*/\n\n $phoneNumber = preg_replace('/[^0-9]/','',$contactPerson_phone);\n\n if(strlen($phoneNumber) > 10) {\n $countryCode = substr($phoneNumber, 0, strlen($phoneNumber)-10);\n $areaCode = substr($phoneNumber, -10, 3);\n $nextThree = substr($phoneNumber, -7, 3);\n $lastFour = substr($phoneNumber, -4, 4);\n\n $phoneNumber = $areaCode.$nextThree.'-'.$lastFour;\n }\n else if(strlen($phoneNumber) == 10) {\n $areaCode = substr($phoneNumber, 0, 3);\n $nextThree = substr($phoneNumber, 3, 3);\n $lastFour = substr($phoneNumber, 6, 4);\n\n $phoneNumber = $areaCode.$nextThree.'-'.$lastFour;\n }\n else if(strlen($phoneNumber) > 7 && strlen($phoneNumber) < 10) {\n $nextThree = substr($phoneNumber, 0, 3);\n $lastFour = substr($phoneNumber, 3, 5);\n\n $phoneNumber = $nextThree.'-'.$lastFour;\n }\n else if(strlen($phoneNumber) == 7) {\n $nextThree = substr($phoneNumber, 0, 3);\n $lastFour = substr($phoneNumber, 3, 4);\n\n $phoneNumber = $nextThree.'-'.$lastFour;\n }\n\n /*$contactNumberInfo .= '<ContactNumber NameNumber=\"'.$counter_number.'.1\" Phone=\"9 '.$phoneNumber.' '.$passenger->passengerTitle.' '.$givenName.' '.$surname.'\" PhoneUseType=\"H\" />';*/\n $contactNumberInfo .= '<ContactNumber NameNumber=\"'.$counter_number.'.1\" Phone=\"'.$phoneNumber.'\" PhoneUseType=\"H\" />';\n $contactEmailInfo = '<Email Address=\"'.$contactPerson_email.'\" NameNumber=\"'.$counter_number.'.1\" ShortText=\"CTC Ticket\" Type=\"BC\"></Email>';\n $personInfo .= '<PersonName '.$isInfant.' NameNumber=\"'.$counter_number.'.1\" PassengerType=\"'.$pdtype.'\">\n <GivenName>'.$givenName.$psgTitle.'</GivenName>\n <Surname>'.$surname.'</Surname>\n </PersonName>';\n\n break;\n case 'CHILD' :\n $passengerRemarksInfo.= '<Remark Code=\"H\" SegmentNumber=\"A\" Type=\"General\">\n <Text>'.($passenger->passenger_remarks != ''? $passenger->passenger_remarks.'-'.$counter_number.'.1' : 'No Remarks').'</Text>\n </Remark>';\n\n $pdtype = 'CNN';//CNN\n $nameRef = 'NameReference=\"C'.$passengerAge.'\"';\n $specialServicePassengerInfo .= '<AdvancePassenger SegmentNumber=\"A\">\n <Document ExpirationDate=\"'.$passenger->passengerPassportExpiryDate.'\" Number=\"'.$passenger->passengerPassportNo.'\" Type=\"P\">\n <IssueCountry>'.$passissuecountryCode.'</IssueCountry>\n <NationalityCountry>'.$nationalitycountryCode.'</NationalityCountry>\n </Document>\n <PersonName DateOfBirth=\"'.$dob.'\" Gender=\"'.$gender.'\" NameNumber=\"'.$counter_number.'.1\" >\n <GivenName>'.$givenName.$psgTitle.'</GivenName>';\n /*if($middleName != \"\") {\n $specialServicePassengerInfo .= '<MiddleName>'.$middleName.'</MiddleName>';\n }*/\n $specialServicePassengerInfo .= '<Surname>'.$surname.'</Surname>\n </PersonName>\n </AdvancePassenger>';\n $secureServicePassengerInfo .= '<SecureFlight SegmentNumber=\"A\" >\n <PersonName DateOfBirth=\"'.$dob.'\" Gender=\"'.$gender.'\" NameNumber=\"'.$counter_number.'.1\">\n <GivenName>'.$givenName.'</GivenName>\n <Surname>'.$surname.'</Surname>\n </PersonName>\n <VendorPrefs>\n <Airline Hosted=\"false\"/></VendorPrefs>\n </SecureFlight>';\n $serviceChildrenInfo .=\n /*<Service SSR_Code=\"CHLD\" >\n <PersonName NameNumber=\"'.$counter_number.'.1\" />\n <Text>'.strtoupper(date(\"dMy\", strtotime($dob))).'</Text>\n </Service>';\n <Service SSR_Code=\"OSI\" >\n <PersonName NameNumber=\"'.$counter_number.'.1\" />\n <Text>PASSENGER NAME SHOULD BE '.$surname.'/'.$givenName.' '.$psgTitle.'</Text>\n <VendorPrefs>\n <Airline Code=\"'.$flightCode.'\" />\n </VendorPrefs>\n </Service>\n */\n\n /*<Service SSR_Code=\"OSI\">\n <PersonName NameNumber=\"'.$counter_number.'.1\" />\n <Text>PASSENGER NAME SHOULD BE '.$surname.'/'.$givenName.' '.$psgTitle.'</Text>\n\n <VendorPrefs>\n <Airline Code=\"'.$flgCode.'\" Hosted=\"false\"/>\n </VendorPrefs>\n </Service>*/\n '\n <Service SSR_Code=\"CHLD\" SegmentNumber=\"A\">\n <PersonName NameNumber=\"'.$counter_number.'.1\" />\n <Text>'.strtoupper(date(\"dMy\", strtotime($dob))).'</Text>\n <VendorPrefs>\n <Airline Hosted=\"false\" />\n </VendorPrefs>\n </Service>\n ';\n\n $personInfo .= '<PersonName '.$isInfant.' NameNumber=\"'.$counter_number.'.1\" PassengerType=\"'.$pdtype.'\" '.$nameRef.'>\n <GivenName>'.$givenName.$psgTitle.'</GivenName>\n <Surname>'.$surname.'</Surname>\n </PersonName>';\n\n break;\n case 'INFANT' :\n $passengerRemarksInfo.= '<Remark Code=\"H\" SegmentNumber=\"A\" Type=\"General\">\n <Text>'.($passenger->passenger_remarks != ''? $passenger->passenger_remarks .'-'.$counter_number.'.1' : 'No Remarks').'</Text>\n </Remark>';\n\n $pdtype = 'INF';\n $isInfant = 'Infant=\"true\"';\n $passengerAge = $passengerAge == \"00\" ? \"01\" : $passengerAge;\n $nameRef = 'NameReference=\"I'.$passengerAge.'\"';\n $gender = strtolower($passenger->passengerTitle) == 'mr' || strtolower($passenger->passengerTitle) == 'master' ? 'MI' : 'FI';\n $specialServicePassengerInfo .= '<AdvancePassenger SegmentNumber=\"A\">\n <Document ExpirationDate=\"'.$passenger->passengerPassportExpiryDate.'\" Number=\"'.$passenger->passengerPassportNo.'\" Type=\"P\">\n <IssueCountry>'.$passissuecountryCode.'</IssueCountry>\n <NationalityCountry>'.$nationalitycountryCode.'</NationalityCountry>\n </Document>\n <PersonName DateOfBirth=\"'.$dob.'\" Gender=\"'.$gender.'\" NameNumber=\"'.$infantParentNameNumber.'\" >\n <GivenName>'.$givenName.$psgTitle.'</GivenName>';\n /*if($middleName != \"\") {\n $specialServicePassengerInfo .= '<MiddleName>'.$middleName.'</MiddleName>';\n }*/\n $specialServicePassengerInfo .= '<Surname>'.$surname.'</Surname>\n </PersonName>\n </AdvancePassenger>';\n $secureServicePassengerInfo .= '<SecureFlight SegmentNumber=\"A\" >\n <PersonName DateOfBirth=\"'.$dob.'\" Gender=\"'.$gender.'\" NameNumber=\"'.$infantParentNameNumber.'\">\n <GivenName>'.$givenName.'</GivenName>\n <Surname>'.$surname.'</Surname>\n </PersonName>\n <VendorPrefs>\n <Airline Hosted=\"false\"/></VendorPrefs>\n </SecureFlight>';\n\n /*<Service SSR_Code=\"OSI\" >\n <PersonName NameNumber=\"'.$counter_number.'.1\" />\n <Text>PASSENGER NAME SHOULD BE '.$surname.'/'.$givenName.' '.$psgTitle.'</Text>\n <VendorPrefs>\n <Airline Code=\"'.$flgCode.'\" Hosted=\"false\"/>\n </VendorPrefs>\n </Service>*/\n\n /*\n <Service SSR_Code=\"OSI\" >\n <PersonName NameNumber=\"'.$infantParentNameNumber.'\" />\n <Text>PASSENGER NAME SHOULD BE '.$surname.'/'.$givenName.' '.$psgTitle.'</Text>\n\n <VendorPrefs>\n <Airline Code=\"'.$flgCode.'\" Hosted=\"false\"/>\n </VendorPrefs>\n </Service>*/\n\n $serviceInfantInfo .= '\n <Service SegmentNumber=\"A\" SSR_Code=\"INFT\">\n <PersonName NameNumber=\"'.$infantParentNameNumber.'\" />\n <Text>'.strtoupper($surname).'/'.strtoupper($givenName).' '.$psgTitle.'/'.strtoupper(date(\"dMy\", strtotime($dob))).'</Text>\n <VendorPrefs>\n <Airline Hosted=\"false\" />\n </VendorPrefs>\n </Service>';\n\n $personInfo .= '<PersonName '.$isInfant.' NameNumber=\"'.$counter_number.'.1\" PassengerType=\"'.$pdtype.'\" '.$nameRef.'>\n <GivenName>'.$givenName.$psgTitle.'</GivenName>\n <Surname>'.$surname.'</Surname>\n </PersonName>';\n break;\n case 'STUDENT' :\n break;\n case 'AGENT' :\n break;\n case 'TOURS' :\n break;\n case 'MILITARY' :\n break;\n default : break;\n }\n $counter_number++;\n }\n\n $specialServicePassengerInfo .= $secureServicePassengerInfo . $serviceAdultInfo . $serviceChildrenInfo . $serviceInfantInfo;\n\n //EndTransaction Ind=false to return no PNR\n $PDBookRQ = '<PassengerDetailsRQ xmlns=\"http://services.sabre.com/sp/pd/v3_3\" version=\"3.3.0\" IgnoreOnError=\"false\" HaltOnError=\"true\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n <PostProcessing IgnoreAfter=\"false\" RedisplayReservation=\"true\" UnmaskCreditCard=\"true\" xmlns=\"http://services.sabre.com/sp/pd/v3_3\">\n <EndTransactionRQ>\n <EndTransaction Ind=\"true\" />\n <Source ReceivedFrom=\"CTC TRAVEL\"/>\n </EndTransactionRQ>\n </PostProcessing>\n <PreProcessing xmlns=\"http://services.sabre.com/sp/pd/v3_3\" IgnoreBefore=\"false\">\n <UniqueID ID=\"\" />\n </PreProcessing>\n <PriceQuoteInfo>\n '.$priceQuoteInfo.'\n </PriceQuoteInfo>\n <SpecialReqDetails>\n <AddRemarkRQ>\n <RemarkInfo>\n '.$passengerRemarksInfo.'\n </RemarkInfo>\n </AddRemarkRQ>\n <SpecialServiceRQ>\n <SpecialServiceInfo>\n '.$specialServicePassengerInfo.'\n </SpecialServiceInfo>\n </SpecialServiceRQ>\n </SpecialReqDetails>\n <TravelItineraryAddInfoRQ xmlns=\"http://services.sabre.com/sp/pd/v3_3\">\n <AgencyInfo>\n <Address>\n <AddressLine>COMMONWEALTH TRAVEL SERVICE CORPORATION PTE LTD</AddressLine>\n <CityName>CHINATOWN POINT, SINGAPORE</CityName>\n <CountryCode>SG</CountryCode>\n <PostalCode>059413</PostalCode>\n <StreetNmbr>133 NEW BRIDGE ROAD 03-03</StreetNmbr>\n </Address>\n <Ticketing TicketType=\"7TAW\"/>\n </AgencyInfo>\n <CustomerInfo>\n <ContactNumbers>\n '.$contactNumberInfo.'\n </ContactNumbers>\n '.$contactEmailInfo.'\n '.$personInfo.'\n </CustomerInfo>\n </TravelItineraryAddInfoRQ>\n </PassengerDetailsRQ>';\n /* end PD true */\n //$xml = $service->Execute(\"PassengerDetailsRQ\",$PDBookRQ, 'OTA', 'Air');\n\n $xml = $service->Execute(\"PassengerDetailsRQ\",$PDBookRQ, 'OTA', 'Air');\n /*\n echo '1<br>';\n echo '<xmp>'.$EnhancedAirBookRQ.'</xmp>';\n echo '<xmp>'.$PDBookRQ.'</xmp>';\n if( $xml ) {\n $parseResult = simplexml_load_string($xml);\n $arrayFinal = json_decode(json_encode($parseResult), true);\n var_dump($arrayFinal);\n } else {\n echo htmlspecialchars($service->error);\n }\n die();*/\n\n if( $xml ) {\n $parseResult = simplexml_load_string($xml);\n $arrayFinal = json_decode(json_encode($parseResult), true);\n\n $countAF = count($arrayFinal);\n /*\n echo $xml;\n echo '<pre>';\n var_dump($parseResult);\n var_dump($arrayFinal);\n */\n\n $txt = \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][PD] Output \". print_r($arrayFinal, true);\n $txt .= \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][PD] XML \". $xml;\n\n //log file\n $myfile = fopen(sinstanceurl.\"assets/api-logs/logs.txt\", \"a\") or die(\"Unable to open file!\");\n // $txt = \"[\".date(\"Y-m-d H:i:s\").\"] - \".$output;\n fwrite($myfile, \"\\n\". $txt);\n fclose($myfile);\n\n return $countAF && array_key_exists('ItineraryRef', $arrayFinal) ? $arrayFinal['ItineraryRef']['@attributes']['ID'] : 'error';\n } else {\n $txt = \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][EAB1] \". htmlspecialchars($service->error);\n //log file\n $myfile = fopen(sinstanceurl.\"assets/api-logs/logs.txt\", \"a\") or die(\"Unable to open file!\");\n // $txt = \"[\".date(\"Y-m-d H:i:s\").\"] - \".$output;\n fwrite($myfile, \"\\n\". $txt);\n fclose($myfile);\n return false;\n }\n } else {\n $txt = \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][PD] No Passenger Details\";\n\n //log file\n $myfile = fopen(sinstanceurl.\"assets/api-logs/logs.txt\", \"a\") or die(\"Unable to open file!\");\n // $txt = \"[\".date(\"Y-m-d H:i:s\").\"] - \".$output;\n fwrite($myfile, \"\\n\". $txt);\n fclose($myfile);\n return 'error';\n }\n }\n else {\n $txt = \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][PD-2]\". htmlspecialchars($service->error);\n\n //log file\n $myfile = fopen(sinstanceurl.\"assets/api-logs/logs.txt\", \"a\") or die(\"Unable to open file!\");\n // $txt = \"[\".date(\"Y-m-d H:i:s\").\"] - \".$output;\n fwrite($myfile, \"\\n\". $txt);\n fclose($myfile);\n return 'error';\n }\n }\n else {\n $txt = \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][EAB3] \". htmlspecialchars($service->error);\n //log file\n $myfile = fopen(sinstanceurl.\"assets/api-logs/logs.txt\", \"a\") or die(\"Unable to open file!\");\n // $txt = \"[\".date(\"Y-m-d H:i:s\").\"] - \".$output;\n fwrite($myfile, \"\\n\". $txt);\n fclose($myfile);\n return false;\n }\n }\n else {\n $txt = \"[\".date(\"Y-m-d H:i:s\").\"] [Multi-PD][EAB4] \". htmlspecialchars($service->error);\n //log file\n $myfile = fopen(sinstanceurl.\"assets/api-logs/logs.txt\", \"a\") or die(\"Unable to open file!\");\n // $txt = \"[\".date(\"Y-m-d H:i:s\").\"] - \".$output;\n fwrite($myfile, \"\\n\". $txt);\n fclose($myfile);\n return false;\n //echo '4 - '.htmlspecialchars($service->error);\n }\n\n\n}",
"static function add_fare_details(& $flight_data) {\r\n\t\tif (isset ( $flight_data ['fare'] ) && valid_array ( $flight_data ['fare'] )) {\r\n\t\t\t$api_total_display_fare = 0;\r\n\t\t\t$api_total_tax = 0;\r\n\t\t\t$api_total_fare = 0;\r\n\t\t\t$total_meal_and_baggage = 0;\r\n\t\t\t$price_breakup = array ();\r\n\t\t\t\r\n\t\t\tforeach ( $flight_data ['fare'] as $_f_key => $__fare ) {\r\n\t\t\t\t$api_total_display_fare += $__fare ['api_total_display_fare'];\r\n\t\t\t\t$api_total_tax += $__fare ['total_breakup'] ['api_total_tax'];\r\n\t\t\t\t$api_total_fare += $__fare ['total_breakup'] ['api_total_fare'];\r\n\t\t\t\t\r\n\t\t\t\tif (isset ( $__fare ['total_breakup'] ['meal_and_baggage_fare'] )) {\r\n\t\t\t\t\t$total_meal_and_baggage += $__fare ['total_breakup'] ['meal_and_baggage_fare'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tforeach ( $__fare ['price_breakup'] as $p_key => $breakup ) {\r\n\t\t\t\t\tif (isset ( $price_breakup [$p_key] ) == false) {\r\n\t\t\t\t\t\t$price_breakup [$p_key] = $breakup;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$price_breakup [$p_key] += $breakup;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$flight_data ['price'] ['api_currency'] = $__fare ['api_currency'];\r\n\t\t\t$flight_data ['price'] ['api_total_display_fare'] = $api_total_display_fare;\r\n\t\t\t$flight_data ['price'] ['total_breakup'] ['api_total_tax'] = $api_total_tax;\r\n\t\t\t$flight_data ['price'] ['total_breakup'] ['api_total_fare'] = $api_total_fare;\r\n\t\t\t$flight_data ['price'] ['total_breakup'] ['meal_and_baggage_fare'] = $total_meal_and_baggage;\r\n\t\t\t$flight_data ['price'] ['price_breakup'] = $price_breakup;\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add block button form. | function counterfield_add_block_form() {
$form['add'] = array(
'#value' => t('Add'),
'#type' => 'submit',
);
$form['#redirect'] = 'admin/settings/counterfield/add';
return $form;
} | [
"function print_add_button() {\n if (!$this->can_do('add')) {\n return;\n }\n\n $obj = $this->get_new_data_object();\n\n echo '<div align=\"center\">';\n $options = array('s' => $this->pagename, 'action' => 'add');\n $parent = $this->optional_param('id', 0, PARAM_INT);\n if ($parent) {\n $options['parent'] = $parent;\n }\n // FIXME: change to language string\n echo print_single_button('index.php', $options, get_string('add','block_curr_admin').' ' . get_string($obj->get_verbose_name(),'block_curr_admin'), 'get', '_self', true, get_string('add','block_curr_admin').' ' . get_string($obj->get_verbose_name(),'block_curr_admin'));\n echo '</div>';\n }",
"public function addFormButton()\n {\n global $current_screen;\n\n if (\n ($current_screen->base != 'post' && $current_screen->base != 'widgets') ||\n (wp_count_posts(self::FORM_SLUG)->publish == 0)\n ) {\n return;\n }\n\n $config = '&name=Formular&plural=Formulare&posttype=lbwp-form&code=lbwp:formular';\n $link = File::getViewsUri() . '/module/general/add.php?body_id=media-upload' . $config . '&TB_iframe=1';\n\n echo '\n <a href=\"' . $link . '\" id=\"add-form\" title=\"Formular einfügen\"\n class=\"thickbox button dashicons-before dashicon-big dashicons-welcome-widgets-menus\"></a>\n ';\n }",
"public function getAdd()\n {\n $form_options = array (\n 'action' => 'Nijibelle\\Blocks\\BlocksController@postBlocks',\n 'class' => 'form-signup',\n 'files' => true\n );\n\n\t\t$this->layout->content = \\View::make('blocks::addBlock')->with('form_options',$form_options);\t\n }",
"function register_block_glutenblocks_button() {\n register_block_type(\n 'glutenblocks/button',\n [\n 'style' => 'glutenblocks-style',\n 'editor_script' => 'glutenblocks',\n 'editor_style' => 'glutenblocks-editor',\n 'render_callback' => 'glutenblocks_button_render_callback'\n ]\n );\n}",
"public function blockAddAction()\n {\n $setTable = $this->_tblViewingSeq->getSetTableForAdding();\n if ( ! $setTable->supportsBlockEntry() )\n {\n $this->view->errMsgs[] =\n \"The \" . $setTable->getSettingName() . \" setting does \" .\n \"not have the required \" . self::BLOCK_ENTRY . \" property.\";\n }\n\n // Let view renderer know the table and data sets to use.\n $this->view->buttonList = array(\n $this->adapter->translate(self::SAVE),\n $this->adapter->translate(self::RESET_BUTTON),\n $this->adapter->translate(self::CANCEL),\n $this->adapter->translate(self::SEARCH)\n );\n\n $this->_multiRecordInitDisplayWithoutData($setTable);\n\n // Get full data set and split into shared/different fields.\n $fullDataSet = $setTable->getTableEntries($this->_fieldsToMatch,\n $this->_matchComparators,\n $this->_searchType);\n $dataSplit = $this->_getSplitData($setTable, $fullDataSet);\n $sharedData = $dataSplit[self::SAME];\n $differentFields = $dataSplit[self::DIFFERENT];\n\n // Get settings for shared and entry data (needed for initial\n // display and callbacks).\n $sharedViewSetting = $this->_createSharedView($setTable, $sharedData,\n $differentFields);\n $entryField = $setTable->getBlockEntryField();\n $entrySetting = $this->view->entrySetting =\n $setTable->createSingleFieldSubset($entryField);\n\n // Create forms for block data entry. (Fatal error if the setting\n // has any required fields other than the block entry field that\n // are not already populated.)\n $badReqFields = $this->_allRequiredFieldsOK($setTable, $sharedData,\n $entryField);\n $this->view->entryForms = array();\n if ( empty($badReqFields) )\n {\n $count = $setTable->getBlockEntryCount();\n for ( $i = 0; $i < $count; $i++ )\n {\n $form = $this->view->entryForms[] =\n $this->_getForm($entrySetting, $this->adapter->translate(self::ADD), true, \"_\" . $i);\n }\n }\n else\n {\n $this->view->errMsgs[] = \"Cannot do block entry. \" .\n \"Have too many values for required field(s): $badReqFields.\";\n }\n\n // Is this the initial display or the callback with fields provided?\n if ( $this->_thisIsInitialDisplay() )\n {\n // Get setting and data for summary display area.\n $differentViewSetting = $this->_createDifferentView($setTable,\n $fullDataSet, $sharedData);\n }\n elseif ( $this->_submittedButton == $this->adapter->translate(self::SAVE) )\n {\n // Get the new entry fields from the posted data.\n $formData = $this->getRequest()->getPost();\n unset($formData[self::SUBMIT_BUTTON]);\n $rawEntryData = array_diff_key($formData,\n $sharedViewSetting->getRelevantFields());\n\n // Determine shared field values to include.\n $localFields = $sharedViewSetting->getLocalRelevantFields();\n unset($localFields[$entryField]);\n $relevantSharedData =\n array_intersect_key($sharedData, $localFields);\n $this->view->stuff[] = $relevantSharedData;\n\n // Transform unstructured entry fields into records.\n $allRecords = array();\n foreach ( $rawEntryData as $encodedName => $data )\n {\n $recordIndicator = substr(strrchr($encodedName, '_'), 1);\n $fieldName = substr($encodedName, 0, strlen($encodedName) -\n strlen($recordIndicator) - 1);\n if ( $fieldName == $entryField && $data != null )\n {\n $allRecords[$recordIndicator] = $relevantSharedData;\n $allRecords[$recordIndicator][$entryField] = $data;\n }\n }\n\n // Insert the new records into the database.\n foreach ( $allRecords as $recordEntryData )\n {\n $setTable->addTableEntry($recordEntryData);\n }\n\n $this->_goTo('block-add', $this->_fieldsToMatch);\n }\n\n /*\n // Where does the isValid check go? And which form are we checking?\n if ( $entryForm[$i]->isValid($formData)\n {\n\n }\n else\n {\n // Get setting and data for summary display area.\n $differentViewSetting = $this->_createDifferentView($setTable,\n $fullDataSet, $sharedData);\n\n // Invalid entries: show them for editing.\n $this->view->errMsgs[] =\n \"Invalid data values. Please correct.\";\n $form->populate($formData);\n }\n */\n\n elseif ( $this->_submittedButton == $this->adapter->translate(self::CANCEL) )\n { $this->_goTo('split-view', $this->_fieldsToMatch); }\n else\n { $this->_goTo($this->_getButtonAction($this->_submittedButton)); }\n\n }",
"function dvbanner_block_add_submit ($form_id, $form_values) {\n $delta = db_next_id ('{dvbanner_block}_delta');\n \n db_query (\n \"INSERT INTO {dvbanner_block} (delta, type, title, data) VALUES (%d, '%s', '%s', '%s')\", \n $delta, $form_values['type'], $form_values['title'], serialize (array ('limitation' => 1))\n );\n \n // Thông báo: đã tạo bannner block thành công\n drupal_set_message (t(\n \"Created banner block <strong>!title</strong>\", \n array ('!title' => check_plain ($form_values['title']))\n ));\n \n // redirect to block setting form\n drupal_goto ('admin/build/block/configure/dvbanner/' . $delta, 'destination=admin/build/block/dvbanner');\n}",
"public function actionCreate()\n\t{ \n\t\t$this->render('block_create');\n\t}",
"public function blockFormAction()\n {\n $block = new ExhibitPageBlock;\n $block->layout = $this->getParam('layout');\n $block->order = $this->getParam('order');\n\n $this->view->block = $block;\n }",
"public function btn_onclick_add_new_ip_blocklist($e){\r\n\t\t \treturn $this->module_btn_onclick_add_new_ip_blocklist($e);\r\n\t\t }",
"function _twitter_filter_words_add_block($form, &$form_state) {\n module_load_include('inc', 'block', 'block.admin');\n $form = block_admin_configure($form, $form_state, 'twitter_filter_words', NULL);\n\n $form['#validate'] = array('_twitter_filter_words_add_block_validate');\n $form['#submit'] = array('_twitter_filter_words_add_block_submit');\n\n return $form;\n}",
"function enqueue_block_editor_assets__button_block_script() {\n\twp_enqueue_script(\n\t\t'ubc-button-block-script',\n\t\tplugins_url( 'js/block.js', __FILE__ ),\n\t\tarray( 'wp-blocks' )\n\t);\n}",
"function block_skinChooser(){\n //Show first part\n echo '<form action=\"php/profile/form_skinChooser.php\" method=\"post\" id=\"columnBack\">';\n echo '<h1 class=\"title is-4\">- Custom skin chooser -</h1>';\n showSuccess(2);\n\n block_skinChooser_body();\n \n //Show last part\n echo <<<EOF\n <br>\n <br>\n <input type=\"submit\" value=\"Save all modifications\" class=\"button is-light\"/>\n </form>\nEOF;\n}",
"public function addButton()\n {\n $tag_generator = WPCF7_TagGenerator::get_instance();\n $tag_generator->add(\n 'images-optimize-upload',\n 'optimize & upload',\n [$this, 'template']\n );\n }",
"public function addBlockToPage()\n {\n try {\n $this->setHeader();\n $data = json_decode(file_get_contents(\"php://input\"));\n $block = new BlockModel();\n $block->name = $data->name;\n if (isset($data->content)) {\n $block->content = $data->content;\n } else {\n $block->content = \"\";\n }\n $block->pageId = $data->pageId;\n\n $maxOrderBlock = BlockModel::getMaxOrderBlock($data->pageId);\n if($data->orderBlock <= $maxOrderBlock) {\n $block->orderBlock = $maxOrderBlock[0][\"MAX(orderBlock)\"] + 1;\n } else {\n $block->orderBlock = $data->orderBlock;\n }\n\n $block->idBlockType = $data->idBlockType;\n if (isset($data->idParent)) {\n $block->idParent = $data->idParent;\n } else {\n $block->idParent = null;\n }\n if (isset($data->idColumn)) {\n $block->idColumn = $data->idColumn;\n } else {\n $block->idColumn = null;\n }\n if (isset($data->styleBlock)) {\n $block->styleBlock = $data->styleBlock;\n } else {\n $block->styleBlock = null;\n }\n $targetPage = PageModel::findById($data->pageId);\n if (empty($targetPage)) {\n http_response_code(404);\n echo json_encode(array(\"message\" => \"The page you are trying to add a block on does not exists. Block not added to base.\"));\n } else {\n BlockModel::save($block);\n $id = BlockModel::findByName($block->name)[0]->id;\n http_response_code(200);\n echo json_encode(array(\n \"message\" => \"Block succesfully added to base\",\n \"id\" => $id\n ));\n }\n } catch (Exception $e) {\n http_response_code(412);\n echo json_encode(array(\"message\" => $e));\n }\n }",
"public function block()\n {\n // Add class to attributes array\n $this->currentButton['attributes'] = Helpers::add_class($this->currentButton['attributes'], 'btn-block');\n\n return $this;\n }",
"public function initFormFeedBlock($a_mode)\n\t{\n\t\tglobal $lng;\n\t\t\n\t\t$lng->loadLanguageModule(\"block\");\n\t\t\n\t\tinclude(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t\n\t\t$this->form_gui = new ilPropertyFormGUI();\n\t\t\n\t\t// Property Title\n\t\t$text_input = new ilTextInputGUI($lng->txt(\"block_feed_block_title\"), \"block_title\");\n\t\t$text_input->setInfo(\"\");\n\t\t$text_input->setRequired(true);\n\t\t$text_input->setMaxLength(200);\n\t\t$this->form_gui->addItem($text_input);\n\t\t\n\t\t// Property FeedUrl\n\t\t$text_input = new ilFeedUrlInputGUI($lng->txt(\"block_feed_block_feed_url\"), \"block_feed_url\");\n\t\t$text_input->setInfo($lng->txt(\"block_feed_block_feed_url_info\"));\n\t\t$text_input->setRequired(true);\n\t\t$text_input->setMaxLength(250);\n\t\t$this->form_gui->addItem($text_input);\n\t\t\n\t\t\n\t\t// save and cancel commands\n\t\tif (in_array($a_mode, array(IL_FORM_CREATE,IL_FORM_RE_CREATE)))\n\t\t{\n\t\t\t$this->form_gui->addCommandButton(\"saveFeedBlock\", $lng->txt(\"save\"));\n\t\t\t$this->form_gui->addCommandButton(\"cancelSaveFeedBlock\", $lng->txt(\"cancel\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_gui->addCommandButton(\"updateFeedBlock\", $lng->txt(\"save\"));\n\t\t\t$this->form_gui->addCommandButton(\"cancelUpdateFeedBlock\", $lng->txt(\"cancel\"));\n\t\t}\n\t\t\n\t\t$this->form_gui->setTitle($lng->txt(\"block_feed_block_head\"));\n\t\t$this->form_gui->setFormAction($this->ctrl->getFormAction($this));\n\t\t\n\t\t$this->prepareFormFeedBlock($this->form_gui);\n\n\t}",
"public function admin_new_ad_block_page()\n\t{\n\t\t// set up the vars\n\t\t$vars = $this->_get_template_vars( 'ad_block' );\n\t\textract( $vars );\n\n\t\t// get the view\n\t\t$tpl_path = dirname(__DIR__) . '/views/edit_ad_block.php';\n\t\tinclude( $tpl_path );\n\t}",
"function _totem_common_block_view_button_add_type($delta, $context) {\n\n global $user;\n\n if (!empty($context)) {\n $type = $context[0];\n $verb = $context[1];\n\n $text = t('@verb @label', array('@verb' => t($verb), '@label' => t($type->name)));\n $path = 'community/add/' . $type->path;\n if ($node = _totem_common_get_community_context_node()) {\n $path .= '/' . $node->nid;\n }\n\n // Check that user is allowed to add a node in this context.\n if (node_access('create', $type->type, $user)) {\n $link = _totem_common_modal_link(array(\n 'text' => $text,\n 'path' => $path,\n 'class' => array('btn', 'corners', 'add-' . drupal_html_class($type->type)),\n ));\n\n $block = array(\n 'content' => array(\n '#entity_type' => $type->type,\n '#type' => 'markup',\n '#markup' => $link,\n '#classes_array' => array('button-type', 'action', 'action-' . drupal_html_class($type->type)),\n ),\n );\n\n // Allow modules to alter this block.\n // Prefer this approach to hook_block_view_alter, as this view callback\n // could be triggered from a number of different unknown $deltas.\n drupal_alter('block_view_totem_common_button_add_type', $block);\n\n return $block;\n }\n }\n}",
"function tombolCreate(){\r\n\t\tif(getPermission()){\r\n\t\t\tif(getPermission()->BTN_CREATE==1){\r\n\t\t\t\t$title1 = Yii::t('app', ' Add');\r\n\t\t\t\t$url = Url::toRoute(['/warehouse/header-receive/create']);\r\n\t\t\t\t$options1 = ['value'=>$url,\r\n\t\t\t\t\t\t\t'id'=>'wh-tab1-receive-button-create',\r\n\t\t\t\t\t\t\t'class'=>\"btn btn-danger btn-sm\" \r\n\t\t\t\t];\r\n\t\t\t\t$icon1 = '<span class=\"fa fa-download fa-lg\"></span>';\r\n\t\t\t\t$label1 = $icon1 . ' ' . $title1;\r\n\t\t\t\t$content = Html::button($label1,$options1);\r\n\t\t\t\treturn $content;\r\n\t\t\t}\r\n\t\t}\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get spending stats for period | public function getSpendingsForPeriod($statsPeriod = '7days') {
// Period
if ($statsPeriod == '7days') {
$from = now()->addDays(-7);
$to = now();
$fromPrevious = now()->addDays(-15);
$toPrevious = now()->addDays(-8);
}
// Customer signups for current period
$period = new \DatePeriod( new \DateTime($from), new \DateInterval('P1D'), new \DateTime($to));
$range = [];
foreach($period as $date){
$range[$date->format("Y-m-d")] = 0;
}
$data = $this->history()
->select([
DB::raw('DATE(`created_at`) as `date`'),
DB::raw('SUM(points) as `count`')
])
->whereBetween('created_at', [$from, $to])
->where('points', '<', 0)
->groupBy('date')
->get()
->pluck('count', 'date');
$dbData = [];
$total = 0;
if ($data !== null) {
foreach($data as $date => $count) {
$dbData[$date] = abs($count);
$total += abs($count);
}
}
$spendings = array_replace($range, $dbData);
$spendingsTotal = $total;
// Customer signups for previous period
$period = new \DatePeriod( new \DateTime($fromPrevious), new \DateInterval('P1D'), new \DateTime($toPrevious));
$data = $this->history()
->select([
DB::raw('SUM(ABS(points)) as `count`')
])
->whereBetween('created_at', [$fromPrevious, $toPrevious])
->where('points', '<', 0)
->get()
->pluck('count');
$spendingsTotalPrevious = (isset($total[0])) ? (int) $total[0] : 0;
return [
'spendings' => $spendings,
'spendingsTotal' => $spendingsTotal,
'spendingsTotalPrevious' => $spendingsTotalPrevious,
'spendingsChange' => $spendingsTotal - $spendingsTotalPrevious
];
} | [
"public function getPendingStats() {\n\t\t// $findCond = [\n\t\t// \t'fields' => [\n\t\t// \t\t'job_type',\n\t\t// \t\t'created',\n\t\t// \t\t'status',\n\t\t// \t\t'fetched',\n\t\t// \t\t'progress',\n\t\t// \t\t'reference',\n\t\t// \t\t'failed',\n\t\t// \t\t'failure_message',\n\t\t// \t],\n\t\t// \t'conditions' => [\n\t\t// \t\t'completed IS' => null,\n\t\t// \t],\n\t\t// ];\n\t\t// return $this->find('all', $findCond);\n\t}",
"public function getTotals($period='24h')\n {\n\n $collection = Mage::getResourceModel('reports/order_collection')\n ->addCreateAtPeriodFilter($period)\n //->getSelectCountSql()\n ->calculateTotals(1)\n ;\n /*\n $collection->addFieldToFilter('store_id',\n array('eq' => Mage::app()->getStore(Mage_Core_Model_Store::ADMIN_CODE)->getId())\n );\n */\n $collection->load();\n\n $totals = $collection->getFirstItem();\n\n\n return array(\n 'Revenue' => $totals->getRevenue()\n , 'Tax' => $totals->getTax()\n , 'Shipping' => $totals->getShipping()\n , 'Quantity' => $totals->getQuantity() * 1\n );\n }",
"private function getSpending($source)\n {\n $spendings = BillItem::select(DB::raw(\"rty_code, month(bil_date) as mth, sum(bili_gross) as total\"))\n ->join('bills', 'bil_id', '=', 'bili_bill')\n ->join('resources', 'rs_id', '=', 'bili_resource')\n ->join('resource_types', 'rty_id', '=', 'rs_type')\n ->join('bookings', 'book_id', '=', 'bil_booking')\n ->where('bili_active', '=', 1)\n ->where('book_source', '=', $source)\n ->where('bil_status', '=', 'active')\n ->where(function ($query) {\n $query->whereNotIn('book_status', ['cancelled', 'hold'])->orWhereNull('book_status');\n })\n ->whereYear('bil_date', $this->year)\n ->groupBy(DB::raw(\"rty_code, month(bil_date)\"))->get();\n\n $spend_arr = [];\n\n foreach ($spendings as $spending) {\n $spend_arr[$spending->rty_code][$spending->mth] = $spending->total;\n }\n\n if ($source == 2) {\n // Spending by sources from walk-in bills\n $spendings_wi = BillItem::select(DB::raw(\"rty_code, month(bil_date) as mth, sum(bili_gross) as total\"))\n ->join('bills', 'bil_id', '=', 'bili_bill')\n ->join('resources', 'rs_id', '=', 'bili_resource')\n ->join('resource_types', 'rty_id', '=', 'rs_type')\n ->where('bili_active', '=', 1)\n ->where('bil_status', '=', 'active')\n ->whereNull('bil_booking')\n ->whereYear('bil_date', $this->year)\n ->groupBy(DB::raw(\"rty_code, month(bil_date)\"))->get();\n\n foreach ($spendings_wi as $spending) {\n if (isset($spend_arr[$spending->rty_code][$spending->mth])) {\n $spend_arr[$spending->rty_code][$spending->mth] += $spending->total;\n } else {\n $spend_arr[$spending->rty_code][$spending->mth] = $spending->total;\n }\n }\n }\n\n return $spend_arr;\n }",
"public function getPeriod();",
"public function getSales($period)\n{\n\tif($period == \"week\")\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases WHERE PurchasedTime > DATE_SUB(NOW(), INTERVAL 1 WEEK)\");\n\t}\n\telse if($period == \"month\")\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases WHERE PurchasedTime > DATE_SUB(NOW(), INTERVAL 1 MONTH)\");\n\t}\n\telse if($period == \"year\")\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases WHERE PurchasedTime > DATE_SUB(NOW(), INTERVAL 1 YEAR)\");\n\t}\n\telse\n\t{\t\n\t\t$query = $this->db->query(\"SELECT * FROM Purchases\");\n\t}\n\t\n\treturn $query->num_rows();\n}",
"public function getSpend()\n {\n return $this->spend;\n }",
"public function getPeriodSummary() {\n // Get empty fields\n $data = $this->getPeriodSummaryFields();\n // Set diagram type\n $this->diagramType = self::PERIOD_SUMMARY;\n\n /**\n * Check if it is allowed to show custom payments in filters. In order\n * it is not allowed, we will show 0 values. This check will be moved inside\n * the function _getCustomPayments later on...\n */\n $totalCustomAcceptedAmount = 0;\n $totalCustomNotAcceptedAmount = 0;\n // $totalCustomAmount = 0; // Unused variable\n if($this->isShowCustomPayments) {\n // Get payments with status ACCEPTED_BY_USER / PAID\n $totalCustomAcceptedAmount = $this->_getCustomPayments(self::ACCEPTED_PAYMENTS);\n // Get payments with status differend than ACCEPTED_BY_USER / PAID\n $totalCustomNotAcceptedAmount = $this->_getCustomPayments(self::NOT_ACCEPTED_PAYMENTS);\n // Get total custom amount\n $totalCustomAmount = $totalCustomAcceptedAmount + $totalCustomNotAcceptedAmount;\n /**\n * Set values for fields`\n * custom_payment_accepted\n * custom_payment_not_accepted\n * total_custom_payment\n */\n $this->setPeriodSummaryField($data, $totalCustomAcceptedAmount, 'custom_payment_accepted', 'total_custom_payment');\n $this->setPeriodSummaryField($data, $totalCustomNotAcceptedAmount, 'custom_payment_not_accepted', 'total_custom_payment');\n $this->setPeriodSummaryField($data, $totalCustomAmount, 'total_custom_payment');\n }\n\n // Get accepted payments\n $totalRegularAcceptedAmount = $this->_getRegularPayments(self::ACCEPTED_PAYMENTS);\n // Get not accepted payments\n $totalRegularNotAcceptedAmount = $this->_getRegularPayments(self::NOT_ACCEPTED_PAYMENTS);\n /**\n * Get WIP payments, these payments are not calculated and assigned\n * to the users yet. Are being worked out using additional table named\n * user_payment_statistic_data\n */\n $totalWIPAmount = $this->_getWIPPayments();\n /**\n * Set values for fields`\n * total_regular_accepted_payment\n * total_regular_not_accepted_payment\n * total_wip_payment\n * grand_total\n * total_accepted\n * total_not_accepted\n */\n $totalRegularAcceptedAmount = $this->setPeriodSummaryField($data, $totalRegularAcceptedAmount, 'total_regular_accepted_payment');\n $totalRegularNotAcceptedAmount = $this->setPeriodSummaryField($data, $totalRegularNotAcceptedAmount, 'total_regular_not_accepted_payment');\n $this->setPeriodSummaryField($data, $totalWIPAmount, 'total_wip_payment');\n // Set Grand Total\n $totalOfAccepted = $totalCustomAcceptedAmount + $totalRegularAcceptedAmount['amount'];\n $this->setPeriodSummaryField($data, $totalOfAccepted, 'total_accepted', 'grand_total');\n $totalOfNotAccepted = $totalCustomNotAcceptedAmount + $totalRegularNotAcceptedAmount['amount'];\n $this->setPeriodSummaryField($data, $totalOfNotAccepted, 'total_not_accepted', 'grand_total');\n $grandTotal = $totalOfAccepted + $totalOfNotAccepted + $totalWIPAmount['amount'];\n $this->setPeriodSummaryField($data, $grandTotal, 'grand_total');\n\n // Get accepted payments\n $billableProjectAcceptedAmount = $this->_getRegularPayments(self::ACCEPTED_PAYMENTS, array(Project::STATUS_FINISHED));\n // Get not accepted payments\n $billableProjectNotAcceptedAmount = $this->_getRegularPayments(self::NOT_ACCEPTED_PAYMENTS, array(Project::STATUS_FINISHED));\n // Get total amount of billable projects\n $billableProjectAmount = $billableProjectAcceptedAmount['amount'] + $billableProjectNotAcceptedAmount['amount'];\n\n // Get accepted payments\n $wipProjectAcceptedAmount = $this->_getRegularPayments(self::ACCEPTED_PAYMENTS, array(Project::STATUS_ACTIVE));\n // Get not accepted payments\n $wipProjectNotAcceptedAmount = $this->_getRegularPayments(self::NOT_ACCEPTED_PAYMENTS, array(Project::STATUS_ACTIVE));\n // Get total amount of billable projects\n $wipProjectAmount = $wipProjectAcceptedAmount['amount'] + $wipProjectNotAcceptedAmount['amount'];\n\n /**\n * Set values for fields`\n * total_billable_projects\n * total_billable_projects_accepted\n * total_billable_projects_not_accepted\n * total_wip_projects\n * total_wip_projects_accepted\n * total_wip_projects_not_accepted\n */\n $this->setPeriodSummaryField($data, $billableProjectAmount, 'total_billable_projects');\n $this->setPeriodSummaryField($data, $billableProjectAcceptedAmount, 'total_billable_projects_accepted', 'total_billable_projects');\n $this->setPeriodSummaryField($data, $billableProjectNotAcceptedAmount, 'total_billable_projects_not_accepted', 'total_billable_projects');\n $this->setPeriodSummaryField($data, $wipProjectAmount, 'total_wip_projects');\n $this->setPeriodSummaryField($data, $wipProjectAcceptedAmount, 'total_wip_projects_accepted', 'total_wip_projects');\n $this->setPeriodSummaryField($data, $wipProjectNotAcceptedAmount, 'total_wip_projects_not_accepted', 'total_wip_projects');\n\n return $data;\n }",
"public function billingStats(){\n\t\t\n\t\t$exportFlag = json_decode(file_get_contents('php://input'), true);\n\t\t\n\t\t$lastWeekStartDay = date(\"Y-m-d\", strtotime('monday last week'));\n\t\t$lastWeekEndDay = date(\"Y-m-d\", strtotime('sunday last week'));\n\t\t$thisWeekStartDay = date(\"Y-m-d\", strtotime('monday this week'));\n\t\t$thisWeekLastDay = date(\"Y-m-d\", strtotime('sunday this week'));\n\t\t$thisWeekToday = date(\"Y-m-d\");\n\t\t$yesterday = date(\"Y-m-d\", strtotime(\"yesterday\"));\n\t\t$pieChart = $lastWeek = $thisWeek = $filters = array();\n\t\tif(isset($_COOKIE[\"_gDateRangeBillDash\"])){\n\t\t\t$filters = json_decode($_COOKIE[\"_gDateRangeBillDash\"],true);\n\t\t\tif(!empty($filters[\"startDate\"])){\n\t\t\t\t$lastWeekStartDay = $filters[\"startDate\"];\n\t\t\t\t$lastWeekEndDay = $filters[\"endDate\"];\t\n\t\t\t}\n\t\t}\n\t\t$goalFilterThisWeek = array(\"startDate\"=>$thisWeekStartDay, \"endDate\"=> $thisWeekLastDay);\n\t\t$goalFilterLastWeek = array(\"startDate\"=>$lastWeekStartDay, \"endDate\"=> $lastWeekEndDay);\n\t\t$goalValuesThisWeek = $this->getMonthDays($thisWeekStartDay ,$thisWeekLastDay);\n\t\t$goalValuesLastWeek = $this->getMonthDays($lastWeekStartDay ,$lastWeekEndDay);\n\n\t\t$dispatchersList = $this->Report->getDispatchersListForGoals();\n\t\t$thisWeek[\"goal\"] = $this->getPerformanceLoadsForAllDispatchers($dispatchersList, $goalFilterThisWeek, $goalValuesThisWeek);\n\t\t$lastWeek[\"goal\"] = $this->getPerformanceLoadsForAllDispatchers($dispatchersList, $goalFilterLastWeek, $goalValuesLastWeek);\n\n\t\t$considerDate = $yesterday;\n\t\t$recentTransactions = $this->Billing->getRecentTransactions(date(\"Y-m-d\"), 1);\n\t\tif(isset($recentTransactions[0][\"date\"])){ \n\t\t\t$considerDate = $recentTransactions[0][\"date\"]; \n\t\t}\n\t\t$expectedBillingToday = $this->Billing->expectedBillingOnDate($considerDate,$yesterday);\t\n\t\t$expectedBillingToday = is_null($expectedBillingToday) ? 0 : $expectedBillingToday;\n\n\t\t$lastWeek[\"sentToTriumph\"] = $this->Billing->sentForPaymentWithFilter( $lastWeekStartDay, $lastWeekEndDay );\n\t\t$lastWeek[\"sentToTriumph\"] = is_null($lastWeek[\"sentToTriumph\"]) ? 0 : $lastWeek[\"sentToTriumph\"];\n\t\t$lastWeek[\"goalCompleted\"] = ( isset($lastWeek['goal']) && $lastWeek['goal'] != 0 ) ? ( $lastWeek[\"sentToTriumph\"] / $lastWeek[\"goal\"] ) * 100 : 0;\n\n\n\t\t$thisWeek[\"sentToTriumph\"] = $this->Billing->sentForPaymentWithFilter( $thisWeekStartDay, $thisWeekToday );\n\t\t$thisWeek[\"sentToTriumph\"] = is_null($thisWeek[\"sentToTriumph\"]) ? 0 : $thisWeek[\"sentToTriumph\"];\n\t\t$thisWeek[\"goalCompleted\"] = ( isset($lastWeek['goal']) && $lastWeek['goal'] != 0 ) ? ( $thisWeek[\"sentToTriumph\"] / $thisWeek[\"goal\"] ) * 100 : 0;\n\t\t$thisWeek[\"targetType\"] = $thisWeek[\"goalCompleted\"] > 100 ? \"ahead\" : \"behind\";\n\t\t$thisWeek[\"target\"] = abs($thisWeek[\"goalCompleted\"] - 100) ;\n\n\n\t\t$sentToTriumphToday = $this->Billing->sentForPaymentWithFilter( $thisWeekToday, $thisWeekToday );\n\t\t$sentToTriumphToday = is_null($sentToTriumphToday) ? 0 : $sentToTriumphToday;\n\t\t\n\n\t\t$jobStatusStats = $this->Job->fetchLoadsSummary(null, $filters,\"all\");\n\t\t$pieChart[\"waitingPaperwork\"] = (int)$this->Job->getWaitingPaperworkCount($filters,\"all\");\n\t\t$pieChart[\"inprogress\"] = $pieChart[\"booked\"] = $pieChart[\"delivered\"] = $pieChart[\"hasValue\"] = 0;\n\t\tif(isset($jobStatusStats[0])){\n\t\t\tforeach ($jobStatusStats as $key => $value) {\n\t\t\t\tif(empty(trim($value['JobStatus'])) )\n\t\t\t\t\tcontinue;\n\t\t\t\t$pieChart[$value['JobStatus']] = (int)$value['tnum'];\n\t\t\t\t$pieChart[\"hasValue\"] = 1;\n\t\t\t}\n\t\t}\n\n\t\t$recentTransactions = $this->getRecentTransactions($filters);\n\t\t$sentPaymentData = $this->fetchingSentPaymentsInfo('otherPage');\n\t\t//pr($exportFlag);die;\n\t\tif(!empty($exportFlag[\"export\"])){\n\t\t\t$this->exportStat($recentTransactions);die();\n\t\t}\n\n\t\techo json_encode(array(\"sentToTriumphToday\"=>$sentToTriumphToday, \"lastWeek\"=> $lastWeek, \"thisWeek\" => $thisWeek, \"recentTransactions\" => $recentTransactions, \"expectedBillingToday\"=>$expectedBillingToday,\"pieChart\" => $pieChart, \"sentPaymentData\" => $sentPaymentData));\n\t}",
"public function getPeriods() {\n\t $query = \"select periodSlotId, periodNumber, startTime, startAmPm, endTime, endAmPm from period\";\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }",
"public function getPaymentMonthlyStats()\n {\n\n $paymentObject = new App\\Payment();\n $payment_data = (object)$paymentObject->getSuccessMonthlyData();\n\n\n $payment_dataset = [];\n $payment_labels = [];\n $payment_dataset_labels = [getPhrase('total')];\n $payment_bgcolor = [];\n $payment_border_color = [];\n\n\n foreach($payment_data as $record)\n {\n $color_number = rand(0,999);;\n $payment_dataset[] = $record->total;\n $payment_labels[] = $record->month;\n $payment_bgcolor[] = getColor('',$color_number);\n $payment_border_color[] = getColor('background', $color_number);\n\n }\n\n $payments_stats['data'] = (object) array(\n 'labels' => $payment_labels,\n 'dataset' => $payment_dataset,\n 'dataset_label' => $payment_dataset_labels,\n 'bgcolor' => $payment_bgcolor,\n 'border_color' => $payment_border_color\n );\n $payments_stats['type'] = 'line';\n $payments_stats['title'] = getPhrase('payments_reports_in').' '.getCurrencyCode();\n\n return $payments_stats;\n }",
"public function getPeriods()\n {\n return $this->plans_period->order_by('price', 'ASC')->get();\n }",
"function getStatPeriod($account_id, $period_start,$period_end,$interval=\"d\")\n{\n\tglobal $db;\n\tif ($interval == \"d\")\n\t\t$intval = \" DAY \";\n\telse if ($interval == \"h\")\n\t\t$intval = \" HOUR \";\n\telse if ($interval == \"w\")\n\t\t$intval = \" WEEK \";\n\telse if ($interval == \"m\")\n\t\t\t$intval = \" MONTH \";\n\telse\n\t\t$intval = \" DAY \";\n\t\t\n\t//$account_id = getPlayerIdFromNick($_GET[\"name\"]);\n\t$statsA = array();\n\t$statsB = array();\n\t$statsC = array();\n\t// Try to load stats for given period start\n\tif ($interval == \"d\") { // 1001775453\n\t\t$q = $db->prepare(\"select * from account_stats where account_id=:aid and updateTime <= DATE_SUB(CONCAT(CURDATE(),' 23:59:59'), INTERVAL :t $intval) and updateTime >= DATE_SUB(CONCAT(CURDATE(),' 23:59:59'), INTERVAL :tb $intval) order by updateTime DESC limit 1\");\n\t\t\t$q->execute(array(\":aid\"=>$account_id,\":t\"=>$period_start,\":tb\"=>$period_start+1));\n\t } else {\n\t$q = $db->prepare(\"select * from account_stats where account_id=:aid and updateTime <= DATE_SUB(NOW(),INTERVAL :t $intval) order by updateTime DESC limit 1\");\n\t\t$q->execute(array(\":aid\"=>$account_id,\":t\"=>$period_start));\n\t}\n\t\tif ($q->rowCount()) { \n\t\t\t$statsA = $q->fetch();\n\t\t\t\t$q2= $db->prepare(\"select * from tank_stats where account_stats_update=:update and account_id=:acid\");\n\t\t\t\t$q2->execute(array(\":update\"=>$statsA[\"updated\"],\":acid\"=>$account_id));\n\t\t\t\t$statsA[\"tanks\"] = array();\n\t\t\t\twhile($t=$q2->fetch()){\n\t\t\t\t\t\tarray_push($statsA[\"tanks\"],$t);\n\t\t\t\t}\n\t\t} else {\n\t\t\t//echo \"StatsA<BR>\";\n\t\t\t$statsA = false;\n\t\t}\n\t\n\t// Try to load stats for period end\n\t// \n\t\tif ($period_start != $period_end) {\n\t\t\t\n\t\t\tif ($interval ==\"d\") {\n\t\t\t$q = $db->prepare(\"select * from account_stats where account_id=:aid and updateTime <= DATE_SUB(CONCAT(CURDATE(),' 23:59:59'), INTERVAL :t $intval) and updateTime >= DATE_SUB(CONCAT(CURDATE(),' 23:59:59'), INTERVAL :tb $intval) order by updateTime DESC limit 1\");\n\t\t\t\t$q->execute(array(\":aid\"=>$account_id,\":t\"=>$period_end,\":tb\"=>$period_end+1));\n\t\t\t} else {\n\t\t\t\t\t$q = $db->prepare(\"select * from account_stats where account_id=:aid and updateTime <= DATE_SUB(NOW(), INTERVAL :t $intval) order by updateTime DESC limit 1\");\n\t\t\t\t\t$q->execute(array(\":aid\"=>$account_id,\":t\"=>$period_end));\n\t }\n\t\t\t\t\tif ($q->rowCount()) { \n\t\t\t\t\t\t$statsB = $q->fetch();\n\t\t\t\t\t\t\t$q2= $db->prepare(\"select * from tank_stats where account_stats_update=:update and account_id=:acid\");\n\t\t\t\t\t\t\t$q2->execute(array(\":update\"=>$statsB[\"updated\"],\":acid\"=>$account_id));\n\t\t\t\t\t\t\t$statsB[\"tanks\"] = array();\n\t\t\t\t\t\t\twhile($t=$q2->fetch()){\n\t\t\t\t\t\t\t\t\tarray_push($statsB[\"tanks\"],$t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t//\techo \"$period_start - $period_end - $intval = StatsB<BR>\";\n\t\t\t\t\t\t$statsB = false;\n\t\t\t\t\t}\n\t\t}\n\t\t\n\t\tif (!$statsA or !$statsB)\n\t\t\treturn false;\n\t\t\n\t\t\t\t\n\t\t// ok we've made it this far, we should have valid data in StatsA and statsB\n\t\t$statsC = $statsA;\n\t\t$tanks = array();\n\t\t$statsC[\"tanks\"] = array();\n\t\tforeach($statsA as $key=>$val)\n\t\t{\n\t\t\tif (is_numeric($val))\n\t\t\t\t$statsC[\"$key\"] = ($statsA[\"$key\"] - $statsB[\"$key\"]);\n\t\t\t\t\n\t\t\t\t\n\t\t\tif ($key == \"tanks\")\n\t\t\t{\n\t\t\t\tforeach($statsA[\"tanks\"] as $keyb=>$valb) {\n\t\t\t\t\n\t\t\t\t\t\t$tank = array();\n\t\t\t\t\t\tif ($statsA[\"tanks\"][$keyb][\"name\"] == $statsB[\"tanks\"][$keyb][\"name\"]) {\n\t\t\t\t\t\t\t//echo \"Processing \" .$statsA[\"tanks\"][$keyb][\"name\"] .\"<BR>\";\n\t\t\t\t\t\t\tforeach ($statsA[\"tanks\"][$keyb] as $ky=>$vy)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (!is_numeric($ky))\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(($ky == \"battles\") or ($ky == \"victories\")) {\n\t\t\t\t\t\t\t\t//\techo \"$ky == battles or victories<BR>\";\n\t\t\t\t\t\t\t\t\t$tank[$ky] = $statsA[\"tanks\"][$keyb][$ky] - $statsB[\"tanks\"][$keyb][$ky];\n\t\t\t\t\t\t\t\t//\techo $tank[$ky] . \"<BR>\";\n\t\t\t\t\t\t\t\t//\tif ($k != 0)\n\t\t\t\t\t\t\t\t//\techo \"$ky => \" . $tank[\"$ky\"] .\" = \". $statsA[\"tanks\"][$keyb][$ky].\" - \".$statsB[\"tanks\"][$keyb][$ky].\"<BR>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$tank[\"$ky\"] = $statsA[\"tanks\"][$keyb][$ky];\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//echo \"<pre>\";\n\t\t\t\t\t\t\t//\tprint_r($tank);\n\t\t\t\t\t\t\t//echo \"</pre>\";\n\t\t\t\t\t\t//\tprint_r($tank);\n\t\t\t\t\t\t\tarray_push($tanks,$tank);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\n\t//\techo \"<pre>\";\n\t//\t\tprint_r($statsC[\"tanks\"]);\n\t//\techo \"</pre>\";\n\t\n\t\t\t$statsC[\"damage\"] = $statsA[\"damage\"] - $statsB[\"damage\"];\n\t\t\t//$statsC[\"defeat\"] = $statsA[\"damage\"] - $statsB[\"damage\"];\n\t\t\t$statsC[\"efficiency\"] = $statsA[\"efficiency\"];\n\t\t\t$statsC[\"avg_exp\"] = $statsA[\"avg_exp\"];\n\t\t\t$statsC[\"max_exp\"] = $statsA[\"max_exp\"];\n\t\t\t$statsC[\"hitratio\"] = $statsA[\"hitratio\"];\n\t\t\t\n\t\t\t// Lets calculate some common ratio's just to make display easier\n\t\t\tif ($statsC[\"battles\"]) {\n\t\t\t\t$statsC[\"victories_p\"] = round(($statsC[\"victories\"] / $statsC[\"battles\"]) * 100,2);\n\t\t\t\t$statsC[\"defeats_p\"] = round(($statsC[\"defeats\"] / $statsC[\"battles\"]) * 100,2);\n\t\t\t\t$statsC[\"draws\"] = $statsC[\"battles\"] - $statsC[\"victories\"] - $statsC[\"defeats\"];\n\t\t\t\t$statsC[\"draws_p\"] =round(($statsC[\"draws\"] / $statsC[\"battles\"]) * 100,2);\n\t\t\t\t$statsC[\"survived_p\"] = round(($statsC[\"survived\"] / $statsC[\"battles\"]) * 100,2);\n\t\t\t\t$statsC[\"destroyed_r\"] = round(($statsC[\"destroyed\"] / $statsC[\"battles\"]),2);\n\t\t\t\t$statsC[\"damage_r\"] = round(($statsC[\"damage\"] / $statsC[\"battles\"]),2);\n\t\t\t\t\n\t\t\t\tif ($statsC[\"battles\"] - $statsC[\"survived\"])\n\t\t\t\t$statsC[\"kd_r\"] = round(($statsC[\"destroyed\"] / ($statsC[\"battles\"] - $statsC[\"survived\"])),2);\n\t\t\t\t$statsC[\"detected_r\"] = round(($statsC[\"detected\"] / $statsC[\"battles\"]) ,2);\n\t\t\t\t$statsC[\"capture_r\"] = round(($statsC[\"capture\"] / $statsC[\"battles\"]) ,2);\t\t\t\n\t\t\t\t$statsC[\"defense_r\"] = round(($statsC[\"defense\"] / $statsC[\"battles\"]) ,2);\n\t\t\t\t$statsC[\"experience_r\"] = round(($statsC[\"experience\"] / $statsC[\"battles\"]),2);\n\t\t\n\t\t\t\t\t$statC[\"tanks\"] = array();\n\t\t\t\t\t$statsC[\"tanks\"] = $tanks;\n\t\t\t\n\t\t}\t\n\t\t\n\t\t\n//\t\tprint_r($statsA);\n\t//\tprint_r($statsB);\n\t\treturn $statsC;\n}",
"function GetPeriodTransfers()\n\t{\n $date_clause = $this->MakeSqlForDate();\n if (strlen($date_clause) > 0)\n {\n $date_clause = \" AND $date_clause \";;\n }\n\t\t$SQL = sprintf(\"\n\t\t\tSELECT\n\t\t\t\tCOUNT(id) AS transfers\n\t\t\tFROM %s\n\t\t\tWHERE\n\t\t\t\treferer <> ''\n\t\t\t%s\n\t\t\t\", $this->getTable(\"StatTable\"), $date_clause);\n $_tmp = $this->Connection->ExecuteScalar($SQL);\n return $_tmp[\"transfers\"];\n\t}",
"public function getTransactionStats($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n // ->groupBy('status')\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('count(*)'))\n ->whereIn('orderline_statuses.name', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n // ->groupBy('status')\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n // ->whereIn('status', [$this->successStatus])\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n // payment method\n $paymentMethod = DB::connection('marketplace')\n ->table('orders')\n ->join('payment_method_types', 'orders.payment_method_type_id', '=', 'payment_method_types.id')\n ->select(DB::raw('payment_method_types.name, count(*)'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n // ->where('status', '=', $this->successStatus)\n ->groupBy('payment_method_types.name')\n ->orderByRaw('count desc')\n ->get(); \n\n $data = array();\n\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n \n $data['transaction_status'] = $transactionStatus;\n $data['payment_method'] = $paymentMethod;\n \n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }",
"public function getStats()\n {\n $broker = Broker::where(\"name\", request(\"broker\"))->first();\n return (new SpotRepository)->getStats($broker);\n }",
"public function getPendingAmount() {\n\n\t\t// Total Pending Amount\n\t\t$pendingAmount = 0;\n\t\t$pendingOrdersCollection = [];\n\t\t$data = ['total'=> $pendingAmount , 'action' => ''];\n\t\t$priceCurrency=$this->_objectManager->get('Magento\\Framework\\Pricing\\PriceCurrencyInterface');\n\t\t$orderCollection = $this->getBookingOrdersCollection();\n\t\tif (count($orderCollection)!=0) {\n\t\t\t$orderData = $orderCollection->addFieldToFilter('status','pending')->getData();\n\t\t}\n\t\tif (isset($orderData) && count($orderData)!=0) {\n\t\t\tforeach ($orderData as $pendingData) {\n\t\t\t\t$pendingAmount = $pendingData['grand_total'] + $pendingAmount;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($pendingAmount > 1000000000000) {\n\t\t\t\t$pendingAmount = round($pendingAmount / 1000000000000, 4);\n\t\t\t\t$data['total'] = $this->_localeCurrency->getCurrency($this->_objectManager->create('Magento\\Store\\Model\\StoreManagerInterface')->getStore(null)->getBaseCurrencyCode())->toCurrency($pendingAmount) . 'T';\n\t\n\t\t} elseif ($pendingAmount > 1000000000) {\n\t\t\t\t$pendingAmount = round($pendingAmount / 1000000000, 4);\n\t\t\t\t$data['total'] = $this->_localeCurrency->getCurrency($this->_objectManager->create('Magento\\Store\\Model\\StoreManagerInterface')->getStore(null)->getBaseCurrencyCode())->toCurrency($pendingAmount) . 'B';\n\t\t\t\n\t\t} elseif ($pendingAmount > 1000000) {\n\t\t\t\t$pendingAmount = round($pendingAmount / 1000000, 4);\n\t\t\t\t$data['total'] = $this->_localeCurrency->getCurrency($this->_objectManager->create('Magento\\Store\\Model\\StoreManagerInterface')->getStore(null)->getBaseCurrencyCode())->toCurrency($pendingAmount) . 'M';\n\t\t\t\n\t\t} elseif ($pendingAmount > 1000) {\n\t\t\t\t$pendingAmount = round($pendingAmount / 1000, 4);\t\n\t\t\t\t$data['total'] = $this->_localeCurrency->getCurrency($this->_objectManager->create('Magento\\Store\\Model\\StoreManagerInterface')->getStore(null)->getBaseCurrencyCode())->toCurrency($pendingAmount) . 'K';\n\t\t\n\t\t} else {\n\t\t\t\t$data['total'] =$priceCurrency->format($pendingAmount);\n\t\t}\n\t\t\t \n\t\t\t\t\n\t\treturn $data;\n\t}",
"public function getStatistic() {\n\t\t$sumTypes = $this->getDebts();\n\t\t\n\t\t$parkingType = $this->getService('ParkingType')->getTypes();\n\t\t$parkingTotal = Parking::find()->sum('return_amount');\n\n\t\treturn compact('parkingType', 'parkingTotal', 'sumTypes');\n\t}",
"public static function mlmWithdrawalPeriod();",
"public function getSaleDetailsbyPeriod($period) {\n $db = new DBManager();\n $year = date(\"Y\",strtotime($period));\n $month = date(\"m\",strtotime($period));\n $sql = \"SELECT * from ems_invoices, ems_invoice_amount where MONTH(ems_invoices.invoice_paid_date) = $month AND YEAR(ems_invoices.invoice_paid_date) = $year and ems_invoices.status = 1 and ems_invoices.invoice_id = ems_invoice_amount.invoice_id order by ems_invoices.id desc\";\n $data = $db->getAllRecords($sql);\n $total = $db->getNumRow($sql);\n while ($row = $db->getNextRow()) {\n $this->invoice_id[] = $row['invoice_id'];\n $this->client_name[] = $row['name'];\n $this->gstin[] = $row['gstin'];\n $this->invoice_date[] = $row['invoice_date'];\n $this->invoice_paid_date[] = $row['invoice_paid_date'];\n $this->desc_of_service[] = $row['desc_of_service'];\n $this->sac_code[] = $row['sac_code'];\n $this->quantity[] = $row['quantity'];\n $this->price[] = $row['price'];\n $this->sgst[] = $row['sgst'];\n $this->cgst[] = $row['cgst'];\n $this->igst[] = $row['igst'];\n $this->currency_type[] = $row['currency_type'];\n $this->invoice_amount[] = $row['net_amount'];\n $this->status[] = $row['status'];\n }\n return $total;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
//////////////////////////////////////////////// Constructs and initialize a Ogone data default helper class | public function __construct( Pronamic_WP_Pay_Gateways_Ogone_Data $data ) {
$this->data = $data;
} | [
"public function __construct() {\n\n\t\t$this->app = App::get();\n\t\t$this->data = array();\n\t\t$this->data['defaults'] = Config::getOption(\"defaults\");\n\t}",
"public function __construct()\n {\n $dataModel = new \\Model\\dataModel\\dataModel();\n $apiKey = $dataModel->getApiKey();\n if(!$apiKey){\n $apiKey = $dataModel->getDefaultApiKey();\n }\n $this->authorization = $apiKey->meta_value;\n\n }",
"public function init_data()\n\t{\n\t\n\t}",
"function __construct() {\n parent::__construct(Feeligo_Api_Feeligo::_());\n }",
"public function __construct()\n\t{\n\t\tinclude_once('Config.php');\n\t\t\n\t\t$this->dojo = new Dojo(Config::getMeta());\n\t\t$this->wind = new Wind(Config::getDatabase());\n\t\t$this->forest = new Forest();\n\t\t$this->training = new Training();\n\t\t$this->medic = new Medic(Config::getReporting());\n\t\t$this->sky = new Sky();\n\t}",
"public function __construct(){\n\t\t$this->idAdjuntos = \"\";\n $this->nombre_archivo = \"\";\n\t\t$this->url = \"\";\n\t\t$this->fecha_vencimiento = \"NULL\";\n $this->etiqueta=\"NULL\";\n $this->observaciones=\"NULL\";\n\t\n }",
"public function __construct()\n {\n $this->key = (object) [\n 'request' => \"ozziest_oversode_request\",\n 'overdose' => \"ozziest_oversode_overdose\",\n 'recreation' => \"ozziest_oversode_recreation\",\n 'critical' => \"ozziest_oversode_critical\"\n ];\n }",
"public function __construct() {\n\t\trequire_once ABSPATH . '/wp-includes/pomo/po.php';\n\t\t$this->po = new PO();\n\t}",
"private function __construct (){}",
"private function __construct() {\n\t\t$this->data_container = new DataContainer();\n\t}",
"function __construct()\n {\n $this->obj_contato_anunciante = new OBJ_Contato_Anunciante();\n }",
"function __construct() {\r\n\r\n\t\t$this->model = new HttpRequestsModel();\r\n\t\t$this->class_data_custom_fields = new LscfDataCustomFieldsControoler();\r\n\r\n\t}",
"public static function _init() \n\t{\n\t\tstatic::$data = CCConfig::create( ClanCats::$config->get( 'orbit.data' ), 'json' );\n\t}",
"public function __construct () {\n $this->coordinata = new Coordinata ( array ( 'x' => 0, 'y' => 0 ) );\n\n }",
"public function __construct($data)\n {\n }",
"public function __construct()\n {\n $this->dev = config('novaposhta.dev');\n $this->getApi();\n $this->url = config('novaposhta.base_uri').config('novaposhta.point');\n\n $this->return = [\n 'success' => false,\n 'result' => null,\n 'info' => [],\n ];\n }",
"function __construct() {\n $this->codigo = null;\n\t\t$this->nome = null;\n\t\t$this->senha = null;\n\t\t$this->cpf = null;\n\t\t$this->planoDeSaude = null;\n\t\t$this->genero = null;\n\t\t$this->tipoSanguineo = null;\n\t\t$this->dtNascimento = null;\n\t\t$this->endereco = null;\n\t\t$this->telefone = null;\n\t\t$this->email = null;\n\t\t$this->reg_date = null;\n\t\t$this->semEspaco = false;\n\t\t$this->tablePathPaciente = $_SERVER['DOCUMENT_ROOT'].\"/BancoDeDados/db/tPaciente.xml\";\n }",
"function __construct()\n\t{\n\t\t# grab the config\n\t\t$this->cloudinary_config = ee()->config->item('easy_cloudinary');\n\t\tif ( $this->cloudinary_config !== NULL )\n\t\t{\n\t\t\t# get the host name\n\t\t\t$this->site_domain = ee()->config->site_url();\n\t\t\t$this->return_data = $this->convert( ee()->TMPL->tagdata );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->return_data = ee()->TMPL->tagdata;\n\t\t}\n\t}",
"public function __construct(){\r\n\t\t\tparent::__construct();\r\n\t\t\t$this->cod = null;\r\n\t\t\t$this->nom = null;\r\n\t\t\t$this->ape = null;\r\n\t\t\t$this->tel = null;\r\n\t\t\t$this->cargo = null;\r\n\t\t\t$this->email = null;\r\n\t\t\t$this->fecha = null;\r\n\t\t\t$this->dir = null;\r\n\t\t\t$this->dep = null;\r\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation deleteThirdPartyParcelAccountFileWithHttpInfo Delete a file for a thirdPartyParcelAccount. | public function deleteThirdPartyParcelAccountFileWithHttpInfo($third_party_parcel_account_id, $file_id)
{
$returnType = '';
$request = $this->deleteThirdPartyParcelAccountFileRequest($third_party_parcel_account_id, $file_id);
try {
$options = $this->createHttpClientOption();
try {
$response = $this->client->send($request, $options);
} catch (RequestException $e) {
throw new ApiException(
"[{$e->getCode()}] {$e->getMessage()}",
$e->getCode(),
$e->getResponse() ? $e->getResponse()->getHeaders() : null,
$e->getResponse() ? $e->getResponse()->getBody()->getContents() : null
);
}
$statusCode = $response->getStatusCode();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf(
'[%d] Error connecting to the API (%s)',
$statusCode,
$request->getUri()
),
$statusCode,
$response->getHeaders(),
$response->getBody()
);
}
return [null, $statusCode, $response->getHeaders()];
} catch (ApiException $e) {
switch ($e->getCode()) {
}
throw $e;
}
} | [
"public function deleteThirdPartyParcelAccountFile($third_party_parcel_account_id, $file_id)\n {\n $this->deleteThirdPartyParcelAccountFileWithHttpInfo($third_party_parcel_account_id, $file_id);\n }",
"public function deleteThirdPartyParcelAccountFileAsync($third_party_parcel_account_id, $file_id)\n {\n return $this->deleteThirdPartyParcelAccountFileAsyncWithHttpInfo($third_party_parcel_account_id, $file_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"protected function deleteParcelAccountFileRequest($parcel_account_id, $file_id)\n {\n // verify the required parameter 'parcel_account_id' is set\n if ($parcel_account_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $parcel_account_id when calling deleteParcelAccountFile'\n );\n }\n // verify the required parameter 'file_id' is set\n if ($file_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_id when calling deleteParcelAccountFile'\n );\n }\n\n $resourcePath = '/beta/parcelAccount/{parcelAccountId}/file/{fileId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($parcel_account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'parcelAccountId' . '}',\n ObjectSerializer::toPathValue($parcel_account_id),\n $resourcePath\n );\n }\n // path params\n if ($file_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fileId' . '}',\n ObjectSerializer::toPathValue($file_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"private function deleteFileWithHttpInfo(Requests\\deleteFileRequest $request)\n {\n $returnType = 'void';\n $this->_checkAuthToken();\n $req = $request->createRequest($this->config);\n\n try {\n $options = $this->_createHttpClientOption();\n try {\n $response = $this->client->send($req, $options);\n } catch (RequestException $e) {\n if ($e->getCode() == 401) {\n $this->_requestToken();\n throw new RepeatRequestException(\"Request must be retried\", 401, null, null);\n }\n else if ($e->getCode() < 200 || $e->getCode() > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $e->getCode(), $req->getUri()), $e->getCode(), null, null);\n }\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(sprintf('[%d] Error connecting to the API (%s)', $statusCode, $req->getUri()), $statusCode, $response->getHeaders(), $response->getBody());\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n throw $e;\n }\n }",
"public function delete_attachment_file() {\n if (check_ajax_referer(\"orbisius_support_tickets_action_delete_file\")) {\n $ticket_id = intval($this->request_obj->get('ticket-id'));\n if (!$this->user_have_access($ticket_id)) {\n $this->send_json_response(0, __('You do not have access to this ticket.', ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_TX_DOMAIN));\n }\n $attachment_id = intval($this->request_obj->get('id'));\n if (!$attachment_id) {\n $this->send_json_response(0, _('Invalid attachment ID.', ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_TX_DOMAIN));\n }\n add_filter('upload_dir', array($this, 'custom_upload_dir'));\n $delete_file = wp_delete_attachment($attachment_id, true);\n remove_filter('upload_dir', array($this, 'custom_upload_dir'));\n if ($delete_file === false || $delete_file === null) {\n $this->send_json_response(0, __('Error when trying to delete ticket attachment.', ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_TX_DOMAIN));\n }\n do_action('orbisius_support_tickets_filter_submit_ticket_form_after_delete_file', $attachment_id);\n $this->send_json_response(1, __('The attachment file have succesfully deleted.', ORBISIUS_SUPPORT_TICKETS_ATTACHMENTS_ADDON_TX_DOMAIN));\n }\n }",
"protected function deleteThirdPartyParcelAccountTagRequest($third_party_parcel_account_id, $third_party_parcel_account_tag)\n {\n // verify the required parameter 'third_party_parcel_account_id' is set\n if ($third_party_parcel_account_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $third_party_parcel_account_id when calling deleteThirdPartyParcelAccountTag'\n );\n }\n // verify the required parameter 'third_party_parcel_account_tag' is set\n if ($third_party_parcel_account_tag === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $third_party_parcel_account_tag when calling deleteThirdPartyParcelAccountTag'\n );\n }\n\n $resourcePath = '/beta/thirdPartyParcelAccount/{thirdPartyParcelAccountId}/tag/{thirdPartyParcelAccountTag}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($third_party_parcel_account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'thirdPartyParcelAccountId' . '}',\n ObjectSerializer::toPathValue($third_party_parcel_account_id),\n $resourcePath\n );\n }\n // path params\n if ($third_party_parcel_account_tag !== null) {\n $resourcePath = str_replace(\n '{' . 'thirdPartyParcelAccountTag' . '}',\n ObjectSerializer::toPathValue($third_party_parcel_account_tag),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function addThirdPartyParcelAccountFileRequest($third_party_parcel_account_id, $file_name)\n {\n // verify the required parameter 'third_party_parcel_account_id' is set\n if ($third_party_parcel_account_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $third_party_parcel_account_id when calling addThirdPartyParcelAccountFile'\n );\n }\n // verify the required parameter 'file_name' is set\n if ($file_name === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $file_name when calling addThirdPartyParcelAccountFile'\n );\n }\n\n $resourcePath = '/beta/thirdPartyParcelAccount/{thirdPartyParcelAccountId}/file/{fileName}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($third_party_parcel_account_id !== null) {\n $resourcePath = str_replace(\n '{' . 'thirdPartyParcelAccountId' . '}',\n ObjectSerializer::toPathValue($third_party_parcel_account_id),\n $resourcePath\n );\n }\n // path params\n if ($file_name !== null) {\n $resourcePath = str_replace(\n '{' . 'fileName' . '}',\n ObjectSerializer::toPathValue($file_name),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getThirdPartyParcelAccountFilesWithHttpInfo($third_party_parcel_account_id)\n {\n $returnType = '';\n $request = $this->getThirdPartyParcelAccountFilesRequest($third_party_parcel_account_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteJobTypeFileWithHttpInfo($job_type_id, $file_id)\n {\n $returnType = '';\n $request = $this->deleteJobTypeFileRequest($job_type_id, $file_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteItemReceiptActivityFileWithHttpInfo($item_receipt_activity_id, $file_id)\n {\n $returnType = '';\n $request = $this->deleteItemReceiptActivityFileRequest($item_receipt_activity_id, $file_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deleteLineOfBusinessFile($line_of_business_id, $file_id)\n {\n $this->deleteLineOfBusinessFileWithHttpInfo($line_of_business_id, $file_id);\n }",
"public function deleteLineOfBusinessFileAsyncWithHttpInfo($line_of_business_id, $file_id)\n {\n $returnType = '';\n $request = $this->deleteLineOfBusinessFileRequest($line_of_business_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function deleteEmailTemplateFileWithHttpInfo($email_template_id, $file_id)\n {\n $returnType = '';\n $request = $this->deleteEmailTemplateFileRequest($email_template_id, $file_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"public function deletePalletTypeFileWithHttpInfo($pallet_type_id, $file_id)\n {\n $returnType = '';\n $request = $this->deletePalletTypeFileRequest($pallet_type_id, $file_id);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n return [null, $statusCode, $response->getHeaders()];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n }\n throw $e;\n }\n }",
"function removePersonInfoOrderData($order_id, $person_info_variant_id)\n {\n global $application;\n $tables = $this->getTables();\n $opd = $tables['order_person_data']['columns'];\n $query = new DB_Delete(\"order_person_data\");\n $query->WhereValue($opd[\"order_id\"], DB_EQ, (int)$order_id);\n $query->WhereAnd();\n $query->WhereValue($opd[\"variant_id\"], DB_EQ, (int)$person_info_variant_id);\n $application->db->getDB_Result($query);\n }",
"public function deleteJobTimeActivityFileAsyncWithHttpInfo($job_time_activity_id, $file_id)\n {\n $returnType = '';\n $request = $this->deleteJobTimeActivityFileRequest($job_time_activity_id, $file_id);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n return [null, $response->getStatusCode(), $response->getHeaders()];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function getThirdPartyParcelAccountByIdWithHttpInfo($third_party_parcel_account_id)\n {\n \n // verify the required parameter 'third_party_parcel_account_id' is set\n if ($third_party_parcel_account_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $third_party_parcel_account_id when calling getThirdPartyParcelAccountById');\n }\n \n // parse inputs\n $resourcePath = \"/beta/thirdPartyParcelAccount/{thirdPartyParcelAccountId}\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array());\n \n \n \n // path params\n \n if ($third_party_parcel_account_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"thirdPartyParcelAccountId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($third_party_parcel_account_id),\n $resourcePath\n );\n }\n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } elseif (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('API-Key');\n if (strlen($apiKey) !== 0) {\n $headerParams['API-Key'] = $apiKey;\n }\n \n \n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, 'GET',\n $queryParams, $httpBody,\n $headerParams, '\\Infoplus\\Model\\ThirdPartyParcelAccount'\n );\n \n if (!$response) {\n return array(null, $statusCode, $httpHeader);\n }\n\n return array(\\Infoplus\\ObjectSerializer::deserialize($response, '\\Infoplus\\Model\\ThirdPartyParcelAccount', $httpHeader), $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = \\Infoplus\\ObjectSerializer::deserialize($e->getResponseBody(), '\\Infoplus\\Model\\ThirdPartyParcelAccount', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n }",
"public function deleteThirdPartyParcelAccountAsync($third_party_parcel_account_id)\n {\n return $this->deleteThirdPartyParcelAccountAsyncWithHttpInfo($third_party_parcel_account_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function deleteAsset(AssetFileModel $asset)\n {\n $settings = $this->getSettings();\n \n try {\n $this->getS3Bucket()->rm(trim($settings->bucketPath . '/' . $asset->filename, '/'));\n } catch (\\Exception $e) {\n throw new CraftException($e->getMessage());\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/create a property expression create a property expression | public static function Property($name, ...$args): JSExpression
{
return self::Factory("Property", $name, ...$args);
} | [
"public function getPropertyExpressions();",
"public function createExpression();",
"function createProperty();",
"public function property($name) {\n\treturn new PHPParser_Builder_Property($name);\n }",
"abstract protected function createExpression();",
"protected function generateExpression()\n\t{\n\t\tif (isset($this->properties))\n\t\t\t$properties = Json::encode($this->properties);\n\t\telse\n\t\t\t$properties = '';\n\t\treturn \"new ol.$this->class($properties)\";\n\t}",
"public function makeProperty()\n {\n return new Property();\n }",
"public function expression()\n { \n return new self;\n }",
"public function expression()\n {\n return new self;\n }",
"public function getExpression();",
"public function createPropertyDefinitionTemplate() {\r\n\t\t\r\n\t}",
"final public function createProperty()\n {\n $container = $this->getContainer();\n\n $prop = $container['property/factory']->create('generic');\n $prop->setIdent('xyzzy');\n\n return $prop;\n }",
"public function property(string $name) : Builder\\Property {\n return new Builder\\Property($name);\n }",
"public function toProperty() {\n\t\treturn new Property($this->pm, $this->path, $this->name, $this->value);\n\t}",
"public function onPropertyAccessExpression($expression)\n {\n $parent = $expression;\n $variable = null;\n $isFirstLevelPrimitive = is_null($parent->getParent());\n if (!$isFirstLevelPrimitive) {\n \t// This propery access sub-expression in the $filter need access\n \t// to level 2 or greater property of a complex or resource reference\n \t// property.\n \t// e.g. Customers?$filter=Address/City eq 'Kottayam'\n \t// Level_2 property access [Complex]\n \t// Customers?$filter=Address/AltAddress/City eq 'Seattle'\n \t// Level_3 property access [Complex]\n \t// Orders?$filter=Customer/CustomerID eq 'ALFKI'\n \t// Level_2 property access [Resource Reference]\n \t$parent2 = null;\n \tdo {\n \t\t$parent2 = $parent;\n \t\t$parent = $parent->getParent();\n \t} while ($parent != null);\n \t\n \t$resourceProperty = $parent2->getResourceProperty();\n \tif ($resourceProperty->isKindOf(ResourcePropertyKind::RESOURCE_REFERENCE)) {\n \t\t// Orders?$filter=Customer/CustomerID eq 'ALFKI'\n \t\tthrow new NotImplementedException(\n \t\t\t\t'This implementation not supports Resource reference in the filter',\n \t\t\t\t500,\n \t\t\t\tNULL\n \t\t);\n \t} else {\n \t\t// Customers?$filter=Address/AltAddress/City eq 'Seattle'\n \t\t// Customers?$filter=Address/City eq 'Seattle'\n \t\t$propertyName = $parent2->getResourceProperty()->getName();\n \t\tif (\"Address\" == $propertyName) {\n \t\t\t$child = $parent2->getChild();\n \t\t\t$propertyName = $child->getResourceProperty()->getName();\n \t\t\tif (\"AltAddress\" != $propertyName) {\n \t\t\t\treturn $propertyName;\n \t\t\t}\n \t\t\t\n \t\t\tthrow new NotImplementedException(\n \t\t\t\t\t'This implementation not supports Customer::Address::AltAddress in the filter',\n \t\t\t\t\t500,\n \t\t\t\t\tNULL\n \t\t\t);\n \t\t}\n \t}\n\n } else {\n \t// This is a first level property access\n \t$resourceProperty = $parent->getResourceProperty();\n \tif ($resourceProperty->isKindOf(ResourcePropertyKind::COMPLEX_TYPE)\n \t || $resourceProperty->isKindOf(ResourcePropertyKind::RESOURCE_REFERENCE)) {\n \t\t// Customers?$filter=Address eq null\n \t\t// Orders?$filter=Customer ne null\n \t\t// First level property access to a complex or resource reference\n \t\t// which is not supported by $this [this implementation of IDSQP2]\n \t\tthrow new NotImplementedException(\n 'First level complex and Resource reference are not supported in the filter', \n \t\t 500, \n \t\t NULL\n );\n \t} else {\n \t\t// First level property access to primitive property\n \t\treturn $parent->getResourceProperty()->getName();\n \t}\n }\n }",
"public function expression()\n {\n $className = $this->definition->getExpressionClass();\n return new $className;\n }",
"public function set_expr($property, $value = null) {\r\n $this->orm->set_expr($property, $value);\r\n }",
"abstract protected function getBuildProperty($name);",
"protected function parsePropertyDefinition()\n {\n if ($this->features->restSpreadProperties &&\n ($prop = $this->parseSpreadElement())) {\n return $prop;\n }\n\n $state = $this->scanner->getState();\n if (($property = $this->parsePropertyName()) &&\n $this->scanner->consume(\":\")\n ) {\n $value = $this->isolateContext(\n array(\"allowIn\" => true), \"parseAssignmentExpression\"\n );\n if ($value) {\n $startPos = isset($property[2]) ? $property[2] : $property[0];\n $node = $this->createNode(\"Property\", $startPos);\n $node->setKey($property[0]);\n $node->setValue($value);\n $node->setComputed($property[1]);\n return $this->completeNode($node);\n }\n\n $this->error();\n \n }\n \n $this->scanner->setState($state);\n if ($property = $this->parseMethodDefinition()) {\n\n $node = $this->createNode(\"Property\", $property);\n $node->setKey($property->getKey());\n $node->setValue($property->getValue());\n $node->setComputed($property->getComputed());\n $kind = $property->getKind();\n if ($kind !== Node\\MethodDefinition::KIND_GET &&\n $kind !== Node\\MethodDefinition::KIND_SET\n ) {\n $node->setMethod(true);\n $node->setKind(Node\\Property::KIND_INIT);\n } else {\n $node->setKind($kind);\n }\n return $this->completeNode($node);\n \n } elseif ($key = $this->parseIdentifier(static::$identifierReference)) {\n \n $node = $this->createNode(\"Property\", $key);\n $node->setShorthand(true);\n $node->setKey($key);\n $value = $this->isolateContext(\n array(\"allowIn\" => true), \"parseInitializer\"\n );\n $node->setValue($value ?: $key);\n return $this->completeNode($node);\n \n }\n return null;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a bopomofo from string. | function bpmf($string)
{
return app(Pinyin::class)->bpmf($string);
} | [
"public function fromString($string);",
"public function getBin(Order $order)\n {\n try {\n $binAdapter = $this->paymentVerificationFactory->createPaymentBin($order->getPayment()->getMethod());\n\n $this->logger->debug('Getting bin using ' . get_class($binAdapter), ['entity' => $order]);\n\n $bin = $binAdapter->getData($order);\n\n if (isset($bin) === false) {\n return null;\n }\n\n $bin = preg_replace('/\\D/', '', $bin);\n\n if (empty($bin)) {\n return null;\n }\n\n $bin = (int) $bin;\n // A credit card does not starts with zero, so the bin intaval has to be at least 100.000\n if ($bin < 100000) {\n return null;\n }\n\n return (string) $bin;\n } catch (Exception $e) {\n $this->logger->error('Error fetching bin: ' . $e->getMessage(), ['entity' => $order]);\n return null;\n }\n }",
"public static function fromString($string);",
"public static function loadString(string $string): Graph\n {\n $loader = new FbpParser($string);\n $definition = $loader->run();\n\n return self::loadDefinition($definition);\n }",
"function s2o( $str, $assoc = false ) {\n\t\treturn json_decode( $str, $assoc );\n\t}",
"function bstr2bin($input)//из текстовых в бинарные\n// Binary representation of a binary-string\n{\n if (!is_string($input)) return null; // Sanity check\n // Unpack as a hexadecimal string\n $value = unpack('H*', $input);\n // Output binary representation\n return base_convert($value[1], 16, 2);\n}",
"function parse_bytes($str)\n{\n if (is_numeric($str))\n return floatval($str);\n\n if (preg_match('/([0-9\\.]+)\\s*([a-z]*)/i', $str, $regs))\n {\n $bytes = floatval($regs[1]);\n switch (strtolower($regs[2]))\n {\n case 'g':\n case 'gb':\n $bytes *= 1073741824;\n break;\n case 'm':\n case 'mb':\n $bytes *= 1048576;\n break;\n case 'k':\n case 'kb':\n $bytes *= 1024;\n break;\n }\n }\n\n return floatval($bytes);\n}",
"Static Function Parsear_bbcc ($texto)\n {\n // tomamos el código bbc en una variable para usarlo más fácil\n $bbc = self::$BBCC;\n // recorremos el array\n foreach ($bbc as $key => $item)\n {\n // reemplazamos los códigos\n $texto = preg_replace('#'.str_replace(array('[',']'),array('\\[','\\]'),str_replace('?','(.+)',$key)).'#i', $item, $texto);\n }\n return $texto;\n }",
"public function findBrandNameInString($string, $is_flat = false);",
"public function getBoleto()\n {\n if (isset($this->data['object']) && 'transaction' === $this->data['object']) {\n if ($this->data['boleto_url']) {\n $data = array(\n 'boleto_url' => $this->data['boleto_url'],\n 'boleto_barcode' => $this->data['boleto_barcode'],\n 'boleto_expiration_date' => $this->data['boleto_expiration_date'],\n );\n return $data;\n } else {\n return null;\n }\n }\n\n return null;\n }",
"public function provide()\n {\n preg_match_all(\"/[0-9A-F]{2}/i\", $this->string, $parts);\n return ByteList::factoryFromArray($parts[0], true);\n }",
"function parse_binary($binary)\n{\n $last = $binary[-1];\n if ($last !== '0' && $last !== '1') {\n throw new InvalidArgumentException;\n }\n if (strlen($binary) == 1) {\n return $binary;\n }\n return 2 * (parse_binary(substr($binary, 0, -1))) + $last;\n}",
"public function getBanco()\n\t{\n\t\treturn $this->banco;\n\t}",
"public function loadString($str) { }",
"public static function convertToBlock(string $str){\n\t\t$b = explode(\":\", str_replace([\" \", \"minecraft:\"], [\"_\", \"\"], trim($str)));\n\t\tif(!isset($b[1])){\n\t\t\t$meta = 0;\n\t\t}elseif(is_numeric($b[1])){\n\t\t\t$meta = $b[1] & 0xFFFF;\n\t\t}else{\n\t\t\tthrow new \\InvalidArgumentException(\"Unable to parse \\\"\" . $b[1] . \"\\\" from \\\"\" . $str . \"\\\" as a valid meta value\");\n\t\t}\n\n\t\tif(is_numeric($b[0])){\n\t\t\t$item = Block::get(((int)$b[0]) & 0xFFFF, $meta);\n\t\t}elseif(defined(BlockIds::class . \"::\" . strtoupper($b[0]))){\n\t\t\t$item = Block::get(constant(BlockIds::class . \"::\" . strtoupper($b[0])), $meta);\n\t\t}else{\n\t\t\tthrow new \\InvalidArgumentException(\"Unable to resolve \\\"\" . $str . \"\\\" to a valid item\");\n\t\t}\n\n\t\treturn $item;\n\t}",
"public function getBanco()\n {\n return $this->banco;\n }",
"public static function convertPostGis($value) {\n\t\tif (!empty($value)) {\n\t\t\ttry {\n\t\t\t\t$geom = geoPHP::load($value, 'wkt'); // Detect whether it's already in WKT\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$geom = null;\n\t\t\t}\n\t\t\tif (empty($geom)) {\n\t\t\t\t// Due to a bad designed ORM we need to do some extra querys...\n\t\t\t\t// TODO: Find a better solution. This is a really BAD solution!\n\t\t\t\t$result = DB::selectOne(\"SELECT ST_AsText('{$value}') AS bbox\");\n\t\t\t\treturn $result->bbox;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"function parse($string)\n{\n\tGLOBAL $format;\n\t\n\tswitch( $format ){\n\t\tcase \"json\":\n\t\t\treturn json_decode($string);\n\t\t\tbreak;\n\t\tcase \"xml\":\n\t\t\treturn simplexml_load_string($string);\n\t\t\tbreak;\n\t}\t\t\n}",
"public function deserialize(string $string, string $type): object;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get list of presets fields with description | public function presetFields()
{
$fullResult = $this->client->call(
'crm.requisite.preset.fields'
);
return $fullResult;
} | [
"public static function getPresetsList(): array\n\t{\n\t\t$presets['filter_last_30_days'] = [\n\t\t\t'name' => Loc::getMessage('TELEPHONY_REPORT_LAST_30_DAYS_FILTER_PRESET_TITLE'),\n\t\t\t'fields' => [\n\t\t\t\t'TIME_PERIOD_datesel' => DateType::LAST_30_DAYS,\n\t\t\t],\n\t\t\t'default' => true,\n\t\t];\n\n\n\t\t$presets['filter_current_month'] = [\n\t\t\t'name' => Loc::getMessage('TELEPHONY_REPORT_CURRENT_MONTH_FILTER_PRESET_TITLE'),\n\t\t\t'fields' => [\n\t\t\t\t'TIME_PERIOD_datesel' => DateType::CURRENT_MONTH,\n\t\t\t],\n\t\t\t'default' => false,\n\t\t];\n\n\t\t$presets['filter_current_quarter'] = [\n\t\t\t'name' => Loc::getMessage('TELEPHONY_REPORT_CURRENT_QUARTER_FILTER_PRESET_TITLE'),\n\t\t\t'fields' => [\n\t\t\t\t'TIME_PERIOD_datesel' => DateType::CURRENT_QUARTER,\n\t\t\t],\n\t\t\t'default' => false,\n\t\t];\n\n\t\treturn $presets;\n\t}",
"public function fetchAllSpecificationPreset()\n { \n return SpecificationPreset::select('_id', 'title')->get();\n }",
"public function getListFieldDescriptions();",
"public function getFields(){\n return\n AMI::getResourceModel('ext_eshop_custom_fields/table')\n ->getList()\n ->addColumns(array('id', 'name', 'fnum', 'ftype', 'value_type', 'default_gui_type'))\n ->addWhereDef(\n DB_Query::getSnippet(\"AND i.`default_params` LIKE %s\")\n ->q('%admin_filter\";s:1:\"1\"%')\n )\n ->addOrder('name', 'asc')\n ->load();\n }",
"private function getFields()\n {\n return [[\n 'handle' => 'seotamic_meta',\n 'field' => [\n 'display' => 'Meta',\n 'listable' => 'hidden',\n 'type' => 'section',\n 'localizable'=> false\n ],\n ],\n [\n 'handle' => 'seotamic_title',\n 'field' => [\n 'options' => [\n 'title' => 'Title',\n 'custom' => 'Custom'\n ],\n 'clearable' => false,\n 'multiple' => false,\n 'searchable' => true,\n 'taggable' => false,\n 'push_tags' => false,\n 'cast_booleans' => false,\n 'type' => 'select',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'default' => 'title',\n 'display' => 'Title',\n 'instructions' => 'It can be used to determine the title used on search engine results pages.'\n ]\n ],\n [\n 'handle' => 'seotamic_custom_title',\n 'field' => [\n 'input_type' => 'text',\n 'character_limit' => 100,\n 'type' => 'text',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Custom Meta Title',\n 'if' => [\n 'seotamic_title'=> 'equals custom'\n ]\n ]\n ],\n [\n 'handle' => 'seotamic_title_prepend',\n 'field' => [\n 'type' => 'toggle',\n 'instructions' => 'Prepends to title the text set in General SEO settings',\n 'localizable' => false,\n 'default' => true,\n 'width' => 50,\n 'listable' => 'hidden',\n 'display' => 'Title prepend',\n ]\n ],\n [\n 'handle' => 'seotamic_title_append',\n 'field' => [\n 'type' => 'toggle',\n 'localizable' => false,\n 'instructions' => 'Appends to title the text set in General SEO settings',\n 'width' => 50,\n 'listable' => 'hidden',\n 'default' => true,\n 'display' => 'Title append',\n ]\n ],\n [\n 'handle' => 'seotamic_meta_description',\n 'field' => [\n 'options' => [\n 'empty' => 'Empty',\n 'general' => 'General',\n 'custom' => 'Custom',\n ],\n 'clearable' => false,\n 'default' => 'empty',\n 'multiple' => false,\n 'searchable' => true,\n 'taggable' => false,\n 'push_tags' => false,\n 'cast_booleans' => false,\n 'type' => 'select',\n 'instructions' => 'It can be used to determine the text used under the title on search engine results pages. If empty, search engines will automatically generate this text.',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Meta description',\n ]\n ],\n [\n 'handle' => 'seotamic_custom_meta_description',\n 'field' => [\n 'input_type' => 'text',\n 'character_limit' => 200,\n 'type' => 'textarea',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Custom Meta description',\n 'if' => [\n 'seotamic_meta_description' => 'equals custom'\n ]\n ]\n ],\n [\n 'handle' => 'seotamic_canonical',\n 'field' => [\n 'type' => 'link',\n 'instructions' => 'By default it will be set to the page url',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Canonical',\n ]\n ],\n [\n 'handle' => 'seotamic_social',\n 'field' => [\n 'type' => 'section',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Social',\n ]\n ],\n [\n 'handle' => 'seotamic_open_graph_title',\n 'field' => [\n 'options' => [\n 'title' => 'Title',\n 'general' => 'General',\n 'custom' => 'Custom',\n ],\n 'clearable' => false,\n 'default' => 'title',\n 'multiple' => false,\n 'searchable' => true,\n 'taggable' => false,\n 'push_tags' => false,\n 'cast_booleans' => false,\n 'type' => 'select',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Open Graph title',\n ]\n ],\n [\n 'handle' => 'seotamic_custom_open_graph_title',\n 'field' => [\n 'input_type' => 'text',\n 'character_limit' => 100,\n 'type' => 'text',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Custom Open Graph title',\n 'if' => [\n 'seotamic_open_graph_title' => 'equals custom'\n ]\n ]\n ],\n [\n 'handle' => 'seotamic_open_graph_description',\n 'field' => [\n 'options' => [\n 'meta' => 'Meta description',\n 'general' => 'General description',\n 'custom' => 'Custom',\n ],\n 'clearable' => false,\n 'default' => 'general',\n 'multiple' => false,\n 'searchable' => true,\n 'taggable' => false,\n 'push_tags' => false,\n 'cast_booleans' => false,\n 'type' => 'select',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Open Graph description',\n ]\n ],\n [\n 'handle' => 'seotamic_custom_open_graph_description',\n 'field' => [\n 'input_type' => 'text',\n 'character_limit' => 200,\n 'type' => 'textarea',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Custom Open Graph description',\n 'if' => [\n 'seotamic_open_graph_description' => 'equals custom'\n ]\n ]\n ],\n [\n 'handle' => 'seotamic_twitter_title',\n 'field' => [\n 'options' => [\n 'title' => 'Title',\n 'general' => 'General',\n 'custom' => 'Custom',\n ],\n 'clearable' => false,\n 'default' => 'title',\n 'multiple' => false,\n 'searchable' => true,\n 'taggable' => false,\n 'push_tags' => false,\n 'cast_booleans' => false,\n 'type' => 'select',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Twitter title',\n ]\n ],\n [\n 'handle' => 'seotamic_custom_twitter_title',\n 'field' => [\n 'input_type' => 'text',\n 'character_limit' => 100,\n 'type' => 'text',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Custom Twitter title',\n 'if' => [\n 'seotamic_twitter_title' => 'equals custom'\n ]\n ]\n ],\n [\n 'handle' => 'seotamic_twitter_description',\n 'field' => [\n 'options' => [\n 'meta' => 'Meta description',\n 'general' => 'General description',\n 'custom' => 'Custom',\n ],\n 'clearable' => false,\n 'default' => 'general',\n 'multiple' => false,\n 'searchable' => true,\n 'taggable' => false,\n 'push_tags' => false,\n 'cast_booleans' => false,\n 'type' => 'select',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Twitter description',\n ]\n ],\n [\n 'handle' => 'seotamic_custom_twitter_description',\n 'field' => [\n 'input_type' => 'text',\n 'character_limit' => 200,\n 'type' => 'textarea',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Custom Twitter description',\n 'if' => [\n 'seotamic_twitter_description' => 'equals custom'\n ]\n ]\n ],\n [\n 'handle' => 'seotamic_image',\n 'field' => [\n 'container' => 'assets',\n 'mode' => 'grid',\n 'restrict' => false,\n 'allow_uploads' => true,\n 'max_files' => 1,\n 'type' => 'assets',\n 'instructions' => 'If not set, the general image will be used. It\\'s best to use an image with a 1.91:1 aspect ratio that is at least 1200px wide for universal support. The image will be resized to 1200 width.',\n 'localizable' => false,\n 'listable' => 'hidden',\n 'display' => 'Image',\n ]\n ]\n ];\n }",
"public function GetFieldsets ();",
"public function ListPresets_RC() {\n \n }",
"public function presets()\n {\n return $this->presets;\n }",
"public function getPrepDetailsList()\n {\n return $this->_fields['PrepDetailsList']['FieldValue'];\n }",
"public function get_field_options_sources() {\n\t\t\treturn apply_filters( 'jet-engine/forms/editor/field-options-sources', array(\n\t\t\t\t'manual_input' => __( 'Manual Input', 'jet-engine' ),\n\t\t\t\t'posts' => __( 'Posts', 'jet-engine' ),\n\t\t\t\t'terms' => __( 'Terms', 'jet-engine' ),\n\t\t\t\t'meta_field' => __( 'Meta Field', 'jet-engine' ),\n\t\t\t\t'generate' => __( 'Generate Dynamically', 'jet-engine' ),\n\t\t\t) );\n\t\t}",
"public function getPresets()\n {\n return $this->presets;\n }",
"public function getFilterFieldDescriptions();",
"function getProductDisplayFields(){\n $field_list = array();\n foreach (field_info_instances('node', $this->product_display['content_type_name']) as $key => $value)\n $field_list[$key] = $value['label'];\n foreach($this->product_display['natural_fields'] as $field => $label)\n $field_list[$field] = $label;\n return $field_list;\n }",
"public function actionListPresets()\n {\n $this->renderTemplate('texteffect/presets/_index');\n }",
"public function getPreRequisite() {\n\t\t$departments = $this->department->listAll();\n\t\t$designations = $this->designation->selectAllExludingDefault();\n\t\t$branches = $this->branch->listAll();\n\t\t$document_types = $this->document_type->listAll();\n\t\t$banks = $this->bank->listAll();\n\t\t$roles = $this->role->employeeRoleList();\n\t\t$list = getVar('list');\n\t\t$genders = generateTranslatedSelectOption(isset($list['gender']) ? $list['gender'] : []);\n\t\t$codes = $this->employee->groupBy('prefix')->get(['prefix', \\DB::raw('MAX(code) as code')]);\n\n\t\treturn compact('departments', 'genders', 'designations', 'codes', 'branches', 'document_types', 'banks', 'roles');\n\t}",
"public function getPresets()\n\t{\n\t\tglobal $DB;\n\n\t\tIncludeModuleLangFile(__FILE__);\n\n\t\tswitch ($this->contextId)\n\t\t{\n\t\t\tcase CTaskColumnContext::CONTEXT_RESPONSIBLE:\n\t\t\t\t$arPresets = array(\n\t\t\t\t\tself::PRESET_DEFAULT => array(\n\t\t\t\t\t\t'ID' => self::PRESET_DEFAULT,\n\t\t\t\t\t\t'USER_ID' => $this->userId,\n\t\t\t\t\t\t'CONTEXT_ID' => $this->contextId,\n\t\t\t\t\t\t'NAME' => GetMessage('TASKS_COLUMN_MANAGER_DEFAULT_PRESET_NAME'),\n\t\t\t\t\t\t'SERIALIZED_COLUMNS' => serialize(array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_TITLE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_DEADLINE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_ORIGINATOR,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_GRADE,\n\t\t\t\t\t\t\t\t'WIDTH' => 65\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t))\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tbreak;\n\n\t\t\tcase CTaskColumnContext::CONTEXT_ORIGINATOR:\n\t\t\t\t$arPresets = array(\n\t\t\t\t\tself::PRESET_DEFAULT => array(\n\t\t\t\t\t\t'ID' => self::PRESET_DEFAULT,\n\t\t\t\t\t\t'USER_ID' => $this->userId,\n\t\t\t\t\t\t'CONTEXT_ID' => $this->contextId,\n\t\t\t\t\t\t'NAME' => GetMessage('TASKS_COLUMN_MANAGER_DEFAULT_PRESET_NAME'),\n\t\t\t\t\t\t'SERIALIZED_COLUMNS' => serialize(array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_TITLE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_DEADLINE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_RESPONSIBLE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_GRADE,\n\t\t\t\t\t\t\t\t'WIDTH' => 65\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t))\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\tcase CTaskColumnContext::CONTEXT_ALL:\n\t\t\tcase CTaskColumnContext::CONTEXT_AUDITOR:\n\t\t\tcase CTaskColumnContext::CONTEXT_ACCOMPLICE:\n\t\t\tcase CTaskColumnContext::CONTEXT_TASK_DETAIL:\n\t\t\t\t$arPresets = array(\n\t\t\t\t\tself::PRESET_DEFAULT => array(\n\t\t\t\t\t\t'ID' => self::PRESET_DEFAULT,\n\t\t\t\t\t\t'USER_ID' => $this->userId,\n\t\t\t\t\t\t'CONTEXT_ID' => $this->contextId,\n\t\t\t\t\t\t'NAME' => GetMessage('TASKS_COLUMN_MANAGER_DEFAULT_PRESET_NAME'),\n\t\t\t\t\t\t'SERIALIZED_COLUMNS' => serialize(array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_TITLE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_DEADLINE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_ORIGINATOR,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_RESPONSIBLE,\n\t\t\t\t\t\t\t\t'WIDTH' => 0\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'ID' => CTaskColumnList::COLUMN_GRADE,\n\t\t\t\t\t\t\t\t'WIDTH' => 65\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t))\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\tbreak;\n\t\t}\n\n\t\t$rc = $DB->query(\n\t\t\t\"SELECT ID, USER_ID, CONTEXT_ID, NAME, SERIALIZED_COLUMNS\n\t\t\tFROM b_tasks_columns\n\t\t\tWHERE USER_ID = \" . $this->userId . \" AND CONTEXT_ID = \" . $this->contextId\n\t\t);\n\n\t\twhile ($ar = $rc->fetch())\n\t\t\t$arPresets[$ar['ID']] = $ar;\n\n\t\treturn ($arPresets);\n\t}",
"protected function getFieldsetsFromForm()\n {\n $queryBuilder = DatabaseUtility::getQueryBuilderForTable(Page::TABLE_NAME);\n $rows = (array)$queryBuilder\n ->select('uid', 'title')\n ->from(Page::TABLE_NAME)\n ->where('form = ' . $this->getFormUid())\n ->addOrderBy('sorting')\n ->execute()\n ->fetchAll();\n $fieldsets = [];\n foreach ($rows as $row) {\n $fieldsets[] = $row;\n }\n return $fieldsets;\n }",
"public function summaryFields() {\n $summaryFields = array(\n 'Title' => $this->fieldLabel('Title'),\n 'Description' => $this->fieldLabel('Description'),\n 'Priority' => $this->fieldLabel('Priority'),\n 'IsDefaultString' => $this->fieldLabel('IsDefault'),\n );\n\n $this->extend('updateSummaryFields', $summaryFields);\n return $summaryFields;\n }",
"private function getFieldDefinitions() {\r\n $product_model = new ModelDef(self::PRODUCT_MODEL);\r\n $field_defs = $product_model->getFieldDefinitions();\r\n //hide detail link\r\n $field_defs['name']['type'] = 'varchar';\r\n\r\n return $field_defs;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the sort value | public function getSortValue() {} | [
"public function getSortValue()\n {\n return $this->getId();\n }",
"public function getSort()\n {\n $value = $this->get(self::sort);\n return $value === null ? (integer)$value : $value;\n }",
"public function getSort()\n {\n return $this->sort;\n }",
"private function sortVal()\n {\n $day = $this->Day;\n return date('N', strtotime($day));\n }",
"public function getSort()\n {\n return $this->customSort;\n }",
"public function getSortKey() {\n\t\treturn $contentObj->{$this->sortKey};\n\t}",
"public function getScSort()\n {\n return $this->sc_sort;\n }",
"public function getSortKey()\n {\n return $this->get('sort');\n }",
"function getSorting() {\n\t\treturn $this->_sorting;\n\t}",
"public function _get_sort_field() {\r\n return $this->__sort_field_name;\r\n }",
"public function getItemSort()\n {\n return $this->itemSort;\n }",
"public function getSorting()\n {\n return $this->sorting;\n }",
"public function getSortField()\n {\n return $this->field;\n }",
"public function getSortingField()\n {\n $result = null;\n /**\n * Just prior to getting the configured sorting field.\n *\n * @delegate SectionGetSortingField\n * @since Symphony 3.0.0\n * @param string $context\n * '/publish/'\n * @param string $section-handle\n * The handle of the current section\n * @param string &$field\n * The field as set by extensions\n */\n Symphony::ExtensionManager()->notifyMembers('SectionGetSortingField', '/publish/', array(\n 'section-handle' => $this->get('handle'),\n 'field' => &$result,\n ));\n\n if (!$result) {\n $result = Symphony::Configuration()->get('section_' . $this->get('handle') . '_sortby', 'sorting');\n }\n\n return (!$result ? $this->getDefaultSortingField() : (string)$result);\n }",
"function getSortField() {\n \treturn $this->sSortField;\n }",
"public function field()\n {\n return 'sort';\n }",
"function getSort() {\n $sort = 'name';\n if (isset($this->data['sort'])) {\n switch ($this->data['sort']) {\n case 0:\n case 1:\n $sort = 'title';\n break;\n case 2 :\n case 3 :\n $sort = 'date';\n break;\n case 4 :\n case 5 :\n $sort = 'sort';\n break;\n }\n }\n return $sort;\n }",
"protected function getSortParameter() {\n\t\t$value = trim(t3lib_div::_GP($this->sortParameterName));\n\t\tif (!$this->isValidSortParameter($value)) {\n\t\t\t$value = '';\n\t\t}\n\t\treturn $value;\n\t}",
"public function getArticleSort()\n {\n return $this->article_sort;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the specified RelationType in storage. | public function update($id, UpdateRelationTypeRequest $request)
{
$relationType = $this->relationTypeRepository->findWithoutFail($id);
if (empty($relationType)) {
Flash::error('Relation Type not found');
return redirect(route('relations.relationTypes.index'));
}
$relationType = $this->relationTypeRepository->update($request->all(), $id);
Flash::success('Relation Type updated successfully.');
return redirect(route('relations.relationTypes.index'));
} | [
"public function updateAction(Tx_Taxonomy_Domain_Model_LabelRelationType $labelRelationType) {\n\t\t$this->labelRelationTypeRepository->update($labelRelationType);\n\t\t$this->flashMessageContainer->add('Your LabelRelationType was updated.');\n\t\t$this->redirect('list');\n\t}",
"public function updateAction(Tx_Taxonomy_Domain_Model_SemanticRelationType $semanticRelationType) {\n\t\t$this->semanticRelationTypeRepository->update($semanticRelationType);\n\t\t$this->flashMessageContainer->add('Your SemanticRelationType was updated.');\n\t\t$this->redirect('list');\n\t}",
"public function updateStorageType($type)\n {\n $this->processStorageOptionsOrType($type);\n }",
"private function setRelationType(Type $relationType): void\n {\n $this->relationType = $relationType;\n }",
"public static function updateRelatedViewType($relationId, $type)\n\t{\n\t\t\\App\\Db::getInstance()->createCommand()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->execute();\n\t\t\\App\\Cache::clear();\n\t}",
"function admin_change_relation_type() {\n\t\t//\n\t}",
"public function updateType($old_type, $new_type);",
"public function setRelationType($relationType)\n {\n $this->relationType = $relationType;\n }",
"public function updated(Type $type)\n {\n //\n }",
"private function _update_relationship_fieldtype()\n\t{\n\t\t// UPDATE TABLE `exp_fieldtypes` SET name='relationships' WHERE name='rel';\n\t\tee()->db->where('name', 'rel');\n\t\tee()->db->update('fieldtypes', array('name'=>'relationship'));\n\n\t\t// UPDATE TABLE `exp_channel_fields` set field_type='relationships' where field_type='rel';\n\t\tee()->db->where('field_type', 'rel');\n\t\tee()->db->update('channel_fields', array('field_type'=>'relationship'));\n\n\t\tee()->db->where('field_type', 'relationship');\n\t\t$channel_fields = ee()->db->get('channel_fields');\n\t\tforeach ($channel_fields->result_array() as $channel_field)\n\t\t{\n\t\t\t$settings = array(\n\t\t\t\t'channels'\t\t=> array($channel_field['field_related_id']),\n\t\t\t\t'expired'\t\t=> 0,\n\t\t\t\t'future'\t\t=> 0,\n\t\t\t\t'categories'\t=> array(),\n\t\t\t\t'authors'\t\t=> array(),\n\t\t\t\t'statuses'\t\t=> array(),\n\t\t\t\t'limit'\t\t\t=> $channel_field['field_related_max'],\n\t\t\t\t'order_field'\t=> $channel_field['field_related_orderby'],\n\t\t\t\t'order_dir'\t\t=> $channel_field['field_related_sort'],\n\t\t\t\t'allow_multiple'\t=> 0\n\t\t\t);\n\n\t\t\tee()->db->where('field_id', $channel_field['field_id']);\n\t\t\tee()->db->update(\n\t\t\t\t'channel_fields',\n\t\t\t\tarray('field_settings'=>base64_encode(serialize($settings))));\n\n\t\t}\n\n\t}",
"protected function setRelationType($relation)\r\n {\r\n Validate::relation_type($relation);\r\n $this->relationType = $relation;\r\n }",
"function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'100')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}",
"public function update(AgentTypeInterface $agentType);",
"public function update($link_type)\n {\n $query=\"UPDATE link_type \".\n\t \"SET \".\n \"id= \".$link_type->id.\" ,\".\n \"parent= \".$link_type->parent.\" ,\".\n \"child_order= \".$link_type->child_order.\" ,\".\n \"gid='\".$this->sqlSafe($link_type->gid).\"',\".\n \"entity_type0='\".$this->sqlSafe($link_type->entity_type0).\"',\".\n \"entity_type1='\".$this->sqlSafe($link_type->entity_type1).\"',\".\n \"name='\".$this->sqlSafe($link_type->name).\"',\".\n \"description='\".$this->sqlSafe($link_type->description).\"',\".\n \"link_phrase='\".$this->sqlSafe($link_type->link_phrase).\"',\".\n \"reverse_link_phrase='\".$this->sqlSafe($link_type->reverse_link_phrase).\"',\".\n \"long_link_phrase='\".$this->sqlSafe($link_type->long_link_phrase).\"',\".\n \"priority= \".$link_type->priority.\" ,\".\n \"last_updated='\".$this->sqlSafe($link_type->last_updated).\"',\".\n \"is_deprecated='\".$this->sqlSafe($link_type->is_deprecated).\"',\".\n \"has_dates='\".$this->sqlSafe($link_type->has_dates).\"',\".\n \"entity0_cardinality= \".$link_type->entity0_cardinality.\" ,\".\n \"entity1_cardinality= \".$link_type->entity1_cardinality.\" \". \n\t \"WHERE id=\".$link_type->id;\n\n $this->executeQuery($query);\n }",
"function updateContentRelation($data) {\n\n $content_relations = $this->getContentRelations($data['content_id'], $data['type']);\n\n if($content_relations == 404) {\n return $this->insertContentRelation($data);\n } else {\n $relation_array = array(\n 'intTypeId' => $data['type_id'],\n );\n\n return $this->updateByArray($this->_rel_relation, $relation_array, \"strType = '\".$data['type'].\"' and intContentId = \".$data['content_id']);\n }\n }",
"public function setRelation($type, $name, $info)\n {\n if (! isset($this->types[$type])) {\n throw new Exception(\"Type '$type' is not in the manager.\");\n }\n\n if ($this->types[$type] instanceof GenericType) {\n // set on a type instance\n $relation = $this->relation_builder->newInstance(\n $type,\n $name,\n $info,\n $this\n );\n $this->types[$type]->setRelation($name, $relation);\n } else {\n // set the relation name on a type definition\n $this->types[$type]['relation_names'][$name] = $info;\n }\n }",
"public function testUpdateFulfillmentType()\n {\n }",
"public function updateNode($type) {\n $this->current->updateType($type);\n }",
"public function setRelation($relation, $value);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Downloads the input of a testcase This function downloads the input of the testcase whose ID is $testcase_id. | public function downloadTestcaseInput($testcase_id)
{
$this->load->helper('download');
$testcase = $this->problem_manager->get_testcase($testcase_id);
$content = $this->problem_manager->get_testcase_content($testcase_id, 'input');
force_download($testcase['input'], $content);
} | [
"public function downloadTestcaseOutput($testcase_id)\n\t{\n\t\t$this->load->helper('download');\n\t\t$testcase = $this->problem_manager->get_testcase($testcase_id);\n\t\t$content = $this->problem_manager->get_testcase_content($testcase_id, 'output');\n\n\t\tforce_download($testcase['output'], $content);\n\t}",
"public function download($id);",
"function getTestCaseData($testCaseID, $theSubjectID, $roundID, $studyID, $clientID) {\n global $definitions;\n\n $testCaseParentTestCategoryPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasesFolderID'], $clientID);\n\n $theTestCase = array();\n $theTestCase['TC_ID'] = $testCaseID;\n $theTestCase['ROUND_ID'] = $roundID;\n $theTestCase['STUDY_ID'] = $studyID;\n $theTestCase['SUBJECT_ID'] = $theSubjectID;\n\n //Also, get the parent testCategory for the test case\n $theTestCase['PARENT_TC_ID'] = getItemPropertyValue($testCaseID, $testCaseParentTestCategoryPropertyID, $clientID);\n\n //Get the steps for this testCase\n $theSteps = array();\n\n $theSteps = getStepsScriptsForTestCase($testCaseID, $theSubjectID, $roundID, $studyID, $clientID);\n //print(\"Steps scritps details for testCase $testCaseID and subject $theSubjectID\\n\\r\" );\n //print_r($theSteps);\n $stepsCount = 0;\n //Only returns the testcase if any step of the test case is automated and has the type passed (TODO this last)\n $hasAutomatedSteps = \"NO\";\n\n //Add the steps to the result\n for ($i = 0; $i < count($theSteps); $i++) {\n if ($theSteps[$i]['scriptAppValue'] == 'steps.types.php') {\n //print(\"found automated step\\n\\r\");\n $theTestCase['STEP_ID_' . $stepsCount] = $theSteps[$i]['ID'];\n $theTestCase['STEP_TYPE_' . $stepsCount] = $theSteps[$i]['stepType'];\n $theTestCase['STEP_APPTYPE_' . $stepsCount] = $theSteps[$i]['scriptAppValue'];\n $theTestCase['STEP_RESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_Result_ID'];\n //Get the stepUnits values\n\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_ID'];\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_DESCRIPTION_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_DESCRIPTION_ID'];\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULT_LASTRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUM_LASTRESULT_ID'];\n\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULTDESCRIPTION_LASTRESULT_ID_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMDESCRIPTION_LASTRESULT_ID'];\n\n }\n if (isset($theSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'])) {\n $theTestCase['STEP_STEPUNITS_SELENIUMRESULTEXECVALUE_' . $stepsCount] = $theSteps[$i]['stepUnit_SELENIUMRESULT_EXECVALUE'];\n\n }\n\n $stepsCount++;\n $hasAutomatedSteps = \"YES\";\n }\n }\n\n if ($hasAutomatedSteps == \"YES\") {\n //And return the test case\n //print (\"Return automated testCase: $testCaseID\\n\\r\");\n return $theTestCase;\n } else {\n //print (\"Not automated testCase $testCaseID. Return null\\n\\r\");\n return null;\n }\n\n}",
"public function get_testcase($testcase_id)\n\t{\n\t\t$this->db->from('testcase');\n\t\t$this->db->where('id', $testcase_id);\n\t\t$q = $this->db->get();\n\t\tif ($q->num_rows() == 0)\n\t\t\treturn FALSE;\n\t\treturn $q->row_array();\n\t}",
"public function get_file($download_id = '')\n {\n }",
"function show_detailed_testcase($ID) {\n\n $query = \"SELECT * FROM daf.testcase where ID = '\" . $ID . \"'\";\n $testcase = mysql_query($query);\n\n if (! $testcase) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Testcase</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n $fieldindex[$fieldname] = $i;\n }\n \n $testcase_row = mysql_fetch_row($testcase);\n /* $ScenarioID = $scenario_row[$fieldindex['ID']]; */\n\n for ($i = 0; $i < $num_fields; $i++) {\n echo '<tr>';\n echo '<th>' . mysql_field_name($testcase, $i) . '</th>';\n echo '<td>' . $testcase_row[$i] . '</td>';\n echo '</tr>';\n echo \"\\n\";\n }\n echo '</table>';\n \n $query = \"SELECT DISTINCT scenario.ID, scenario.Name, action.Stepnumber FROM daf.action INNER JOIN daf.scenario ON action.ScenarioID = scenario.ID WHERE action.TestcaseID = '\" . $ID . \"'\";\n $testcase = mysql_query($query);\n\n if (! $testcase) \n die (\"Database access failed for query=$query: \" . mysql_error());\n\n $num_rows = mysql_num_rows($testcase); // should only be one row\n $num_fields = mysql_num_fields($testcase);\n\n echo '<form action=\"index.php\" method=\"post\">' . \"\\n\";\n\n echo '<table class=\"tab1\">';\n echo \"<caption class=\\\"cap1\\\"><div>Scenarios</div></caption>\";\n echo \"\\n\";\n \n $fieldindex = array();\n for ($i = 0; $i < $num_fields; $i++) {\n $fieldname = mysql_field_name($testcase, $i);\n echo '<th>' . $fieldname . '</th>';\n $fieldindex[$fieldname] = $i; \n }\n echo \"</tr>\\n\";\n \n $idindex = $fieldindex['ID'];\n $nameindex = $fieldindex['Name'];\n \n for ($i= 0; $i < $num_rows; $i++) {\n \n $testcase_row = mysql_fetch_row($testcase);\n echo '<tr>';\n for ($j = 0; $j < $num_fields; $j++) { \n if ($j == $nameindex) {\n echo \"<td class=td_smd><a href=index.php?action=show&object=scenario&ID=$testcase_row[$idindex]>$testcase_row[$j]</a></td>\"; \n } else { \n echo '<td>' . $testcase_row[$j] . '</td>';\n }\n } \n echo \"</tr>\\n\";\n \n }\n \n echo \"</tr>\\n\";\n echo '</table>'; \n \n}",
"function instant_download($product_id) {\n\t //echo \"PICKIT:\",$file; \n \n\t switch ($this->type) {\n\t\t\t\t\n case 'fullversion' :\n\t\t $file = paramload('SHELL','prpath') . \n\t\t\t\t\t\t\t paramload('RCPICKIT','dirsource') . \n\t\t\t\t\t\t\t\t\t $product_id . \n\t\t\t\t\t\t\t\t\t paramload('RCPICKIT','filetype');\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t \n\t case 'shareware' : $file = paramload('SHELL','prpath') . \n\t\t\t\t\t\t\t paramload('RCDOWNLOAD','dirsource') . \n\t\t\t\t\t\t\t\t \t $product_id . \n\t\t\t\t\t\t\t\t\t paramload('RCDOWNLOAD','filetype');\n\t\t\t\t\t\t\t break;\n\t }\t \n\n $downloadfile = new DOWNLOADFILE($file);\n\t \n //$this->tell_by_mail(\n\t GetGlobal('controller')->calldpc_method(\"rcdownload.tell_by_mail use \" .\n\t $this->type . \" file downloaded\".\"+\".\n\t 'support@re-coding.com'.\"+\".\n\t\t 'billy@re-coding.com'.\"+\".\n\t\t\t\t\t\t $file);\t \t \n\t \n if (!$downloadfile->df_download()) {\n\t //echo \"Sorry, we are experiencing technical difficulties downloading this file. Please report this error to Technical Support.\";\t \t \n $ret = $this->error;\t \n\t }\n\t //else\n\t // $ret = \"OK\";\t\n\t \n\t return ($ret);\n }",
"public function getById($id) {\r\n return $this->testcaseEntity->find($id);\r\n }",
"public function download_spec($id)\n {\n App::import('Helper', 'Plaintext');\n $Plaintext = new PlaintextHelper(new View(null));\n\n $Entities = $this->Entity->find('all', array(\n 'conditions' => array(\n 'Entity.problem_map_id' => $id,\n 'Entity.type' => 'requirement',\n 'Entity.subtype' => 'specification'\n )\n ));\n\n if (count($Entities)) {\n $count = 0;\n $htmldata = \"\";\n $htmldata .= \"S.No. \\r\\t Specifications \\r\\n\";\n foreach ($Entities as $entity) {\n $count++;\n $htmldata .= $count . \" \\r\\t \" . $entity['Entity']['name'] . \"\\r\\t\" . $entity['Entity']['name'] . \"\\r\\n\";\n }\n } else {\n $htmldata = \"No data available\";\n }\n $this->ProblemMap->recursive = -1;\n $ProblemMap = $this->ProblemMap->findById($id);\n $filename = $ProblemMap['ProblemMap']['name'] . '_Specifications_' . date('Y-m-d') . '.txt';\n Configure::write('debug', 0);\n $this->layout = 'ajax';\n $Plaintext->setFilename($filename);\n echo $Plaintext->render($htmldata);\n\n $this->autoRender = false;\n }",
"function download ($video_id) {\n\t\t$url = \"http://www.youtube.com/watch?v=\".$video_id;\n\t\t$this->req =& new HTTP_Request($url);\n\t\t$response = $this->req->sendRequest();\n\t\tif (PEAR::isError($response)) {\n\t\t\techo $response->getMessage().\"\\n\";\n\t\t} else {\t\n\t\t\t$page = $this->req->getResponseBody();\t\n\t\t\t//preg_match('/watch_fullscreen\\?video_id=(.*?)&l=(.*?)+&t=(.*?)&/', $page, $match);\n\t\t\tpreg_match('/\"video_id\": \"(.*?)\"/', $page, $match);\n\t\t\t$var_id = $match[1];\n\n\t\t\tpreg_match('/\"t\": \"(.*?)\"/', $page, $match);\n\t\t\t$var_t = $match[1];\n\n\t\t\t$url = \"\";\n\t\t\t$url .= $var_id;\n\t\t\t$url .= \"&t=\";\n\t\t\t$url .= $var_t;\n\t\t\t$url = \"http://www.youtube.com/get_video?video_id=\".$url;\n\t\t\tif ($this->debug)\n\t\t\t\treturn $url;\n\t\t\t\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"function download ($video_id, $video_filename) {\n\t\t$url = \"http://www.youtube.com/watch?v=\".$video_id;\n\t\t$this->req =& new HTTP_Request($url);\n\t\t$response = $this->req->sendRequest();\n\t\tif (PEAR::isError($response)) {\n\t\t\techo $response->getMessage().\"\\n\";\n\t\t} else {\t\n\t\t\t$page = $this->req->getResponseBody();\t\n\t\t\t//preg_match('/watch_fullscreen\\?video_id=(.*?)&l=(.*?)+&t=(.*?)&/', $page, $match);\n\t\t\tpreg_match('/\"video_id\": \"(.*?)\"/', $page, $match);\n\t\t\t$var_id = $match[1];\n\n\t\t\tpreg_match('/\"t\": \"(.*?)\"/', $page, $match);\n\t\t\t$var_t = $match[1];\n\n\t\t\t$url = \"\";\n\t\t\t$url .= $var_id;\n\t\t\t$url .= \"&t=\";\n\t\t\t$url .= $var_t;\n\t\t\t$url = \"http://www.youtube.com/get_video?video_id=\".$url;\n\t\t\tif ($this->debug)\n\t\t\t\tprint $url.\"\\n\";\n\t\t\t$req =& new HTTP_Request($url,array (\"allowRedirects\"=>true, \"maxRedirects\"=> 99));\n\t\t\t$req->setMethod(HTTP_REQUEST_METHOD_GET);\n\t\t\t$req->addHeader(\"User-Agent\",\"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)\");\t\n\t\t\t$response = $req->sendRequest();\n\t\t\tif (PEAR::isError($response)) {\n\t\t\t //echo $response->getMessage().\"\\n\";\n\t\t\t\tprint \"Error: Failed to open YouTube-Source\\n\";\t\t\t\t\t \n\t\t\t} else {\n \t\tif ($o = fopen ($video_filename, \"w\")) {\n\t\t\t\t\tfwrite($o,$req->getResponseBody());\n\t\t\t\t\tfclose ($o);\n \t\t\tprint \"Download done! File: \".$video_filename.\"\\n\";\n\t\t\t\t} else { \n\t\t\t\t\tprint \"Error: Failed to open target-file\\n\";\n \t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function actionDownload($id)\n {\n try{\n $withdrawal_model = $this->findModel($id);\n \n if(is_null($withdrawal_model->kaewithdr_decisionfile))\n throw new Exception(\"There is no uploaded withdrawal decision file.\");\n \n $filepath = Yii::getAlias(Yii::$app->params['finance_uploadfolder']);\n //echo $file; die();\n if(!is_readable($filepath . $withdrawal_model->kaewithdr_decisionfile))\n throw new Exception(\"The decision file cannot be found.\"); \n \n return Yii::$app->response->SendFile($filepath . $withdrawal_model->kaewithdr_decisionfile, $withdrawal_model->kaewithdr_decisionfile);\n\n \n return $this->redirect(['/finance/finance-kaewithdrawal/index']);\n \n }\n catch(Exception $e){\n Yii::$app->session->addFlash('danger', Module::t('modules/finance/app', $e->getMessage()));\n return $this->redirect(['/finance/finance-kaewithdrawal/index']);\n }\n }",
"public function testDownloadARecordingFile()\n {\n }",
"function downloadFile()\n\t{\n\t\tglobal $ilAccess, $ilias, $lng;\n\t\t\n\t\tif (!$ilAccess->checkAccess(\"read\", \"\", $_GET[\"ref_id\"]))\n\t\t{\n\t\t\t$ilias->raiseError($lng->txt(\"permission_denied\"),$ilias->error_obj->MESSAGE);\n\t\t}\n\n\t\t$file = explode(\"_\", $_GET[\"file_id\"]);\n\t\tinclude_once(\"./Modules/File/classes/class.ilObjFile.php\");\n\t\t$fileObj =& new ilObjFile($file[count($file) - 1], false);\n\t\t$fileObj->sendFile();\n\t\texit;\n\t}",
"public function downloadBIO($id)\n {\n }",
"public function loadTestCaseById($id){\n return $this->getRepository()->findOneBy(array('idtestCase' => $id));\n }",
"public function fileControllerDownloadRequest($id)\n {\n // verify the required parameter 'id' is set\n if (null === $id || (is_array($id) && 0 === count($id))) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling fileControllerDownload');\n }\n\n $resourcePath = '/sync-core/file/{id}/download';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if (null !== $id) {\n $resourcePath = str_replace(\n '{'.'id'.'}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem,\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ('application/json' === $headers['Content-Type']) {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if (null !== $this->config->getAccessToken()) {\n $headers['Authorization'] = 'Bearer '.$this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testDownloadSoftpin()\n {\n $response = $this->service->downloadSoftpin([\n 'request_id' => uniqid('9PAY_TEST'),\n 'provider' => Provider::TYPE_VINAGAME,\n 'amount' => 10000,\n 'quantity' => 2\n ]);\n\n echo \"\\n\" . json_encode($response);\n\n if (isset($response['error'])) {\n return $this->assertTrue(false);\n }\n\n return $this->assertTrue(true);\n }",
"public function downloadDocument() {\n\t \n\t extract($this->requireInput(array('document_id')));\n\t \n\t $this->loadModel('PatientDocument');\n\t $this->params['named']['document_id'] = $document_id;\n\t $this->PatientDocument->execute($this, 'download_file', '');\n\t\t \n\t exit;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if company has created any jobs. | public function hasJobs()
{
if($this->numJobs() > 0)
{
return true;
}
return false;
} | [
"public function hasJobs()\r\n {\r\n return !$this->jobs->isEmpty();\r\n }",
"public function hasJob()\n {\n return $this->hasEntity();\n }",
"public function check()\n {\n $results = $this->getDelayedJobs();\n $delayedJobs = [['Type', 'Reference', 'Created']];\n foreach ($results as $result) {\n $waiting = $result->created->timeAgoInWords();\n $delayedJobs[] = [\n 'type' => $result['job_type'],\n 'reference' => $result['reference'],\n 'created' => $waiting,\n ];\n }\n\n if (! $results->isEmpty()) {\n $this->out('Jobs created more than ' . $this->threshold . ':');\n $this->helper('Table')->output($delayedJobs);\n } else {\n $this->out('No jobs created more than ' . $this->threshold . '.');\n }\n }",
"public function hasCompany(): bool\n {\n return $this->company()->exists();\n }",
"public function exists()\n {\n try {\n $this->connection->getJob($this->identity + ['fields' => 'jobReference']);\n } catch (NotFoundException $ex) {\n return false;\n }\n\n return true;\n }",
"public function doesExist(){ return $this->APICall( '', \"Could not test for existence for job \" . $this->description() ); }",
"private function ensureJobsAvailable() : bool\n {\n //Check existing jobs in queue, if there are none then try to get updated jobs from the storage handler\n if ($this->queue->isEmpty()) {\n $this->updateJobQueue();\n\n //if still nothing then return\n if ($this->queue->isEmpty()) {\n return false;\n }\n }\n\n return true;\n }",
"function job_exists($id){\n foreach (get_job_list() as $job) {\n if($job->id == $id){\n return true;\n }\n }\n return false;\n}",
"public function hasChildrenJobsOnParentJob() {\n $dbCriteria = $this->getChildrenJobCriteriaForParentJob();\n return $dbCriteria ? self::model()->exists($dbCriteria) : false;\n }",
"public function hasQCJob() {\n return (!is_null($this->projectJob->qc_job_id)) ? true : false;\n }",
"public function checkAllJobs() {\n $this->checkEditorsCheckJob();\n }",
"function qe_undone_jobs_before_current_exists($job) {\n $undone_jobs = kms_oci_queue_get_job_ids(\n array('exclude' => array(KmsOciQueueJob::STATUS_DONE))\n );\n $undone_jobs_b4 = array_filter($undone_jobs, function($jid) use ($job) {\n return intval($jid) < intval($job->jid);\n });\n\n return (bool) count($undone_jobs_b4);\n}",
"protected function isJobLimit(): bool\n {\n return $this->jobCount >= $this->options->jobLimit;\n }",
"public function check_company_setup_status()\n {\n return (Auth::user()->company_id > 0) ? true : false;\n }",
"public function needWork()\n {\n if ($this->employed)\n return !($this->employment());\n\n return false;\n }",
"function hasAlreadyCompletedAJobToday()\n {\n $sql = sprintf(\"SELECT task_start FROM %s WHERE username = '%s' AND task_3 = 1\",\n CAREER_TABLE,\n USERNAME);\n $set = db_fetch_assoc(db_query($sql));\n \n $taskStart = @ $set['task_start'];\n if (date('z-Y', $taskStart) == date('z-Y'))\n {\n _trace('User has already completed a job today');\n return TRUE;\n }\n \n return FALSE;\n }",
"public function getCompanyJobs()\n {\n return $this->jobs()\n ->where('is_closed', 0)\n // ->whereDate('closes_at', '>', Carbon::now())\n ->with('location', 'type', 'category');\n }",
"public function hasCompany(): bool;",
"public function driverCheckJobs()\n\t{\n\t\tSELF::$errCode = EnumError::SUCCESS;\n\n\t\t$jobs = get_user_object()->check_job(_USER('id'));\n\n\t\t$data = new stdClass();\n\t\t$data->jobs = $jobs;\n\n\t\techo _Respond(SELF::$errCode, $data);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the value for the OriginalText input for this AddTranslation Choreo. | public function setOriginalText($value)
{
return $this->set('OriginalText', $value);
} | [
"public function setRawText($text) {\n $this->rawText = $text;\n }",
"public function setOriginal(string $original): self\n {\n if ($original !== $this->original) {\n $this->original = $original;\n $this->transliteration = null;\n }\n\n return $this;\n }",
"public function setTranslatedText($value)\n {\n return $this->set('TranslatedText', $value);\n }",
"public function setText($text) : Lightbox\n {\n \n $this->_data['attributes']['text'] = $text;\n $this->_data['attributes']['lastpdate_date'] = date('Y-m-d h:i:s');\n \n if (!in_array(\"attributes\", $this->_changedProperties)) $this->_changedProperties[] = \"attributes\";\n \n return $this;\n \n }",
"public function setOriginal($var)\n {\n GPBUtil::checkString($var, True);\n $this->original = $var;\n\n return $this;\n }",
"function wsr_change_translate_text( $translated_text ) {\n\tif ( $translated_text == 'Old Text' ) {\n\t\t$translated_text = 'New Translation';\n\t}\n\treturn $translated_text;\n}",
"public function setText($text)\n {\n $this->addText = true;\n $this->text = $text;\n }",
"public function set_text($text)\n {\n $this->entry->set_text($text);\n }",
"public function setTranslation($orig, $translation, $language);",
"public function setText($text) {\n $this->text = $text;\n }",
"public function set_text( $text ) {\n\t\t$this->text = addslashes( $text ); // is the addslashes necessary?\n\t}",
"public function setText($text)\n {\n $this->text = $text;\n }",
"public function setPlainText($text)\n {\n $this->_plainText = $text . \"\"; //force it to be a string\n }",
"public function setText($text)\n {\n $this->text = $this->message['text'] = $text;\n }",
"public function setText($text) {\n\t\t$this->text = $text;\n\t\t// Reset the rendered text. It will be filled again when the post\n\t\t// is rendered.\n\t\t$this->renderedText = '';\n\t}",
"public function setText($text) {\n Validator::validateNonNull(\"MmsMessage text\", $text);\n\n $this->text = $text;\n }",
"public function setText($text);",
"public function setText($text) {\n\t\t$this->text = htmlentities($text);\n\t}",
"public function setContentOriginal($var)\n {\n GPBUtil::checkString($var, True);\n $this->content_original = $var;\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set Currencies Write the currencies, along with their exchange rates to the exchange.json file in the temp directory. | private static function _setCurrencies(\stdClass $currencies, $timestamp = null)
{
$file = new \stdClass();
$file->updated = (new \DateTime('UTC'))->setTimestamp($timestamp);
$file->currencies = $currencies;
return file_put_contents(static::_getExchangePath(), json_encode($file));
} | [
"public function saveAllCurrencies()\n {\n $this->saveDataToJsonFile($this->getAllCurrencies(), $this->basicFileDataPath . '/all_currencies.json');\n }",
"private function writeCurrenciesToFile() {\n createFile(\n \"currencies.xml\",\n $this->currencies[0]->asXML()\n );\n }",
"public static function updateCurrencies()\n\t{\n\t\t//Get instance of CurrenciesOperations Class\n\t\t$currenciesOperations = new CurrenciesOperations();\n\t\t\n\t\t//Get instance of BodyWrapper Class that will contain the request body\n\t\t$bodyWrapper = new BodyWrapper();\n\t\t\n\t\t//List of Currency instances\n $currencies = array();\n \n $currencyClass = \"com\\zoho\\crm\\api\\currencies\\Currency\";\n\t\t\n\t\t//Get instance of Currency Class\n\t\t$currency = new $currencyClass();\n\t\t\n\t\t//To set the position of the ISO code in the currency.\n\t\t//true: Display ISO code before the currency value.\n\t\t//false: Display ISO code after the currency value.\n\t\t$currency->setPrefixSymbol(true);\n\t\t\n\t\t//To set currency Id\n\t\t$currency->setId(\"3477061000006040001\");\n\t\t\n\t\t//To set the rate at which the currency has to be exchanged for home currency.\n\t\t$currency->setExchangeRate(\"5.0000000\");\n\t\t\n\t\t//To set the status of the currency.\n\t\t//true: The currency is active.\n\t\t//false: The currency is inactive.\n\t\t$currency->setIsActive(true);\n\t\t\n\t\t$format = new Format();\n\t\t\n\t\t//It can be a Period or Comma, depending on the currency.\n\t\t$format->setDecimalSeparator(new Choice(\"Period\"));\n\t \n\t\t//It can be a Period, Comma, or Space, depending on the currency.\n\t\t$format->setThousandSeparator(new Choice(\"Comma\"));\n \n\t\t//To set the number of decimal places allowed for the currency. It can be 0, 2, or 3.\n\t\t$format->setDecimalPlaces(new Choice(\"2\"));\n\t\t\n\t\t//To set the format of the currency\n\t\t$currency->setFormat($format);\n\t\t\n\t\tarray_push($currencies, $currency);\n\t\t\n\t\t//Set the list to Currency in BodyWrapper instance\n\t\t$bodyWrapper->setCurrencies($currencies);\n\t\t\n\t\t//Call updateCurrencies method that takes BodyWrapper instance as parameter \n\t\t$response = $currenciesOperations->updateCurrencies($bodyWrapper);\n\t\t\n\t\tif($response != null)\n\t\t{\n\t\t\t//Get the status code from response\n\t\t\techo(\"Status Code: \" . $response->getStatusCode() . \"\\n\");\n\t\t\t\n\t\t\t//Get object from response\n $actionHandler = $response->getObject();\n \n if($actionHandler instanceof ActionWrapper)\n {\n //Get the received ActionWrapper instance\n $actionWrapper = $actionHandler;\n \n //Get the list of obtained ActionResponse instances\n $actionResponses = $actionWrapper->getCurrencies();\n \n foreach($actionResponses as $actionResponse)\n {\n //Check if the request is successful\n if($actionResponse instanceof SuccessResponse)\n {\n //Get the received SuccessResponse instance\n $successResponse = $actionResponse;\n \n //Get the Status\n echo(\"Status: \" . $successResponse->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $successResponse->getCode()->getValue() . \"\\n\");\n \n echo(\"Details: \" );\n \n //Get the details map\n foreach($successResponse->getDetails() as $key => $value)\n {\n //Get each value in the map\n echo($key . \": \" . $value . \"\\n\");\n }\n \n //Get the Message\n echo(\"Message: \" . $successResponse->getMessage()->getValue() . \"\\n\");\n }\n //Check if the request returned an exception\n else if($actionResponse instanceof APIException)\n {\n //Get the received APIException instance\n $exception = $actionResponse;\n \n //Get the Status\n echo(\"Status: \" . $exception->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $exception->getCode()->getValue() . \"\\n\");\n \n if($exception->getDetails() != null)\n {\n echo(\"Details: \" );\n \n //Get the details map\n foreach($exception->getDetails() as $key => $value)\n {\n //Get each value in the map\n echo($key . \": \" . $value . \"\\n\");\n }\n }\n \n //Get the Message\n echo(\"Message: \" . $exception->getMessage()->getValue() . \"\\n\");\n }\n }\n }\n //Check if the request returned an exception\n else if($actionHandler instanceof APIException)\n {\n //Get the received APIException instance\n $exception = $actionHandler;\n \n //Get the Status\n echo(\"Status: \" . $exception->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $exception->getCode()->getValue() . \"\\n\");\n \n if($exception->getDetails() != null)\n {\n echo(\"Details: \" );\n \n //Get the details map\n foreach($exception->getDetails() as $key => $value)\n {\n //Get each value in the map\n echo($key . \": \" . $value . \"\\n\");\n }\n }\n \n //Get the Message\n echo(\"Message: \" . $exception->getMessage()->getValue() . \"\\n\");\n }\n\t\t}\n\t}",
"private function getExchangeRates() {\n $values = array();\n\n // NOTE: We could use curl for more robust handling of remote connections\n \n // TODO: Improve error handling when calling the RESTful web service\n $exchangeRateXML = simplexml_load_file($this->webServiceURI);\n\n /**\n * Using multi-insert in one query execution instead of executing\n * mulltiple prepared statements for lower server overhead.\n */\n foreach ($exchangeRateXML->conversion as $conversion) {\n $values[] = '(\"' . (string)$conversion->currency . '\", ' . (float)$conversion->rate . ')';\n }\n\n $this->mysqli->query('INSERT INTO exchange_rates (currency, rate) VALUES ' . implode(',', $values));\n }",
"public function insertMockCurrencies() {\n $currency1 = new Currency();\n $data1 = [ 'xname' => 'Dollar', 'code' => 'USD', 'symbol' => '$', 'active' => true];\n $currency1->exchangeArray($data1);\n $currency2 = new Currency();\n $data2 = [ 'xname' => 'Euro', 'code' => 'EUR', 'symbol' => '€', 'active' => true];\n $currency2->exchangeArray($data2);\n $currency3 = new Currency();\n $data3 = ['xname' => 'Fiji Dollar', 'code' => 'FJD', 'symbol' => '$', 'active' => true];\n $currency3->exchangeArray($data3);\n $currency4 = new Currency();\n $data4 = ['xname' => 'Pound', 'code' => 'FKP', 'symbol' => '£', 'active' => true];\n $currency4->exchangeArray($data4);\n $this->emanager->persist($currency1);\n $this->emanager->persist($currency2);\n $this->emanager->persist($currency3);\n $this->emanager->persist($currency4);\n $this->emanager->flush();\n }",
"public function syncAvailableCoins() {\n try {\n\n // Get currencies\n $currencies = $this->request('rates');\n\n // Remove all currencies before sync\n if($currencies->result) {\n CoinpaymentsCurrency::truncate();\n }\n\n // Iterate each currency to store\n foreach ($currencies->result as $name=>$currency) {\n\n // If it is fiat skip\n if($currency->is_fiat) continue;\n\n // If it is not used for payments skip it\n if(!in_array('payments', $currency->capabilities)) continue;\n\n $hasPaymentId = in_array('dest_tag', $currency->capabilities);\n\n // Create or update currency\n CoinpaymentsCurrency::updateOrCreate(\n ['symbol' => $name],\n [\n 'name' => $currency->name,\n 'symbol' => $name,\n 'fee' => $currency->tx_fee,\n 'confirmations' => $currency->confirms,\n 'status' => $currency->status,\n 'blockchain_url' => isset($currency->explorer) ? str_replace('?from=coinpayments', '', $currency->explorer) : null,\n 'has_payment_id' => $hasPaymentId\n ]\n );\n }\n\n } catch (\\Exception $exception) {\n Log::error($exception);\n }\n }",
"private function setupCurrencyRateExchangeService()\n {\n config([\n 'baslat.module.currency.config.services.fixer.access_key' => setting('fixer_access_key'),\n 'baslat.module.currency.config.services.forge.api_key' => setting('forge_api_key'),\n 'baslat.module.currency.config.services.currency_data_feed.api_key' => setting('currency_data_feed_api_key'),\n ]);\n }",
"public function renderCurrencies()\r\n {\r\n $this->write('<currencies>' . PHP_EOL);\r\n foreach ($this->currencies as $currency) {\r\n $this->write('<currency id=\"' . $currency['iso'] . '\" rate=\"' . $currency['rate'] . '\"/>' . PHP_EOL);\r\n }\r\n\r\n $this->write('</currencies>' . PHP_EOL);\r\n }",
"function changeCurrency($exchangeRate) {\r\n\t\treturn $this->update('UPDATE article_source SET amount = amount*'.$exchangeRate);\r\n }",
"public static function enableMultipleCurrencies()\n\t{\n\t\t//Get instance of CurrenciesOperations Class\n\t\t$currenciesOperations = new CurrenciesOperations();\n\t\t\n\t\t//Get instance of BaseCurrencyWrapper Class that will contain the request body\n\t\t$bodyWrapper = new BaseCurrencyWrapper();\n \n $currencyClass = \"com\\zoho\\crm\\api\\currencies\\Currency\";\n\t\t\n\t\t//Get instance of Currency Class\n $currency = new $currencyClass();\n \n\t\t//To set the position of the ISO code in the base currency.\n\t\t//true: Display ISO code before the currency value.\n\t\t//false: Display ISO code after the currency value.\n\t\t$currency->setPrefixSymbol(true);\n\t\t\n\t\t//To set the name of the base currency.\n\t\t$currency->setName(\"Angolan Kwanza - AOA\");\n\t\t\n\t\t//To set the ISO code of the base currency.\n\t\t$currency->setIsoCode(\"AOA\");\n\t\t\n\t\t//To set the symbol of the base currency.\n\t\t$currency->setSymbol(\"Kz\");\n\t\t\n\t\t//To set the rate at which the currency has to be exchanged for home base currency.\n\t\t$currency->setExchangeRate(\"1.0000000\");\n\t\t\n\t\t//To set the status of the base currency.\n\t\t//true: The currency is active.\n\t\t//false: The currency is inactive.\n\t\t$currency->setIsActive(true);\n\t\t\n\t\t$format = new Format();\n\t\t\n\t\t//It can be a Period or Comma, depending on the base currency.\n\t\t$format->setDecimalSeparator(new Choice(\"Period\"));\n\t\t\n\t\t//It can be a Period, Comma, or Space, depending on the base currency. \n\t\t$format->setThousandSeparator(new Choice(\"Comma\"));\n \n\t\t//To set the number of decimal places allowed for the base currency. It can be 0, 2, or 3.\n\t\t$format->setDecimalPlaces(new Choice(\"2\"));\n\t\t\n\t\t//To set the format of the base currency\n\t\t$currency->setFormat($format);\n\t\t\n\t\t//Set the Currency in BodyWrapper instance\n\t\t$bodyWrapper->setBaseCurrency($currency);\n\t\t\n\t\t//Call enableMultipleCurrencies method that takes BodyWrapper instance as parameter \n\t\t$response = $currenciesOperations->enableMultipleCurrencies($bodyWrapper);\n\t\t\n\t\tif($response != null)\n\t\t{\n\t\t\t//Get the status code from response\n echo(\"Status code\" . $response->getStatusCode() . \"\\n\");\n\t\t\t\n\t\t\t//Get object from response\n $baseCurrencyActionHandler = $response->getObject();\n\t\t\t\t\n if($baseCurrencyActionHandler instanceof BaseCurrencyActionWrapper)\n {\n //Get the received BaseCurrencyActionWrapper instance\n $baseCurrencyActionWrapper = $baseCurrencyActionHandler;\n \n //Get the received obtained ActionResponse instances\n $actionResponse = $baseCurrencyActionWrapper->getBaseCurrency();\n \n //Check if the request is successful\n if($actionResponse instanceof SuccessResponse)\n {\n //Get the received SuccessResponse instance\n $successResponse = $actionResponse;\n \n //Get the Status\n echo(\"Status: \" . $successResponse->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $successResponse->getCode()->getValue() . \"\\n\");\n \n echo(\"Details: \" );\n \n //Get the details map\n foreach($successResponse->getDetails() as $key => $value)\n {\n //Get each value in the map\n echo($key . \": \" . $value);\n }\n \n //Get the Message\n echo(\"Message: \" . $successResponse->getMessage()->getValue() . \"\\n\");\n }\n //Check if the request returned an exception\n else if($actionResponse instanceof APIException)\n {\n //Get the received APIException instance\n $exception = $actionResponse;\n \n //Get the Status\n echo(\"Status: \" . $exception->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $exception->getCode()->getValue() . \"\\n\");\n \n if($exception->getDetails() != null)\n {\n echo(\"Details: \" );\n \n //Get the details map\n foreach($exception->getDetails() as $key => $value)\n {\n //Get each value in the map\n echo($key . \": \" . $value);\n }\n }\n \n //Get the Message\n echo(\"Message: \" . $exception->getMessage()->getValue() . \"\\n\");\n }\n }\n //Check if the request returned an exception\n else if($baseCurrencyActionHandler instanceof APIException)\n {\n //Get the received APIException instance\n $exception = $baseCurrencyActionHandler;\n \n //Get the Status\n echo(\"Status: \" . $exception->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $exception->getCode()->getValue() . \"\\n\");\n \n if($exception->getDetails() != null)\n {\n echo(\"Details: \" );\n \n //Get the details map\n foreach($exception->getDetails() as $key => $value)\n {\n //Get each value in the map\n echo($key . \": \" . $value . \"\\n\");\n }\n }\n \n //Get the Message\n echo(\"Message: \" . $exception->getMessage()->getValue() . \"\\n\");\n }\n\t\t}\n\t}",
"public function setExchangeRates(array $exchangeRates): void\n {\n $this->exchangeRates = $exchangeRates;\n }",
"public function save_currency_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $currency_settings_val = $this->input->post(\"currency\");\n $config = '<?php ';\n foreach ($currency_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_currency_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Currency settings updated successfully','admin_adminlogin_currency_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_currency_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }",
"function UpdateExchangeRatesDB() {\n $time_now = TIMESTAMP_NOW;\n $rates = GetExchangeRateAPI();\n\n foreach ($rates[\"rates\"] as $currency => $rate) {\n // If exists, update rates of each currency\n // Otherwise, add new entry and set base\n if (CheckIfCurrencyExists($currency)) {\n $query = \"UPDATE conversion_rates SET rate='$rate', updated_at='$time_now' WHERE currency='$currency';\";\n } else {\n $query = \"INSERT INTO conversion_rates (currency, rate, created_at, updated_at) VALUES ('$currency', '$rate', '$time_now', '$time_now')\";\n }\n $GLOBALS['conn']->query($query);\n\n // Set base currency flag\n $base_rate = $rates['base'];\n $query = \"UPDATE conversion_rates SET is_base=true WHERE currency='$base_rate'\";\n $GLOBALS['conn']->query($query);\n }\n }",
"public function testUpdateCurrency()\n {\n }",
"function ps_1761_update_currencies()\n{\n // Force cache reset of languages (load locale column)\n ObjectModel::disableCache();\n\n /** @var Currency[] $currencies */\n $currencies = Currency::getCurrencies(true, false);\n $context = Context::getContext();\n $container = isset($context->controller) ? $context->controller->getContainer() : null;\n if (null === $container) {\n $container = SymfonyContainer::getInstance();\n }\n\n /** @var LocaleRepository $localeRepoCLDR */\n $localeRepoCLDR = $container->get('prestashop.core.localization.cldr.locale_repository');\n // CLDR locale give us the CLDR reference specification\n $cldrLocale = $localeRepoCLDR->getLocale($context->language->getLocale());\n\n foreach ($currencies as $currency) {\n if ((int) $currency->precision !== 6 || !empty((int) $currency->numeric_iso_code)) {\n continue;\n }\n // CLDR currency gives data from CLDR reference, for the given language\n $cldrCurrency = $cldrLocale->getCurrency($currency->iso_code);\n if (!empty($cldrCurrency)) {\n $currency->precision = (int) $cldrCurrency->getDecimalDigits();\n $currency->numeric_iso_code = $cldrCurrency->getNumericIsoCode();\n }\n Db::getInstance()->execute(\n 'UPDATE `' . _DB_PREFIX_ . 'currency`\n SET `precision` = ' . $currency->precision . ', `numeric_iso_code` = ' . $currency->numeric_iso_code . '\n WHERE `id_currency` = ' . $currency->id\n );\n }\n\n ObjectModel::enableCache();\n}",
"public function testCurrencyValues()\n {\n $this->loginAdmin(\"Master Settings\", \"Core Settings\");\n $this->openTab(\"Settings\");\n $this->click(\"link=Other settings\");\n $this->assertEquals(\"EUR@ 1.00@ ,@ .@ €@ 2\\nGBP@ 0.8565@ .@ @ £@ 2\\nCHF@ 1.4326@ ,@ .@ <small>CHF</small>@ 2\\nUSD@ 1.2994@ .@ @ $@ 2\", $this->getValue(\"confarrs[aCurrencies]\"));\n $this->clickAndWait(\"save\");\n $this->click(\"link=Other settings\");\n $this->assertEquals(\"EUR@ 1.00@ ,@ .@ €@ 2\\nGBP@ 0.8565@ .@ @ £@ 2\\nCHF@ 1.4326@ ,@ .@ <small>CHF</small>@ 2\\nUSD@ 1.2994@ .@ @ $@ 2\", $this->getValue(\"confarrs[aCurrencies]\"));\n }",
"public function currencyconversion()\n {\n $currency_conversion_data = [];\n $currency_conversion_history_data = [];\n $httpAdapter = new \\Ivory\\HttpAdapter\\FileGetContentsHttpAdapter();\n $chainProvider = new \\Swap\\Provider\\ChainProvider([\n new \\Swap\\Provider\\YahooFinanceProvider($httpAdapter),\n new \\Swap\\Provider\\GoogleFinanceProvider($httpAdapter)\n ]);\n $swap = new \\Swap\\Swap($chainProvider);\n $currency_list = Currency::select('id', 'code')->get();\n $active_currencies = Currency::select('id', 'code')->where('is_active', '=', 1)->get();\n foreach ($currency_list as $currency) {\n foreach ($active_currencies as $active_currency) {\n $currency_conversion_data['currency_id'] = $currency->id;\n $currency_conversion_data['converted_currency_id'] = $active_currency->id;\n $rate = $swap->quote($currency->code . '/' . $active_currency->code);\n $currency_conversion_data['rate'] = (double)$rate->getValue();\n $currency_conversion_list = CurrencyConversion::where('currency_id', '=', $currency->id)\n ->where('converted_currency_id', '=', $active_currency->id)->first();\n if ($currency_conversion_list) {\n $currency_conversion_data['id'] = $currency_conversion_list->id;\n $currency_conversion_history_data['rate_before_change'] = $currency_conversion_list->rate;\n $currency_conversion_history_data['currency_conversion_id'] = $currency_conversion_list->id;\n $validator = Validator::make($currency_conversion_data, CurrencyConversion::GetValidationRule());\n if ($validator->passes() && $currency_conversion_list) {\n $currency_conversion_list->update($currency_conversion_data);\n }\n } else {\n $currency_conversion_history_data['rate_before_change'] = 0.00;\n $validator = Validator::make($currency_conversion_data, CurrencyConversion::GetValidationRule());\n if ($validator->passes()) {\n $currency_conversion = CurrencyConversion::create($currency_conversion_data);\n $currency_conversion_history_data['currency_conversion_id'] = $currency_conversion->id;\n }\n }\n $currency_conversion_history_data['rate'] = (double)$rate->getValue();\n $validator = Validator::make($currency_conversion_history_data, CurrencyConversionHistory::GetValidationRule());\n if ($validator->passes()) {\n CurrencyConversionHistory::create($currency_conversion_history_data);\n }\n }\n }\n }",
"public function setCurrencies(?array $value): void {\n $this->getBackingStore()->set('currencies', $value);\n }",
"public static function addCurrencies()\n\t{\t\t\n\t\t//Get instance of CurrenciesOperations Class\n\t\t$currenciesOperations = new CurrenciesOperations();\n\t\t\n\t\t//Get instance of BodyWrapper Class that will contain the request body\n\t\t$bodyWrapper = new BodyWrapper();\n\t\t\n\t\t//List of Currency instances\n\t\t$currencies = array();\n \n $currencyClass = \"com\\zoho\\crm\\api\\currencies\\Currency\";\n\n\t\t//Get instance of Currency Class\n\t\t$currency = new $currencyClass();\n\t\t\n\t\t//To set the position of the ISO code in the currency.\n\t\t//true: Display ISO code before the currency value.\n\t\t//false: Display ISO code after the currency value.\n\t\t$currency->setPrefixSymbol(true);\n\t\t\n\t\t//To set the name of the currency.\n\t\t$currency->setName(\"USD\");\n\t\t\n\t\t//To set the ISO code of the currency.\n\t\t$currency->setIsoCode(\"USD\");\n\t\t\n\t\t//To set the symbol of the currency.\n\t\t$currency->setSymbol(\"$\");\n\t\t\n\t\t//To set the rate at which the currency has to be exchanged for home currency.\n\t\t$currency->setExchangeRate(\"20.000000000\");\n\t\t\n\t\t//To set the status of the currency.\n\t\t//true: The currency is active.\n\t\t//false: The currency is inactive.\n\t\t$currency->setIsActive(true);\n\t\t\n\t\t$format = new Format();\n\t\t\n\t\t//It can be a Period or Comma, depending on the currency.\n\t\t$format->setDecimalSeparator(new Choice(\"Period\"));\n\t \n\t\t//It can be a Period, Comma, or Space, depending on the currency.\n\t\t$format->setThousandSeparator(new Choice(\"Comma\"));\n \n\t\t//To set the number of decimal places allowed for the currency. It can be 0, 2, or 3.\n\t\t$format->setDecimalPlaces(new Choice(\"2\"));\n\t\t\n\t\t//To set the format of the base currency\n\t\t$currency->setFormat($format);\n\t\t\n\t\tarray_push($currencies, $currency);\n\t\t\n\t\t//Set the list to Currency in BodyWrapper instance\n\t\t$bodyWrapper->setCurrencies($currencies);\n\t\t\n\t\t//Call addCurrencies method that takes BodyWrapper instance as parameter \n\t\t$response = $currenciesOperations->addCurrencies($bodyWrapper);\n\t\t\n\t\tif($response != null)\n\t\t{\n\t\t\t//Get the status code from response\n echo(\"Status code\" . $response->getStatusCode() . \"\\n\");\n\n //Get object from response\n $actionHandler = $response->getObject();\n\n if($actionHandler instanceof ActionWrapper)\n {\n //Get the received ActionWrapper instance\n $actionWrapper = $actionHandler;\n\n //Get the list of obtained action responses\n $actionResponses = $actionWrapper->getCurrencies();\n \n foreach ($actionResponses as $actionResponse)\n {\n //Check if the request is successful\n if($actionResponse instanceof SuccessResponse)\n {\n //Get the received SuccessResponse instance\n $successResponse = $actionResponse;\n \n //Get the Status\n echo(\"Status: \" . $successResponse->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $successResponse->getCode()->getValue() . \"\\n\");\n \n echo(\"Details: \" );\n \n if($successResponse->getDetails() != null)\n {\n //Get the details map\n foreach ($successResponse->getDetails() as $keyName => $keyValue) \n {\n //Get each value in the map\n echo($keyName . \": \" . $keyValue . \"\\n\");\n }\n }\n \n //Get the Message\n echo(\"Message: \" . $successResponse->getMessage()->getValue() . \"\\n\");\n }\n //Check if the request returned an exception\n else if($actionResponse instanceof APIException)\n {\n //Get the received APIException instance\n $exception = $actionResponse;\n \n //Get the Status\n echo(\"Status: \" . $exception->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $exception->getCode()->getValue() . \"\\n\");\n \n echo(\"Details: \" );\n \n if($exception->getDetails() != null)\n {\n //Get the details map\n foreach ($exception->getDetails() as $keyName => $keyValue) \n {\n //Get each value in the map\n echo($keyName . \": \" . $keyValue . \"\\n\");\n }\n }\n \n //Get the Message\n echo(\"Message: \" . $exception->getMessage()->getValue() . \"\\n\");\n }\n }\t\n }\n //Check if the request returned an exception\n else if($actionHandler instanceof APIException)\n {\n //Get the received APIException instance\n $exception = $actionHandler;\n \n //Get the Status\n echo(\"Status: \" . $exception->getStatus()->getValue() . \"\\n\");\n \n //Get the Code\n echo(\"Code: \" . $exception->getCode()->getValue() . \"\\n\");\n \n if($exception->getDetails() != null)\n {\n echo(\"Details: \\n\");\n \n //Get the details map\n foreach ($exception->getDetails() as $keyName => $keyValue) \n {\n //Get each value in the map\n echo($keyName . \": \" . $keyValue . \"\\n\");\n } \n }\n \n //Get the Message\n echo(\"Message: \" . $exception->getMessage()->getValue() . \"\\n\");\n }\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a category with a given key. | public function findByKey($key)
{
return $this->categoryRepository->findCategoryByKey($key);
} | [
"public function findCategoryByKey($key);",
"public function searchCategory($key)\n {\n $collection = $this->collectionFactory->create();\n $collection->addFieldToFilter('name', ['like' => '%' . $key . '%']);\n return $collection->getFirstItem();\n }",
"public static function getId($key)\n {\n return Cache::rememberForever('category:' . Str::slug($key), function () use ($key) {\n return optional(DB::table('categories')->whereKey($key)->first())->id;\n });\n }",
"function getRealtorInformationCategoryByCategoryKey($a_sCategoryKey)\n {\n $oRealtorInformationCategorySelector = getRealtorInformationCategorySelector();\n $oRealtorInformationCategorySelector->setCategoryKey($a_sCategoryKey);\n return $this->readOne($oRealtorInformationCategorySelector);\n\n }",
"private function get_category($mdk) {\n $srch = $this->search($mdk);\n if ($srch !== false) {\n list($cat, $key) = $srch;\n return $cat;\n }\n\n return false;\n }",
"public function getCategory()\n\t{\n\t\t$arrTrailFull = Category::GetTrailByProductId($this->id);\n\t\t$objCat = Category::model()->findbyPk($arrTrailFull[0]['key']);\n\t\treturn $objCat;\n\t}",
"public function getI18nCategory($key = false)\n {\n if ($key) {\n $rules = ArrayHelper::getValue(self::$generator->messages, $key);\n\n foreach ($rules as $regex => $ns) {\n\n $pattern = static::sanitazeNsRegex($regex);\n\n if (preg_match('%' . $pattern . '%', self::basename($this->getClass(self::RK_MODEL_CM)), $matches)) {\n\n return static::sanitazeI18n($ns, $matches);\n }\n }\n }\n\n if (self::$generator->messageCategory) {\n return self::$generator->messageCategory;\n }\n\n $basename = self::basename($this->getClass(self::RK_MODEL_CM));\n\n if (static::$generator->isDbView()) {\n $prefix = ucfirst(str_replace('_', '', static::$generator->dbViewPrefix));\n $basename = str_replace($prefix, '', $basename);\n }\n\n return \\yii\\helpers\\BaseInflector::camel2id($basename, '/');\n }",
"function bib_fetch_item($key)\n{\n\t// check key is valid\n\tif (!is_key_valid($key)) {\n\t\tbib_log_error(\"Cannot fetch item \\\"$key\\\" - key is invalid\");\n\t\treturn NULL;\n\t}\n\t\n\t// query database\n\t$key = pg_escape_string($key);\n\t$result = bib_db_query(\"SELECT * FROM bib_items WHERE key='$key';\");\n\tif (!$result) return NULL;\n\t$item = $result[0];\n\t\n\t// expand category information\n\t$item[\"cats\"] = explode(\"|\", $item[\"cats\"]);\n\t\n\treturn $item;\n}",
"function getCategoryData($category_key) {\r\n\t\r\n\t\tglobal $CONN, $CONFIG;\r\n\r\n\t\t$rs = $CONN->Execute(\"SELECT name, parent_key FROM {$CONFIG['DB_PREFIX']}kb_categories WHERE category_key='$category_key'\");\r\n\r\n\t\twhile (!$rs->EOF) {\r\n\r\n\t\t\t$category_data['name']\t = $rs->fields[0];\r\n\t\t\t$category_data['parent_key'] = $rs->fields[1];\r\n\t\t\t$rs->MoveNext();\r\n\t\t\t\r\n\t\t}\r\n\t\t$rs->Close();\t\r\n\t\treturn $category_data;\r\n\t\t\t\t\t\t\r\n\t}",
"public function getCategoryById($id);",
"function get_category() {\n $category = null;\n\n if (!empty($this->categoryid)) {\n $category = grade_category::fetch('id', $this->categoryid);\n } elseif (!empty($this->iteminstance) && $this->itemtype == 'category') {\n $category = grade_category::fetch('id', $this->iteminstance);\n }\n\n return $category;\n }",
"function get_category($id_cat)\n {\n $category = $this->db->query(\"SELECT * FROM `category` WHERE `id_cat` = ?\", array($id_cat))->getResultArray();\n\n return $category;\n }",
"protected function localCacheCategory(string $key): string\n {\n if (str_starts_with($key, 'user:')) {\n return implode(':', array_slice(explode(':', $key), 0, 2));\n }\n\n return 'app';\n }",
"function GetCategory($category)\n {\n $category = strtoupper($category);\n return $this->config->categories->$category;\n }",
"function lookupInvoiceCategory($categoryKey){\r\n\t\t$resource = \"lkinvoicecategories/$categoryKey\";\r\n\t\t$invoiceCategory = $this->getResource($resource);\r\n\t\tif($invoiceCategory){\r\n\t\t\treturn $invoiceCategory->Description;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public static function getMetafieldByKey($key, $categoryId)\n {\n $sql = new Pluf_SQL('`key`=%s AND `category_id`=%s', array(\n $key,\n $categoryId\n ));\n $str = $sql->gen();\n $metafield = Pluf::factory('Shop_CategoryMetafield')->getOne($str);\n return $metafield;\n }",
"public function getCategory()\n\t{\n\t\t$Category = new Product_Category();\n\t\treturn $Category->findItem( array( 'Id = '.$this->CategoryId ) );\n\t}",
"function getCategoryKey()\n {\n return (string) $this->_sCategoryKey;\n }",
"public function getCategory($categoryId)\n {\n return $this->category->where('id', $categoryId)->first();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
====================================================== END Get UniTray ID === === Start UniTray =========================================================== Start UniTray with path to toplevel (main install folder) and location of ini Note: UniTray does not like forward slashes replace all with back slashes Note: ustop is passed to UniTray and stored in variable %top% this replaces UniTray's %AeTrayMenuPath% variable. | function start_unitray(){
global $base_f;
global $us_con_tray_menu; // Location of UniTray
$UniTray_exe = get_unitray_exe(); // get program name
$UniTray_ini = get_unitray_ini(); // get ini name
$cmd1 = "start ".$us_con_tray_menu."/".$UniTray_exe; // path to executable
$cmd2 = " -ustop=".$base_f; // new UniTray variable ustop
$cmd3 = " -scriptfile=".$us_con_tray_menu."/".$UniTray_ini;
$cmd =$cmd1.$cmd2.$cmd3; // Unitay does not like / hence
$cmd = preg_replace('/\//','\\', $cmd); // Replace / with \
pclose(popen($cmd,'r')); // run and detatch
} | [
"function stop_unitray(){\r\n // Global variables for paths and files\r\n global $us_con_tray_menu; // Location of UniTray\r\n $UniTray_exe = get_unitray_exe(); // get program name \r\n $UniTray_id = get_unitray_id(); // get id name \r\n \r\n $cmd1 = \"start \".$us_con_tray_menu.\"/\".$UniTray_exe; // path to executable\r\n $cmd2 = \" -quit -id=\".$UniTray_id; // set ID \r\n $cmd =$cmd1.$cmd2; // Unitay does not like / hence\r\n $cmd = preg_replace('/\\//','\\\\', $cmd); // Replace / with \\\r\n\r\n exec($cmd,$dummy,$return); // run command \r\n}",
"public function topMenu()\n {\n return $this->spawn('topLevel', $this->roots());\n }",
"function site_notifications_set_topbar() {\n\t\n\t$user = elgg_get_logged_in_user_entity();\n\tif (empty($user)) {\n\t\treturn;\n\t}\n\t\n\telgg_register_menu_item('topbar', [\n\t\t'name' => 'site_notifications',\n\t\t'href' => elgg_generate_url('collection:object:site_notification:owner', [\n\t\t\t'username' => $user->username\n\t\t]),\n\t\t'text' => elgg_echo('site_notifications:topbar'),\n\t\t'icon' => 'bell',\n\t\t'priority' => 100,\n\t]);\n}",
"function start_menu_dtu()\r\n{\r\n global $menu_line;\r\n global $top_menu_counter;\r\n global $home_text;\r\n global $server_name;\r\n global $rel_path;\r\n global $menu_index;\r\n\r\n \tif ($menu_index==-1){\r\n\t\t$classname=\"current\";\r\n\t}else{\r\n\t\t$classname=\"navigation\";\r\n\t}\r\n\r\n big_comment(\"Top and left menus\");\r\n \r\n echo(\"<td valign=\\\"top\\\" width=\\\"151\\\" class=\\\"leftmenu\\\">\");\r\n echo(\"<table align=\\\"center\\\" width=\\\"95%\\\" class=\\\"leftmenu\\\">\\n\");\r\n echo(\"<tr><td class=\\\"leftmenu\\\">\");\r\n $line_width=0.9*145;\r\n echo(\"<table align=\\\"center\\\" width=\\\"100%\\\">\\n\");\r\n \r\n //if (!file_exists(\"def.top_menu\")){\r\n \r\n if ($top_menu_counter == 0){\r\n echo(\"<tr>\\n\");\r\n echo(\"<td class=\\\"leftmenu\\\">\");\r\n\t echo(\"<br>\");\r\n echo(\"<a class=\\\"$classname\\\" href=\\\"http://$server_name\" . $rel_path. \"\\\"> $home_text </a>\\n\");\r\n echo(\"<img src=\\\"$menu_line\\\" width=\\\"$line_width\\\" height=1 alt=\\\"Menu Line\\\">\");\r\n echo(\"</td>\\n\");\r\n\t echo(\"</tr>\\n\");\r\n }\r\n}",
"function ciniki_artistprofiles_hooks_uiSettings($ciniki, $tnid, $args) {\n\n //\n // Setup the default response\n //\n $rsp = array('stat'=>'ok', 'menu_items'=>array(), 'settings_menu_items'=>array());\n\n //\n // Check permissions for what menu items should be available\n //\n if( isset($ciniki['tenant']['modules']['ciniki.artistprofiles'])\n && (isset($args['permissions']['owners'])\n || isset($args['permissions']['employees'])\n || isset($args['permissions']['resellers'])\n || ($ciniki['session']['user']['perms']&0x01) == 0x01\n )\n ) {\n $menu_item = array(\n 'priority'=>3700,\n 'label'=>'Artist Profiles', \n 'edit'=>array('app'=>'ciniki.artistprofiles.main'),\n 'add'=>array('app'=>'ciniki.artistprofiles.main', 'args'=>array('artist_id'=>0)),\n 'search'=>array(\n 'method'=>'ciniki.artistprofiles.artistSearch',\n 'args'=>array(),\n 'container'=>'artists',\n 'cols'=>1,\n 'cellValues'=>array(\n '0'=>'d.name;',\n ),\n 'noData'=>'No artists found',\n 'edit'=>array('method'=>'ciniki.artistprofiles.main', 'args'=>array('artist_id'=>'d.id;')),\n ),\n );\n $rsp['menu_items'][] = $menu_item;\n\n } \n\n //\n // Check if Dropbox has been enabled\n //\n if( ciniki_core_checkModuleFlags($ciniki, 'ciniki.artistprofiles', 0x01) \n && (isset($args['permissions']['owners'])\n || isset($args['permissions']['resellers'])\n || ($ciniki['session']['user']['perms']&0x01) == 0x01\n )\n ) {\n $rsp['settings_menu_items'][] = array('priority'=>3700, 'label'=>'Artist Profiles', 'edit'=>array('app'=>'ciniki.artistprofiles.settings'));\n }\n\n return $rsp;\n}",
"function corona_menu_top( $menu ) {\n corona_generate_menu_hook( $menu, 'corona_menu_top' );\n}",
"function rest_add_toplevel_menu() {\n\n\tadd_menu_page(\n\t\t'REST API Example: Display Posts',\n\t\t'REST API: Display Posts',\n\t\t'manage_options',\n\t\t'rest-read-posts',\n\t\t'rest_display_settings_page',\n\t\t'dashicons-admin-generic',\n\t\tnull\n\t);\n\n}",
"function displayStartup()\n\t{\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientsetup.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"TXT_INFO\",$this->lng->txt(\"info_text_first_client\"));\n\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt(\"setup_first_client\"));\n\n\t\t$this->displayProcessPanel();\n\n\t\t$this->setButtonNext(\"ini\");\n\t}",
"public function testDefaultMenuDefinedWFullPath()\n {\n // TODO: How do we force reading in of ini file with a default \n // menu whose full path is defined?\n }",
"public function open_tray( $path, $data = array() )\n {\n // Graceful fallback to default theme view file\n // by replacing an unfound theme view with default\n if (!\\View::exists( $path ))\n {\n $parts = explode( '.', $path );\n $parts[1] = 'default';\n $path = implode( '.', $parts );\n }\n\n echo View::make( MODULE . 'drawer' )->nest( 'tray', $path, $data );\n }",
"function reactor_do_top_bar() {\n\tif ( has_nav_menu('top-bar-l') || has_nav_menu('top-bar-r') ) {\n\t\t$topbar_args = array(\n\t\t\t'title' => reactor_option('topbar_title', get_bloginfo('name')),\n\t\t\t'title_url' => reactor_option('topbar_title_url', home_url()),\n\t\t\t'fixed' => reactor_option('topbar_fixed', 0),\n\t\t\t'sticky' => reactor_option('topbar_sticky', 0),\n\t\t\t'contained' => reactor_option('topbar_contain', 1),\n\t\t\t'search' => reactor_option('topbar_search', 0),\n\t\t);\n\t\treactor_top_bar( $topbar_args );\n\t}\n}",
"function ciniki_fatt_web_menuItems(&$ciniki, $settings, $tnid, $args) {\n \n if( !isset($ciniki['tenant']['modules']['ciniki.fatt']) ) {\n return array('stat'=>'404', 'err'=>array('code'=>'ciniki.fatt.134', 'msg'=>\"I'm sorry, the file you requested does not exist.\"));\n }\n\n //\n // The menu \n //\n $menu = array();\n if( isset($settings['page-fatt-menu-categories']) && $settings['page-fatt-menu-categories'] == 'yes' ) {\n $strsql = \"SELECT id, name, permalink, primary_image_id, synopsis, description \"\n . \"FROM ciniki_fatt_categories \"\n . \"WHERE ciniki_fatt_categories.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY sequence \";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.fatt', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $categories = $rc['rows'];\n foreach($rc['rows'] as $category) {\n $menu[$category['permalink']] = array('title'=>$category['name'], 'permalink'=>'firstaid/' . $category['permalink']);\n if( isset($ciniki['request']['uri_split'][0]) && $ciniki['request']['uri_split'][0] == 'firstaid' \n && isset($ciniki['request']['uri_split'][1]) && $ciniki['request']['uri_split'][1] == $category['permalink']\n ) {\n $menu[$category['permalink']]['selected'] = 'yes';\n }\n }\n } else {\n if( isset($settings['page-fatt-name']) && $settings['page-fatt-name'] != '' ) {\n $menu['courses'] = array('title'=>$settings['page-fatt-name'], 'permalink'=>'firstaid');\n } else {\n $menu['courses'] = array('title'=>'Courses', 'permalink'=>'firstaid');\n }\n if( isset($ciniki['request']['uri_split'][0]) && $ciniki['request']['uri_split'][0] == 'firstaid' ) {\n $menu['courses']['selected'] = 'yes';\n }\n }\n\n return array('stat'=>'ok', 'menu'=>$menu);\n}",
"function main_menu($current_project = NULL, $current_phase = NULL, $current_logged_in_user = NULL) {\n\techo <<<_END\n\n <script>\n dojo.addOnLoad(_initMenuLoader);\n function _initMenuLoader() {\n var menuitem = dojo.byId(\"navMenu\");\n menuitem.style.display = \"block\";\n menuitem = dojo.byId(\"projMenu\");\n menuitem.style.display = \"block\";\n }\n </script>\n \n <div dojoType=\"dijit.MenuBar\" id=\"navMenu\" style=\"float:left; display:none\">\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Projects\n </span>\n <div dojoType=\"dijit.Menu\" id=\"projectMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=project&action=show'\">\n Projects\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=phase&action=show'\">\n Phases\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=project&action=selectcurrentprojectphase'\">\n Set Current Project/Phase\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Scenarios\n </span>\n <div dojoType=\"dijit.Menu\" id=\"scenarioMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=scenario&action=show'\">\n Scenarios\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=testcase&action=show'\">\n Testcases\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=testlevel&action=show'\">\n Testlevels\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=hostselectortype&action=query'\">\n Host Selector Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=hostselectorvalue&action=show'\">\n Host Selector Values\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=outcomeaction&action=show'\">\n Outcome Actions\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=parameter&action=show'\">\n User Defined Parameters\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Teststands\n </span>\n <div dojoType=\"dijit.Menu\" id=\"teststandMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=teststand&action=show'\">\n Teststands\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=host&action=show'\">\n Hosts\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=objecttype&action=show'\">\n Object Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=objectattributetype&action=show'\">\n Object Attribute Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=object&action=query'\">\n Query Objects\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Collectors\n </span>\n <div dojoType=\"dijit.Menu\" id=\"collectorMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=collectortype&action=show'\">\n Collector Types\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=collectorvalue&action=show'\">\n Collector Values\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=collectorset&action=show'\">\n Collector Sets\n </div>\n <div dojoType=\"dijit.MenuItem\" onClick=\"window.location='index.php?object=collectorsetmember&action=show'\">\n Collector Set Members\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Environments\n </span>\n <div dojoType=\"dijit.Menu\" id=\"environmentMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=environment&action=show'\">\n Environments\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Levels\n </span>\n <div dojoType=\"dijit.Menu\" id=\"levelMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=level&action=show'\">\n Levels\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=levelinstance&action=show'\">\n Level Instances\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Users\n </span>\n <div dojoType=\"dijit.Menu\" id=\"userMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=user&action=show'\">\n Users\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=maillist&action=show'\">\n Mail Lists\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n What is running?\n </span>\n <div dojoType=\"dijit.Menu\" id=\"runningMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=active_workrequest&action=query'\">\n Active Scenarios\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=active_workqueue&action=query'\">\n Workqueue items\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Results\n </span>\n <div dojoType=\"dijit.Menu\" id=\"resultMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=scenarioresult&action=show'\">\n Scenario Results\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=scenarioresult&action=query'\">\n Query Scenario Results\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=actionresult&action=show'\">\n Testcase Action Results\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=archive_workrequest&action=show'\">\n Archived Work Requests\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=archive_workqueue&action=show'\">\n Archived Work Queue\n </div>\n </div>\n </div>\n <div dojoType=\"dijit.PopupMenuBarItem\">\n <span>\n Admin\n </span>\n <div dojoType=\"dijit.Menu\" id=\"adminMenu\" style=\"display:none\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=backup&action=show'\">\n Backup and Restore\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=dafserver&action=show'\">\n DAF Server administration\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=auditlog&action=show'\">\n Show Audit Log\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=licence&action=show'\">\n Show Licence Information\n </div>\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location='index.php?object=licence&action=update'\">\n Update Licence Information\n </div>\n </div>\n </div>\n </div>\n\n_END;\n\t\n\techo '<div dojoType=\"dijit.MenuBar\" id=\"projMenu\" style=\"display:none\" dir=\"rtl\">' . \"\\n\";\n\t\n\tif (isset ( $current_logged_in_user )) {\n\t\t\n\t\techo <<<_END\n \n <div dojoType=\"dijit.MenuBarItem\" id=\"LogoutMenu\">\n <div dojoType=\"dijit.MenuItem\" onclick=\"window.location = 'index.php?action=logout'\">\n Logout\n </div>\n </div>\n <div dojoType=\"dijit.MenuBarItem\">|</div>\n\n_END;\n\t}\n\t\n\techo \"<div dojoType=\\\"dijit.MenuBarItem\\\">\\n\";\n\tif (isset ( $current_project ) && isset ( $current_phase )) {\n\t\techo \"<span>Project: $current_project Phase: $current_phase</span>\\n\";\n\t} else {\n\t\t// must have something in the menubar, otherwise it appears as a thinner bar than normal\n\t\techo \"<span> </span>\\n\";\n\t}\n\techo \"</div>\\n\";\n\t\n\techo \"<div dojoType=\\\"dijit.MenuBarItem\\\">|</div>\\n\";\n\t\n\techo \"<div dojoType=\\\"dijit.MenuBarItem\\\">\\n\";\n\tif (isset ( $current_logged_in_user )) {\n\t\techo \"<span>User: $current_logged_in_user </span>\";\n\t}\n\techo \"</div>\\n\";\n\t\n\techo \"</div>\\n\";\n}",
"function shortAppStartup(){\n\t\t$this->layout = 'short_app';\n\t\t$this->Session->write('activeMenu','borrower');\n\t}",
"function upd_addMenuEntry() {\n global $sn, $plugin_tx, $pth;\n\n $imgtag = tag('img src=\\\"' . $pth['folder']['plugins']\n . 'hi_updatecheck/images/update-available-24.png\\\" '\n . 'title=\\\"' . $plugin_tx['hi_updatecheck']['message_qc-update-found'] . '\\\" '\n . 'alt=\\\"' . $plugin_tx['hi_updatecheck']['message_qc-update-found'] . '\\\"'\n );\n $href = $sn . '?&hi_updatecheck&admin=plugin_main&normal';\n $t = \"\\n\";\n $t .= '<script type=\"text/javascript\">\n jQuery(document).ready(function($){\n $(\"#edit_menu\").append(\"<li id=\\\"editmenu_update\\\"><a href=\\\"' . $href . '\\\">' . $imgtag . '<\\/a></li>\"); //before xh1.6\n $(\"#xh_adminmenu > ul\").append(\"<li id=\\\"xh_adminmenu_update\\\"><a href=\\\"' . $href . '\\\">' . $imgtag . '<\\/a></li>\"); //since xh1.6RC\n });\n </script>' . \"\\n\";\n return $t;\n}",
"function wyde_get_fullscreen_menu_id($id, $item, $args, $depth){\n $id = 'fullscreen-menu-item-'.$item->ID;\n return $id;\n}",
"private function control_top_bar_menu_shortcut() {\n\t\t$this->add_control(\n\t\t\tnew Control(\n\t\t\t\t'neve_top_bar_menu_shortcut',\n\t\t\t\tarray(\n\t\t\t\t\t'transport' => $this->selective_refresh,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'button_class' => 'nv-top-bar-menu-shortcut',\n\t\t\t\t\t'icon_class' => 'menu',\n\t\t\t\t\t'button_text' => __( 'Secondary Menu', 'neve' ),\n\t\t\t\t\t'shortcut' => true,\n\t\t\t\t\t'priority' => 40,\n\t\t\t\t\t'section' => 'neve_top_bar_section',\n\t\t\t\t\t'active_callback' => array( $this, 'is_top_bar_on' ),\n\t\t\t\t),\n\t\t\t\t'Neve\\Customizer\\Controls\\Button'\n\t\t\t)\n\t\t);\n\t}",
"private function buildTechMenu() {\n $tech = new TopMenuItem('Tech');\n if ($tech) {\n $tech->addSubItem(new SubMenuItem('Google', '/' . strtolower($tech->displayText) . '/google-accounts'));\n $tech->addSubItem(new SubMenuItem('Google Drive', '/' . strtolower($tech->displayText) . '/google-drive'));\n $tech->addSubItem(new SubMenuItem('Computers', '/' . strtolower($tech->displayText) . '/workstation-manage'));\n }\n return $tech;\n }",
"function lipi__admin_startup_screen() {\n\t$theme = lipi__admin_get_theme_info();\n\t$theme_name = $theme['name'];\n\t\t/*Item Registration*/\n\t\tadd_menu_page( $theme_name, $theme_name, 'manage_options', 'lipi-admin' , 'lipi__admin_page', plugin_dir_url( __FILE__ ) . 'favicon.png',\n\t\t\t'2' );\n\t\t/*Support page*/\n\t\tadd_submenu_page('lipi-admin', esc_html__('Support', 'lipi-framework'), esc_html__('Support', 'lipi-framework'), 'manage_options', 'lipi-admin-support', 'lipi__admin_support_page' );\n\t\t\n\t\t/*Plugins*/\n\t\tadd_submenu_page( 'lipi-admin', esc_html__('Plugins', 'lipi-framework'), esc_html__('Plugins', 'lipi-framework'), 'manage_options', 'lipi-admin-plugins', 'lipi__admin_plugins_page' );\n\n\t\t/*Demo Import*/\n\t\tadd_submenu_page( 'lipi-admin', esc_html__('Demo import', 'lipi-framework'), esc_html__('Demo import', 'lipi-framework'), 'manage_options', 'lipi-demo-import', 'lipi__admin_demo_install_page' );\n\n\t\t/*System status*/\n\t\tadd_submenu_page( 'lipi-admin', esc_html__('System status', 'lipi-framework'), esc_html__('System status', 'lipi-framework'), 'manage_options', 'lipi-admin-system-status', 'lipi__admin_status_page' );\n\n\t\t/*KnowledgeBase Import*/\n\t\tadd_submenu_page( 'lipi-admin', esc_html__('KnowledgeBase import/convert post type', 'lipi-framework'), esc_html__('KnowledgeBase import/convert post type', 'lipi-framework'), 'manage_options', 'lipi-admin-kb-import', 'lipi__admin_kb_import_page' );\n\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method Implements RepositoryServiceInterface Post an Issue via Github API | public function postIssue( $repoUrl, $data )
{
$name = ( isset( $data->name ) ) ? $this->formatterAuthorName( $data->name ): "";
$client = new Client( $repoUrl, array(
"sslverifypeer" => false
) );
$client->setEncType( "application/json" );
$client->setMethod( Request::METHOD_POST );
$client->setAuth( $this->_user, $this->_token );
$client->setRawBody( Json::encode( array(
"title" => $data->title,
"body" => $name . $data->description
)));
return $client->send();
} | [
"abstract protected function create_issue($inputArgs, $ownerName, $repositoryName);",
"function report_an_issue_post(){\t\n\t\n\t\t$this->ReportIssue_model->setPostGetVars();\n\t\t\n\t\t$this->verify_request();\t\n\t\t\t\n\t\tif(!$this->ReportIssue_model->validate_reportIssue()){\n\t\t\t\n\t\t\t$tokenData = time().$this->input->post_get('uniqueId');\n\t\t\t\t\n\t\t\t$token = AUTHORIZATION::generateToken($tokenData);\n\t\t\n\t\t\t$this->Login_model->add_api_token_members($this->input->post_get('uniqueId'),$token);\n\t\t\t\n\t\t\t$result = array();\n\t\t\t\n\t\t\t$response = ['status' => 460, 'token' => $token, 'result' => $result, 'message' => HTTP_STATUS_CODES[460]];\n\t\t\t\n\t\t\t$this->response($response, 200); \n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$result = $this->ReportIssue_model->set_reportIssue();\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\t\n\t\t\t\t$tokenData = time().$this->input->post_get('uniqueId');\n\t\t\t\t\n\t\t\t\t$token = AUTHORIZATION::generateToken($tokenData);\n\t\t\t\n\t\t\t\t$this->Login_model->add_api_token_members($this->input->post_get('uniqueId'),$token);\n\t\t\t\t\n\t\t\t\t$result = array();\n\n\t\t\t\t$response = ['status' => 400, 'token' => $token, 'result' => $result, 'message' => HTTP_STATUS_CODES[460]];\n\t\t\t\t\n\t\t\t\t$this->response($response, 200);\n\t\t\t}else{\n\t\t\t\t$tokenData = time().$this->input->post_get('uniqueId');\n\t\t\n\t\t\t\t$token = AUTHORIZATION::generateToken($tokenData);\n\t\t\t\n\t\t\t\t$this->Login_model->add_api_token_members($this->input->post_get('uniqueId'),$token);\n\t\t\t\t\n\t\t\t\t$status = 200;\n\t\t\t\t\n\t\t\t\t$response = ['status' => $status, 'token' => $token, 'result'=> $result , 'message' => 'Thanks for your frankness! The issue has been reported.'];\n\t\t\t\t\n\t\t\t\t$this->response($response, 200); \n\t\t\t}\n\t\t}\n }",
"public function createAction_POST()\n {\n $github = \\Canddi_Helper_Github::getInstance();\n\n $strRepo = $this->_request->getParam('repository', null);\n if (empty($strRepo)) {\n throw new Canddi_Exception_Fatal_ValueCantBeNull('repository');\n }\n\n $response = $github->createRepository($strRepo);\n\n $this->view->assign($response);\n }",
"public static function CreateIssue() {\n\t\t$response = array();\n\t\tif(Flight::getGlobal('user_logged')) {\n\t\t\tif (isset($_POST['head']) && isset($_POST['text']) && isset($_POST['attachments'])) {\n\t\t\t\tif(DB::addIssue($_POST['head'], $_POST['text'], $_POST['attachments']) == 0) {\n\t\t\t\t\t$response['code'] = 0;\n\t\t\t\t\t$response['error'] = '';\n\t\t\t\t} else {\n\t\t\t\t\t$response['code'] = 3;\n\t\t\t\t\t$response['error'] = 'There was an error while inserting into DB';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$response['code'] = 1;\n\t\t\t\t$response['error'] = 'Parameters `head`, `text` or `attachments` are not passed';\n\t\t\t}\n\t\t} else {\n\t\t\t$response['code'] = 2;\n\t\t\t$response['error'] = 'User is not logged in';\n\t\t}\n\t\treturn json_encode($response, JSON_UNESCAPED_UNICODE);\n\t}",
"public function createIssue(Issue $issue);",
"public function postComment($issue_id, $content);",
"function github_comment_pull($repo, $pullid, $comment)\n{\n global $curlBaseOpts;\n\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt_array($ch, $curlBaseOpts);\n curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/repos/' . $repo . '/issues/' . $pullid . '/comments');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['body' => $comment]));\n\n //execute post\n $result = curl_exec($ch);\n\n continueOrFailOnHttpCode(curl_getinfo($ch, CURLINFO_HTTP_CODE));\n\n //close connection\n curl_close($ch);\n\n return json_decode($result, true);\n}",
"private function updateGitHub($title, $body, $assignee, $milestone, $labels)\n\t{\n\t\t/* @type \\JTracker\\Application $application */\n\t\t$application = $this->getContainer()->get('app');\n\n\t\t$project = $application->getProject();\n\n\t\ttry\n\t\t{\n\t\t\t// Try to perform the action on behalf of current user\n\t\t\t$gitHub = GithubFactory::getInstance($application);\n\n\t\t\t// Look if we have a bot user configured\n\t\t\tif ($project->getGh_Editbot_User() && $project->getGh_Editbot_Pass())\n\t\t\t{\n\t\t\t\t// Try to perform the action on behalf of an authorized bot\n\t\t\t\t$gitHubBot = GithubFactory::getInstance($application, true, $project->getGh_Editbot_User(), $project->getGh_Editbot_Pass());\n\t\t\t}\n\t\t}\n\t\tcatch (\\RuntimeException $exception)\n\t\t{\n\t\t\tthrow new \\RuntimeException('Error retrieving an instance of the Github object', $exception->getCode(), $exception);\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$gitHubResponse = $gitHub->issues->create(\n\t\t\t\t$project->gh_user, $project->gh_project,\n\t\t\t\t$title, $body, $assignee, $milestone, $labels\n\t\t\t);\n\t\t}\n\t\tcatch (GithubException $exception)\n\t\t{\n\t\t\t$this->getContainer()->get('app')->getLogger()->error(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Error code %1$s received from GitHub when creating an issue with the following data:'\n\t\t\t\t\t. ' GitHub User: %2$s; GitHub Repo: %3$s; Title: %4$s; Body Text: %5$s',\n\t\t\t\t\t$exception->getCode(),\n\t\t\t\t\t$project->gh_user,\n\t\t\t\t\t$project->gh_project,\n\t\t\t\t\t$title,\n\t\t\t\t\t$body\n\t\t\t\t),\n\t\t\t\t['exception' => $exception, 'response' => $exception->getResponse()->body]\n\t\t\t);\n\n\t\t\tthrow new \\RuntimeException('Invalid response from GitHub', $exception->getCode(), $exception);\n\t\t}\n\n\t\t/**\n\t\t * Try to update the milestone and/or labels.\n\t\t * We are not throwing any error because the issue is already created.\n\t\t */\n\t\tif (isset($gitHubBot))\n\t\t{\n\t\t\tif ((!empty($milestone) && empty($gitHubResponse->milestone))\n\t\t\t\t|| (!empty($labels) && empty($gitHubResponse->labels)))\n\t\t\t{\n\t\t\t\t$gitHubBot->issues->edit(\n\t\t\t\t\t$project->gh_user, $project->gh_project,\n\t\t\t\t\t$gitHubResponse->number, 'open', $title, $body,\n\t\t\t\t\t$assignee, $milestone, $labels\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $gitHubResponse;\n\t}",
"public function create($project, CreateIssueRequest $request)\n {\n $issue = new Issue();\n $issue->hidden \t = $request->has('hidden');\n $issue->author_id = Auth::user()->id;\n $issue->project_id = $project->id;\n $issue->summary = $request->summary;\n $issue->priority = 'Medium';\n $issue->version\t\t= $project->current_version;\n $issue->reference = $request->reference;\n $issue->description = $request->description;\n\n if($request->assigned == '1') {\n $groupid = Group::where('name', '=', 'Client')->first()->id;\n $issue->status = 'Awaiting Client';\n $issue->assigned_to_id = $groupid;\n } else {\n $groupid = Group::where('name', '=', 'Sponge UK')->first()->id;\n $issue->status = 'New';\n $issue->assigned_to_id = $groupid;\n }\n $result = $issue->save();\n\n if($request->file('attachment')) {\n $attachment = $request->file('attachment');\n $file = array(\n \"filename\" => $attachment->getClientOriginalName(),\n \"extension\" => $attachment->getClientOriginalExtension(),\n \"filetype\" => $attachment->getMimeType()\n );\n $attachment->move(\"uploads/tmp\", $file['filename']);\n $this->dispatch(new AddAttachmentCommand($file, $issue->id, Auth::user()->id));\n }\n\n if($result) {\n $update = new IssueHistory();\n $update->hidden = false;\n $update->project_id = $issue->project->id;\n $update->issue_id = $issue->id;\n $update->author_id = $issue->author->id;\n $update->type = 'status';\n $update->status = 'created';\n $update->comment = 'Amendment was created';\n $update->save();\n }\n\n return $issue->id;\n }",
"public function createPR() {\n\n $usuario = env('GITHUB_USER');\n $token = env('GITHUB_TOKEN');\n\n if (env('GITHUB_USER') == '' || env('GITHUB_TOKEN') == '') {\n return redirect('/errorcredentials');\n }\n\n $input = request('create');\n if (isset($input)) {\n // Unicamente creamos el PR y lo salvamos dejandolo con status=open\n $response = Http::withBasicAuth($usuario, $token)->post('https://api.github.com/repos/chuchini/99minutos-fullstack-interview-test/pulls', [\n 'title' => request('title'),\n 'body' => request('description'),\n 'head' => request('head'),\n 'base' => request('base')\n ]);\n\n if ($response->failed()) {\n return redirect('/errorpr');\n }\n } else {\n // Primero se crea el PR\n $response = Http::withBasicAuth($usuario, $token)->post('https://api.github.com/repos/chuchini/99minutos-fullstack-interview-test/pulls', [\n 'title' => request('title'),\n 'body' => request('description'),\n 'head' => request('head'),\n 'base' => request('base')\n ]);\n // Se obtiene el pull_number, como se acaba de crear estara en la posicion 0 de la api de github.\n // Puede existir el caso en el que, debido a la concurrencia, esto no se cumpla. Sin embargo se puede arreglar\n // agregando otro metodo de comprobacion, lo cual no hacemos aqui para fines practicos.\n $response = Http::withBasicAuth($usuario, $token)->get('https://api.github.com/repos/chuchini/99minutos-fullstack-interview-test/pulls');\n \n $pull_request_id = $response->json();\n $pull_request_id = $pull_request_id[0]['number'];\n \n // Por ultimo, hacemos el merge con el ID del PR\n $response = Http::withBasicAuth($usuario, $token)->put('https://api.github.com/repos/chuchini/99minutos-fullstack-interview-test/pulls/' . $pull_request_id . '/merge',[\n 'title' => request('title')\n ]);\n \n if ($response->failed()) {\n return redirect('/errorpr');\n }\n }\n \n return redirect('/pullrequests');\n }",
"protected function insertIssue()\n\t{\n\t\t// Prepare the dates for insertion to the database\n\t\t$dateFormat = $this->db->getDateFormat();\n\n\t\t$data = [];\n\t\t$data['issue_number'] = $this->hookData->issue->number;\n\t\t$data['title'] = $this->hookData->issue->title;\n\t\t$data['description'] = $this->parseText($this->hookData->issue->body);\n\t\t$data['description_raw'] = $this->hookData->issue->body;\n\t\t$data['status'] = ($this->hookData->issue->state) == 'open' ? 1 : 10;\n\t\t$data['opened_date'] = (new Date($this->hookData->issue->created_at))->format($dateFormat);\n\t\t$data['opened_by'] = $this->hookData->issue->user->login;\n\t\t$data['modified_date'] = (new Date($this->hookData->issue->updated_at))->format($dateFormat);\n\t\t$data['modified_by'] = $this->hookData->sender->login;\n\t\t$data['project_id'] = $this->project->project_id;\n\t\t$data['build'] = $this->hookData->repository->default_branch;\n\n\t\t// Add the closed date if the status is closed\n\t\tif ($this->hookData->issue->closed_at)\n\t\t{\n\t\t\t$data['closed_date'] = (new Date($this->hookData->issue->closed_at))->format($dateFormat);\n\t\t\t$data['closed_by'] = $this->hookData->sender->login;\n\t\t}\n\n\t\t// If the title has a [# in it, assume it's a JoomlaCode Tracker ID\n\t\tif (preg_match('/\\[#([0-9]+)\\]/', $this->hookData->issue->title, $matches))\n\t\t{\n\t\t\t$data['foreign_number'] = $matches[1];\n\t\t}\n\t\t// If the body has tracker_item_id= in it, that is a JoomlaCode Tracker ID\n\t\telseif (preg_match('/tracker_item_id=([0-9]+)/', $this->hookData->issue->body, $matches))\n\t\t{\n\t\t\t$data['foreign_number'] = $matches[1];\n\t\t}\n\n\t\t// Process labels for the item\n\t\t$data['labels'] = $this->processLabels($this->hookData->issue->number);\n\n\t\ttry\n\t\t{\n\t\t\t(new IssueModel($this->db))\n\t\t\t\t->setProject(new TrackerProject($this->db, $this->project))\n\t\t\t\t->add($data);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$this->logger->error(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Error adding GitHub issue %s/%s #%d to the tracker',\n\t\t\t\t\t$this->project->gh_user,\n\t\t\t\t\t$this->project->gh_project,\n\t\t\t\t\t$this->hookData->issue->number\n\t\t\t\t),\n\t\t\t\t['exception' => $e]\n\t\t\t);\n\n\t\t\t$this->getContainer()->get('app')->close();\n\t\t}\n\n\t\t// Get a table object for the new record to process in the event listeners\n\t\t$table = (new IssuesTable($this->db))\n\t\t\t->load($this->db->insertid());\n\n\t\t$this->triggerEvent('onCommentAfterCreateIssue', ['table' => $table]);\n\n\t\t// Pull the user's avatar if it does not exist\n\t\t$this->pullUserAvatar($this->hookData->issue->user->login);\n\n\t\t// Add a close record to the activity table if the status is closed\n\t\tif ($this->hookData->issue->closed_at)\n\t\t{\n\t\t\t$this->addActivityEvent(\n\t\t\t\t'close',\n\t\t\t\t$data['closed_date'],\n\t\t\t\t$this->hookData->sender->login,\n\t\t\t\t$this->project->project_id,\n\t\t\t\t$this->hookData->issue->number\n\t\t\t);\n\t\t}\n\n\t\t// Store was successful, update status\n\t\t$this->logger->info(\n\t\t\tsprintf(\n\t\t\t\t'Added GitHub issue %s/%s #%d (Database ID #%d) to the tracker.',\n\t\t\t\t$this->project->gh_user,\n\t\t\t\t$this->project->gh_project,\n\t\t\t\t$this->hookData->issue->number,\n\t\t\t\t$table->id\n\t\t\t)\n\t\t);\n\t}",
"public function v1IndividualsDocumentsIssuePostRequest($document_issue_request)\n {\n\n // verify the required parameter 'document_issue_request' is set\n if ($document_issue_request === null || (is_array($document_issue_request) && count($document_issue_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $document_issue_request when calling v1IndividualsDocumentsIssuePost'\n );\n }\n\n $resourcePath = '/v1/individuals/documents/issue';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json; charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json; charset=utf-8'],\n ['application/json; charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($document_issue_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($document_issue_request));\n } else {\n $httpBody = $document_issue_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function github_comment_commit($repo, $sha, $comment)\n{\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt_array($ch, $GLOBALS['curl_base_opts']);\n curl_setopt($ch, CURLOPT_URL, 'https://api.github.com/repos/' . $repo . '/commits/' . $sha . '/comments');\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('body' => $comment)));\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return json_decode($result, true);\n}",
"public function test_commit_github( $args, $assoc_args ) {\n\t\t$post_args = array(\n\t\t\t'body' => '{\"before\":\"6d0ed7cb7fd2721ecb2455da8151bf92df3b767e\",\"after\":\"d3eb4a74bd94dc7737430868a5ea0d693b2a850a\",\"ref\":\"refs/heads/master\",\"user_id\":8214,\"user_name\":\"Keith Devon\",\"repository\":{\"name\":\"Kew Responsive\",\"url\":\"git@gitlab.com:simond/kew-responsive.git\",\"description\":null,\"homepage\":\"https://gitlab.com/simond/kew-responsive\"},\"commits\":[{\"id\":\"36d0beb8b982dde337f03366a2319b74b1a34401\",\"message\":\"Create \\'part-social\\' template part and ass to single attraction template\\n\\nNew settings page created for the social profiles too\\n\\nSigned-off-by: Keith Devon <keith@keithdevon.com>\",\"timestamp\":\"2013-09-03T16:45:21+00:00\",\"url\":\"https://gitlab.com/simond/kew-responsive/commit/36d0beb8b982dde337f03366a2319b74b1a34401\",\"author\":{\"name\":\"Keith Devon\",\"email\":\"keith@keithdevon.com\"}},{\"id\":\"c21a10a64f15dc0e96572edc170258be7e97cf69\",\"message\":\"Add event calendar template\\n\\nSigned-off-by: Keith Devon <keith@keithdevon.com>\",\"timestamp\":\"2013-09-03T16:45:45+00:00\",\"url\":\"https://gitlab.com/simond/kew-responsive/commit/c21a10a64f15dc0e96572edc170258be7e97cf69\",\"author\":{\"name\":\"Keith Devon\",\"email\":\"keith@keithdevon.com\"}},{\"id\":\"d3eb4a74bd94dc7737430868a5ea0d693b2a850a\",\"message\":\"Add single event template\\n\\nSigned-off-by: Keith Devon <keith@keithdevon.com>\",\"timestamp\":\"2013-09-03T16:45:57+00:00\",\"url\":\"https://gitlab.com/simond/kew-responsive/commit/d3eb4a74bd94dc7737430868a5ea0d693b2a850a\",\"author\":{\"name\":\"Keith Devon\",\"email\":\"keith@keithdevon.com\"}}],\"total_commits_count\":3}',\n\t\t\t'headers' => array(\n\t\t\t\t'X-GitHub-Event' => 'push',\n\t\t\t),\n\t\t);\n\t\t$url = home_url( '/commit-receiver/', 'http' );\n\t\t$response = wp_remote_post( $url, $post_args );\n\n\t\tif ( is_wp_error( $response ) )\n\t\t\treturn \\WP_CLI::error( $response->get_error_message() );\n\n\t\tif ( 200 != wp_remote_retrieve_response_code( $response ) )\n\t\t\treturn \\WP_CLI::error( sprintf( 'The URL %s responded with %s', $url, wp_remote_retrieve_response_code( $response ) ) );\n\n\t\treturn \\WP_CLI::error( 'This command is currently incorrect, do not rely on it' );\n\t}",
"public function p_add_issue() {\n\n\t\t# Associate this issue with this user\n\t\t$_POST['user_id'] = $this->user->user_id;\n\n\t\t# Unix timestamp of when this issue was created/modified\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\t\t$_POST['active'] = 1;\n\n\t\t# Insert this issue into the database\n\t\tDB::instance(DB_NAME)->insert(\"issues\", $_POST);\n\n\t\t# Get all the markers\n\t\techo self::get_markers();\n\n\t}",
"public function v1OrganizationsDocumentsIssuePostRequest($document_issue_request)\n {\n\n // verify the required parameter 'document_issue_request' is set\n if ($document_issue_request === null || (is_array($document_issue_request) && count($document_issue_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $document_issue_request when calling v1OrganizationsDocumentsIssuePost'\n );\n }\n\n $resourcePath = '/v1/organizations/documents/issue';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json; charset=utf-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json; charset=utf-8'],\n ['application/json; charset=utf-8']\n );\n }\n\n // for model (json/xml)\n if (isset($document_issue_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($document_issue_request));\n } else {\n $httpBody = $document_issue_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function publishIssue($args) {\n\t\t$issueId = isset($args[0]) ? (int) $args[0] : 0;\n\t\t$this->validate($issueId);\n\t\t$issue =& $this->issue;\n\n\t\t$journal =& Request::getJournal();\n\t\t$journalId = $journal->getId();\n\t\t\n\t\t$CBPPlatformDao =& DAORegistry::getDAO('CBPPlatformDAO');\n\t\t$requiredSections = $CBPPlatformDao->getRequiredSections($journalId);\n\t\tforeach($requiredSections as $requiredSection) {\n\t\t\t$requiredSectionsArr[$requiredSection['title']] = 1;\n\t\t}\n\t\t$requiredSections = $requiredSectionsArr;\n\n\t\t$publishedArticleDao =& DAORegistry::getDAO('PublishedArticleDAO');\n\t\t$articleDao =& DAORegistry::getDAO('ArticleDAO');\n\t\t$publishedArticles =& $publishedArticleDao->getPublishedArticles($issueId);\n\t\t$numberPublishedArticles = count($publishedArticles);\n\t\t\n\t\tforeach ($publishedArticles as $publishedArticle) {\n\t\t\t$article =& $articleDao->getArticle($publishedArticle->getId());\n\t\t\tif ($article && $article->getStatus() == STATUS_QUEUED) {\n\t\t\t\t$article->setStatus(STATUS_PUBLISHED);\n\t\t\t\t$article->stampStatusModified();\n\t\t\t\t$articleDao->updateArticle($article);\n\t\t\t}\n\t\t\t//TODO: %CBP% get most recent galley, not just a submission, review version etc\n\t\t\t$articleGalleys = $publishedArticle->getGalleys();\n\t\t\t$articleGalley = end($articleGalleys); //get the most recent galley\n\t\t\tif (strpos($articleGalley->_data['fileName'], \"RV\") !== false) $path = \"/submission/review/\";\n\t\t\tif (strpos($articleGalley->_data['fileName'], \"ED\") !== false) $path = \"/submission/editor/\";\n\t\t\tif (strpos($articleGalley->_data['fileName'], \"PB\") !== false) $path = \"/public/\";\n\t\t\t$issueChapters[] = Array(\"id\" => $article->getArticleId(), \"name\" => $article->getArticleTitle(), \"description\" => $article->getArticleAbstract(), \"author\" => $article->getAuthorString(false, ', ', false), \"src\" => $articleGalley->_data['fileName'], \"dir\" => Config::getVar('files', 'files_dir') . \"/journals/$journalId/articles/\" . $articleGalley->_data['submissionId'] . $path);\n\t\t\t$relatedItems[] = Config::getVar('general', 'component_namespace') . \":\" . $article->getArticleId();\n\t\t\t\n\t\t\t//%CBP% retreive docx supplementary files for publication in the book\n\t\t\t$suppFiles = $publishedArticle->getSuppFiles();\n\t\t\tforeach ($suppFiles as $suppFile) {\n\t\t\t\tif ($suppFile->_data['fileType'] == \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\") {\n\t\t\t\t\t$suppFilesArr[] = $suppFile;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$issueAuthors[] = $article->getAuthorString(false, ', ', false);\n\t\t\tunset($article);\n\t\t}\n\n\t\t//%CBP% adding author biographies section to the end of the book\n\t\tif (array_key_exists(\"Author Biographies\", $requiredSections)) {\n\t\t\tforeach ($suppFilesArr as $suppFile) {\n\t\t\t\t$path = \"/supp/\";\n\t\t\t\t$title = $suppFile->getTitle();\n\t\t\t\tif (stristr($title['en_US'], \"author biography\") != false) { //if the title of the supplementary file doesn't include the words 'author biography', don't include\n\t\t\t\t\t$issueChapters[] = Array(\"id\" => $suppFile->getArticleId(), \"name\" => $title['en_US'], \"src\" => $suppFile->_data['fileName'], \"dir\" => Config::getVar('files', 'files_dir') . \"/journals/$journalId/articles/\" . $suppFile->getArticleId() . $path, \"type\" => \"supp\", \"desc\" => \"Author Biography\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasort($issueAuthors);\n\t\t$numberOfIssueAuthors = count($issueAuthors);\n\t\t$i = 0;\n\t\t$issueAuthorsString = \"\";\n\t\t$issueAuthors = array_unique($issueAuthors);\n\t\tforeach ($issueAuthors as $issueAuthor){\n\t\t\t$issueAuthorsString .= $issueAuthor;\n\t\t\t($i+1 == $numberOfIssueAuthors) ? $issueAuthorsString .= \"\" : $issueAuthorsString .= \"; \";\n\t\t\t$i++;\n\t\t}\n\n\t\t//%CBP% Upload file to Repository and update database with PID/DsId\n\t\t$digitalObject = new CBPPlatformDigitalObject();\n\t\t$epubconvert = new CBPPlatformEpubConvert();\n\t\t$mobiconvert = new CBPPlatformMobiConvert();\n\t\t$pdfconvert = new CBPPlatformPdfConvert();\n\t\t\n\t\t$coverImage = Config::getVar('general', 'base_url') . \"/\" . Config::getVar('files', 'public_files_dir') . \"/journals/\" . $issue->getJournalId() . \"/\" . $issue->getIssueFileName();\n\t\t$epubArgs = array(\"author\" => $issueAuthorsString, \"imprint\" => $journal->getJournalTitle(), \"title\" => $issue->getIssueTitle(), \"description\" => $issue->getIssueDescription(), \"isbn\" => $CBPPlatformDao->getIssueISBN($issueId), \"cover\" => $coverImage);\n\t\t\n\t\t$epubconvert->createEpub(null, null, \"cache/$journalId-$issueId.epub\", $issueChapters, $journalId, $epubArgs);\n\t\t$mobiconvert->createMobi(null, null, \"cache/$journalId-$issueId.mobi\", $issueChapters, $journalId, $epubArgs);\n\t\t$pdfconvert->createPdf(null, null, \"cache/$journalId-$issueId.pdf\", $issueChapters, $journalId, $epubArgs, \"cache/$journalId-$issueId-FC.pdf\");\n\t\t\n\t\t$digitalObject->setPID($journalId . \"-\" . $issueId); \n\t\t$digitalObject->setLabel($issue->getIssueTitle()); \n\t\t$digitalObject->setNamespace(Config::getVar('general', 'compiled_namespace'));\n\t\t\n\t\t///\n\t\t$ext = \"pdf\";\n\t\t$digitalObject->setDatastream(Array($ds = \"content\" => Array (\"file\" => Config::getVar('general', 'docroot') . \"/cache/$journalId-$issueId.$ext\", \"label\" => $issue->getIssueTitle() . \".$ext\", \"mimetype\" => \"application/pdf\", \"filetype\" => $ext)));\n\t\t///\n\t\t$ext = \"epub\";\n\t\t$digitalObject->setDatastream(Array(\"content02\" => Array (\"file\" => Config::getVar('general', 'docroot') . \"/cache/$journalId-$issueId.$ext\", \"label\" => $issue->getIssueTitle() . \".$ext\", \"mimetype\" => \"application/epub+zip\", \"filetype\" => $ext)));\n\t\t///\n\t\t$ext = \"mobi\";\n\t\t$digitalObject->setDatastream(Array(\"content03\" => Array (\"file\" => Config::getVar('general', 'docroot') . \"/cache/$journalId-$issueId.$ext\", \"label\" => $issue->getIssueTitle() . \".$ext\", \"mimetype\" => \"application/x-mobipocket-ebook\", \"filetype\" => $ext)));\n\t\t///\n\t\t$ext = \"pdf\";\n\t\tif (file_exists(Config::getVar('general', 'docroot') . \"/cache/$journalId-$issueId-FC.$ext\")) $digitalObject->setDatastream(Array(\"content04\" => Array (\"file\" => Config::getVar('general', 'docroot') . \"/cache/$journalId-$issueId-FC.$ext\", \"label\" => $issue->getIssueTitle() . \" Front Cover Artwork.pdf\", \"mimetype\" => \"application/pdf\", \"filetype\" => $ext)));\n\t\t\n\t\t$obj = new SimpleXMLElement($digitalObject->readObjectProperties());\n\t\tforeach ($obj as $result) {\n\t\t\t$noObjects = $result->count();\n\t\t}\n\t\tif ($noObjects==0) {\n\t\t\t$digitalObject->createObject();\n\t\t}\n\t\t$digitalObject->createObjectDatastreams();\n\t\t$digitalObject->makeHydraCompliant(\"book\", $issue->getIssueTitle(), $issueAuthorsString, $relatedItems);\n\t\t$CBPPlatformDao->setFedoraIssueObjectInformation($digitalObject->obj->PID, $digitalObject->obj->ns, $ds, $issueId);\n\n\t\t//%CBP% don't publish just yet, we don't have EIC approval for the publication, but still create the issue...\n\t\t$issue->setCurrent(1);\n\t\t$CBPPlatformDao->setIssuePending($issueId, 1);\n\n\t\t// If subscriptions with delayed open access are enabled then\n\t\t// update open access date according to open access delay policy\n\t\tif ($journal->getSetting('publishingMode') == PUBLISHING_MODE_SUBSCRIPTION && $journal->getSetting('enableDelayedOpenAccess')) {\n\n\t\t\t$delayDuration = $journal->getSetting('delayedOpenAccessDuration');\n\t\t\t$delayYears = (int)floor($delayDuration/12);\n\t\t\t$delayMonths = (int)fmod($delayDuration,12);\n\n\t\t\t$curYear = date('Y');\n\t\t\t$curMonth = date('n');\n\t\t\t$curDay = date('j');\n\n\t\t\t$delayOpenAccessYear = $curYear + $delayYears + (int)floor(($curMonth+$delayMonths)/12);\n \t\t\t$delayOpenAccessMonth = (int)fmod($curMonth+$delayMonths,12);\n\n\t\t\t$issue->setAccessStatus(ISSUE_ACCESS_SUBSCRIPTION);\n\t\t\t$issue->setOpenAccessDate(date('Y-m-d H:i:s',mktime(0,0,0,$delayOpenAccessMonth,$curDay,$delayOpenAccessYear)));\n\t\t}\n\n\t\t$issueDao =& DAORegistry::getDAO('IssueDAO');\n\t\t$issueDao->updateCurrentIssue($journalId,$issue);\n\n\t\t// Send a notification to associated users\n\t\t// %CBP% TODO: move this to EIC publishing approval stage\n\t\t/*import('lib.pkp.classes.notification.NotificationManager');\n\t\t$notificationManager = new NotificationManager();\n\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t$notificationUsers = array();\n\t\t$allUsers = $roleDao->getUsersByJournalId($journalId);\n\t\twhile (!$allUsers->eof()) {\n\t\t\t$user =& $allUsers->next();\n\t\t\t$notificationUsers[] = array('id' => $user->getId());\n\t\t\tunset($user);\n\t\t}\n\t\t$url = Request::url(null, 'issue', 'current');\n\t\tforeach ($notificationUsers as $userRole) {\n\t\t\t$notificationManager->createNotification(\n\t\t\t\t$userRole['id'], 'notification.type.issuePublished',\n\t\t\t\tnull, $url, 1, NOTIFICATION_TYPE_PUBLISHED_ISSUE\n\t\t\t);\n\t\t}\n\t\t$notificationManager->sendToMailingList(\n\t\t\t$notificationManager->createNotification(\n\t\t\t\t0, 'notification.type.issuePublished',\n\t\t\t\tnull, $url, 1, NOTIFICATION_TYPE_PUBLISHED_ISSUE\n\t\t\t)\n\t\t);*/\n\n\t\tRequest::redirect(null, null, 'issueToc', $issue->getId());\n\t}",
"public function sendRequest() {\n\t\t\tif($this->inputValidation()) {\n\t\t\t\t//Send request to create repository issue on github|bitbucket\n\t\t\t\t$response = $this->auth->post(array('title' => $this->title, 'desc' => $this->desc));\n\n\t\t\t\t//show message based on return response from Api's\n\t\t\t\tif(isset($response->title)) {\n\t\t\t\t\techo ucwords($this->auth->getOption('api_type')) .' Issue posted successfully'. PHP_EOL;\n\t\t\t\t} else { \n\t\t\t\t\techo $response.\"<br>\".ucwords($this->auth->getOption('api_type')) .' Issue not posted successfully'. PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function store(IssueRequest $request)\n\t{\t\t\n\t\t$todoIssueStatusId = IssueStatus::getIdByMachineName('todo');\n\t\t\n\t\t$request['user_id'] = Auth::user()->id;\n\t\t$request['sprint_id'] = Project::findOrFail($request->project_id)->getBacklogSprint()->id;\n\t\t$request['status_id'] = $todoIssueStatusId;\n\t\t\n\t\t$issue = new Issue;\n\t\t$issue->create($request->all());\n\n\t\treturn redirect('projects/' . $request->project_id);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
getConsoleUsage(Console $console) cantilever load scripts, descriptions of commands (For Console usage help) | public function getConsoleUsage(Console $console)
{
return [
// Here I describe the console Command
'websocket open ' => 'Websocket server start',
'websocket system [--verbose|-v] <option>' => 'type the system command',
['option' => 'system command for your CLI'],
['--verbose|-v' => '(optional) turn on verbose mode'],
];
} | [
"public function getConsoleUsage(AdapterInterface $console)\n {\n return [\n 'UDP server',\n 'server run' => 'Run controller'\n ];\n }",
"public function getConsoleCommands();",
"function usage() {\n\t\techo \"Command-line tool for import/export tasks\\n\"\n\t\t\t. \"Usage:\\n\"\n\t\t\t. \"\\t{$this->scriptName} list: List available plugins\\n\"\n\t\t\t. \"\\t{$this->scriptName} [pluginName] usage: Display usage information for a plugin\\n\"\n\t\t\t. \"\\t{$this->scriptName} [pluginName] [params...]: Invoke a plugin\\n\";\n\t}",
"public function cli_help() {}",
"public function help()\n {\n $help = [\n '',\n 'Tooth Software ' . config('version'),\n '',\n 'Usage:',\n '',\n '⇾ php index.php console [command] [arguments]',\n '',\n 'Commands:',\n '',\n '⇾ php index.php console migrate',\n '⇾ php index.php console migrate fresh',\n '⇾ php index.php console seed',\n '⇾ php index.php console install',\n '⇾ php index.php console backup',\n '⇾ php index.php console sync',\n '',\n '',\n ];\n\n $this->output->set_output(implode(PHP_EOL, $help));\n }",
"private function getLoadConsoleCommand(): string\n {\n return (string) file_get_contents($this->resourcePath . DIRECTORY_SEPARATOR . 'Console' . DIRECTORY_SEPARATOR . 'LoadConsoleCommand.php.stub');\n }",
"public function showCommandsList()\n {\n // Loop through the commands to show its info\n foreach ($this->console->commands as $command) {\n $this->console->output->println(' ' . $command::signature, 'green', \"\");\n $this->console->output->println(str_pad(' ', 25 - strlen($command::signature),' ') . $command::description);\n }\n\n // Some extra spaces\n $this->console->output->println(\"\\n\\r\");\n }",
"private function _printusage()\n {\n return \"usage: php -f mkmod.php module_name template_type team_security navigation_tab importable \\n\";\n }",
"public function testPrintUsage()\n {\n \n ob_start();\n $this->cli->printUsage();\n $usage = ob_get_clean();\n $this->assertContains('sqlics', $usage);\n $this->assertNotContains('phpcs', $usage);\n }",
"private function _usage()\n {\n $question = str_replace(\"!usage \", \"\", $this->_data->message);\n \n $question = escapeshellcmd($question);\n $hack = false;\n if (strpos($question, \";\") === FALSE ) {\n $value = `ruby phpManual.rb $question`;\n \n }\n else {\n $hack = true; \n }\n \n $result = str_replace(\"\\n\", \"\", strip_tags($value));\n \n if ($value) {\n $this->_message($this->_data->nick.': '. $result);\n }\n else {\n $this->_message($this->_data->nick.': Sorry, cannot find that function ('. $question .')');\n }\n \n }",
"function printUsage()\n{\n echo 'usage is: <PATH_TO_SCRIPT>' . basename(__FILE__) . ' --source=<SOURCE_PATH> --target=<TARGET_PATH>\n';\n}",
"public function listCommands()\n {\n $commands = $this->library->getAll();\n\n foreach ($commands as $name => $details) {\n $this->output->writeln(ucwords($name));\n $this->output->hr(strlen($details['description']), '-');\n $this->output->writeln($details['description']);\n $this->output->hr(strlen($details['description']), '-');\n\n foreach ($details['actions'] as $action) {\n $this->output->writeln(\n sprintf(\n \"%s - php [file] %s%s [params]\",\n $action,\n $name,\n ($action != 'main' ? \":$action\" : '')\n )\n );\n }\n\n // Just for padding\n $this->output->writeln('');\n }\n }",
"protected function showCommands()\n {\n $formater = new TextFormater(array('indent' => 2));\n $this->writeln('Available commands:', Colors::YELLOW);\n\n $rows = [];\n foreach ($this->console->getCommands() as $name => $fqdn) {\n $help = Help::fromFQDN($fqdn);\n $rows[] = array(Colors::colorize($name, Colors::GREEN), $help->getShortDescription());\n }\n $table = new Widgets\\Table(null, $rows, array('border'=>false, 'frame'=>false));\n $this->writeln($formater->format($table->render()));\n }",
"public static function displayCliHelp() {\n echo \"FastTrack application CLI Usage :\\n\";\n echo \"php app_main_script.php command arg1 arg2 ...\\n\";\n echo \"\\n\";\n echo \"Commands :\\n\";\n echo \" - action NameSpace\\\\ControllerClass.method Execute a controller action\\n\";\n echo \" - help Display this message\\n\";\n echo \"\\n\";\n }",
"public function getHelp();",
"public function cli_help()\n {\n foreach ($this->cli_help as $key => $value) {\n $this->cli_echo(strtoupper($key) . ':\n');\n switch ($key) {\n case 'synopsis':\n $optStr = '';\n foreach ($this->cli_options as $v) {\n $optStr .= ' [' . $v[0] . ']';\n }\n $this->cli_echo($this->cli_indent(str_replace('###OPTIONS###', trim($optStr), $value), 4) . '\n\n');\n break;\n case 'options':\n $this->cli_echo($this->cli_indent($value, 4) . LF);\n $maxLen = 0;\n foreach ($this->cli_options as $v) {\n if (strlen($v[0]) > $maxLen) {\n $maxLen = strlen($v[0]);\n }\n }\n foreach ($this->cli_options as $v) {\n $this->cli_echo($v[0] . substr($this->cli_indent(rtrim($v[1] . LF . $v[2]), $maxLen + 4), strlen($v[0])) . LF);\n }\n $this->cli_echo(LF);\n break;\n default:\n $this->cli_echo($this->cli_indent($value, 4) . '\n\n');\n }\n }\n }",
"public function getConsole();",
"public function test_cli_help() {\n $this->resetAfterTest();\n $this->setAdminUser();\n $clihelper = $this->construct_helper([\"--help\"]);\n ob_start();\n $clihelper->print_help();\n $output = ob_get_contents();\n ob_end_clean();\n\n // Basically a test that everything can be parsed and displayed without errors. Check that some options are present.\n $this->assertEquals(1, preg_match('/--delimiter_name=VALUE/', $output));\n $this->assertEquals(1, preg_match('/--uutype=VALUE/', $output));\n $this->assertEquals(1, preg_match('/--auth=VALUE/', $output));\n }",
"protected function showOverview() {\n $this->output->writeLine('Available commands:');\n\n foreach ($this->commandContainer as $command) {\n $syntax = $command->getSyntax();\n\n $aliases = $command->getAliases();\n if ($aliases) {\n $syntax .= ' (' . implode(',', $aliases) . ')';\n }\n\n $this->output->writeLine('- ' . $syntax);\n }\n\n $this->output->writeLine('');\n $this->output->writeLine('Use \\'help <command>\\' to get help for a specific command.');\n $this->output->writeLine('');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the xDimension array for the pivot grid | public function setxDimension( $param ) {
if(is_array($param)) {
$this->pivotoptions['xDimension'] = jqGridUtils::array_extend($this->pivotoptions['xDimension'],$param);
}
} | [
"public function getXDimension(): int;",
"protected function setPivotValues()\n {\n if (null !== $pivot = $this->parsePivot($this->parent)) {\n $pivot = $pivot->toArray();\n unset($pivot[$this->pivotKey], $pivot['_' . $this->pivotKey]);\n foreach ($pivot as $column => $value) {\n $this->pivotValues[] = compact('column', 'value');\n }\n }\n }",
"private function setBoardDimensions()\n {\n $this->currentBoard['dimensions'] = array(\n sizeof($this->currentBoard['data']),\n sizeof($this->currentBoard['data'][0])\n );\n }",
"public function setDimensions()\r\n\t{\r\n\t\t$this->cube->addDimension(\"page\", \"string\");\r\n\t\t$this->cube->addDimension(\"country\", \"string\");\r\n\t}",
"protected function _setColumnXs()\n {\n $this->setProductNameX(35);\n $this->setProductSkuX(200);\n $this->setConditionX(280);\n $this->setResolutionX(360);\n $this->setQtyRequestedX(425);\n $this->setQtyX(490);\n $this->setStatusX(520);\n }",
"public function setXMax($xMax) {}",
"public function setPivot($pivot)\n {\n\n $this->Query->pivot = $pivot;\n\n }",
"public function resetDimension() {\n\t\t$this->elements['dimension'] = NULL;\n\t}",
"abstract public function setupGrid();",
"public function setXLabels($array) {\n\t\t$this->Options['xaxis']['ticks'] = $array;\n\t}",
"abstract public function setDimensions(array $dimensions);",
"public function setPivotDimensionHeaders($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Analytics\\Data\\V1beta\\PivotDimensionHeader::class);\n $this->pivot_dimension_headers = $arr;\n\n return $this;\n }",
"private function setGridValues()\n {\n for ($i = 0; $i < $this->gridRow; $i++) {\n for ($j = 0; $j < $this->gridColumn; $j++) {\n if (\n ($i == 0 || $i == ($this->gridRow - 1))\n && ($j >= 0 && $j < $this->gridColumn)\n ) {\n $this->slot[$i][$j] = \"#\";\n } else if (\n ($j == 0 || $j == ($this->gridColumn - 1))\n && ($i >= 0 && $i < $this->gridRow)\n ) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 2 && ($j >= 2 && $j <= 4)) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 3 && ($j == 4 || $j == 6)) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 4 && $j == 2) {\n $this->slot[$i][$j] = \"#\";\n } else if ($i == 4 && $j == 1) {\n $this->slot[$i][$j] = \"X\";\n $userPosition = new stdClass();\n $userPosition->row = $i;\n $userPosition->column = $j;\n $this->position_user = $userPosition;\n } else {\n $this->slot[$i][$j] = \".\";\n $clearPath = new stdClass();\n $clearPath->row = $i;\n $clearPath->column = $j;\n $this->clearPathslot[\"{$clearPath->row}::{$clearPath->column}\"] = $clearPath;\n }\n }\n }\n }",
"public function get_xaxes() {\n return $this->xaxes;\n }",
"public function setXAxis($x)\n {\n $this->x_axis = $x;\t\n\n return $this;\n }",
"public function setX($x) {\n\t\t$this->x = $x;\n\t}",
"protected function setHorizontal()\n {\n $difference = $this->currentDimensions['width'] - $this->currentDimensions['height'];\n $this->cropValues['width'] = $this->currentDimensions['width'] - $difference;\n $this->cropValues['height'] = $this->currentDimensions['height'];\n $this->cropValues['x'] = $difference / 2;\n }",
"public function getPivotData(): array;",
"public function setShowGridX($value = true)\n {\n $this->gridX = $this->setBoolVal($value, $this->gridX);\n\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get geo information and update nursery's lon lat by batch | public function getNurseryLonLat()
{
if (!$this->input->is_cli_request())
{
return NULL;
}
try
{
// for test
/*
$testdata = array(
0 => 86697,
1 => 86700,
);*/
$api_count = 0;
$ok_count = 0;
$ng_count = 0;
//$nursery_areas = $this->Logic_nursery->get_all_nursery_address($testdata);
$nursery_areas = $this->Logic_nursery->get_all_nursery_address();
$delete_flg = $this->config->item('not_deleted','common_config');
foreach($nursery_areas as $nursery_area)
{
// areas info
$area_params = array(
'area_id' => $nursery_area['area_id'],
'delete_flg' => $delete_flg
);
$area = $this->Logic_area->get_detail($area_params);
$pref = $this->Logic_area->get_pref_name($area[0]['pref_id']);
if(empty($nursery_area['address']))
{
$area_name = $pref[0]['name'] . $area[0]['name'];
$geoinfo = $this->strAddrToLatLngByGoogle($area_name);
$api_count++;
}
else
{
$area_name = $pref[0]['name'] . $area[0]['name'] . $nursery_area['address'];
$geoinfo = $this->strAddrToLatLngByGoogle($area_name);
$api_count++;
if($geoinfo == '')
{
$area_name = $pref[0]['name'] . $area[0]['name'];
$geoinfo = $this->strAddrToLatLngByGoogle($area_name);
$api_count++;
}
}
if($geoinfo == '')
{
$ng_count++;
echo "request count : " . $api_count;
echo " : NG : " . $nursery_area['nursery_id'] . " : " . $area_name . PHP_EOL;
}
else
{
$ok_count++;
$this->Service_nursery->update_geoinfo($nursery_area['nursery_id'], $geoinfo);
echo "request count : " . $api_count;
echo " : OK : " . $nursery_area['nursery_id'] . " : " . $area_name . PHP_EOL;
}
}
echo "batch finished : OK " . $ok_count . " : NG " . $ng_count . PHP_EOL;
}catch(Exception $e){
echo $e->getMessage();
echo $e->getTraceAsString();
}
} | [
"function refreshLatLon(){\r\n\t\t$records = $this->find('all');\r\n\t\tforeach($records as $r){\r\n\t\t\t$this->id = $r['Stockist']['id'];\r\n\t\t\t$postcode = $r['Stockist']['postcode'];\r\n\t\t\t$latlon = $this->postcode2LatLon($postcode);\r\n\t\t\t$save = array('Stockist' => array(\r\n\t\t\t\t'latitude' => $latlon['lat'],\r\n\t\t\t\t'longitude' => $latlon['lon']\r\n\t\t\t));\r\n\t\t\t$this->save($save);\r\n\t\t}\r\n\t}",
"private function fetchGeoCoordinates()\r\n {\r\n $geoCoordinatesNode = $this->findFirstGrandchild('geo', 'geokoordinaten');\r\n $attributes = $this->fetchLowercasedDomAttributes($geoCoordinatesNode);\r\n \r\n if (\r\n $this->isElementSetAndNonEmpty('laengengrad', $attributes)\r\n && $this->isElementSetAndNonEmpty('breitengrad', $attributes)\r\n ) {\r\n $this->addImportedData('has_coordinates', true);\r\n $this->addImportedData('coordinates_problem', false);\r\n $this->addImportedData('longitude', (float)$attributes['laengengrad']);\r\n $this->addImportedData('latitude', (float)$attributes['breitengrad']);\r\n }\r\n }",
"public function getNurseryLonLat()\n {\n if (!$this->input->is_cli_request())\n {\n return NULL;\n }\n \n try\n {\n // for test\n /*\n $testdata = array(\n 0 => 83567,\n 1 => 83569,\n );*/\n \n $api_count = 0;\n $ok_count = 0;\n $ng_count = 0;\n \n //$nursery_areas = $this->Logic_nursery->get_all_nursery_address($testdata);\n $nursery_areas = $this->Logic_nursery->get_all_nursery_address();\n \n $delete_flg = $this->config->item('not_deleted','common_config');\n\n foreach($nursery_areas as $nursery_area)\n {\n // areas info\n $area_params = array(\n 'area_id' => $nursery_area['area_id'],\n 'delete_flg' => $delete_flg\n );\n $area = $this->Logic_area->get_detail($area_params);\n $pref = $this->Logic_area->get_pref_name($area[0]['pref_id']);\n \n if(empty($nursery_area['address']))\n {\n $area_name = $pref[0]['name'] . $area[0]['name'];\n $geoinfo = $this->strAddrToLatLngByYahoo($area_name);\n $api_count++;\n }\n else\n {\n $area_name = $pref[0]['name'] . $area[0]['name'] . $nursery_area['address'];\n $geoinfo = $this->strAddrToLatLngByYahoo($area_name);\n $api_count++;\n \n if($geoinfo == '')\n {\n $area_name = $pref[0]['name'] . $area[0]['name'];\n $geoinfo = $this->strAddrToLatLngByYahoo($area_name);\n $api_count++;\n }\n }\n \n if($geoinfo == '')\n {\n $ng_count++;\n echo \"request count : \" . $api_count;\n echo \" : NG : \" . $nursery_area['nursery_id'] . \" : \" . $area_name . PHP_EOL;\n }\n else\n { \n $ok_count++;\n $this->Service_nursery->update_geoinfo($nursery_area['nursery_id'], $geoinfo);\n echo \"request count : \" . $api_count;\n echo \" : OK : \" . $nursery_area['nursery_id'] . \" : \" . $area_name . PHP_EOL;\n }\n }\n echo \"batch finished : OK \" . $ok_count . \" : NG \" . $ng_count . PHP_EOL;\n \n }catch(Exception $e){\n echo $e->getMessage();\n echo $e->getTraceAsString();\n }\n }",
"private function updateGeoCoords()\n\t{\n\t\t// $this->attributes contains payload of the session\n\t\t// $this->handler->get_table_row() contains extended Row's field like IP and Platform\n\t\t$row = $this->handler->get_table_row();\n\t\t$current_ip = PlatformDetector::getClientIp();\n\n\t\t// define the flag for new re-detection\n\t\t// if no coordinates is set\n\t\t$should_recheck_coords = !isset($this->attributes['geo_coords']);\n\t\t// or if IP address was changed\n\t\t$should_recheck_coords |= $row && $row['ip_address'] != $current_ip;\n\n\t\tif ($should_recheck_coords) {\n\t\t\t//Log::info('Recheck GEO coords for session');\n\t\t\t// we need to update geo coordinates\n\t\t\t$coords = GeoIPLib::get_lat_lon($current_ip);\n\t\t\t$this->attributes['geo_coords'] = [\n\t\t\t\t'latitude' => $coords[0],\n\t\t\t\t'longitude' => $coords[1],\n\t\t\t];\n\t\t}\n\n\t}",
"public function fill_missing_coords() {\n\t\n\t\tini_set('memory_limit', '256M');\n\t\tini_set('max_execution_time', 0);\n\t\t\n\t\trequire_once ASL_PLUGIN_PATH . 'includes/class-agile-store-locator-helper.php';\n\n\t\tglobal $wpdb;\n\n\t\t$response = new \\stdclass();\n\t\t$response->success = false;\n\t\t$response->summary = array();\n\n\t\t//Get the API Key\n\t\t$sql = \"SELECT `key`,`value` FROM \".ASL_PREFIX.\"configs WHERE `key` = 'server_key'\";\n\t\t$configs_result = $wpdb->get_results($sql);\n\t\t$api_key \t\t= $configs_result[0]->value;\n\n\t\tif($api_key) {\n\n\t\t\t//Get the Stores\n\t\t\t$stores = $wpdb->get_results(\"SELECT `s`.`id`, `s`.`title`, `s`.`description`, `s`.`street`, `s`.`city`, `s`.`state`, `s`.`postal_code`, `c`.`country`, `s`.`lat`, `s`.`lng` \n\t\t\t\t\t\t\t\t\t\tFROM \".ASL_PREFIX.\"stores s LEFT JOIN \".ASL_PREFIX.\"countries c ON s.country = c.id \n\t\t\t\t\t\t\t\t\t\tWHERE lat is NULL OR lat = '' OR lng is NULL OR lng = '' OR lat = '0' OR lat = '0.0' ORDER BY s.`id`\");\n\n\t\t\tforeach($stores as $store) {\n\n\t\t\t\t$coordinates = AgileStoreLocator_Helper::getCoordinates($store->street, $store->city, $store->state, $store->postal_code, $store->country, $api_key);\n\n\t\t\t\tif($coordinates) {\n\n\t\t\t\t\tif($wpdb->update( ASL_PREFIX.'stores', array('lat' => $coordinates['lat'], 'lng' => $coordinates['lng']),array('id'=> $store->id )))\n\t\t\t\t\t{\n\t\t\t\t\t\t$response->summary[] = 'Store ID: '.$store->id.\", LAT/LNG Fetch Success, Address: \".implode(', ', array($store->street, $store->city, $store->state, $store->postal_code));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response->summary[] = '<span class=\"red\">Store ID: '.$store->id.\", LAT/LNG Error Save, Address: \".implode(', ', array($store->street, $store->city, $store->state, $store->postal_code)).'</span>';\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$response->summary[] = '<span class=\"red\">Store ID: '.$store->id.\", LAT/LNG Fetch Failed, Address: \".implode(', ', array($store->street, $store->city, $store->state, $store->postal_code)).'</span>';\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif(!$stores || count($stores) == 0) {\n\n\t\t\t\t$response->summary[] = __('Missing Coordinates are not Found in Store Listing','asl_admin');\n\t\t\t}\n\n\t\t\t$response->msg \t\t\t= __('Missing Coordinates Request Completed','asl_admin');\n\t\t\t$response->success \t= true;\n\t\t}\n\t\telse\n\t\t\t$response->msg \t\t= __('Google Server API Key is Missing.','asl_admin');\n\n\t\n\t\techo json_encode($response);die;\n\t}",
"public function populateCounselorGeoData(){\n $lat = 0;\n $lon = 0;\n $processedCount = 0;\n $processedDetails = array();\n\n ini_set('max_execution_time', 120); //120 seconds = 2 minutes\n\n// $sql = \"select\n// Counselor.ID,\n// Counselor.Address1 as Address1,\n// Counselor.Address2 as Address2,\n// Counselor.City as City,\n// Counselor.State as State,\n// Counselor.ZIPCode as ZIPCode\n// from counselors Counselor\n// LEFT join geodatas g\n// on Counselor.id = g.counselors_id\n// where g.counselors_id is null\n// LIMIT 30\";\n\n $sql = \"\n select\n Counselor.ID,\n Counselor.Address1 as Address1,\n Counselor.Address2 as Address2,\n Counselor.City as City,\n Counselor.State as State,\n Counselor.ZIPCode as ZIPCode ,\n sha1( upper(trim(address1)) + ' ' + upper(trim(address2)) + ' ' + upper(trim(city)) + ' ' + upper(trim(state)) ) as sha1\n from counselors Counselor\n left join geodatas g\n on sha1( upper(trim(address1)) + ' ' + upper(trim(address2)) + ' ' + upper(trim(city)) + ' ' + upper(trim(state)) ) = g.sha1\n where g.sha1 is null\n order by Counselor.LastName, Counselor.FirstName\n LIMIT 50\n \";\n\n $counselorWithoutGeodata = $this->Counselor->query($sql);\n\n $i = 0;\n\n $sha1 = '';\n\n foreach($counselorWithoutGeodata as $item){\n $sha1 = $item[0]['sha1'];\n if ( ! $this->shaExistsInTable($sha1)){\n\n $i++;\n $add1 = trim($item['Counselor']['Address1'].\" \");\n $add2 = trim($item['Counselor']['Address2'].\" \");\n if (strlen($add2) > 0){\n $add1 = $add2;\n $add2 = \"\";\n }\n $city = $item['Counselor']['City'];\n $state = $item['Counselor']['State'];\n $zip = $item['Counselor']['ZIPCode'];\n\n $success = $this->GetLatLonFromAddress($add1, $city, $state, $zip, $lat, $lon);\n\n $this->Geodata->create();\n $data = Array\n (\n 'Geodata' => Array\n (\n 'sha1' => $sha1,\n 'lat' => $lat,\n 'lon' => $lon\n )\n );\n $this->Geodata->save($data);\n $processedCount++;\n array_push( $processedDetails , $item['Counselor']['ID'] );\n\n // if ($i > 28) return;\n }\n else{\n echo(' already exists: ' . $sha1 . '<br/>');\n }\n }\n if ($processedCount == 0){\n $this->set('header', 'No data processed. It appears the geodata table is up to date.');\n }\n else{\n $this->set('header', $processedCount . ' address(es) processed');\n $this->set('processedIds', $processedDetails);\n }\n }",
"function geodaten_update_from_result_set($address) {\n $custom_fields = geodaten_get_custom_fields_from_table('geodaten');\n\n if ($address->N == 0) {\n return;\n }\n\n // Walk through all addresses and create geodata entity\n while($address->fetch()) {\n if (!empty($address->lat) && !empty($address->lon)) {\n // Values for api call to create set of geodata\n // information.\n $values = array('entity_id' => $address->id);\n\n // Get geodata and add geodata to values.\n $geodata = geodaten_get_geodata($address->lat, $address->lon);\n \n if (!empty($geodata)) {\n foreach ($geodata as $column => $value) {\n $values[$custom_fields[$column]] = $value;\n }\n \n // Save geodata.\n $status = civicrm_api3('CustomValue', 'create', $values);\n } else {\n echo \"Could not get geodata for \"\n . \"$address->id($address->lat,$address->lon)\\n\";\n }\n\n sleep(2);\n }\n }\n}",
"function readysaster_update_user_last_location($lat, $lng, $fbId, $mobileNo){\r\n \r\n // CONSTRUCT DB QUERY WITH FBID CONDITION\r\n $query = db_select('node', 'n');\r\n $query->join('field_data_field_facebook_id', 'fb', 'fb.entity_id = n.nid');\r\n $query->fields('n', array('nid','vid'));\r\n $query->condition('n.type', 'people');\r\n $query->condition('fb.field_facebook_id_value', $fbId);\r\n $query->range(0,1);\r\n $result = $query->execute()->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n if($result){\r\n $entityNodeLoad = node_load($result[0]['nid'], $result[0]['vid']);\r\n $postedLatLangCoor = $lat.' '.$lng;\r\n $savedLatLangCoor = $entityNodeLoad->field_last_location_geo_code['und'][0]['value'];\r\n \r\n // CHECK IF POSTED COORDINATE IS DIFFERENT, THIS MEANS HE CHANGED LOCATION\r\n if($postedLatLangCoor != $savedLatLangCoor){\r\n \r\n // UPDATE LOCATION\r\n $entityNodeLoad->field_last_location_geo_code['und'][0]['value'] = $postedLatLangCoor;\r\n node_save($entityNodeLoad);\r\n }\r\n }\r\n}",
"private function geocode() {\r\n \r\n if (!empty($this->region) && !empty($this->country) && !empty($this->locality)) {\r\n #return;\r\n }\r\n \r\n $woe = PlaceUtility::LatLonWoELookup($this->lat, $this->lon);\r\n $woe = PlaceUtility::formatWoE($woe);\r\n \r\n $this->country = $woe['country_code'];\r\n $this->region = $woe['region_code'];\r\n $this->locality = $woe['neighbourhood'];\r\n $this->neighbourhood = null; // $this->neighbourhood is ignored\r\n \r\n if (empty($this->region)) {\r\n $this->region = $woe['region']; \r\n }\r\n \r\n /**\r\n * Shit's a little bit broken, it's ok\r\n */\r\n \r\n if (empty($this->region) || empty($this->country)) {\r\n $woe = PlaceUtility::LatLonWoELookup($this->lat, $this->lon, true); // force lookup, ignore any cached data\r\n $woe = PlaceUtility::formatWoE($woe);\r\n \r\n $this->region = $woe['region_code'];\r\n $this->country = $woe['country_code'];\r\n }\r\n \r\n if (empty($this->region)) {\r\n $this->region = strtoupper($woe['region_name']); \r\n }\r\n \r\n #printArray($this->region);die;\r\n \r\n return;\r\n \r\n /*\r\n \r\n // Fetch geodata and populate the vars\r\n //$url = \"http://maps.google.com/maps/geo?q=\".$this->lat.\",\".$this->lon.\"&output=json&sensor=false\";\r\n $url = \"http://maps.googleapis.com/maps/api/geocode/json?latlng=\" . $this->lat . \",\" . $this->lon . \"&sensor=false\";\r\n $ch = curl_init();\r\n \r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n \r\n $data = curl_exec($ch);\r\n $jsondata = json_decode($data, true); \r\n curl_close($ch);\r\n \r\n if (isset($jsondata['results'][0]['address_components'])) {\r\n $row = $jsondata['results'][0]['address_components']; \r\n }\r\n \r\n if (isset($jsondata['Placemark']) && $area = $jsondata['Placemark'][0]['AddressDetails']['Country']) {\r\n $this->country = $area['CountryNameCode']; \r\n $this->region = isset($area['AdministrativeArea']['AdministrativeAreaName']) ? $area['AdministrativeArea']['AdministrativeAreaName'] : NULL; \r\n $this->locality = isset($area['AdministrativeArea']['Locality']['LocalityName']) ? $area['AdministrativeArea']['Locality']['LocalityName'] : NULL; \r\n $this->neighbourhood = isset($area['CountryNameCode']['someotherarea']) ? $area['CountryNameCode']['someotherarea'] : NULL; \r\n } elseif (isset($row)) {\r\n // Loop through the results and try to populate the object\r\n foreach ($row as $area) {\r\n if ($area['types'][0] == \"country\") {\r\n $this->country = $area['short_name']; \r\n }\r\n \r\n if ($area['types'][0] == \"administrative_area_level_2\") {\r\n $this->region = $area['long_name']; \r\n }\r\n \r\n if ($area['types'][0] == \"administrative_area_level_3\") {\r\n $this->neighbourhood = $area['long_name']; \r\n }\r\n \r\n if ($area['types'][0] == \"locality\") {\r\n $this->locality = $area['long_name']; \r\n }\r\n }\r\n }\r\n \r\n if (empty($this->country) || empty($this->region) || empty($this->locality)) {\r\n // Google doesn't give data in a consistent bloody format - go here instead\r\n $url = sprintf(\"http://www.geoplugin.net/extras/location.gp?lat=%s&long=%s&format=php\", $this->lat, $this->lon);\r\n $ch = curl_init();\r\n \r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n \r\n $geodata = curl_exec($ch);\r\n $geodata = unserialize($geodata); \r\n curl_close($ch);\r\n \r\n $this->country = $geodata['geoplugin_countryCode']; \r\n $this->region = $geodata['geoplugin_region']; \r\n $this->locality = $geodata['geoplugin_place']; \r\n $this->neighbourhood = NULL;\r\n }\r\n \r\n return;\r\n */\r\n \r\n }",
"function rec_regenerate_coordinates() {\n\n\tif( ! isset( $_GET['coord_debug'] ) ) {\n\t\treturn;\n\t}\n\n\t$posts = new WP_Query(\n\t\tarray(\n\t\t\t'post_type'\t\t=>\tepl_get_core_post_types(),\n\t\t\t'post_status'\t=>\t'any',\n\t\t\t'posts_per_page' =>\t-1,\n\t\t\t'meta_query'\t=>\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'key'\t\t=>\t'property_address_coordinates',\n\t\t\t\t\t'value'\t\t=>\tarray(\n\t\t\t\t\t\t'',\n\t\t\t\t\t\t','\n\t\t\t\t\t),\n\t\t\t\t\t'compare'\t=>\t'IN'\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t);\n\twhile( $posts->have_posts() ) {\n\t\t$posts->the_post();\n\t\t$coord = get_property_meta( 'property_address_coordinates' );\n\t\t\n\t\t$query_address = epl_property_get_the_full_address();\n\t\t$query_address = trim( $query_address );\n\n\t\tif( $query_address != ',' ) {\n\t\n\t\t\t$googleapiurl = \"https://maps.google.com/maps/api/geocode/json?address=$query_address&sensor=false\";\n\t if( epl_get_option('epl_google_api_key') != '' ) {\n\t $googleapiurl = $googleapiurl.'&key='.epl_get_option('epl_google_api_key');\n\t }\n\n\t $geo_response = wp_remote_get( $googleapiurl );\n\t $geocode = $geo_response['body'];\n\t $output = json_decode($geocode);\n\t /** if address is validated & google returned response **/\n\t if( !empty($output->results) && $output->status == 'OK' ) {\n\n\t $lat = $output->results[0]->geometry->location->lat;\n\t $long = $output->results[0]->geometry->location->lng;\n\t $coord = $lat.','.$long;\n\n\t update_post_meta( get_the_ID(), 'property_address_coordinates', $coord);\n\t update_post_meta( get_the_ID(), 'property_address_display', 'yes');\n\t }\n }\n\t}\n}",
"function custom_geocode_update_callback($uid, $nid, $lat, $lon) {\n module_load_include('inc', 'custom', 'custom');\n return custom_geocode_update($uid, $nid, $lat, $lon);\n}",
"function getNodeCoordinates() {\n if(empty($this->pool)) {\n $this->loadDefaultPool();\n }\n\n if(empty($this->count)) {\n $this->loadModel();\n }\n $db = & JFactory::getDBO();\n $query = \"SELECT geo_loc FROM #pool_stats WHERE count = \".$this->count.\" and \".\n \"geo_loc != \\\"0.0000, 0.0000\\\" and geo_loc != \\\"\\\" and geo_loc != \\\",\\\"\";\n $query = str_replace(\"#pool\", $this->pool->pool, $query);\n $db->setQuery($query);\n return $db->loadResultArray();\n }",
"public function update_geo_nursery($id, $data)\n {\n if(!empty($data))\n {\n $sql = \"UPDATE nursery SET lon = {$data['lon']}, lat = {$data['lat']} WHERE nursery_id = {$id}\";\n $this->db->query($sql);\n }\n }",
"private function updateGeoplace() {\r\n \r\n $id = PlaceUtility::findGeoPlaceID($this->lat, $this->lon); \r\n \r\n if ($id != $this->geoplace_id) {\r\n $data = [ \"geoplace\" => $id ];\r\n $where = [ \"id = ?\" => $this->id ];\r\n \r\n $this->db->update(\"location\", $data, $where); \r\n $this->Memcached->delete($this->mckey); \r\n }\r\n \r\n return;\r\n \r\n }",
"private function getCoordinates()\n\t{\n\t\t// Check if we are overriding the default client's IP \n\t\t$ipSetting = \"\";\n\t\tif($this->ip != null) {\n\t\t\t$ipSetting = \"&IpAddress=\" . $this->ip;\n\t\t}\n\t\telse {\n\t\t\t$ipSetting = \"&IpAddress=\" . $_SERVER[\"REMOTE_ADDR\"];\n\t\t}\t\t\n\t\t$url = self::geobytesUrl . $ipSetting;\n\t\t$result = $this->getUrl($url);\n\t\t$arr = json_decode($result, true);\n\t\tif($arr[\"geobytes\"][\"latitude\"] == null || $arr[\"geobytes\"][\"longitude\"] == null) {\n\t\t\t$latitude = 0;\n\t\t\t$longitude = 0;\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$latitude = $arr[\"geobytes\"][\"latitude\"];\n\t\t\t$longitude = $arr[\"geobytes\"][\"longitude\"];\n\t\t}\n\t\treturn array(\"latitude\"=>$latitude, \"longitude\"=>$longitude);\n\t}",
"public function setLatLon()\n\t{\n\t\t$query = 'listZipCodeList='.$this->zipcode;\n\t\t\n\t\t$url = $this->baseURL.'?'.$query;\n\t\t\n\t\t$xml = self::retrieveXML($url);\n\t\t\n\t\t$points = preg_split('[,]', $xml->latLonList);\n\t\t\t\t\t\n\t\t$this->lat = $points[0];\n\t\t$this->lon = $points[1];\t\t\n\t}",
"private function getCoordinates() {\n if (\n array_key_exists('point', $this->rawData) &&\n $this->rawData['point'] != '' &&\n $this->rawData['point'] != 'POINT(0 0)'\n ) {\n $this->point = \\geoPHP::load($this->rawData['point'],'wkt');\n }\n }",
"function civicrm_api3_job_Geodataupdate($params) {\n geodaten_update();\n}",
"function testLatLong() \n {\n $arr = $this->get('v1/nodes', ['region' => 'Puerto Rico', 'latitude' => 18.2341200, 'longitude' => -66.0485000])->seeJson([\n 'ip' => '127.0.0.1'\n ]);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for updateNetworkFirmwareUpgrades Update firmware upgrade information for a network. | public function testUpdateNetworkFirmwareUpgrades()
{
} | [
"public function testCreateNetworkFirmwareUpgradesRollback()\n {\n }",
"function upgrade_network() {}",
"protected function getNetworkFirmwareUpgradesRequest($network_id)\n {\n // verify the required parameter 'network_id' is set\n if ($network_id === null || (is_array($network_id) && count($network_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network_id when calling getNetworkFirmwareUpgrades'\n );\n }\n\n $resourcePath = '/networks/{networkId}/firmwareUpgrades';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($network_id !== null) {\n $resourcePath = str_replace(\n '{' . 'networkId' . '}',\n ObjectSerializer::toPathValue($network_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-Cisco-Meraki-API-Key');\n if ($apiKey !== null) {\n $headers['X-Cisco-Meraki-API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testUpdateNetworkSwitchMtu()\n {\n }",
"public function testUpdateNetworkSwitchSettings()\n {\n }",
"public function testUpdateNetworkSwitchStp()\n {\n }",
"public function testUpdateNetworkSmDevicesFields()\n {\n }",
"public function testUpdateNetworkSnmp()\n {\n }",
"public function testUpdateNetworkNetflow()\n {\n }",
"public function setfirmwareAction() {\n\n Zend_Controller_Front::getInstance()->setParam('noViewRenderer', true);\n $this->getResponse()->setHeader('Content-Type', 'application/json');\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n $newFirmware = intval($request->getParam('firmware', null));\n $printerId = $request->getParam('printerId', null); \n\n $printer = Yourdelivery_Model_Printer_Abstract::factory($printerId);\n $actualFirmware = intval($printer->getFirmware());\n \n if ($newFirmware < $actualFirmware) {\n echo json_encode(array(\n 'error' => 1,\n 'message' => sprintf(__b('Die Update Version ist kleiner als die aktuelle Version bei dem Printer %s'), $printerId)\n )); \n }\n else if ($newFirmware == $actualFirmware) {\n echo json_encode(array(\n 'error' => 1,\n 'message' => sprintf(__b('Die Update Version ist die gleiche wie die aktuelle Version bei dem Printer %s'), $printerId)\n )); \n }\n else if ($newFirmware > $actualFirmware+50) {\n echo json_encode(array(\n 'error' => 1,\n 'message' => sprintf(__b('Die Update Version ist zu groß bei dem Printer %s'), $printerId)\n )); \n }\n else {\n $printer->setUpgrade($newFirmware); \n $printer->save();\n echo json_encode(array(\n 'success' => 1,\n 'message' => sprintf(__b('Die Update Version wurde gesetzt für den Printer %s'), $printerId)\n )); \n }\n\n }\n }",
"public function testUpdateNetworkAppliancePort()\n {\n }",
"function upgrade_all(){\n $upgrade = new moduleinstaller();\n //$upgrade->upgradeAll();\n $modules = $upgrade->getModules();\n\n foreach($modules as $val){\n // testing if this is working\n $options = array ('module' => $val['module_name']);\n $upgrade = new moduleinstaller($options);\n $upgrade->upgrade();\n\n //update_ini_file($options);\n common::echoMessage($upgrade->confirm);\n }\n}",
"public function testUpdateNetworkWirelessBluetoothSettings()\n {\n }",
"public function update_network(){\n\t\t\t\n\t\t\t$network_updated = [];\n\t\t\t\n\t\t\t//These two options are set in the options table. \n\t\t\t$role_changes = get_option( 'nn_role_changes' );\n\t\t\t$network_role_changes = get_option( 'nn_network_role_changes' );\n\t\t\t\n\t\t\t//Assess what role change is being performed to know what network change need be accessed. \n\t\t\tforeach( $role_change as $change ){\n\t\t\t\t\n\t\t\t\tlist( $old_role, $new_role, $network_role_change ) = $change;\n\t\t\t\tif( strpos( $old_role, $this->old_role ) == 0 && strpos( $new_role, $this->role ) == 0 )\n\t\t\t\t\t$change_id = $network_role_change;\n\t\t\t}\n\t\t\t\n\t\t\tif( isset( $change_id ) ){\n\t\t\t\t\n\t\t\t\tforeach( $network_role_changes[ $change_id ] as $site_change ){\n\t\t\t\t\t\n\t\t\t\t\t//$site_change = array( 0(site_id) , '(role)', 0(priority) );\n\t\t\t\t\t$network_updated[ $site_change[0] ] = update_network_role( $site_change );\n\t\t\t\t\t//returns the updated role for the site ID. \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}",
"public function testUpdateNetworkCameraWirelessProfile()\n {\n }",
"public function testUpdateNetworkApplianceVpnBgp()\n {\n }",
"public function updateNetworkFirmwareUpgradesAsyncWithHttpInfo($network_id, $update_network_firmware_upgrades = null)\n {\n $returnType = 'object';\n $request = $this->updateNetworkFirmwareUpgradesRequest($network_id, $update_network_firmware_upgrades);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }",
"public function updateNetworkFirmwareUpgradesAsync($network_id, $update_network_firmware_upgrades = null)\n {\n return $this->updateNetworkFirmwareUpgradesAsyncWithHttpInfo($network_id, $update_network_firmware_upgrades)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"function upgrade_module($zone, $module)\n{\n $rows = $GLOBALS['SITE_DB']->query_select('modules', array('*'), array('module_the_name' => $module), '', 1);\n if (!array_key_exists(0, $rows)) {\n return (-2); // Not installed, so can't upgrade\n }\n\n $upgrade_from = $rows[0]['module_version'];\n $upgrade_from_hack = $rows[0]['module_hack_version'];\n\n $module_path = get_file_base() . '/' . _get_module_path($zone, $module);\n\n $functions = extract_module_functions($module_path, array('info', 'install'), array($upgrade_from, $upgrade_from_hack));\n if ((is_null($functions[1])) && (strpos($module_path, '/modules_custom/') !== false)) {\n $functions = extract_module_functions($module_path, array('info', 'install'), array($upgrade_from, $upgrade_from_hack));\n }\n if (is_null($functions[0])) {\n $info = array();\n $info['author'] = 'Chris Graham';\n $info['organisation'] = 'ocProducts';\n $info['hacked_by'] = null;\n $info['hack_version'] = null;\n $info['version'] = 2;\n $info['locked'] = true;\n } else {\n $info = is_array($functions[0]) ? call_user_func_array($functions[0][0], $functions[0][1]) : eval($functions[0]);\n }\n\n $ret = 0;\n if ((!is_null($functions[1])) && (!empty($info['update_require_upgrade']))) {\n if ((($upgrade_from < $info['version']) && (!empty($info['update_require_upgrade'])))\n || (($upgrade_from_hack < $info['hack_version']) && (!empty($info['hack_require_upgrade'])))\n ) {\n require_code('database_action');\n require_code('config2');\n require_code('files2');\n\n if (is_array($functions[1])) {\n call_user_func_array($functions[1][0], $functions[1][1]);\n } else {\n eval($functions[1]);\n }\n $ret = 1;\n }\n }\n if (is_null($info['hacked_by'])) {\n $info['installed_hacked_by'] = '';\n }\n $GLOBALS['SITE_DB']->query_update('modules', array('module_version' => $info['version'], 'module_hack_version' => $info['hack_version'], 'module_hacked_by' => is_null($info['hacked_by']) ? '' : $info['hacked_by']), array('module_the_name' => $module), '', 1);\n persistent_cache_delete('MODULES');\n\n return $ret;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up the setting for aggregated multidimensional values. When a multidimensional setting gets aggregated, all of its preview and update calls get combined into one call, greatly improving performance. | protected function aggregate_multidimensional() {
$id_base = $this->id_data['base'];
if ( ! isset( self::$aggregated_multidimensionals[ $this->type ] ) ) {
self::$aggregated_multidimensionals[ $this->type ] = array();
}
if ( ! isset( self::$aggregated_multidimensionals[ $this->type ][ $id_base ] ) ) {
self::$aggregated_multidimensionals[ $this->type ][ $id_base ] = array(
'previewed_instances' => array(), // Calling preview() will add the $setting to the array.
'preview_applied_instances' => array(), // Flags for which settings have had their values applied.
'root_value' => $this->get_root_value( array() ), // Root value for initial state, manipulated by preview and update calls.
);
}
if ( ! empty( $this->id_data['keys'] ) ) {
// Note the preview-applied flag is cleared at priority 9 to ensure it is cleared before a deferred-preview runs.
add_action( "customize_post_value_set_{$this->id}", array( $this, '_clear_aggregated_multidimensional_preview_applied_flag' ), 9 );
$this->is_multidimensional_aggregated = true;
}
} | [
"public static function reset_aggregated_multidimensionals() {}",
"static public function reset_aggregated_multidimensionals() {\n\t\tself::$aggregated_multidimensionals = array();\n\t}",
"private function set_data() {\r\n $params = array();\r\n $coefs = array();\r\n foreach ($this->groups as $group) {\r\n foreach ($group['items'] as $item => $type) {\r\n if ($type) {\r\n $params[] = $item;\r\n } else {\r\n $coefs[] = $item;\r\n }\r\n }\r\n }\r\n $this->coefs = $coefs;\r\n $this->params = $params;\r\n }",
"protected function buildDimensionValues() {\n\t\t$dimensionValues = array();\n\t\tforeach ($this->dimensions as $dimension) {\n\t\t\t/** @var NodeDimension $dimension */\n\t\t\t$dimensionValues[$dimension->getName()][] = $dimension->getValue();\n\t\t}\n\t\t$this->dimensionsHash = Utility::sortDimensionValueArrayAndReturnDimensionsHash($dimensionValues);\n\t\t$this->dimensionValues = $dimensionValues;\n\t}",
"public function set(){\n\t\t\t//Get incoming data\t\t\n\t\t\t$data = $this->data;\n\t\t\t\n\t\t\t//what action are we taking?\n\t\t\t$action = $this->action;\n\t\t\t\n\t\t\t//What data set are we taking action on. \n\t\t\t$action_set = $action. '_set';\n\t\t\t\n\t\t\t//load keys from that data set. \n\t\t\t$keys = $this->$action_set;\n\t\t\t//dump( __LINE__, __METHOD__, $data ); \n\t\t\t\n\t\t\t//Now we start to build. \n\t\t\tforeach( $keys as $key ){\n\t\t\t\tif( !empty( $data[ $key ] ) ){\n\t\t\t\t\t$this->data_set[ $key ] = $data[ $key ];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( !empty( $data[ 'data' ] ) && is_array( $data[ 'data' ] ) ){\n\t\t\t\t\t//looking deeper into the source arrays for data that matches the requesting field.\n\t\t\n\t\t\t\t\t//first check if field is available in top level of nested array. \n\t\t\t\t\tif( !empty( $data[ 'data' ][ $key ] ) ){\n\t\t\t\t\t\t$this->data_set[ $key ] = $data[ 'data' ][ $key ];\n\t\t\t\t\t\tcontinue;\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//else look deeper by referencing the first word of the key to find it's associated array. \n\t\t\t\t\t$pos = strpos( $key, '_' );\n\t\t\t\t\t$sub_arr = substr( $key, 0, $pos );\n\t\t\t\t\t\n\t\t\t\t\tif( !isset( $data[ 'data' ][ $sub_arr ] ) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t \n\t\t\t\t\tif( is_array( $data[ 'data' ][ $sub_arr ] ) ){\n\t\t\t\t\t\t$sub_key = substr( $key, $pos + 1 );\t\t\t\t\t\n\t\t\t\t\t\t$this->data_set[ $key ] = $data[ 'data' ][ $sub_arr ][ $sub_key ] ?? '';\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t/* if( strcmp( $key, 'src_data' ) === 0 ){\n\t\t\t\t\t$this->data_set[ 'src_data' ] = $data;\n\t\t\t\t\tcontinue;\n\t\t\t\t} */\n\t\t\t\t\n\t\t\t\t$this->data_set[ $key ] = '';\n\t\t\t}\t\n\t\t\t\n\t\t\t\n\t\t\t//The final data set is specific to the initiating action being performed \n\t\t\t//$this->data_set = $this->$action();\n\t\t\t\n\t\t\treturn true;\n\t\t}",
"function addCubeSet(&$themeConfig, &$dimensions, $barDim, &$barBranch = null, $stackDim=false, $sideDim=false) {\n if(!$barBranch){ //this is a initial call (i.e. not a recursive call)\n $barBranch = $dimensions[$barDim][\"hierarchy\"];\n }\n $barRootCode = false;\n if(count($barBranch)==1){\n //we have a total code (root or local)...\n foreach($barBranch as $barRootCode=>$subBranch){\n\n }\n $barBranch = $subBranch; //go up the hierarchy one level\n }\n if(count($barBranch)>1){\n //have cubeSet: add it!\n\n //add dimDefs\n\n $barDimKey = $themeConfig[\"tKey\"] . \":\" . $barDim . ($barRootCode?\">\".$barRootCode:\"\");\n //$cubeSetKey = $barDimKey . ($stackDim?\",\".$stackDim:\"\") . ($sideDim?\",\".$sideDim:\"\");\n //$cubedBy = \"by \".$dimensions[$barDim][\"name\"].($stackDim?\" by \".$dimensions[$stackDim][\"name\"]:\"\").($sideDim?\" by \".$dimensions[$sideDim][\"name\"]:\"\");\n //preprint($barDim);\n //preprint($dimensions[$barDim]);\n\n $cubedBy = \"by \". $dimensions[$barDim][\"name\"].($stackDim?($sideDim?\", \":\" and \").$dimensions[$stackDim][\"name\"]:\"\").($sideDim?\" and \".$dimensions[$sideDim][\"name\"]:\"\");\n\n //build cube code lists\n $bar_codes = [];\n foreach($barBranch as $key=>$val) {\n $bar_codes[] = is_integer($key)?$val:$key;\n if(!is_integer($key) && count($val)>1){\n //RECURSE for each sub-branch!!\n $subBranch = [$key => $val];\n addCubeSet($themeConfig, $dimensions, $barDim, $subBranch, $stackDim, $sideDim);\n }\n }\n $stack_codes = [];\n if($stackDim){ //stack must be a hierarchy (local or root) and must be passed as a assoc. branch\n $stackL1 = $dimensions[$stackDim][\"hierarchy\"][$dimensions[$stackDim][\"rootCode\"]];\n //foreach($stack_branch as $stack_local_root=>$stack_leaves);\n foreach($stackL1 as $key=>$val) $stack_codes[] = is_integer($key)?$val:$key;\n }\n $side_codes = [];\n if($sideDim){\n $sideL1 = $dimensions[$sideDim][\"hierarchy\"][$dimensions[$sideDim][\"rootCode\"]];\n //foreach($stack_branch as $stack_local_root=>$stack_leaves);\n foreach($sideL1 as $key=>$val) $side_codes[] = is_integer($key)?$val:$key;\n }\n\n //determine the left out dims and the set dims that determine a set key. (note: set dims = tsv dim - geo and time dims)\n $left_out_dims = [];\n foreach($themeConfig[\"tsvDims\"] as $dimIndex=>$tsvdim){\n if($dimIndex!==$themeConfig[\"geoIndex\"] && $dimIndex!==$themeConfig[\"timeIndex\"]){\n //unitsIndex will be in there, but gets special treatment // && $dimIndex!==$themeConfig[\"unitIndex\"]){\n if($tsvdim!==$barDim && $tsvdim!==$stackDim && $tsvdim!==$sideDim){\n $left_out_dims[$tsvdim] = null;\n }\n }\n }\n\n $qualifiers = [];\n //bar qualifier if not dim root (note: stack and side are only root/ground level and are never up the tree)\n if($barRootCode && $barRootCode!=$dimensions[$barDim][\"rootCode\"]) $qualifiers[] = $dimensions[$barDim][\"allCodes\"][$barRootCode];\n\n //add dimDefs\n $barDimKey = $barDim . ($barRootCode?\">\".$barRootCode:\"\");\n if(!isset($themeConfig[\"dimDefs\"][$barDimKey])) {\n $themeConfig[\"dimDefs\"][$barDimKey] = makeDimDef($dimensions, $barDim, $bar_codes);\n }\n if($stackDim){\n $stackDimKey = $stackDim . \">\" . $dimensions[$stackDim][\"rootCode\"];\n if(!isset($themeConfig[\"dimDefs\"][$stackDimKey])){\n $themeConfig[\"dimDefs\"][$stackDimKey] = makeDimDef($dimensions, $stackDim, $stack_codes);\n }\n } else $stackDimKey = \"\";\n if($sideDim){\n $sideDimKey = $sideDim . \">\" . $dimensions[$sideDim][\"rootCode\"];\n if(!isset($themeConfig[\"dimDefs\"][$sideDimKey])){\n $themeConfig[\"dimDefs\"][$sideDimKey] = makeDimDef($dimensions, $sideDim, $side_codes);\n }\n } else $sideDimKey = \"\";\n\n addCubesOverLeftOuts($themeConfig, $dimensions, $qualifiers, $cubedBy,\n $barDim, $barDimKey, $bar_codes, $barRootCode,\n $stackDim, $stackDimKey, $stack_codes,\n $sideDim, $sideDimKey, $side_codes, $left_out_dims);\n\n } else { printNow(\"unitary barbranch\"); }\n}",
"function setup()\n\t{\n\t\t$propgroupdata = array();\n\t\tforeach($this->glu->ent_prop_3dhash as $prop_id => $ron) {\n\t\t\t//skip if not in filter properties set or if filter set is empty\n\t\t\tif (!empty($this->filter_properties) && !in_array($prop_id, $this->filter_properties))\n\t\t\t{ \n\t\t\t\tcontinue; \n\t\t\t\t\n\t\t\t}\n\t\t\tif (!empty($this->exclude_properties) && in_array($prop_id, $this->exclude_properties))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$thepropname = $this->glu->prop_id_prop_obj_hash[$prop_id]->get_property_name();\n\t\t\t$thepropgroupid = $this->glu->prop_id_prop_obj_hash[$prop_id]->prop_group_id;\n\t\t\t// add node for each row\n\t\t\tforeach ($ron as $theron => $theprop )\n\t\t\t{\n\t\t\t\t//echo microtime().\" ----Record: create_xml_rec; \".'starting loop for $ron: '.\"$theron, prop_id: $prop_id<br>\";\n\t\t\t\t // $roni = 0; //ron index\n\t\t\t\t // $theprop = $ron[$roni];\n\t\t\t\tif (method_exists($theprop,\"get_value_with_referenced\"))\n\t\t\t\t{\n\t\t\t\t\t$fieldvalue = $theprop->get_value_with_referenced(); //set lookuptable values\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$fieldvalue = $theprop->get_val();\n\t\t\t\t}\n\t\t\t\tif (empty($thepropgroupid))\n\t\t\t\t{\n\t\t\t\t\t$this->prop_id_value_hash[$prop_id] = $fieldvalue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!isset($propgroupdata[$thepropgroupid]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$propgroupdata[$thepropgroupid] = array();\n\t\t\t\t\t}\t\n\t\t\t\t\tif (!isset($propgroupdata[$thepropgroupid][$theron]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$propgroupdata[$thepropgroupid][$theron] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$propgroupdata[$thepropgroupid][$theron][$prop_id] = $fieldvalue;\n\t\t\t\t}\n\t\t\t}\n\t\t} // foreach\n\t\tforeach ($propgroupdata as $propgroupid => $propgroupdatum)\n\t\t{\n\t\t\t$first_row_of_prop_group = array_shift($propgroupdatum);\n\t\t\tforeach ($first_row_of_prop_group as $fr_prop_id => $fr_prop_val)\n\t\t\t{\n\t\t\t\t$this->prop_id_value_hash[$fr_prop_id] = $fr_prop_val;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// get completed xml document\n\t\t//echo microtime().\" --Record: create_xml_rec; \".'ended foreach($this->glu->ent_prop_3dhash as $prop_id => $ron)'.\"<br>\";\n\t//\t$xml_string = $doc->saveXML();\n\t\t//echo microtime().\" --Record: create_xml_rec; \".'returning'.\"<br>\";\n\t//\treturn $xml_string;\n\t\t\n\t}",
"public function PopulateCustom(){\t\n\t\t$this->custom = array();\n\t\t$this->custom['_settings'] = Page::getCustomSettings();\n\t\t$values = $GLOBALS['db']->selectindex(\"select * from pagevalues where pageid = {$this->id}\",'settingid');\n\t\tforeach($this->custom['_settings'] as $setting){\n\t\t\tif($setting['type']=='array'){\n\t\t\t\t$val = isset($values[$setting['id']])?$values[$setting['id']]['value']:$setting['default'];\n\t\t\t\t$val = json_decode($val);\n\t\t\t\t$this->custom[$setting['name']] = $val;\n\t\t\t}else{\n\t\t\t\t$this->custom[$setting['name']] = isset($values[$setting['id']])?$values[$setting['id']]['value']:$setting['default'];\n\t\t\t}\n\t\t}\n\t}",
"function applyDimensions() {\n\t\t\n\t\tforeach ($this->dimensions as $dimension_name) {\n\t\t\t$dim = $this->lookupDimension($dimension_name, $this->baseEntity);\n\t\t\t// add column name to select statement\n\t\t\t$this->db->selectColumn($dim['column'], $dim['name']);\n\t\t\t// add groupby\n\t\t\t$this->db->groupBy($dim['column']);\n\t\t\t$this->addLabel($dim['name'], $dim['label']);\n\t\t}\n\t}",
"protected function setPivotValues()\n {\n if (null !== $pivot = $this->parsePivot($this->parent)) {\n $pivot = $pivot->toArray();\n unset($pivot[$this->pivotKey], $pivot['_' . $this->pivotKey]);\n foreach ($pivot as $column => $value) {\n $this->pivotValues[] = compact('column', 'value');\n }\n }\n }",
"static function view_type_settings_grid() {\n\n\t\t\t$prefix = 'grid-';\n\n\t\t\t$result = array(\n\t\t\t\t// Number of columns\n\t\t\t\tarray(\n\t\t\t\t\t'label'\t\t => array(\n\t\t\t\t\t\t'text' => __( 'Items per row', 'content-views-query-and-display-post-page' ),\n\t\t\t\t\t),\n\t\t\t\t\t'params'\t => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'type'\t\t\t => 'number',\n\t\t\t\t\t\t\t'name'\t\t\t => $prefix . 'number-columns',\n\t\t\t\t\t\t\t'std'\t\t\t => '2',\n\t\t\t\t\t\t\t'append_text'\t => '1 → 12',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'dependence' => array( 'view-type', 'grid' ),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$result = apply_filters( PT_CV_PREFIX_ . 'view_type_settings_grid', $result );\n\n\t\t\treturn $result;\n\t\t}",
"private function adjustmentsGrid() {\n\t\t\n\t\t$adjustmentsGridDataBinding = array();\n\n\t\t$this->settingVars->tableUsedForQuery = $this->measureFields = array();\n $this->measureFields[] = $this->skuID;\n $this->measureFields[] = $this->storeID;\n\t\t\n $this->settingVars->useRequiredTablesOnly = true;\n if (is_array($this->measureFields) && !empty($this->measureFields)) {\n $this->prepareTablesUsedForQuery($this->measureFields);\n }\n $this->queryPart = $this->getAll();\n\n //$lastSalesDays = datahelper\\Common_Data_Fetching_Functions::findLastSalesDays($this->settingVars);\n $lastSalesDays \t\t= datahelper\\Common_Data_Fetching_Functions::getLastSalesDays( $this->skuID, $this->storeID, $this->settingVars, $this->queryPart);\n\n\t\t// get VSI according to all mydate\n $query = \"SELECT distinct skuID AS TPNB\" .\n \",SNO \" .\n \",VSI \" .\n \",TSI \" .\n \"FROM \" . $this->settingVars->ranged_items .\n \" WHERE clientID='\" . $this->settingVars->clientID . \"' AND GID = \".$this->settingVars->GID;\n\n $redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\n if ($redisOutput === false) {\n $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n $this->redisCache->setDataForHash($result);\n } else {\n $result = $redisOutput;\n }\n\n $tsiStatusData = array();\n $vsiStatusData = array();\n\n $this->settingVars->tableUsedForQuery = $this->measureFields = array();\n\t\t\n\t\tif (is_array($result) && !empty($result)) {\n\t\t\tforeach ($result as $key => $row) {\n\t\t\t\t$vsiStatusData[$row['TPNB'] . '_' . $row['SNO']] = $row['VSI'];\n\t\t\t\t$tsiStatusData[$row['TPNB'] . '_' . $row['SNO']] = $row['TSI'];\n\t\t\t}\n\t\t\t\n\t\t\t// For Territory\n\t\t\tif (isset($_REQUEST[\"territoryLevel\"]) && $_REQUEST[\"territoryLevel\"] != \"\") {\n\t\t\t\t$addTerritoryColumn = \",\".$this->settingVars->territoryTable . \".Level\".$_REQUEST[\"territoryLevel\"].\" AS TERRITORY\";\n\t\t\t\t$addTerritoryGroup = \",TERRITORY\";\n\t\t\t\t$this->measureFields[] = $this->settingVars->territoryTable . \".Level\".$_REQUEST[\"territoryLevel\"];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$addTerritoryColumn = '';\n\t\t\t\t$addTerritoryGroup = '';\n\t\t\t}\n\n\t\t\t$this->measureFields[] = $this->skuID;\n\t\t\t$this->measureFields[] = $this->skuName;\n\t $this->measureFields[] = $this->storeID;\n\t $this->measureFields[] = $this->storeName;\n\t $this->measureFields[] = $this->bannerName;\n\t $this->measureFields[] = $this->ohaq;\n\t $this->measureFields[] = $this->baq;\n\t $this->measureFields[] = $this->msq;\n\t $this->measureFields[] = $this->ohq;\n\t $this->measureFields[] = $this->settingVars->clusterID;\n\t\t\t\n\t $this->settingVars->useRequiredTablesOnly = true;\n\t if (is_array($this->measureFields) && !empty($this->measureFields)) {\n\t $this->prepareTablesUsedForQuery($this->measureFields);\n\t }\n\n\t // [STATIC FIX TO BYPASS THE TERRITORY LEVEL FROM THE QUERY WHERE PART ]\n\t\t\tif (isset($_REQUEST[\"Level\"]) && $_REQUEST[\"Level\"] != \"\" && isset($_REQUEST[\"territoryLevel\"]) && $_REQUEST[\"territoryLevel\"] != \"\") {\n\t\t\t\t$reqLevel = $_REQUEST[\"Level\"]; $_REQUEST[\"Level\"] = '';\n\t\t\t\t\t$this->queryPart = $this->getAll();\n\t\t\t\t$_REQUEST[\"Level\"] = $reqLevel;\n\t\t\t}else{\n\t\t\t\t$this->queryPart = $this->getAll();\n\t\t\t}\n\n\t\t\t$query = \"SELECT \"\n\t\t\t\t\t. $this->skuID . \" AS TPNB \" .\n\t\t\t\t\t\",TRIM(MAX(\" . $this->skuName . \")) AS SKU\" .\n\t\t\t\t\t\",\" . $this->storeID . \" AS SNO \" .\n\t\t\t\t\t\",TRIM(MAX(\" . $this->storeName . \")) AS STORE \" .\n\t\t\t\t\t$addTerritoryColumn.\n\t\t\t\t\t\",TRIM(MAX(\" . $this->settingVars->clusterID . \")) AS CLUSTER \" . \n\t\t\t\t\t\",SUM((CASE WHEN \" . $this->settingVars->ProjectVolume . \">0 THEN 1 ELSE 0 END)*\" . $this->settingVars->ProjectVolume . \") AS SALES \" .\n\t\t\t\t\t\",TRIM(MAX(\" . $this->bannerName . \")) AS BANNER \" .\n\t\t\t\t\t\",\" . $this->settingVars->DatePeriod . \" AS MYDATE \" .\n\t\t\t\t\t\",SUM((CASE WHEN \" . $this->settingVars->DatePeriod . \"= '\" . filters\\timeFilter::$tyDaysRange[0] . \"' THEN 1 ELSE 0 END)*\" . $this->ohq . \") AS STOCK \" .\n\t\t\t\t\t\",SUM(\" . $this->ohaq . \") AS OHQ \" .\n\t\t\t\t\t\",SUM(\" . $this->baq . \") AS BAQ \" .\n\t\t\t\t\t\",SUM((CASE WHEN \" . $this->settingVars->DatePeriod . \"= '\" . filters\\timeFilter::$tyDaysRange[0] . \"' THEN 1 ELSE 0 END)*\" . $this->msq . \") AS SHELF \" .\n\t\t\t\t\t\"FROM \" . $this->settingVars->tablename . \" \" . $this->queryPart .\n\t\t\t\t\t\"AND \" . filters\\timeFilter::$tyWeekRange .\n\t\t\t\t\t\"AND ($this->ohaq<>0 OR $this->baq<>0) \".\n\t\t\t\t\t\"GROUP BY TPNB,SNO,MYDATE \".$addTerritoryGroup.\" ORDER BY MYDATE DESC\";\n\t\t\t\n\t\t\t$redisOutput = $this->redisCache->checkAndReadByQueryHashFromCache($query);\n\t if ($redisOutput === false) {\n\t $result = $this->queryVars->queryHandler->runQuery($query, $this->queryVars->linkid, db\\ResultTypes::$TYPE_OBJECT);\n\t $this->redisCache->setDataForHash($result);\n\t } else {\n\t $result = $redisOutput;\n\t }\n\n\t\t\tif (is_array($result) && !empty($result)) {\n\t\t\t\tforeach ($result as $value) {\n\t\t\t\t\t\n\t\t\t\t\t$index \t= $value['TPNB'] . '_' . $value['SNO'];\n\t\t\t\t\t$status = array_key_exists($index, $vsiStatusData) ? 1 : 0;\n\t\t\t\t\t\n\t\t\t\t\tif (($_REQUEST['VSI'] == 1 && $status == 1) || ($_REQUEST['VSI'] == 2 && $status == 0) || ($_REQUEST['VSI'] == 3)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (isset($_REQUEST[\"Level\"]) && $_REQUEST[\"Level\"] != \"\" && isset($_REQUEST[\"territoryLevel\"]) && $_REQUEST[\"territoryLevel\"] != \"\") {\n\t\t\t\t\t\t\t\tif($_REQUEST[\"Level\"] == '1' && $value['TERRITORY'] == 'NOT CALLED'){\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if($_REQUEST[\"Level\"] == '2' && $value['TERRITORY'] != 'NOT CALLED'){\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($tsiStatusData[$index] == 1 && $vsiStatusData[$index] == 1)\n\t\t\t\t\t\t\t\t$tsiVsi = \"Y/Y\";\n\t\t\t\t\t\t\telse if ($tsiStatusData[$index] == 1 && $vsiStatusData[$index] == 0)\n\t\t\t\t\t\t\t\t$tsiVsi = \"Y/N\";\n\t\t\t\t\t\t\telse if ($tsiStatusData[$index] == 0 && $vsiStatusData[$index] == 1)\n\t\t\t\t\t\t\t\t$tsiVsi = \"N/Y\";\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$tsiVsi = \"N/N\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$row \t\t\t\t= array();\n\t\t\t\t\t\t\t$row['SNO'] \t\t= $value['SNO'];\n\t\t\t\t\t\t\t$row['STORE'] \t\t= utf8_encode($value['STORE']);\t\t\t\t\n\t\t\t\t\t\t\t$row['CLUSTER'] \t= utf8_encode($value['CLUSTER']);\t\t\t\t\n\t\t\t\t\t\t\t$row['SKUID'] \t\t= $value['TPNB'];\n\t\t\t\t\t\t\t$row['SKU'] \t\t= utf8_encode($value['SKU']);\n\t\t\t\t\t\t\t$row['MYDATE'] \t\t= $value['MYDATE'];\n\t\t\t\t\t\t\t$row['OHQ'] \t\t= $value['OHQ'];\n\t\t\t\t\t\t\t$row['BAQ'] \t\t= $value['BAQ'];\n\t\t\t\t\t\t\t$row['STOCK'] \t\t= $value['STOCK'];\n\t\t\t\t\t\t\t$row['SHELF'] \t\t= $value['SHELF'];\n\t\t\t\t\t\t\t$row['LAST_SALE'] \t= $lastSalesDays[$value['TPNB'] . \"_\" . $value['SNO']];\n\t\t\t\t\t\t\t$row['TSIVSI'] \t\t= $tsiVsi;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($value['TERRITORY'])\n\t\t\t\t\t\t\t\t$row['TERRITORY'] \t= $value['TERRITORY'];\n\n\t\t\t\t\t\t\tarray_push($adjustmentsGridDataBinding, $row);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\n\t\t\t\tforeach ($adjustmentsGridDataBinding as $key => $value) {\n\t\t\t\t\t//still going to sort by firstname\n\t\t\t\t\t$emp[$key] = $value['AVE_DAILY_SALES'];\n\t\t\t\t}\n\n\t\t\t\tif (is_array($emp) && !empty($emp))\n array_multisort($emp, SORT_DESC, $adjustmentsGridDataBinding);\n\t\t\t\n\t\t\t} // end if\n\t\t} // end if\n $this->jsonOutput['adjustmentsGrid'] = $adjustmentsGridDataBinding;\n }",
"protected function setBatch()\n {\n $parameters = $this->runtime_data->resource->parameters;\n\n $this->plugin_data->grid_batch_categories = array();\n $this->plugin_data->grid_batch_tags = array();\n $this->plugin_data->grid_batch_groups = array();\n\n $options = array();\n $options['runtime_data'] = $this->runtime_data;\n $options['plugin_data'] = $this->plugin_data;\n\n if ((int)$parameters->grid_batch_categories === 1) {\n $this->plugin_data->grid_batch_categories = $this->getDatalist('Categories', $options);\n }\n if ((int)$parameters->grid_batch_tags === 1) {\n $this->plugin_data->grid_batch_tags = $this->getDatalist('Tags', $options);\n }\n if ((int)$parameters->grid_batch_permissions === 1) {\n $this->plugin_data->grid_batch_groups = $this->getDatalist('Groups', $options);\n }\n\n return $this;\n }",
"public function set_rendering_properties() {\n\t\t$this->custom_dimensions = $this->custom_dimensions();\n\t\t$this->active_custom_dimensions_types = $this->active_custom_dimensions_types();\n\t\t$this->custom_dimensions_usage = count( $this->active_enabled_custom_dimensions() );\n\t\t$this->custom_dimensions_limit = count( $this->enabled_custom_dimensions() );\n\t}",
"public function setFieldsetsAndFields() {\n\t\t$Dataset = new FormularFieldset(__('Your Dataset'));\n\t\t$Dataset->setHtmlCode($this->getCode());\n\t\t$Dataset->addInfo( __('You can specify which values show up in the overview of your activities.').'<br>'.\n\t\t\t\t\t\t\t__('This does not influence the detailed activity view, the form or any plugin.') );\n\n\t\t$this->Formular->addFieldset($Dataset);\n\t}",
"protected function buildViewsData()\n {\n $this->viewsData = $this->configs + ['blogPosts' => array_reverse((array) $this->postsData)];\n\n $this->fileHandler->viewsData = $this->viewsData;\n\n $this->blogPostHandler->viewsData = $this->viewsData;\n }",
"public function setFilterSettings() {\n\n // For each type in the settings\n foreach ($this->settings['types'] as $type => $settings) {\n\n // If modelFieldOptions key is not set\n if (!isset($settings['modelFieldOptions'])\n || empty($settings['modelFieldOptions'])) {\n\n // Add the default of all model fields and all belongsTo and hasOne\n // associated model fields in the appropriate format\n $this->settings['types'][$type]['modelFieldOptions'] = $this->_getModelFieldOptions();\n\n } elseif (is_string($settings['modelFieldOptions'])) {\n\n $model = $this->controller->modelClass;\n\n switch ($settings['modelFieldOptions']) {\n\n \tcase 'displayFieldOnly':\n \t // Get the Model::schema() value for Model::displayField\n \t $displayField = $this->controller->$model->displayField;\n \t $displayFieldSchema = $this->controller->$model->schema($displayField);\n $this->settings['types'][$type]['modelFieldOptions'] = $this->_processModelFieldOptions(array($displayField => $displayFieldSchema), $model);\n \tbreak;\n case 'noAssociatedFields':\n // Get the Model::schema()\n $schema = $this->controller->$model->schema();\n $this->settings['types'][$type]['modelFieldOptions'] = $this->_processModelFieldOptions($schema, $model);\n break;\n default:\n // Add the default of all model fields and all belongsTo and hasOne\n // associated model fields in the appropriate format\n $this->settings['types'][$type]['modelFieldOptions'] = $this->_getModelFieldOptions();\n break;\n }\n\n\n }\n\n // If operator options is a string, and one of the keys from the available\n // operators, use just this one\n if (isset($settings['operatorOptions'])\n && is_string($settings['operatorOptions'])\n && array_key_exists($settings['operatorOptions'], $this->_operators)) {\n\n // Add the specified operator => label element\n $this->settings['types'][$type]['operatorOptions'] = array(\n $settings['operatorOptions'] => $this->_operators[$settings['operatorOptions']]['label']\n );\n\n } elseif (!isset($settings['operatorOptions'])\n || empty($settings['operatorOptions'])) {\n\n // Add the default of all operators in the appropriate format\n $this->settings['types'][$type]['operatorOptions'] = $this->_getOperatorsOptions();\n\n }\n\n }\n\n $this->controller->set('filterSettings', $this->settings);\n\n }",
"public function setDimensions()\r\n\t{\r\n\t\t$this->cube->addDimension(\"page\", \"string\");\r\n\t\t$this->cube->addDimension(\"country\", \"string\");\r\n\t}",
"protected function populateBundleData($collection)\n {\n foreach ($collection as $product) {\n $id = $product->getEntityId();\n $this->bundleData[$id][self::BUNDLE_PRICE_TYPE_COL] = $this->getTypeValue($product->getPriceType());\n $this->bundleData[$id][$this->shipmentTypeColumn] = $this->getShipmentTypeValue(\n $product->getShipmentType()\n );\n $this->bundleData[$id][self::BUNDLE_SKU_TYPE_COL] = $this->getTypeValue($product->getSkuType());\n $this->bundleData[$id][self::BUNDLE_PRICE_VIEW_COL] = $this->getPriceViewValue($product->getPriceView());\n $this->bundleData[$id][self::BUNDLE_WEIGHT_TYPE_COL] = $this->getTypeValue($product->getWeightType());\n $this->bundleData[$id][self::BUNDLE_VALUES_COL] = $this->getFormattedBundleOptionValues($product);\n }\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Define a SELECT clause, converting the column data to HEX values. If no alias name is specified the original column name minus the surrounding HEX() is taken. | public abstract function select_hex($select, $escape = TRUE); | [
"public function select($column_name, $alias = null, $value = null, $data_type = null)\n {\n\n }",
"public function compileSelect()\n {\n if (is_null($this->columns)) {\n $this->columns = array('*');\n }\n\n $select = $this->distinct ? 'SELECT DISTINCT' : 'SELECT';\n\n return $select .' ' .$this->columnize($this->columns) .' FROM {' .$this->table .'}' .$this->constraints();\n }",
"private function formatSelect(): string {\n if ($this->resultType === \"count\") {\n $query = \"SELECT COUNT(*)\";\n } elseif ($this->resultType === \"exists\") {\n $query = \"SELECT 1\";\n } else {\n $query = [];\n $distinct = $this->distinct ? \"DISTINCT \" : \"\";\n foreach ($this->select as $table => $columns) {\n if (count($columns) == 0) {\n $query[] = \"{$table}.*\";\n }\n foreach ($columns as $alias => $column) {\n $select = \"{$table}.{$column}\";\n if ($column != $alias) {\n $select .= \" AS {$alias}\";\n }\n $query[] = $select;\n }\n }\n $query = implode(\", \", $query);\n if (!$query) {\n $query = \"*\";\n }\n $query = \"SELECT {$distinct}\" . $query;\n }\n $query .= \" FROM {$this->from}\";\n return $query;\n }",
"protected function getCompiledSelectClause()\n {\n return 'select ' . implode(', ', $this->select);\n }",
"protected function compileSelect()\n\t{\n\t\t$params = [];\n\n\t\t// select\n\t\t$query = 'SELECT ';\n\n\t\t// values\n\t\tif (count($this->select) === 0) {\n\t\t\t$query .= '* ';\n\t\t} else {\n\t\t\t$separator = '';\n\t\t\tforeach ($this->select as $identifier) {\n\t\t\t\tif (is_array($identifier)) {\n\t\t\t\t\tlist($identifier, $alias) = $identifier;\n\t\t\t\t} else {\n\t\t\t\t\t$alias = false;\n\t\t\t\t}\n\t\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t\t$query.= $separator . $identifier->expression();\n\t\t\t\t} else {\n\t\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t\t}\n\t\t\t\tif ($alias) {\n\t\t\t\t\t$query.= ' AS ' . $this->quoteIdentifier($alias);\n\t\t\t\t}\n\t\t\t\t$separator = ', ';\n\t\t\t}\n\t\t}\n\n\t\t//distinct\n\t\tif (count($this->distinct) > 0) {\n\t\t\t$query.= ' DISTINCT ';\n\t\t\t$separator = '';\n\t\t\tforeach ($this->distinct as $identifier) {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t\t$separator = ', ';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t// from\n\t\tif (is_array($this->table)) {\n\t\t\tlist($table, $alias) = $this->table;\n\t\t} else {\n\t\t\t$table = $this->table;\n\t\t\t$alias = false;\n\t\t}\n\n\t\tif ($table instanceof \\Base\\Database\\Query) {\n\t\t\tlist($subQuery, $subParams) = $table->compile();\n\t\t\t$params = array_merge($params, $subParams);\n\t\t\t$query.= ' FROM (' . $subQuery . ')';\n\t\t} else {\n\t\t\t$query.= ' FROM ' . $this->quoteTable($table);\n\t\t}\n\t\tif ($alias) {\n\t\t\t$query.= ' AS ' . $this->quoteTable($alias);\n\t\t}\n\n\n\t\t// join\n\t\tif (count($this->joins) > 0) {\n\t\t\tforeach ($this->joins as $join) {\n\t\t\t\tif (in_array(strtoupper($join['type']), ['INNER', 'OUTER', 'LEFT', 'RIGHT', 'FULL'])) {\n\t\t\t\t\t$query .= ' ' . strtoupper($join['type']) . ' JOIN ';\n\n\t\t\t\t\tif (is_array($join['table'])) {\n\t\t\t\t\t\tlist($table, $alias) = $join['table'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$table = $join['table'];\n\t\t\t\t\t\t$alias = false;\n\t\t\t\t\t}\n\n\t\t\t\t\t$query.= $this->quoteTable($table) . ' ';\n\t\t\t\t\tif ($alias) {\n\t\t\t\t\t\t$query.= 'AS ' . $this->quoteTable($alias);\n\t\t\t\t\t}\n\n\t\t\t\t\t$on = false;\n\t\t\t\t\tif (count($join['on']) > 0) {\n\t\t\t\t\t\t$on = true;\n\t\t\t\t\t\tlist($onQuery, $onParams) = $this->compileConditions($join['on'], true);\n\t\t\t\t\t\t$query .= 'ON ' . $onQuery;\n\t\t\t\t\t\t$params = array_merge($params, $onParams);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (count($join['where']) > 0) {\n\t\t\t\t\t\tlist($onWhereQuery, $onWhereParams) = $this->compileConditions($join['where']);\n\t\t\t\t\t\tif ($on === true) {\n\t\t\t\t\t\t\t$query .= ' ' . $join['where'][0]['logic'] . ' ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$query.= $onWhereQuery;\n\t\t\t\t\t\t$params = array_merge($params, $onWhereParams);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// where\n\t\tif (count($this->where) > 0) {\n\t\t\tlist($whereQuery, $whereParams) = $this->compileConditions($this->where);\n\t\t\t$query.= ' WHERE ' . $whereQuery;\n\t\t\t$params = array_merge($params, $whereParams);\n\t\t}\n\n\t\t// group by\n\t\t$separator = ' GROUP BY ';\n\t\tforeach ($this->group as $identifier) {\n\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t$query.= $separator . $identifier->expression();\n\t\t\t} else {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier);\n\t\t\t}\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\t// having\n\t\tif (count($this->having) > 0) {\n\t\t\tlist($havingQuery, $havingParams) = $this->compileConditions($this->having);\n\t\t\t$query.= ' HAVING ' . $havingQuery;\n\t\t\t$params = array_merge($params, $havingParams);\n\t\t}\n\n\t\t// order\n\t\t$separator = ' ORDER BY ';\n\t\tforeach ($this->order as $identifier => $direction) {\n\t\t\t$direction = strtoupper($direction) === 'DESC' ? 'DESC' : 'ASC';\n\t\t\tif ($identifier instanceof \\Base\\Database\\Raw) {\n\t\t\t\t$query.= $separator . $identifier->expression() . ' ' . $direction;\n\t\t\t} else {\n\t\t\t\t$query.= $separator . $this->quoteIdentifier($identifier) . ' ' . $direction;\n\t\t\t}\n\t\t\t$separator = ', ';\n\t\t}\n\n\t\t// limit\n\t\tif ($this->limit !== false) {\n\t\t\t$query .= ' LIMIT ' . (int) $this->limit;\n\t\t}\n\n\t\t// offset\n\t\tif ($this->offset !== false) {\n\t\t\t$query .= ' OFFSET ' . (int) $this->offset;\n\t\t}\n\n\t\t// union / union_all\n\t\t$unioned = false;\n\t\tforeach ($this->union as $union) {\n\t\t\tlist($unionQuery, $unionParams) = $union->compile();\n\t\t\t$params = array_merge($params, $unionParams);\n\t\t\tif ($unioned == false) {\n\t\t\t\t$query = '(' . $query . ')';\n\t\t\t}\n\t\t\t$query.= ' UNION (' . $unionQuery . ')';\n\t\t\t$unioned = true;\n\t\t}\n\n\t\tforeach ($this->unionAll as $union) {\n\t\t\tlist($unionQuery, $unionParams) = $union->compile();\n\t\t\t$params = array_merge($params, $unionParams);\n\t\t\tif ($unioned == false) {\n\t\t\t\t$query = '(' . $query . ') ';\n\t\t\t}\n\t\t\t$query.= ' UNION ALL (' . $unionQuery . ')';\n\t\t\t$unioned = true;\n\t\t}\n\n\n\t\treturn [$query, $params];\n\t}",
"private function SQL_select()\n {\n $SQL = \"SELECT \";\n\n $all = false;\n foreach ($this->data as $col)\n {\n if ($col == self::ATTR_SELECT_ALL) {\n $SQL .= \"* \";\n $all = true;\n continue;\n }\n\n $SQL .= \"`{$col}`, \";\n }\n $SQL = rtrim($SQL);\n if (!$all) $SQL = substr($SQL, 0, -1); // Trim last comma.\n\n $SQL .= \" FROM `{$this->table_name}` \" . $this->parseWhere();\n\n if ($this->order_by) $SQL .= $this->parseOrderBy();\n if ($this->limit) $SQL .= \" \" . $this->parseLimit();\n\n //die($SQL);\n return trim($SQL);\n }",
"protected function compilePartSelect(): string\n {\n $columns = $this->query['columns'];\n empty($columns) && $columns = ['*'];\n $columns = array_map(callback: [$this, 'quoteIdentifier'], array: $columns);\n return 'SELECT' . ($this->query['distinct'] === true ? ' DISTINCT ' : ' ') . trim(string: implode(separator: ', ', array: $columns));\n }",
"protected function _build_select_start() {\n $result_columns = join(', ', $this->_result_columns);\n\n if ($this->_distinct) {\n $result_columns = 'DISTINCT ' . $result_columns;\n }\n\n $fragment = \"SELECT {$result_columns} FROM \" . $this->_quote_identifier($this->_table_name);\n\n if (!is_null($this->_table_alias)) {\n $fragment .= \" \" . $this->_quote_identifier($this->_table_alias);\n }\n return $fragment;\n }",
"public function formatSelectColumn($columnName, $alias = null)\n {\n if ('*' == $columnName[strlen($columnName) - 1]) {\n return '*' === $columnName ? '*'\n : $this->amysql->escapeColumn(substr($columnName, 0, -2)) .\n '.*'\n ;\n }\n $ret = $this->amysql->escapeColumn($columnName);\n if ($alias && !is_numeric($alias)) {\n $ret .= ' AS ' . $this->amysql->escapeColumn($alias);\n }\n return $ret;\n }",
"protected function _buildSelectStart() {\r\n $result_columns = join(', ', $this->_resultColumns);\r\n\r\n if ($this->_distinct) {\r\n $result_columns = 'DISTINCT ' . $result_columns;\r\n }\r\n\r\n $fragment = \"SELECT {$result_columns} FROM \" . $this->_quoteIdentifier($this->_tableName);\r\n\r\n if (!is_null($this->_tableAlias)) {\r\n $fragment .= \" \" . $this->_quoteIdentifier($this->_tableAlias);\r\n }\r\n return $fragment;\r\n }",
"protected function getSelectColumnString()\n {\n return $this->selectColumnString;\n }",
"public function testHexResultColumnWithoutAlias($col, $escaped)\n {\n $value = $this->builder->hex_result_column($col);\n\n $this->assertEquals('HEX(' . $escaped . ') AS `' . $col . '`', $value);\n }",
"protected function build_select_start() {\n\t\t$fragment = 'SELECT ';\n\t\t$result_columns = \\join( ', ', $this->result_columns );\n\t\tif ( $this->distinct ) {\n\t\t\t$result_columns = 'DISTINCT ' . $result_columns;\n\t\t}\n\t\t$fragment .= \"{$result_columns} FROM \" . $this->quote_identifier( $this->table_name );\n\t\tif ( ! \\is_null( $this->table_alias ) ) {\n\t\t\t$fragment .= ' ' . $this->quote_identifier( $this->table_alias );\n\t\t}\n\n\t\treturn $fragment;\n\t}",
"private function render_select(): string\n\t{\n\t\treturn 'SELECT ' . ($this->select ? $this->select : '*');\n\t}",
"public function escapeColumn($name) {\n\t\t$name = strval($name);\n\t\treturn $this->escapeIdentifier($name);\n\t}",
"public function getAliasCamposSelect() {\r\n\r\n $campos = $this->_from[1];\r\n $alias = array();\r\n foreach($campos as $indice => $valor) {\r\n if(is_numeric($indice)) {\r\n if(strpos(strtoupper($valor), ' AS ') > 0) {\r\n $divValor = explode(' AS ', strtoupper($valor));\r\n $alias[] = str_replace(\"\\\"\", \"\", trim($divValor[1]));\r\n } else {\r\n $alias[] = trim(strtoupper($campo));\r\n }\r\n } else {\r\n $alias[] = trim(strtoupper($indice));\r\n }\r\n }\r\n \r\n return $alias;\r\n }",
"public function select_expr($expr, $alias=null) {\n return $this->_add_result_column($expr, $alias);\n }",
"public function select_expr($expr, $alias=null) {\n return $this->_add_result_column($expr, $alias);\n }",
"public function generateSqlQuery()\n {\n $res = 'SELECT ';\n $numItems = count($this->aliases);\n $i = 0;\n foreach($this->aliases as $column => $alias) {\n $res .= $column . ' as ' . $alias;\n if(++$i !== $numItems) {\n $res .= ',';\n }\n }\n $res .= ' FROM ' . $this->db . '.' . $this->table;\n $res .= ' WHERE ' . $this->key . ' > ' . $this->last;\n $res .= ' AND (' . $this->generatePreScanClause() . ')';\n $res .= ' ORDER BY ' . $this->key;\n if ($this->limit > 0) {\n $res .= ' LIMIT ' . $this->limit;\n }\n $res .= ';';\n return $res;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets called when recursion creates a nested parent element | abstract protected function getNestedLevelParent(); | [
"function me_rb4_give_children_parent_template() {\n\t\tglobal $post;\n\n\t\t$curr_tmp = get_post_meta( $post->ID, '_wp_page_template', true );\n\t\t$parent_tmp = get_post_meta( $post->post_parent, '_wp_page_template', true );\n\n\t\tif ( $post->post_parent ) :\n\t\t\tupdate_post_meta( $post->ID, '_wp_page_template', $parent_tmp,$curr_tmp );\n\t\tendif;\n\t}",
"public function recursiveNode() {\n\t\t$this->children = array();\n\t\tfor ($k = 0; $k < count($this->parents); $k++) {\n\t\t\tfor ($j = 0; $j < $this->increment; $j++) {\n\t\t\t\t$child = $this->Xml->Node();\n\t\t\t\t$this->parents[$k]->add($child);\n\t\t\t\t$this->children[] = $child;\n\t\t\t\tunset($child);\n\t\t\t}\n\t\t}\n\t\t$this->parents = $this->children;\n\t}",
"abstract protected function createNode($parent = NULL);",
"public function createNestedPagesAndCopyDraftParentPage() {}",
"function UpdateItemParentStateRecursively(wxTreeListItem $item){}",
"public function getGrandParent();",
"public function addParent( $parentTemplate );",
"protected function prepareParentXMLElement()\n {\n $document = new \\DOMDocument();\n $parent = new \\DOMElement('class');\n $document->appendChild($parent);\n\n return $parent;\n }",
"function reparentChildren( Element $element, Element $newParent, $sourceStart );",
"public function moveToNewParent() {\n\t\t$pid = static::$moveToNewParentId;\n\n\t\tif ( is_null($pid) )\n\t\t\t$this->makeRoot();\n\t\telse if ( $pid !== FALSE )\n\t\t\t$this->makeChildOf($pid);\n\t}",
"public function setTreeParent($row){\n $this->treeParentRow = $row;\n return;\n }",
"public function storeNewParent()\n {\n if ($this->isDirty($this->getParentColumnName()) && ($this->exists || !$this->isRoot())) {\n static::$moveToNewParentId = $this->getParentKey();\n } else {\n static::$moveToNewParentId = false;\n }\n }",
"public function moveToNewParent() {\n $pid = static::$moveToNewParentId;\n\n if ( is_null($pid) )\n $this->makeRoot();\n else if ( $pid !== FALSE )\n $this->makeChildOf($pid);\n }",
"public function setParent($node);",
"protected function updateParent()\n {\n $this->each(function ($item) {\n if (method_exists($item, 'parent')) {\n $item->parent($this);\n }\n });\n }",
"function createTreeView($parent, $menu) {\r\n $html = \"\";\r\n if (isset($menu['parents'][$parent])) {\r\n $html .= \"\r\n <ol class='tree'>\";\r\n foreach ($menu['parents'][$parent] as $itemId) {\r\n if(!isset($menu['parents'][$itemId])) {\r\n $html .= \"<li><label for='subfolder2'><a href='\".$menu['items'][$itemId]['link'].\"'>\".$menu['items'][$itemId]['label'].\"</a></label> <input type='checkbox' name='subfolder2'/></li>\";\r\n }\r\n if(isset($menu['parents'][$itemId])) {\r\n $html .= \"\r\n <li><label for='subfolder2'><a href='\".$menu['items'][$itemId]['link'].\"'>\".$menu['items'][$itemId]['label'].\"</a></label> <input type='checkbox' name='subfolder2'/>\";\r\n $html .= createTreeView($itemId, $menu);\r\n $html .= \"</li>\";\r\n }\r\n }\r\n $html .= \"</ol>\";\r\n }\r\n return $html;\r\n}",
"function _buildTree(&$tree, &$element)\n {\n\t\t$tree[$element->name()] = $element;\n\t\tif ($element->superclass()) {\n\t\t\t$rootDoc =& $this->_doclet->rootDoc();\n $superclass =& $rootDoc->classNamed($element->superclass());\n if ($superclass) {\n $this->_buildTree($tree, $superclass);\n }\n\t\t}\n\t}",
"public function getParentNode() {}",
"public function prepareChildren ($parentPath = null);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ end of function show class by id / beggining of function show subject by teacherid | function show_subject_ByteacherId( $id ){
$db = Database::getInstance();
$conn = $db->getConnection();
$sql ="SELECT class_id, class_name FROM tbl_subject WHERE teacher_id=:id";
$stmt = $conn->prepare($sql) ;
$stmt->bindParam(':id',$id,PDO::PARAM_STR) ;
$stmt->execute();
return $stmt ;
} | [
"function ilp_display_teacher_info($student_id)\t{\n \t \t\tglobal\t$CFG;\n \t \t\n \t \t\t$teacherinfo\t\t=\t$this->dbc->get_per_teacher_info($student_id);\n \t \t\t\n \t \t\t$infotexts\t\t\t=\tarray();\n \t \t\t\n \t \t\tforeach ($teacherinfo as $ti) {\n \t \t\t\t$this->return_texts($ti,$infotexts);\t\n \t \t\t}\n \t \t\t\n \t \t\tif (!empty($infotexts)) {\n\t \t \t\t$this->get_archive_student_info($infotexts);\n \t \t\t}\n \t }",
"function getsubjectbyclassid($id)\n {\n $q = \"select * from class where id=$id\";\n $r = mysql_query($q);\n return $r;\n }",
"function get_teacher_class_sec($user_id,$user_type)\n\t{\n\t\t$query=\"SELECT user_id,user_type,user_master_id,teacher_id FROM edu_users WHERE user_id='$user_id' AND user_type='$user_type'\";\n\t\t$resultset=$this->db->query($query);\n\t\t$row=$resultset->result();\n\t\t foreach($row as $rows){}\n\t\t $teacher_id=$rows->user_master_id;\n\t\t //echo $teacher_id;exit;\n\t\t \n\t\t $sql=\"SELECT ts.id,ts.subject_id,ts.teacher_id,ts.class_master_id,ts.status,cm.class_sec_id,cm.class,cm.section,c.class_id,c.class_name,s.sec_id,s.sec_name FROM edu_teacher_handling_subject AS ts,edu_classmaster AS cm,edu_class AS c,edu_sections AS s WHERE ts.teacher_id='$teacher_id' AND ts.class_master_id=cm.class_sec_id AND cm.class=c.class_id AND cm.section=s.sec_id AND ts.status='Active' GROUP BY ts.class_master_id \";\n\t\t $resultset=$this->db->query($sql);\n $res1=$resultset->result();\n return $res1;\n\t}",
"public function classSubjectDetails() {\n $class_id = $this->input->get('c_id');\n $data['SubjectInfo'] = $this->common->getWhere('class_subject', 'class_id', $class_id);\n $this->load->view('temp/header');\n $this->load->view('classSubjectDetails', $data);\n $this->load->view('temp/footer');\n }",
"function displayTeach($tpl, $pid){\n $result = db_query(\"select B.begin_course_cd, B.begin_course_name from `teach_begin_course` A, `begin_course` B, `lrtunit_basic_` C\n\t where A.teacher_cd=$pid and B.begin_course_cd=A.begin_course_cd and C.unit_cd=B.begin_unit_cd and B.note IS NOT NULL\");\n\t$n = $result->numRows();\n\techo \"flag_n=\".$n;\n\twhile(($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) != false){\n $tpl->append(\"all_course\", $row);\n }\n}",
"public function get_teacher_info()\r\n\t\t{\r\n\t\t\t$teacher_id = $this->input->post('t_id');\r\n\t\t\t$result = $this->admin_model->find_teacher_info($teacher_id);\r\n\r\n\t\t\techo $result->first_name . \"-\" . $result->last_name . \"-\" . $result->classroom_id;\r\n\t\t}",
"public function getTeacher($id)\n {\n\t\tif($id == -1){\n\t\t\treturn View::make('teacherTool', array('title' => 'Teacher Information',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'teacher' => null,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => null,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'su' => null,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'full' => false));\n\t\t}\n $user = $this->getUser();\n \n // Make sure they are who they say they are, or have permission to edit teacher info\n // If they aren't, force them to view only their profile\n if (Session::get('user') != $id && !$user->permissions('tinfo')) {\n $id = Session::get('user');\n }\n \n if ($id == '')\n return Redirect::to('T/login/');\n \n $teacher = Teacher::find($id);\n \n // If the user is viewing/logging into their own profile\n if (Session::get('user') == $id) {\n // If it's the first time they're logging in, workshop or not\n if (empty($teacher->name)) {\n \n \n $useLDAP = true;\n \n \n if ($useLDAP) {\n // Bind to LDAP server to pull some demographic info\n $ldapConn = ldap_connect('ldaps://directory.colorado.edu', 636);\n\n // Search for the current user\n $search = ldap_search($ldapConn, \"ou=people,dc=colorado,dc=edu\", 'uid='.$teacher->identikey);\n\n // Get their info and unbind\n $info = ldap_get_entries($ldapConn, $search);\n ldap_unbind($ldapConn);\n } else {\n $info['count'] = 0;\n }\n \n \n if ($info['count'] == 1) {\n $teacher->email = strtolower($info[0]['mail'][0]);\n $teacher->name = $info[0]['displayname'][0];\n }\n \n $teacher->save();\n Session::flash('message', '<strong>Welcome!</strong><br />\n We see this is your first time logging in to our server! Please fill out the demographic information below. Don\\'t worry, though, it will not be shared with anyone; only used by us internally to make our GTP workshops even more useful for you! Thanks!<br /><br /> To print this page, click Ctrl+P, choose the print destination and then click print.<br />To save this page, click Ctrl+P, choose the destination as \\'Save as PDF\\' and then click save');\n \n $this->logAction('insert', 'TD'.$teacher->id);\n \n // No need to show them everything if it's their first time logging in\n $full = false;\n\n // If it's NOT the first time they're logging in\n } else {\n // If they're logging into a workshop\n if (Session::has('workshop_id')) {\n Session::flash('message', '<strong>Welcome back!</strong><br /> Please check below and update any information that has changed before confirming your attendance. Thanks!');\n $full = false;\n\n // If they're just viewing their profile\n } else {\n Session::flash('message', '<strong>Welcome back!</strong><br /> On this page you may edit some of your demographic information, as well as view your completed workshops and other Certificate requirements.<br /><br /> To print this page, click Ctrl+P, choose the print destination and then click print.<br />To save this page, click Ctrl+P, choose the destination as \\'Save as PDF\\' and then click save');\n $full = true;\n }\n }\n \n // If someone is trying to view a profile that isn't theirs (with 'tinfo' privs) ...\n } else {\n // ... and they DON'T exist\n if (empty($teacher)) {\n return Redirect::to('T/find');\n \n // ... and they DO exist\n } else {\n $full = true;\n }\n }\n \n $title = 'Teacher Information';\n $edit = $user->permissions('tinfo');\n $su = $user->permissions('su');\n $info = array('title' => $title,\n 'teacher' => $teacher,\n 'edit' => $edit,\n 'su' => $su,\n 'full' => $full);\n return View::make('teacherTool', $info);\n }",
"public function getStudentsOfSubjectForTeacher($tid = null, $course_id = null) {\n \n $tid = isset($_GET['teacher_id']) ? $_GET['teacher_id'] : $tid;\n $course_id = isset($_GET['course_id']) ? $_GET['course_id'] : $course_id; // course_id is subject\n\n if ((!empty($tid)) && (!empty($course_id))) {\n $connection = ConnectionManager::get('default');\n $sql = \" SELECT users.id as id,first_name,last_name,username,email,password,open_key, profile_pic from users\"\n . \" INNER JOIN user_details ON users.id = user_details.user_id \"\n . \" INNER JOIN user_courses ON users.id = user_courses.user_id \"\n . \" INNER JOIN student_teachers ON users.id = student_teachers.student_id \"\n . \" WHERE student_teachers.teacher_id =\" . $tid . \" AND user_courses.course_id=\" . $course_id\n . \" ORDER BY users.first_name ASC \";\n\n $student_records = $connection->execute($sql)->fetchAll('assoc');\n $studentcount = count($student_records);\n\n if ($studentcount > 0) {\n foreach ($student_records as $studentrow) {\n $student['id'] = $studentrow['id'];\n $student['first_name'] = $studentrow['first_name'];\n $student['last_name'] = $studentrow['last_name'];\n $student['username'] = $studentrow['username'];\n $student['email'] = $studentrow['email'];\n $student['password'] = $studentrow['password'];\n $open_key = $studentrow['open_key'];\n $student['open_key'] = hex2bin($open_key); // decrypt\n\n if ($studentrow['profile_pic'] == NULL) {\n $student['profile_pic'] = '/upload/profile_img/default_studentAvtar.png';\n } else {\n $student['profile_pic'] = $studentrow['profile_pic'];\n }\n $data['students'][] = $student;\n }\n $data['status'] = \"true\";\n } else {\n $data['status'] = \"false\";\n $data['message'] = \"Please Add Student in Your Class.\";\n }\n } else {\n $data['status'] = \"false\";\n $data['message'] = \"Either teacher_id or course_id is null. Please check it cannot be null\";\n }\n $this->set([\n 'response' => $data,\n '_serialize' => ['response']\n ]);\n }",
"public function teacherOf(int $subject)\n {\n $teachers = $this->teachers;\n if ($teachers->count() > 0) {\n \n foreach ($teachers as $teacher) {\n if ($teacher->subject->id == $subject) {\n return $teacher;\n }\n }\n }\n\n }",
"public function teacher()\n {\n $data['title'] = 'Teacher\\'s Course Page';\n\n $course_id = $this->uri->segment(3);\n $classroom_id = $this->uri->segment(4);\n $data['classroom_id'] = $classroom_id;\n $data['course_info'] = $this->course->get_teacher_course($course_id, $classroom_id);\n $data['enrolled_students'] = $this->course->get_enrolled_students_for_teacher($classroom_id);\n $data['quizs'] = $this->course->get_quizs_for_teacher($classroom_id);\n $data['num_questions'] = $this->course->get_number_of_questions_for_teacher($data['quizs']);\n\n $this->load->view('templates/header');\n $this->load->view('courses/teacher', $data);\n $this->load->view('templates/footer');\n }",
"function show_subjectlist_Byid( $id ) {\n\t$db = Database::getInstance();\n\t$conn = $db->getConnection();\n\t$sql = \"SELECT * FROM tbl_subject_list WHERE subjectlist_id=:id\";\n\t$stmt = $conn->prepare($sql) ;\n\t$stmt->bindValue(':id',$id) ;\n\t$stmt->execute();\n\treturn $stmt ;\n}",
"public function teacherDetails() {\n $id = $this->input->get('id');\n $userId = $this->input->get('uid');\n $data['teacher'] = $this->common->getWhere('teachers_info', 'id', $id);\n $data['user'] = $this->common->getWhere('users', 'id', $userId);\n// echo '<pre>';\n// print_r($data['user']);\n// echo '</pre>';\n// die();\n $this->load->view('temp/header');\n $this->load->view('teacherDetails', $data);\n $this->load->view('temp/footer');\n }",
"function get_professor_by_class($classid){\r\n\t\r\n}",
"function getteacherassignments($id){\n\t\t$strQuery=\"select count(description) from assignments where teacherid ='$id'\";\n\t\t$result = $this->query($strQuery);\n\t}",
"public function listsubjectteacher(){\n $data['result'] = $this->commodel->get_list('program_subject_teacher');\n $this->logger->write_logmessage(\"view\",\" View Subject and Paper with Teacher\", \"Map Subject and Paper with Teacher record display successfully.\" );\n $this->logger->write_dblogmessage(\"view\",\" View Subject and Paper with Teacher\", \"Map Subject and Paper with Teacher record display successfully.\" );\n $this->load->view('map/listsubjectteacher',$data);\n }",
"function manage_subject_teachers()\n\n\t{\n\n\t\taccess_control($this);\n\n\t\t\n\n\t\t# Get the passed details into the url data array if any\n\n\t\t$urldata = $this->uri->uri_to_assoc(3, array('m', 'i'));\n\n\t\t\n\n\t\t# Pick all assigned data\n\n\t\t$data = assign_to_data($urldata);\n\n\t\t\n\n\t\t$subject = decryptValue($data['i']);\n\n\t\t\n\n\t\t#Get the paginated list of teachers\n\n\t\t$data['teachers'] = $this->db->query($this->Query_reader->get_query_by_code('get_subject_teachers', array('isactive'=>'Y', 'subject'=> $subject)))->result_array();\n\n\t\t\t\t\n\n\t\t$data['subject_details'] = get_db_object_details($this, 'subjects', $subject);\n\n\t\t\n\n\t\t$data = add_msg_if_any($this, $data);\n\n\t\t$this->load->view('curriculum/manage_subject_teachers', $data);\n\n\t}",
"public function teacher()\n {\n }",
"public function viewCompletedTeacher($id = null)\n {\n $loggedIn = $this->Auth->user();\n \n $intervention = $this->Interventions->get($id, ['contain' => 'Teacher.Highschool']);\n \n if($this->request->is(['post', 'put'])){\n \n $intervention->feedback_prof = $this->request->data['feedback_prof'];\n \n if ($this->Interventions->save($intervention)) {\n $this->Flash->success(__('Vous avez enregistré un feedback.'));\n //$intervention->status = 1;\n //$this->Interventions->save($intervention);\n return $this->redirect(['controller' => 'users', 'action' => 'accueil']);\n }\n $this->Flash->error(__(\"Erreur lors de l'enregistrement du feedback, veuillez essayer à nouveau\"));\n \n }\n \n $this->set(compact(['intervention', 'loggedIn']));\n $this->set('_serialize', ['intervention']);\n }",
"public function getLearnersForAttend($from_index = 0, array $user_subjects = array())\n{\n //check if the request is send frm the index or ajax\n if ($from_index == 1) {\n //class level subject id of the first subject on the list\n $clsID = $user_subjects['clsID'];\n //get the class group level to identify which class learners are\n $cglID = $user_subjects['cglID'];\n //the subject name of the first subject on the list of many\n $subName = $user_subjects['subjectName'];\n //the option of what the user wants to do [1=view]\n $reason = 1;\n }else{\n //the option of what the user wants to do\n $reason = !empty(html_escape($this->input->POST('reason'))) ? html_escape($this->input->POST('reason')) : 0;\n //get class level subject to know which subject is\n $clsID = !empty(html_escape($this->input->POST('clsID'))) ? html_escape($this->input->POST('clsID')) : 0;\n //get the class group level to identify which class learners are\n $cglID = !empty(html_escape($this->input->POST('cglID'))) ? html_escape($this->input->POST('cglID')) : 0;\n //subject name to search for\n $subName = !empty(html_escape($this->input->POST('subjectName'))) ? html_escape($this->input->POST('subjectName')) : '';\n }\n //getting the start date\n $startDate = !empty(html_escape($this->input->POST('startDate'))) ? html_escape($this->input->POST('startDate')) : '';\n //get the end date\n $endDate = !empty(html_escape($this->input->POST('endDate'))) ? html_escape($this->input->POST('startDate')) : '';\n //check who is logged in\n if (strpos(identify_user_role($_SESSION['userID']), 'teacher') !== false) {\n //the user_id of the teacher who is logged in\n $search['end'] = $endDate;\n $search['start'] = $startDate;\n $search['cglID'] = $cglID;\n\n }elseif (identify_user_role($_SESSION['userID']) == 'learner') {\n //the user_id of the learner who is logged in\n $search['learner'] = $_SESSION['userID'];\n $search['clsID'] = $clsID;\n }\n //get the list of learners registered for the subject\n $subjLearners = $this->learners->getLearners($search);\n //VIEW MODE\n if ($reason == 1 || $reason == 0) {\n //display the list of students for attendance\n $learnerList = $this->displayAttendance($subjLearners,$reason,$clsID); \n if ($from_index == 1) {\n return $learnerList;\n }\n //return request to script \n echo json_encode($learnerList);\n }else\n //if user wants to mark attendance, then display buttons [red/green]\n //MARK ATTENDANCE MODE\n if (($reason == 2)) {\n //use today's date and clsID to search for records\n $search['today'] = date('Y-m-d');\n $search['clsID'] = $clsID;\n //send a data request to RETRIEVE OLD LIST of attendance by today's date\n $attends = $this->attendance->getAttendance($search);\n //check if the request returned NULL\n if ($attends == NULL) {\n //create new records for the students then display list\n $insertStatus = $this->attendance->insertLearners($subjLearners,$clsID);\n //if all went 'a' OK with insert\n if ($insertStatus) {\n //then retrieve NEW list based on today's date \n $attend = $this->attendance->getAttendance($search);\n //call display attendance to create a table with learners\n $learnerList = $this->displayAttendance($subjLearners,$reason,$clsID,$attend); \n } \n \n }else {\n //call display attendance to create a table with learners\n $learnerList = $this->displayAttendance($subjLearners,$reason,$clsID,$attends); \n }\n //return request to script \n echo json_encode($learnerList);\n }\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test a correct POST call to calculator route | public function testCalculatorCorrectPost()
{
$client = static::createClient();
$crawler = $client->request('POST', '/calculator',
[
'firstOperator'=>2,
'operation'=>'+',
'secondOperator'=>5,
]);
$response = $client->getResponse();
$this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response);
$this->assertEquals(200, $response->getStatusCode(), "Calculator POST route not defined!");
$this->assertEquals('application/json', $response->headers->get('Content-Type'));
$this->assertJsonStringEqualsJsonString("7", $response->getContent());
} | [
"public function testCurrencyPOSTRequestPost()\n {\n }",
"public function testGetCurrentPricingDataUsingPOST()\n {\n }",
"public function testVerifyUsingPOST()\n {\n\n }",
"public function testPostRequestExecution()\n {\n $router = new Router();\n $router->request(['POST'], '/', function () {\n return true;\n });\n\n $resolution = (new Resolver('/', 'POST', $router, new Parser()))->getResolution();\n\n $this->assertEquals($resolution, true);\n }",
"public function submitCalculation(Request $request)\n {\n $calculationString = str_replace(' ', ',',\n preg_replace('!\\s+!', ' ', trim($request->get('calculationString'))));\n $numbers = explode(',', $calculationString);\n $specialOperation = $this->getOperation($numbers);\n $numbers = $this->getNumbers($numbers);\n if ($specialOperation != false) {\n $argumentCheck = $this->checkArguments($numbers, $specialOperation);\n if ($argumentCheck == true) {\n switch ($specialOperation) {\n case 'and':\n $outcome = $this->and($numbers[0], $numbers[1]);\n break;\n case 'or':\n $outcome = $this->or($numbers[0], $numbers[1]);\n break;\n default:\n return new JsonResponse('Juan3' . $this->errorUnusableOperator($specialOperation));\n }\n } else {\n return new JsonResponse(' Juan' . $argumentCheck);\n }\n } else {\n return new JsonResponse('Juan 2 ' . $this->errorUnusableOperator(''));\n }\n $outcome = ($outcome == true) ? ' TRUE' : ' FALSE';\n return new JsonResponse($outcome);\n }",
"public function handle_calculator_form_submission(){\n $number_1 = sanitize_text_field( $_POST['number_1'] );\n $number_2 = sanitize_text_field( $_POST['number_2'] );\n $sum = $this->add_numbers( $number_1, $number_2 );\n wp_send_json( $sum );\n }",
"public function testPayRunsPost()\n {\n }",
"public function testOperationsPost()\n {\n }",
"public function testClassicPostRequest()\n {\n $form = $this->getSampleForm();\n $data = $this->getSampleData();\n $request = new Request([], ['rocket' => $data], [], [], [], ['REQUEST_METHOD' => 'POST']);\n\n $this->requestHandler->handleRequest($form, $request);\n $this->assertEquals($data, $form->getData());\n }",
"public function testSimpleTestCalculatorForm() {\n\n //Tests the form is created\n $this->drupalGet('example/calculator');\n $this->assertResponse(200, 'Calculator is available');\n $this->assertFieldByName('firts_number', null, 'Firts number field is available');\n $this->assertFieldByName('second_number', null, 'Second number field is available');\n $this->assertFieldByName('operation', null, 'Operation field is available');\n\n }",
"public function testPostRequestDetails()\n {\n }",
"public function testRootPostMethod()\n {\n $response = $this->post(\n '/', [\n 'website' => 'http://example.com',\n 'max' => 1]\n );\n\n $response->assertStatus(200);\n $response->assertSee('http://example.com');\n }",
"public function testSlimPostRoute(){\n Slim::init();\n $callable = function () { echo \"foo\"; };\n $route = Slim::post('/foo/bar', $callable);\n $this->assertEquals('/foo/bar', $route->getPattern());\n $this->assertSame($callable, $route->getCallable());\n }",
"public function testMethodPost() {\n\t\t$_SERVER['REQUEST_METHOD'] = 'POST';\n\n\t\t$request = new Request();\n\n\t\t$this->assertEquals('POST', $request->method);\n\t}",
"public function testRentalInsertFormFrontEnd()\n {\n $route = route('rental.frontend.insert');\n\n $this->get($route); \n $this->seeStatusCode(200);\n }",
"public function testPost()\n {\n $route = '/post';\n $callable = function() { echo 'hi'; };\n $app = new App();\n $routes = new MockRoutes($app);\n $routes->applyPost($route, $callable);\n $slimRoutes = $app->getContainer()->router->getRoutes();\n $firstRoute = array_pop($slimRoutes);\n $this->assertTrue($firstRoute->getMethods() === ['POST']);\n $this->assertTrue($firstRoute->getPattern() === $route);\n }",
"function testPostRouteMatching() {\n $_SERVER['REQUEST_METHOD'] = \"POST\";\n $_SERVER['REQUEST_URI'] = \"15/test-framework.php\";\n\n $requestRouter = new RequestRouter();\n\n $requestRouter->registerRoute(\"{comment_id}/test-framework.php\", \"GET\", function($data) {\n return \"We did not expect to call this route!\";\n });\n\n $requestRouter->registerRoute(\"{comment_id}/test-framework.php\", \"POST\", function($data) {\n return (new HtmlResponseMaker)->response($data);\n });\n\n $response = $requestRouter->handle();\n\n $this->assertTrue($response['handled']);\n $this->assertEquals(\"<div class='content'><div>comment_id: 15</div></div>\", $response['data']);\n }",
"public function testPostRequestForExistingDynamicRoute(): void\n {\n $_SERVER['REQUEST_METHOD'] = 'POST';\n\n $router = new \\Mezon\\Router\\Router();\n $router->addRoute('/catalog/[i:cat_id]', function ($route) {\n return $route;\n }, 'POST');\n\n $result = $router->callRoute('/catalog/1024/');\n\n $this->assertEquals($result, 'catalog/1024', 'Invalid extracted route');\n }",
"public function testPostMethod()\n {\n $client = $this->createClient();\n $crawler = $client->request('POST', '/test');\n $result = $client->getResponse()->getContent();\n $this->assertEquals('POST', $result);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA userList() Returns a JSON or HTML representation of the current User List | function userList($json = false)
{
global $A;
$users = $A->getUsers();
$output = '';
if ($json === false)
{
foreach ($users as $name)
{
//$age = time() - $A->getValueByKey($name);
//$name = ($age > (LACE_ACTIVITY_IDLE * 60)) ? '<em>'.$name.'</em>' : $name;
if ($name{0}=="F") $output .= '<li class="f">'.$name.'</li>';
else if ($name{0}=="H") $output .= '<li class="h">'.$name.'</li>';
else $output .= '<li>'.$name.'</li>';
}
return $output;
}
$userHash = postVar('userHash', false);
$hash = $A->getHash();
if ($userHash === $hash)
{
$output = '"user":{"nodata":"1"}';
}
else
{
$output = '[';
foreach($users as $name)
{
$output .= '"'.addslashes($name).'",';
}
$output = rtrim($output, ',');
$output .= ']';
$output = '"user":{"hash":"'.$hash.'","data":'.$output.',"userHash":"'.$userHash.'"}';
}
return $output;
} | [
"public function getUserLists();",
"function listUsers()\n\t{ \n\t\t$output = shell_exec(\"../min/mc admin user list {$this->alias} --json 2>&1\"); \n\t\techo $output;\n\t}",
"private function listUsers()\n\t{\n\t\t$output = array();\n\t\t//prepare users\n\t\t$jsonUsers = $this->getUsersAsArray();\n\t\tfor($nIter=0;$nIter<$this->m_nGuests;$nIter++)\n\t\t{\n\t\t\t$jsonGuest = array('name1' => self::GUEST);\n\t\t\tarray_push($jsonUsers, $jsonGuest);\n\t\t}\n\t\t$output['users'] = $jsonUsers;\n\t\treturn json_encode($output);\n\t}",
"public function list_users(){\t\t\n\t\t$template_list = $this->smarty->createTemplate('user/users_list.tpl');\n\t\t$template = $this->smarty->createTemplate('user/user_item.tpl');\n\t\t$pager = $this->smarty->createTemplate('pagify.tpl');\n\n\t\t$num = $this->persons->size();\n\t\t$page = floor($this->start / Users_page::SIZE)+1;\n\t\t$pages = ceil($num / Users_page::SIZE);\t\t\n\n\t\t$next = $this->start + Users_page::SIZE;\n\t\t$prev = $this->start - Users_page::SIZE;\n\n\t\t$pager->assign('nav', \"<a href=\\\"users?start=$prev\\\">< Previous</a> Page $page of $pages <a href=\\\"users?start=$next\\\">Next ></a>\");\n\n\t\tif( $page <= 1 )\t\t\t\n\t\t\t$pager->assign('nav', \" Page $page of $pages <a href=\\\"users?start=$next\\\">Next ></a>\");\n\n\t\tif( $page >= $pages )\n\t\t\t$pager->assign('nav', \"<a href=\\\"users?start=$prev\\\">< Previous</a> Page $page of $pages \");\n\t\t\n\t\t$list = $this->persons->display($template_list, $template, $this->start, Users_page::SIZE);\n\t\t$pager->assign('list', $list);\n\t\treturn $pager->fetch();\n\t}",
"public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }",
"public function usersList()\r\n {\r\n if(isset($_SESSION['user_type']) && $_SESSION['user_type'] == 'admin') {\r\n $userModel = new UserModel();\r\n $data['users'] = $userModel->all();\r\n $this->callPage('Users','admin_users','success','Users registered with Angel',$data);\r\n return;\r\n }\r\n }",
"public function getUserList()\n {\n return $this->user_list;\n }",
"public function list_users() {\n\n\t\tforeach( $this->users as $user ) {\n\n\t\t\techo 'Name: ' . $user['name'];\n\t\t\techo 'Email: ' . $user['email'];\n\n\t\t}\n\t}",
"public function usersList()\n {\n $this->checkPermission( 'read.users' );\n $this->setTitle( __( 'Users' ) );\n return view( 'tendoo::components.backend.users-list' );\n }",
"public function getUserList() {\n\t\t// get user list by mandant id from database\n \t\t$users = DB::table('mandant')->where('mandant_id',Session::get('mandantid'))->get();\n\t\t// return these data in form of json to foreend\n\t\treturn $this->custom_response('200 OK',$this->convertUserListforJson($users),'Get User list successed');\n \t\t//return Response::json($users);\n \t}",
"function get_user_list() {\n return $this->query(\"SELECT username AS name, id FROM user ORDER BY username\");\n }",
"function theme_mm_userlist($elt) {\n module_load_include('inc', 'monster_menus', 'mm_browser');\n return _mm_theme_mm_list(MM_BROWSER_MODE_USER, $elt, 0,\n $elt['#title'] ? $elt['#title'] :\n ($elt['#mm_list_max'] == 1 ? t('User:') : t('Users:')),\n t('Path:'), '_mm_theme_list_info_cat');\n}",
"function mod_onlineusers_get_user_list()\r\n{\r\n $PHORUM = $GLOBALS[\"PHORUM\"];\r\n\r\n $list = phorum_api_user_search(\r\n 'date_last_active',\r\n time() - ($PHORUM[\"mod_onlineusers\"][\"idle_time\"] * 60),\r\n '>=', TRUE\r\n );\r\n\r\n $activeusers = array();\r\n if (!empty($list))\r\n {\r\n $users = phorum_api_user_get($list);\r\n foreach ($users as $user)\r\n {\r\n $activeusers[$user['user_id']] = array(\r\n 'user_id' => $user['user_id'],\r\n 'display_name' => $user['display_name'],\r\n 'admin' => $user['admin'],\r\n 'date_last_active' => $user['date_last_active'],\r\n 'last_active_forum' => $user['last_active_forum'],\r\n 'hide_activity' => $user['hide_activity']\r\n );\r\n }\r\n }\r\n\r\n // Sort the users by their name.\r\n if (count($activeusers) > 1) {\r\n uasort($activeusers, 'mod_onlineusers_sort_by_name');\r\n }\r\n\r\n // Allow the default user_list hook to act on the retrieved users.\r\n if (isset($PHORUM['hooks']['user_list']))\r\n $activeusers = phorum_hook('user_list', $activeusers);\r\n\r\n return $activeusers;\r\n}",
"public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}",
"function writeUserList(){\n\t\t$handler = new DBHandler();\n\t\techo '<option value=\"0\">---</option>';\n\t\t$total = $handler->getUserCount();\n\t\tif($total > 0){\n\t\t\t$list = $handler->getUserList();\n\t\t\tfor($i = 0;$i < $total;$i += 1){\n\t\t\t\techo '<option value=\"' . $list[$i][0] . '\">' . $list[$i][1] . ' ' . $list[$i][2] . ' ' . $list[$i][3] . '</option>';\n\t\t\t}\n\t\t}\n\t}",
"private function _getUserList(){\n\t\t/* variable initialization */\n\t\t$strReturnArr = array();\n\t\t\n\t\t/* Get user list objects */\n\t\t$strReturnArr\t= $this->_objDataOperation->getDirectQueryResult(\"select user_name, id from \".$this->_strPrimaryTableName.\" where deleted = 0 order by user_name\");\n\t\t\n\t\t/* return the user list array */\n\t\treturn $strReturnArr;\n\t}",
"public function listUser()\n {\n $this->command = 'CMD_API_PACKAGES_USER';\n $this->send();\n $this->validateResponse();\n $data = $this->getParsedResponse();\n return $data['list'];\n }",
"public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }",
"function dev_list_users( $cap = 'all' ) {\n\n\t$list = array();\n\n\t/* List all users */\n\t$all_users = dev_get_users( array( 'cap' => $cap ) );\n\n\tforeach ( $all_users as $user ) {\n\t\t$user_id = $user->ID;\n\t\t$user_name = $user->data->display_name;\n\t\t$list[ $user_id ] = $user_name;\n\t}\n\n\treturn apply_filters( 'dev_users_list', $list );\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal Method Resolves the given type wether it's an integer or a string and returns the type id. | protected function _resolveType($type): int
{
$given = $type;
$attributeTypes = $this->clientAccessor == 'Pool'
? EvalancheInterface::ATTRIBUTE_TYPES_POOL
: EvalancheInterface::ATTRIBUTE_TYPES;
if (is_string($type) && in_array($type, $attributeTypes)) {
$type = array_search($type, $attributeTypes);
}
if (!is_numeric($type)) {
$trace = debug_backtrace();
array_shift($trace);
$trace = array_shift($trace);
// Undefined attribue type \"{$given}\": Neubert\EvalancheInterface\Behaviors\AttributeBehavior::addAttribute
// Undefined attribue type \"{$given}\": Neubert\EvalancheInterface\Behaviors\GroupBehavior::addAttribute
trigger_error("Undefined attribue type \"{$given}\": {$trace['class']}::{$trace['function']}", E_USER_ERROR);
}
return $type;
} | [
"public function getIdByType(string $type);",
"protected function resolveType($type) : string\n {\n // Pass an object, get back the FQNS as custom type.\n if( is_object($type) ) {\n return get_class($type);\n }\n\n // Pass an array, get back the array built in type.\n if( is_array($type) ) {\n return static::TYPE_ARRAY;\n }\n\n // Pass a callable, get back the callable built in type.\n if( is_callable($type) ) {\n return static::TYPE_CALLABLE;\n }\n\n // Pass a boolean, get back the boolean built in type.\n if( is_bool($type) ) {\n return static::TYPE_BOOLEAN;\n }\n\n // Pass an integer, get back the integer built in type.\n if( is_int($type) ) {\n return static::TYPE_INT;\n }\n\n // Pass a float, get back the float built in type.\n if( is_float($type) ) {\n return static::TYPE_FLOAT;\n }\n\n // Pass a null, get back the null built in type.\n if( is_null($type) ) {\n return static::TYPE_NULL;\n }\n\n // Pass a string, get back the string as a custom type.\n // If you pass \"string\" as the type then it's the same\n // as passing in the built in type for string.\n if( is_string($type) ) {\n return $type;\n }\n\n // Pass a resource, get back the resource built in type.\n if( is_resource($type) ) {\n return static::TYPE_RESOURCE;\n }\n\n // We could create a macro ability for the generic to resolve custom\n // types using a generic type resolver interface. For now we throw exception.\n throw new InvalidArgumentException('Generic type given is not supported.');\n }",
"public static function get_type_id($type) {\n\n switch ($type) {\n case 'album':\n return '1';\n break;\n case 'artist':\n return '2';\n break;\n case 'tag':\n return '3';\n break;\n default:\n return '4';\n break;\n }\n\n }",
"protected static function typeIDToType($type_id) {\n if ($type_id === 0) {\n return 'send';\n } else if ($type_id === 10) {\n return 'order';\n } else if ($type_id === 11) {\n return 'btcpay';\n } else if ($type_id === 20) {\n return 'issuance';\n } else if ($type_id === 30) {\n return 'broadcast';\n } else if ($type_id === 40) {\n return 'bet';\n } else if ($type_id === 50) {\n return 'dividend';\n } else if ($type_id === 70) {\n return 'cancel';\n } else if ($type_id === 21) {\n return 'callback';\n } else if ($type_id === 80) {\n return 'rps';\n } else if ($type_id === 81) {\n return 'rpsresolve';\n }\n\n return null;\n }",
"public function getInt_type() :Type\r\n {\r\n return Type::findById($this->int_type);\r\n }",
"public function testlookupTypeID()\n {\n //Check that we recieve FALSE for an empty entry or an invalid one\n $this->assertFalse(TypeTranslator::lookupTypeID(''));\n $this->assertFalse(TypeTranslator::lookupTypeID('Not a Thing Type'));\n\n //Verify some valid thing ids\n $this->assertEquals('415c95e0-0533-4d9c-ac73-91dc5031186c', TypeTranslator::lookupTypeID('Care Plan'));\n $this->assertEquals('ef9cf8d5-6c0b-4292-997f-4047240bc7be', TypeTranslator::lookupTypeID('Device'));\n $this->assertEquals('85a21ddb-db20-4c65-8d30-33c899ccf612', TypeTranslator::lookupTypeID('Exercise'));\n $this->assertEquals('5c5f1223-f63c-4464-870c-3e36ba471def', TypeTranslator::lookupTypeID('Medication'));\n $this->assertEquals('11c52484-7f1a-11db-aeac-87d355d89593', TypeTranslator::lookupTypeID('Sleep Session'));\n }",
"public function resolve(string $type, string $code): string;",
"public static function resolveID($typeName)\n\t{\n\t\t$typeID = self::innerResolveID($typeName);\n\t\tif($typeID !== self::UNDEFINED)\n\t\t{\n\t\t\treturn $typeID;\n\t\t}\n\n\t\tif(mb_strpos($typeName, '|') !== false)\n\t\t{\n\t\t\t$typeNames = explode('|', $typeName);\n\t\t\tforeach($typeNames as $name)\n\t\t\t{\n\t\t\t\t$typeID |= self::innerResolveID(trim($name));\n\t\t\t}\n\t\t}\n\t\treturn $typeID;\n\t}",
"function convert_mysql_type (\n\t\t\t$type /**< MYSQL-type */){\n\t\t\tif ( stristr($type, \"int\") != false ) {\n\t\t\t\treturn \"integer\";\n\t\t\t} else {\n\t\t\t\treturn \"string\";\n\t\t\t}\n\t\t}",
"public static function getTypeIdByTypeName($type_name) {\n\t\t$mapping = [\n\t\t\t'dbl' => ITEM_VALUE_TYPE_FLOAT,\n\t\t\t'str' => ITEM_VALUE_TYPE_STR,\n\t\t\t'log' => ITEM_VALUE_TYPE_LOG,\n\t\t\t'uint' => ITEM_VALUE_TYPE_UINT64,\n\t\t\t'text' => ITEM_VALUE_TYPE_TEXT\n\t\t];\n\n\t\tif (array_key_exists($type_name, $mapping)) {\n\t\t\treturn $mapping[$type_name];\n\t\t}\n\n\t\t// Fallback to float.\n\t\treturn ITEM_VALUE_TYPE_FLOAT;\n\t}",
"public static function objectID( $type ) {\n\t\tif ( is_numeric( $type ) )\n\t\t\treturn $type;\n\n\t\t// let's not deal with strangeLetterCasing; lowercase ftw\n\t\t$type = strtolower( $type );\n\t\t// find the objectID\n\t\tswitch( $type ) {\n\t\t\tcase 'automationlogitems':\n\t\t\t\t$id = 100;\n\t\t\t\tbreak;\n\t\t\tcase 'blasts':\n\t\t\t\t$id = 13;\n\t\t\t\tbreak;\n\t\t\tcase 'campaignbuilderitems':\n\t\t\t\t$id = 140;\n\t\t\t\tbreak;\n\t\t\tcase 'campaigns':\n\t\t\t\t$id = 75;\n\t\t\t\tbreak;\n\t\t\tcase 'commissions':\n\t\t\t\t$id = 38;\n\t\t\t\tbreak;\n\t\t\tcase 'contacts':\n\t\t\t\t$id = 0;\n\t\t\t\tbreak;\n\t\t\tcase 'contents':\n\t\t\t\t$id = 78;\n\t\t\t\tbreak;\n\t\t\tcase 'couponcodes':\n\t\t\t\t$id = 124;\n\t\t\t\tbreak;\n\t\t\tcase 'couponproducts':\n\t\t\t\t$id = 125;\n\t\t\t\tbreak;\n\t\t\tcase 'coupons':\n\t\t\t\t$id = 123;\n\t\t\t\tbreak;\n\t\t\tcase 'creditcards':\n\t\t\t\t$id = 45;\n\t\t\t\tbreak;\n\t\t\tcase 'customdomains':\n\t\t\t\t$id = 58;\n\t\t\t\tbreak;\n\t\t\tcase 'customervalueitems':\n\t\t\t\t$id = 96;\n\t\t\t\tbreak;\n\t\t\tcase 'customobjectrelationships':\n\t\t\t\t$id = 102;\n\t\t\t\tbreak;\n\t\t\tcase 'customobjects':\n\t\t\t\t$id = 99;\n\t\t\t\tbreak;\n\t\t\tcase 'deletedorders':\n\t\t\t\t$id = 146;\n\t\t\t\tbreak;\n\t\t\tcase 'facebookapps':\n\t\t\t\t$id = 53;\n\t\t\t\tbreak;\n\t\t\tcase 'forms':\n\t\t\t\t$id = 122;\n\t\t\t\tbreak;\n\t\t\tcase 'fulfillmentlists':\n\t\t\t\t$id = 19;\n\t\t\t\tbreak;\n\t\t\tcase 'gateways':\n\t\t\t\t$id = 70;\n\t\t\t\tbreak;\n\t\t\tcase 'groups':\n\t\t\t\t$id = 3;\n\t\t\t\tbreak;\n\t\t\tcase 'imapsettings':\n\t\t\t\t$id = 101;\n\t\t\t\tbreak;\n\t\t\tcase 'invoices': // not an actual ontraport type, but when transactions are returned with WontrapiGo::get_object_meta( 'Transactions' ) they are referred to as \"Invoice\"\n\t\t\t\t$id = 46;\n\t\t\t\tbreak;\n\t\t\tcase 'landingpages':\n\t\t\t\t$id = 20;\n\t\t\t\tbreak;\n\t\t\tcase 'leadrouters':\n\t\t\t\t$id = 69;\n\t\t\t\tbreak;\n\t\t\tcase 'leadsources':\n\t\t\t\t$id = 76;\n\t\t\t\tbreak;\n\t\t\tcase 'logitems':\n\t\t\t\t$id = 4;\n\t\t\t\tbreak;\n\t\t\tcase 'mediums':\n\t\t\t\t$id = 77;\n\t\t\t\tbreak;\n\t\t\tcase 'messages':\n\t\t\t\t$id = 7;\n\t\t\t\tbreak;\n\t\t\tcase 'messagetemplates':\n\t\t\t\t$id = 68;\n\t\t\t\tbreak;\n\t\t\tcase 'notes':\n\t\t\t\t$id = 12;\n\t\t\t\tbreak;\n\t\t\tcase 'offers':\n\t\t\t\t$id = 65;\n\t\t\t\tbreak;\n\t\t\tcase 'openorders':\n\t\t\t\t$id = 44;\n\t\t\t\tbreak;\n\t\t\tcase 'orders':\n\t\t\t\t$id = 52;\n\t\t\t\tbreak;\n\t\t\tcase 'partnerproducts':\n\t\t\t\t$id = 87;\n\t\t\t\tbreak;\n\t\t\tcase 'partnerprograms':\n\t\t\t\t$id = 35;\n\t\t\t\tbreak;\n\t\t\tcase 'partnerpromotionalitems':\n\t\t\t\t$id = 40;\n\t\t\t\tbreak;\n\t\t\tcase 'partners':\n\t\t\t\t$id = 36;\n\t\t\t\tbreak;\n\t\t\tcase 'postcardorders':\n\t\t\t\t$id = 27;\n\t\t\t\tbreak;\n\t\t\tcase 'products':\n\t\t\t\t$id = 16;\n\t\t\t\tbreak;\n\t\t\tcase 'productsaleslogs':\n\t\t\t\t$id = 95;\n\t\t\t\tbreak;\n\t\t\tcase 'purchasehistorylogs':\n\t\t\t\t$id = 30;\n\t\t\t\tbreak;\n\t\t\tcase 'purchases':\n\t\t\t\t$id = 17;\n\t\t\t\tbreak;\n\t\t\tcase 'referrals':\n\t\t\t\t$id = 37;\n\t\t\t\tbreak;\n\t\t\tcase 'roles':\n\t\t\t\t$id = 61;\n\t\t\t\tbreak;\n\t\t\tcase 'rules':\n\t\t\t\t$id = 6;\n\t\t\t\tbreak;\n\t\t\tcase 'salesreportitems':\n\t\t\t\t$id = 94;\n\t\t\t\tbreak;\n\t\t\tcase 'scheduledbroadcasts':\n\t\t\t\t$id = 23;\n\t\t\t\tbreak;\n\t\t\tcase 'sequences':\n\t\t\t\t$id = 5;\n\t\t\t\tbreak;\n\t\t\tcase 'sequencesubscribers':\n\t\t\t\t$id = 8;\n\t\t\t\tbreak;\n\t\t\tcase 'shippedpackages':\n\t\t\t\t$id = 47;\n\t\t\t\tbreak;\n\t\t\tcase 'shippingcollecteditems':\n\t\t\t\t$id = 97;\n\t\t\t\tbreak;\n\t\t\tcase 'shippingfulfillmentruns':\n\t\t\t\t$id = 49;\n\t\t\t\tbreak;\n\t\t\tcase 'shippingmethods':\n\t\t\t\t$id = 64;\n\t\t\t\tbreak;\n\t\t\tcase 'smartforms':\n\t\t\t\t$id = 22; // informed guess from https://api.ontraport.com/doc/#retrieve-smartform-meta\n\t\t\t\tbreak;\n\t\t\tcase 'staffs': // now 'users'\n\t\t\t\t$id = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'subscriberretentionitems':\n\t\t\t\t$id = 92;\n\t\t\t\tbreak;\n\t\t\tcase 'subscriptionsaleitems':\n\t\t\t\t$id = 93;\n\t\t\t\tbreak;\n\t\t\tcase 'tags':\n\t\t\t\t$id = 14;\n\t\t\t\tbreak;\n\t\t\tcase 'tagsubscribers':\n\t\t\t\t$id = 138;\n\t\t\t\tbreak;\n\t\t\tcase 'taskhistoryitems':\n\t\t\t\t$id = 90;\n\t\t\t\tbreak;\n\t\t\tcase 'tasknotes':\n\t\t\t\t$id = 89;\n\t\t\t\tbreak;\n\t\t\tcase 'taskoutcomes':\n\t\t\t\t$id = 66;\n\t\t\t\tbreak;\n\t\t\tcase 'tasks':\n\t\t\t\t$id = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'taxes':\n\t\t\t\t$id = 63;\n\t\t\t\tbreak;\n\t\t\tcase 'taxescollecteditems':\n\t\t\t\t$id = 98;\n\t\t\t\tbreak;\n\t\t\tcase 'terms':\n\t\t\t\t$id = 79;\n\t\t\t\tbreak;\n\t\t\tcase 'trackedlinks':\n\t\t\t\t$id = 80;\n\t\t\t\tbreak;\n\t\t\tcase 'transactions':\n\t\t\t\t$id = 46;\n\t\t\t\tbreak;\n\t\t\tcase 'upsellforms':\n\t\t\t\t$id = 42;\n\t\t\t\tbreak;\n\t\t\tcase 'urlhistoryitems':\n\t\t\t\t$id = 88;\n\t\t\t\tbreak;\n\t\t\tcase 'users':\n\t\t\t\t$id = 2;\n\t\t\t\tbreak;\n\t\t\tcase 'webhooks':\n\t\t\t\t$id = 145;\n\t\t\t\tbreak;\n\t\t\tcase 'wordpressmemberships':\n\t\t\t\t$id = 43;\n\t\t\t\tbreak;\n\t\t\tcase 'wordpresssites':\n\t\t\t\t$id = 67;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$id = '';\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $id;\n\t}",
"private static /* int */ function strToType(/* string */ $type) {\n\t\treturn Utils::strToType(Record::$types, $type);\n\t}",
"public static function getIdFor(mixed $object, string $type): int|string|null\n {\n if (is_object($object)) {\n return $object->getKey();\n }\n\n if (is_array($object)) {\n return $object['id'];\n }\n\n if (is_numeric($object)) {\n return $object;\n }\n\n if (is_string($object)) {\n return call_user_func_array([\n Config::get(\"gatekeeper.models.{$type}\"), 'where'\n ], ['name', $object])->firstOrFail()->getKey();\n }\n\n throw new InvalidArgumentException(\n 'getIdFor function only supports Model, array{id: string}, int, string'\n );\n }",
"private function resolveValueByType($value, $type)\n {\n //TODO: Refactor to deal with PHPMD.CyclomaticComplexity, and remove @SuppressWarnings\n if (null === $value) {\n return null;\n }\n if (null === $type) {\n $type = 'const';\n }\n if ($type == \"string\") {\n return $this->addUniquenessFunctionCall($value);\n } elseif ($type == \"bool\") {\n return $this->toBoolean($value) ? \"true\" : \"false\";\n } elseif ($type == \"int\" || $type == \"float\") {\n return $this->toNumber($value);\n } elseif ($type == \"array\") {\n $this->validateParameterArray($value);\n return \"[\" . $this->addUniquenessToParamArray($value) . \"]\";\n } elseif ($type == \"variable\") {\n return $this->addDollarSign($value);\n } else {\n return $value;\n }\n }",
"private function getTypeIdFromInput()\n\t{\n\t\treturn $this->input->exists('type_id') ?\n\t\t\t$this->input->get('type_id') : $this->input->post->get('type_id');\n\t}",
"public static function convertType(string $type): ?int\n {\n return self::MAP[$type] ?? null;\n }",
"function get_dcformat_id_by_name($type_name)\n\t{\n\t\t$type_arr=explode(' ', $type_name);\n\n\t\tif (!$type_arr)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$type=NULL;\n\t\tforeach($type_arr as $str)\n\t\t{\n\t\t\t$str=trim($str);\n\t\t\tif (isset($str[0]))\n\t\t\t{\n\t\t\t\tif ($str[0]=='[' && $str[strlen($str)-1]==']')\n\t\t\t\t{\n\t\t\t\t\t$type=$str;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Type not found\n\t\tif ($type==NULL)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t//search db\n\t\t$this->db->select('id'); \n\t\t$this->db->like('title', $type); \n\t\t$result= $this->db->get('dcformats')->row_array();\n\t\t\n\t\tif ($result)\n\t\t{\n\t\t\treturn $result['id'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\t\n\t}",
"public function address_type_type_to_index ($type = \"Used\") {\n\t\t# null of no length\n\t\t$type = strlen($type)==0 || is_null($type) ? \"Used\" : $type;\n\t\t# fetch address states\n\t\t$this->addresses_types_fetch();\n\t\t# reindex\n\t\t$states_assoc = array();\n\t\tforeach($this->address_types as $s) {\n\t\t\t$states_assoc[$s['type']] = $s;\n\t\t}\n\t\t# return\n\t\tif(isset($states_assoc[$type])) {\n\t\t\treturn $states_assoc[$type]['id'];\n\t\t}\n\t\telse {\n\t\t\treturn $type;\n\t\t}\n\t}",
"static public function str2typ($type=null);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Create a cookie :: LANGUAGE | function cookieLANG() {
setcookie(lang,$this->lang,time()+365*24*3600);
} | [
"public static function en(){\n setcookie('language', 'en', time()+60);\n }",
"function set_language_cookie()\n\t{\n\t\t\n\t\t// Only set the cookie if the ?lang parameter is used or the cookie has not been set yet\n\t\tif (isset($_COOKIE['_icl_current_language_persist']) AND ! isset($_GET['lang']))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get active language, GET param takes priority\n\t\t$lang = isset($_GET['lang']) ? $_GET['lang'] : ICL_LANGUAGE_CODE;\n\t\t\n\t\t// Cookie properties\n\t\t$cookie_domain \t= defined('COOKIE_DOMAIN') \t? COOKIE_DOMAIN : $_SERVER['HTTP_HOST'];\n\t\t$cookie_path \t= defined('COOKIEPATH') \t\t? COOKIEPATH \t: '/';\n\t\t\n\t\t// Set the cookie\n\t\tsetcookie('_icl_current_language_persist', $lang, time()+86400, $cookie_path, $cookie_domain);\n\t\t$_COOKIE['_icl_current_language_persist'] = $lang;\n\t}",
"private static function setLocaleFromCookie () {\n if (array_key_exists('language', $_COOKIE)) {\n return self::set($_COOKIE['language']);\n }\n return '';\n }",
"function setLanguage() {\n\t\tif(isset($_GET['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_GET['lang']);\n\t\t} elseif(isset($_COOKIE['lang'])) {\n\t\t\t$language = $this->getLanguageFileName($_COOKIE['lang']);\n\t\t} else {\n\t\t\t$language = $this->getLanguageFileName('en-us');\n\t\t}\n\n\t\t//Sets the language cookie for 30 days\n\t\tsetcookie('lang', $language['meta'], time() + 60 * 60 * 24 * 30, '/');\n\n\t\treturn $language;\n\t}",
"public function language();",
"private function getLanguageFromCookie()\n {\n if (Cookie::has('language')){\n $this->language = Cookie::get('language');\n } else {\n $this->language = 'fr';\n }\n }",
"function InitialiseLanguage($code)\r\n\t{\r\n\t\t$cookie = $this->UniqueWebName().\"_lang\";\r\n\t\t\r\n\t\tif (Cookie::Exists($cookie))\r\n\t\t{\r\n\t\t\t//set the language without redoing cookie\r\n\t\t\t$this->SetLanguage(Cookie::Get($cookie),false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//set the deafult lang if no cookie set\r\n\t\t\t$this->SetLanguage($code);\t\r\n\t\t}\r\n\t}",
"function _setLanguage() {\n //write the Config.language with the value from the Cookie\n //echo $this->Cookie->read('lang');\n $lang = $this->Cookie->read('lang');\n if ($lang != \"vi\")\n $lang = \"vi\";\n if (isset($this->Cookie) && $this->Cookie->read('lang') && !$this->Session->check('Config.language')) {\n //$this->Session->write('Config.language', $this->Cookie->read('lang'));\n $this->Session->write('Config.language', $lang);\n }\n //if the user clicked the language URL\n else if (isset($this->params['language']) &&\n ($this->params['language'] != $this->Session->read('Config.language'))\n ) {\n //then update the value in Session and the one in Cookie\n $this->Session->write('Config.language', $this->params['language']);\n $this->Cookie->write('lang', $this->params['language'], false, '20 days');\n }\n }",
"function setLanguage(/*...*/);",
"public static function getCookieLanguageTag() {\n return CookieManager::getCookie(static::LANGUAGE_COOKIE_NAME);\n }",
"function get_lang_id_in_cookie()\n {\n if (isset($_COOKIE['language_id'])) {\n return $_COOKIE['language_id'];\n }\n\n return CONFIG['general']['site_lang'];\n }",
"protected function setLanguage()\n {\n // ==== Intializing or overwriting the session variable ===== //\n $this->session['lang_' . $this->uq] = $this->lang;\n\n // ==== If rememeber is active ==== //\n if($this->options['cookie_enabled'] == true\n && is_numeric($this->options['cookie_expire'])\n && $this->options['cookie_expire'] >= 0\n && !empty($this->options['cookie_path'])\n && !empty($this->options['cookie_domain'])\n && ((isset($_COOKIE['lang_' . $this->uq]) && $_COOKIE['lang_' . $this->uq] != $this->lang) || !isset($_COOKIE['lang_' . $this->uq]))\n )\n {\n // ==== Setting the cookie ==== //\n setcookie('lang_' . $this->uq, $this->lang, time() + $this->options['cookie_expire'], $this->options['cookie_path'], $this->options['cookie_domain']);\n\n // ==== Setting the cookie var ==== //\n $_COOKIE['lang_' . $this->uq] = $this->lang;\n }\n\n // Setting the session\n $this->setSession();\n }",
"private function _setLanguage() {\n //write the Config.language with the value from the Cookie\n if ($this->Cookie->read('lang') && !$this->Session->check('Config.language')) {\n $this->Session->write('Config.language', $this->Cookie->read('lang'));\n }\n //if the user clicked the language URL\n else if (isset($this->params['language']) &&\n ($this->params['language'] != $this->Session->read('Config.language'))\n ) {\n //then update the value in Session and the one in Cookie\n $this->Session->write('Config.language', $this->params['language']);\n $this->Cookie->write('lang', $this->params['language'], false, '20 days');\n }\n }",
"private function _setLanguage()\n {\n //write the Config.language with the value from the Cookie\n if ($this->Cookie->read('lang') && !$this->Session->check('Config.language')) {\n $this->Session->write('Config.language', $this->Cookie->read('lang'));\n } //if the user clicked the language URL\n else {\n if (isset($this->params['language']) &&\n ($this->params['language'] != $this->Session->read('Config.language'))\n ) {\n //then update the value in Session and the one in Cookie\n $this->Session->write('Config.language', $this->params['language']);\n $this->Cookie->write('lang', $this->params['language'], false, '20 days');\n }\n }\n }",
"public function storeLanguageToCookie($lang)\n {\n $cookie = new Cookie(['name' => $this->languageParam, 'value' => $lang]);\n Yii::$app->getResponse()->getCookies()->add($cookie);\n }",
"private static function setupLanguage (){\n\t\t\t$lang = \\config::LANG;\n\t\t\t//if cookie is not set\n\t\t\tif (isset($_GET ['lang'])) {\n\t\t\t\t//set language id\n\t\t\t\tsetcookie('lang', $_GET['lang'], time() + 2592000);\n\t\t\t\t$url = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n\t\t\t\t$pos = strpos($url, '?lang=');\n\t\t\t\tif ($pos === false) {\n\t\t\t\t\t$pos = strpos($url, '&lang=');\n\t\t\t\t}\n\t\t\t\t$url = substr($url, 0, $pos);\n\t\t\t\t// formed uri\n\t\t\t\theader('Location:'.$url);\n\t\t\t}\n\t\t\tif (isset($_COOKIE ['lang']))\n\t\t\t\t$lang = \\config::$langHash [$_COOKIE ['lang']];\n\t\t\t//choose language if isset cookie\n\n\t\t\t\\config::$Lang = self::$Lang = $lang;\n\t\t}",
"private function getLanguageCookie()\n {\n //try to read cookies\n $cookieName = $this->config->get(Config::COOKIE_NAME);\n if (!isset($_COOKIE[$cookieName])) {\n $language = self::getLanguageHeader();\n setcookie($cookieName, $language, time() + 60 * 60 * 24 * 2);\n return $language;\n } else {\n //cookie is already set\n return $_COOKIE[$cookieName];\n }\n }",
"public function getCookieLanguage()\n {\n return isset($_COOKIE['lang']) ? $_COOKIE['lang'] : null;\n }",
"function getRequestedLanguage()\n{\n global $allLanguages;\n\n $languageRequest = $_POST['set-lang'];\n if($languageRequest != null && $allLanguages[$languageRequest])\n {\n setcookie('Language', $languageRequest);\n return $languageRequest;\n }\n return null;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Custom file controls should not render tooltips, as the label renders as an "input box". | public function testDefaultAlignCustomFileControlWithTooltip()
{
$this->Form->create($this->article);
$result = $this->Form->control('file', [
'type' => 'file',
'custom' => true,
'tooltip' => 'Tooltip text',
]);
$expected = [
['div' => ['class' => 'form-group file']],
['div' => ['class' => 'custom-file ']],
['input' => [
'type' => 'file',
'name' => 'file',
'id' => 'file',
'class' => 'custom-file-input',
]],
['label' => ['class' => 'custom-file-label', 'for' => 'file']],
'File',
'/label',
'/div',
'/div',
];
$this->assertHtml($expected, $result);
} | [
"protected function fileField() {\n echo $this->getLabel();\n echo '<div class=\"controls\">';\n echo $this->form->fileField($this->model, $this->attribute, $this->htmlOptions);\n echo $this->getError() . $this->getHint();\n echo '</div>';\n }",
"function fileWidget() {\n\t\t\t?>\n\t\t\t<input type=\"file\" name=\"attachment\" />\n\t\t\t<?php\n\t\t}",
"function theme_field_file($name, $value, $label, $error, $input_id, $options = NULL)\n{\n return _theme_field_common($name, $value, $label, $error, $input_id, $options, 'file');\n}",
"public function getControl()\n\t{\n\t\t$control = Html::el();\n\t\t$control->add(parent::getControl());\n\t\tif($this->showUploadMaxSize) {\n\t\t\t$control->add('<br/>'._('Max. velikost souboru').': '.String::bytes(SystemInfo::getMaxUploadSize()));\n\t\t}\n\t\treturn $control;\n\t}",
"function __htmlInput() { ?>\n\t\t<input \n\t\t\ttype=\"file\" \n\t\t\tid=\"<?=$this->options['input']['id']?>\" \n\t\t\tname=\"<?=$this->options['input']['name']?>\" \n\t\t\tclass=\"<?=$this->styles['input']?>\" \n\t\t\tonchange=\"<?=$this->options['input']['submitOnChange']?>\"\n\t\t/>\n\t<?php }",
"function create_file_field($element, $label = '', $length = 25, $show_replace = true, $replace_label = 'Replace old file?', $file_path = '', $file_name = '', $show_alternate = false, $alt_length = 30, $alt_btn_label = 'Delete image') {\n\t\t$field = '';\n\t\tif ($label != '') $field = '\n\t\t\t<label>'.$label.'</label>';\n\t\t$field = '\n\t\t\t<input type=\"file\" name=\"'.$element.'\" size=\"'.$length.'\" />';\n\t\tif ($show_replace) $field .= '\n\t\t\t<span>'.$replace_label.'</span>\n\t\t\t<input type=\"checkbox\" name=\"replace\" value=\"y\" />';\n\t\tif ($file_name != '' && $show_alternate) {\n\t\t\t$field .= '\n\t\t\t<input type=\"text\" name=\"'.$element.'\" size=\"'.$alt_length.'\" value=\"'.$file_name.'\" readonly=\"readonly\"';\n\t\t\t$field .= (!@file_exists($file_path.$file_name)) ? ' title=\"'.sprintf($this->error_text(17), $file_name).'\" />' : ' />';\n\t\t\t$field .= '\n\t\t\t<input type=\"checkbox\" name=\"del_img\" value=\"y\" />\n\t\t\t<span>'.$alt_btn_label.'</span>';\n\t\t} \n\t\treturn $field;\n\t}",
"protected function fileField( ) {\r\n $this->field( $this->form->fileField( $this->model, $this->attribute, $this->htmlOptions ) );\r\n }",
"protected static function _getInputFile()\n\t{\n\t\treturn '<input '.self::ATTR_MASK.' type=\"file\" />';\t\n\t}",
"public function getLabelsWithoutFilesAndButtons()\r\n {\r\n // Fields without files and buttons\r\n $fields = $this->getFieldsWithoutFilesAndButtons();\r\n // Get its Labels\r\n $allLabels = ArrayHelper::column($fields, 'label', 'name');\r\n // Get Checkboxes & Radio Buttons Labels\r\n $checboxAndRadioLabels = ArrayHelper::column($fields, 'groupLabel', 'name');\r\n // Replace with Checkboxes & Radio Buttons labels\r\n $labels = array_merge($allLabels, $checboxAndRadioLabels);\r\n return $labels;\r\n }",
"public function testControlWithTemplateFile() {\n $result = $this->Form->control('field', [\n 'templates' => 'htmlhelper_tags'\n ]);\n $expected = [\n 'label' => ['for' => 'field', 'class'],\n 'Field',\n '/label',\n 'input' => [\n 'type' => 'text', 'name' => 'field',\n 'id' => 'field', 'class'\n ],\n ];\n $this->assertHtml($expected, $result);\n }",
"function admin_head_select_file() {\n\n\t\t// Only output this css when we are showing a file dialog for simple fields\n\t\tif (isset($_GET[\"simple_fields_action\"]) && $_GET[\"simple_fields_action\"] == \"select_file\") {\n\t\t\t?>\n\t\t\t<style type=\"text/css\">\n\t\t\t\t.wp-post-thumbnail, tr.image_alt, tr.post_title, tr.align, tr.image-size,tr.post_excerpt, tr.url, tr.post_content {\n\t\t\t\t\tdisplay: none; \n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<?php\n\t\t}\n\n\t}",
"public function adminViewFileEdits()\r\n\t{\r\n\t\treturn false;\r\n\t}",
"public function fileLabel()\n {\n return $this->fileLabel;\n }",
"public function lblFilename_Create($strControlId = null) {\n\t\t\t$this->lblFilename = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblFilename->Name = QApplication::Translate('Filename');\n\t\t\t$this->lblFilename->Text = $this->objCounter->Filename;\n\t\t\treturn $this->lblFilename;\n\t\t}",
"protected function defaultChooseButtonLabel()\n {\n if ($this->property()['multiple']) {\n return $this->translator()->translation('Choose files…');\n } else {\n return $this->translator()->translation('Choose file…');\n }\n }",
"function customlabel_get_fileareas() {\n global $CFG;\n\n $basetypedir = $CFG->dirroot.'/mod/customlabel/type';\n\n $areas = array();\n\n $classdir = opendir($basetypedir);\n while ($entry = readdir($classdir)) {\n if (preg_match(\"/^[.!]/\", $entry)) {\n continue; // Ignore what needs to be ignored.\n }\n if (!is_dir($basetypedir.'/'.$entry)) {\n continue; // Ignore real files.\n }\n if (preg_match('/^CVS$/', $entry)) {\n continue; // Ignore versionning files.\n }\n if ($entry == 'NEWTYPE') {\n continue; // Discard plugin prototype.\n }\n require_once($basetypedir.'/'.$entry.'/customlabel.class.php');\n $classname = 'customlabel_type_'.$entry;\n $class = new $classname(null);\n foreach ($class->fields as $f) {\n if ($f->type == 'filepicker') {\n if (!in_array($f->name, $areas)) {\n $areas[] = $f->name;\n }\n }\n }\n }\n\n return $areas;\n}",
"function HtmlInputFile($id, $name, $value, $extra=\"\") {\n echo \"<input type='file'\";\n if ( $id ) echo \" id='$id'\";\n if ( $name ) echo \" name='$name'\";\n if ( $value ) echo \" value=\\\"$value\\\"\";\n if ( $extra ) echo \" $extra\";\n echo \">\\n\";\n }",
"public function it_shows_file_input_on_type_of_file()\n {\n // configure\n $inputs = [\n [\n 'type' => 'file',\n 'name' => 'tc',\n 'label' => 'Upload Terms and Conditions'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }",
"function zen_draw_file_field($name, $required = false) {\r\n $field = zen_draw_input_field($name, '', ' size=\"50\" ', $required, 'file');\r\n\r\n return $field;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The default deletion type does not delete the owner if there are children. | protected function deletionType0(): void
{
if ($this->childs()->count()) {
throw new LogicException('You can’t delete the owner, he has childs.');
}
$this->removeTreePathByIds($this->owner->id);
} | [
"public function forceDelete();",
"public function delete() {\n\t\tif(!$this->hasChildren())\n\t\t\tparent::delete();\n\t}",
"public function forceDelete()\n {\n }",
"public function deleted(Owner $owner)\n {\n //\n }",
"public function setTypeDelete()\n\t{\n\t\t$this->type = 'delete';\n\t}",
"protected function unrestrictedDelete()\n {\n // does to the classes in the class hierarchy but to Person\n // which is mixed in.\n $modelClassName = 'Person';\n $this->deleteOwnedRelatedModels ($modelClassName);\n $this->deleteForeignRelatedModels($modelClassName);\n return parent::unrestrictedDelete();\n }",
"public function getChildrenDeleted();",
"protected function afterDeletion() {}",
"static public function disableDeletedBy();",
"public function forceDeleted(TipoCondicion $tipoCondicion)\n {\n //\n }",
"abstract public function supportsDeleting();",
"protected function afterDelete () {}",
"function delete()\n\t{\n\t\t// always call parent delete function first!!\n\t\tif (!parent::delete())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// get childs\n\t\t$childs = $this->tree->getSubTree($this->tree->getNodeData($this->tree->readRootId()));\n\n\t\t// delete tree\n\t\t$this->tree->removeTree($this->tree->getTreeId());\n\n\t\t// delete childs\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\t$fid = ilMediaPoolItem::lookupForeignId($child[\"obj_id\"]);\n\t\t\tswitch ($child[\"type\"])\n\t\t\t{\n\t\t\t\tcase \"mob\":\n\t\t\t\t\tif (ilObject::_lookupType($fid) == \"mob\")\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t\t\t\t\t$mob = new ilObjMediaObject($fid);\n\t\t\t\t\t\t$mob->delete();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n/*\t\t\t\tcase \"fold\":\n\t\t\t\t\tif (ilObject::_lookupType($fid) == \"fold\")\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once(\"./Modules/Folder/classes/class.ilObjFolder.php\");\n\t\t\t\t\t\t$fold = new ilObjFolder($fid, false);\n\t\t\t\t\t\t$fold->delete();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;*/\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function softDelete();",
"public function onBeforeDelete()\n {\n \tif($this->ItemsAsChildren)\n\t\t{\n\t $CurrentVal = $this->get_enforce_strict_hierarchy();\n\t $this->set_enforce_strict_hierarchy(false);\n\t\n\t\t\tparent::onBeforeDelete();\n\t\n\t $this->set_enforce_strict_hierarchy($CurrentVal);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t parent::onBeforeDelete();\n\t\t}\n }",
"public function forceDeleted(odel=Payment $odel=Payment)\n {\n //\n }",
"public function hardDelete()\n {\n $this->disableSoftDelete();\n $this->delete();\n }",
"public function deleteSetDefault()\n {\n $this->deleteAction = self::ACTION_DEFAULT;\n\n return $this;\n }",
"public function onBeforeDelete()\n {\n $this->owner->AccessTokens()->removeAll();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads all published rules pointing to the provided layout. Rules will be sorted by priority ascending or descending based on the $ascending flag. | public function loadRulesForLayout(Layout $layout, int $offset = 0, ?int $limit = null, bool $ascending = false): RuleList; | [
"protected function LoadRules()\r\n\t{\r\n\t\t$this->_routingRules = $this->LoadRulesDirectory(\"routing/\");\r\n\r\n\t\t//Next Load the application's rules & add them to the array\r\n\t\t$applicationRules = $this->LoadRulesDirectory(\"resources/routing/\");\r\n\r\n\t\t$this->AddRulesToPool($applicationRules);\r\n\r\n\t\t//Finally load any development rules & add them to the array\r\n\t\t$devRules = $this->LoadRulesDirectory(\"dev/\");\r\n\r\n\t\t$this->AddRulesToPool($devRules);\r\n\t}",
"public function loadAllLayouts(bool $includeDrafts = false, int $offset = 0, ?int $limit = null): LayoutList;",
"public function get_all_page_layouts ($load = 'all', $layout_type = false) {\n\t\tglobal $wpdb;\n\t\t$store_key = str_replace('_dev','',Upfront_Model::get_storage_key());\n\t\t$theme_key = $wpdb->esc_like($store_key) . '%';\n\t\t\n\t\tif ( $load == 'all' ) {\n\t\t\t$filter_dev = \"\";\n\t\t} elseif ( $load == self::PAGE_LAYOUT_DEV_TYPE ) {\n\t\t\t$filter_dev = \" post_type = '\". self::PAGE_LAYOUT_DEV_TYPE .\"' AND\";\n\t\t} else {\n\t\t\t$filter_dev = \" post_type = '\". self::PAGE_LAYOUT_TYPE .\"' AND\";\n\t\t}\n\t\t\n\t\t$sql = \"SELECT * FROM {$wpdb->posts} WHERE {$filter_dev} post_name LIKE %s AND post_status = %s\";\n\t\t$query = $wpdb->prepare($sql, $theme_key, self::PAGE_LAYOUT_STATUS);\n\t\t\n\t\tif ( $layout_type ) {\n\t\t\t$sql = \"\n\t\t\t\tSELECT p.*\n\t\t\t\tFROM {$wpdb->posts} p\n\t\t\t\tINNER JOIN {$wpdb->postmeta} m \n\t\t\t\t\t\t\t\t\t\tON p.ID = m.post_id\n\t\t\t\t\t\t\t\t\t\tAND m.meta_key = %s \n\t\t\t\tWHERE {$filter_dev}\n\t\t\t\t\t\t\t\t\t\tm.meta_value = %s\n\t\t\t\t\t\t\t\t\t\tAND p.post_name LIKE %s \n\t\t\t\t\t\t\t\t\t\tAND p.post_status = %s\n\t\t\t\t\";\n\t\t\t$query = $wpdb->prepare($sql, 'layout_type', $layout_type, $theme_key, self::PAGE_LAYOUT_STATUS);\n\t\t}\n\t\t\n\t\treturn $wpdb->get_results($query, OBJECT);\n\t}",
"public function get_rules()\n\t{\n\t\t$this->layout->with('title', 'Rules')\n\t\t\t\t\t ->nest('content', 'rules');\n\t}",
"protected function parseLayouts(): Collection\n {\n $configurations = $this->parseLayoutsConfigurations();\n $layouts = collect();\n foreach ($configurations as $packageName => $configuration) {\n $layouts->put(\n $packageName,\n Layout::fromArray($configuration)\n );\n }\n\n return $layouts;\n }",
"function sortAtRules()\n {\n // split simple declarative At-Rules from the other\n $return = array('atrules' => array(), 'newcss' => array());\n\n foreach ($this->_css as $key => $value) {\n if ((0 === strpos($key, \"@\")) && (1 !== strpos($key, \"-\"))) {\n $return[\"atrules\"][$key] = $value;\n } else {\n $return[\"newcss\"][$key] = $value;\n }\n }\n\n // bring sprecial rules to the top\n foreach (array('@namespace', '@import', '@charset') as $name) {\n if (isset($return['atrules'][$name])) {\n $rule = array($name => $return['atrules'][$name]);\n unset($return['atrules'][$name]);\n $return['atrules'] = $rule + $return['atrules'];\n }\n }\n\n $this->_css = $return['atrules'] + $return['newcss'];\n }",
"public function loadAllLayouts(bool $includeDrafts = false, int $offset = 0, ?int $limit = null): array;",
"private function _loadAclRules()\n {\n $this->_loadRoles();\n $this->_loadResources();\n $this->_loadUsers();\n $this->_loadPermissions();\n }",
"public function loadRulesFromGroup(RuleGroup $ruleGroup, int $offset = 0, ?int $limit = null, bool $ascending = false): array;",
"protected function loadRouteRules(){\n $routeRules = Configurations::get(\"app\", \"router\")[\"rules\"] ?? [];\n\n //Add each route rule from the configuration file into the route rules list\n foreach ($routeRules as $uri => $script) {\n $this->routeRules[] = new RouteRule($uri, $script);\n }\n }",
"private function loadRules() {\n $xml = simplexml_load_file(RULES);\n $i = 0;\n foreach ($xml as $rule) {\n $this->rules[$i]['name'] = trim((string) $rule->name);\n $this->rules[$i]['regex'] = trim((string) $rule->regex);\n $i++;\n }\n }",
"function getPageLayouts() {\n\t $this->setData(ilPageLayout::getLayoutsAsArray());\n\t\t$this->all_mods = ilPageLayout::getAvailableModules();\n\t}",
"protected function loadThemeLayouts()\n {\n $this->layouts = [];\n\n if (file_exists($this->getFolder() . '/layouts')) {\n $layoutsDirectory = new DirectoryIterator($this->getFolder() . '/layouts');\n foreach ($layoutsDirectory as $entry) {\n $this->attemptLayoutRegistration($entry);\n }\n }\n\n foreach (Extensions::getLayouts() as $slug => $path) {\n $this->attemptExtensionLayoutRegistration($slug, $path);\n }\n }",
"protected function loadCSS($layout) \n {\n $sheet = 'layout-'.$layout.'.css';\n $this->addCss($sheet);\n }",
"public function loadPermalinks()\n {\n $permalinks = Permalink::with('entity')->get();\n\n $this->group(config('permalink.group'), function () use ($permalinks) {\n $this->addPermalinks($permalinks);\n });\n }",
"public function getRules()\n\t{\n\t\t// rules are already loaded, skip loading\n\t\tif (is_null($this->rules))\n\t\t{\n\t\t\t$this->rules = self::loadYaml();\n\t\t\t\n\t\t\t// convert rule arrays to objects\n\t\t\tforeach($this->rules as $class_name => &$rule_definition)\n\t\t\t{\n\t\t\t\t$rule_definition = $this->loadRule($class_name, $rule_definition);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// return rules\n\t\treturn $this->rules;\n\t}",
"public function get_layout($layout){\n $this->layout = file_get_contents($layout);\n }",
"function clearSortRules()\n {\n $this->_impl->clearSortRules();\n }",
"function filter_rules_sort() {\n\tglobal $g, $config, $configname;\n\t\n\t/* mark each rule with the sequence number (to retain the order while sorting) */\n\tfor ($i = 0; isset($config['filter'][$configname][$i]); $i++)\n\t\t$config['filter'][$configname][$i]['seq'] = $i;\n\t\n\tfunction filtercmp($a, $b) {\n\t\tif ($a['interface'] == $b['interface'])\n\t\t\treturn $a['seq'] - $b['seq'];\n\t\telse\n\t\t\treturn -strcmp($a['interface'], $b['interface']);\n\t}\n\t\n\tusort($config['filter'][$configname], \"filtercmp\");\n\t\n\t/* strip the sequence numbers again */\n\tfor ($i = 0; isset($config['filter'][$configname][$i]); $i++)\n\t\tunset($config['filter'][$configname][$i]['seq']);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Field Textbox Color | function pt_text_color_render()
{
$options = get_option( 'pt_settings' );
?>
<input type='text' name='pt_settings[pt_text_field_color]' value='<?php if( @$options['pt_text_field_color'] != '') echo $options['pt_text_field_color']; else echo '#ffffff';?>'> (Hex color code, ex white: "#ffffff")
<?php
} | [
"function theme_field_color($name, $value, $label, $error, $input_id, $options = NULL)\n{\n return _theme_field_common($name, $value, $label, $error, $input_id, $options, 'text');\n}",
"function form_color( $args ) {\r\n\r\n\t\t$id = '';\r\n\t\t$value = '';\r\n\t\t$description = '';\r\n\r\n\t\t// set values\r\n\t\tif ( ! empty( $args['value'][$args['id']] ) ) {\r\n\t\t\t$value = $args['value'][$args['id']];\r\n\t\t} else {\r\n\t\t\tif ( ! empty( $args['default'] ) ) {\r\n\t\t\t\t$value = $args['default'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( ! empty( $args['description'] ) ) {\r\n\t\t\t$description = $args['description'];\r\n\t\t}\r\n\r\n\t\t$id = $args['id'];\r\n\r\n?>\r\n\t<input type=\"text\" id=\"<?php echo $id; ?>\" name=\"<?php echo CL_OPTIONS; ?>[<?php echo $id; ?>]\" value=\"<?php echo $this->sanitize_hex_color( $value ); ?>\" data-default-color=\"#<?php echo $this->sanitize_hex_color( $args['default'] ); ?>\" class=\"color-picker\"/>\r\n<?php\r\n\t\tif ( ! empty( $description ) ) {\r\n\t\t\techo '<br /><span class=\"description\">' . $description . '</span>';\r\n\t\t}\r\n\r\n\t}",
"function setting_undermode_form_text_color() {\n\t$options = get_option('undermode_option');\n\t$txt_color = isset( $options['undermode_form_text_color'] ) ? $options['undermode_form_text_color'] : '';\n\techo \"<input id='undermode_form_text_color' class='color-picker' data-alpha='true' name='undermode_option[undermode_form_text_color]' size='40' type='text' value='{$txt_color}' />\";\n}",
"function background_color () {\n\n $options = get_option( self::PREFIX . 'settings' );\n $field_name = self::PREFIX . 'settings[bg-color]';\n $value = '';\n if ( isset($options['bg-color']) ) {\n $value = sanitize_text_field($options['bg-color']);\n }\n ?>\n <input type=\"text\" name=\"<?php echo $field_name; ?>\" class=\"bg-color-picker\" value=\"<?php echo $value; ?>\">\n <?php\n }",
"public function get_font_color_control() {\n\t\t\t// Variables used in view\n\t\t\t$value = $this->value('font_color');\n\t\t\t$default_color = $this->default['font_color'];\n\t\t\t$current_color = isset( $value ) ? $value : $default_color;\n\n\t\t\t// Get control view\n\t\t\t?>\n <label><?php _e( 'Font Color', 'scratch' ); ?>\n <input class=\"color-picker-hex sc-font-color-text-box\" type=\"text\" maxlength=\"7\" placeholder=\"<?php esc_attr_e( 'Hex Value' ); ?>\"\n value=\"<?php echo $current_color; ?>\" data-default-color=\"<?php echo $default_color ?>\"\n <?php $this->link('font_color') ?>\n />\n </label>\n\n <?php\n\t\t}",
"public function keyboardColor()\n {\n }",
"function SetTextColor($txtr,$txtg,$txtb)\n {\n $this->txtr=$txtr; //red text value\n $this->txtb=$txtb; //blue text value\n $this->txtg=$txtg; //green text value\n }",
"function twentyeleven_settings_field_color_scheme() {}",
"public function input_WbfsysProcessNode_TextColor( $params )\n {\n $i18n = $this->view->i18n;\n\n //tpl: class ui:colorpicker\n $inputTextColor = $this->view->newInput( 'inputWbfsysProcessNodeTextColor' , 'Colorpicker' );\n $this->items['wbfsys_process_node-text_color'] = $inputTextColor;\n $inputTextColor->addAttributes\n (\n array\n (\n 'name' => 'wbfsys_process_node[text_color]',\n 'id' => 'wgt-input-wbfsys_process_node_text_color'.($this->suffix?'-'.$this->suffix:''),\n 'class' => 'wcm wcm_ui_tip medium'.($this->assignedForm?' asgd-'.$this->assignedForm:''),\n 'title' => $i18n->l( 'Insert value for {@attr@} ({@src@})', 'wbf.label', array( 'attr' => 'text color', 'src' => 'Process Node' ) ),\n 'maxlength' => $this->entity->maxSize( 'text_color' ),\n )\n );\n $inputTextColor->setWidth( 'medium' );\n\n $inputTextColor->setReadonly( $this->fieldReadOnly( 'wbfsys_process_node', 'text_color' ) );\n $inputTextColor->setRequired( $this->fieldRequired( 'wbfsys_process_node', 'text_color' ) );\n $inputTextColor->setData( $this->entity->getSecure( 'text_color' ) );\n $inputTextColor->setLabel( $i18n->l( 'text color', 'wbfsys.process_node.label' ) );\n\n $inputTextColor->refresh = $this->refresh;\n $inputTextColor->serializeElement = $this->sendElement;\n\n // activate the category\n $this->view->addVar\n (\n 'showCat'.$this->namespace.'_Default' ,\n true\n );\n\n\n }",
"function color() {\r\n\t\t $this->SetFillColor(255,255,255);\r\n\t\t $this->SetTextColor(0,0,0);\r\n\t\t $this->SetDrawColor(0,0,0);\r\n\t\t $this->SetLineWidth(0.1);\r\n\t\t $this->SetFont('','',9);\r\n\t\t}",
"function cps_month_backgroundcolor() {\n\t$options = get_option(CPS_PLUGIN_OPTIONS);\n\techo \"<input id='cps_month_backgroundcolor' name='cps_plugin_options[cps_month_backgroundcolor]' size='7' maxlength='7' type='text' value='{$options['cps_month_backgroundcolor']}' />\";\n}",
"function color_input(){\n $options = get_option( 'color_options' );\n $color = ( $options['color'] != \"\" ) ? sanitize_text_field( $options['color'] ) : '#3D9B0C';\n \n echo '<input id=\"color\" name=\"color_options[color]\" type=\"text\" value=\"' . $color .'\" />';\n \n //This div is only needed for farbtastic, otherwise it is left empty.\n //For more info on using farbtastic check out http://acko.net/blog/farbtastic-jquery-color-picker-plug-in/.\n echo '<div id=\"colorpicker\"></div>'; \n }",
"function as_field_color_picker_in($id, $name, $color, $default = '') {\r\n\t\t$output = '<div class=\"aspb-color-picker\">';\r\n\t\t\t$output .= '<input type=\"text\" id=\"'. $id .'\" class=\"input-color-picker\" value=\"'. $color .'\" name=\"'. $name .'\" data-default-color=\"'. $default .'\"/>';\r\n\t\t$output .= '</div>';\r\n\t\t\r\n\t\treturn $output;\r\n\t}",
"protected function colorselectorField() {\n echo $this->getLabel();\n echo '<div class=\"controls\">';\n echo $this->getPrepend();\n $this->widget('core.widgets.TColorSelector', array(\n 'model' => $this->model,\n 'attribute' => $this->attribute,\n ));\n echo $this->getAppend();\n echo $this->getError() . $this->getHint();\n echo '</div>';\n }",
"function catchbox_settings_field_link_color() {\n\t$options = catchbox_get_theme_options();\n\t?>\n\t<input type=\"text\" name=\"catchbox_theme_options[link_color]\" id=\"link-color\" value=\"<?php echo esc_attr( $options['link_color'] ); ?>\" />\n\t<a href=\"#\" class=\"pickcolor hide-if-no-js\" id=\"link-color-example\"></a>\n\t<input type=\"button\" class=\"pickcolor button hide-if-no-js\" value=\"<?php esc_attr_e( 'Select a Color', 'catchbox' ); ?>\" />\n\t<div id=\"colorPickerDiv\" style=\"z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;\"></div>\n\t<br />\n\t<span><?php printf( __( 'Default color: %s', 'catchbox' ), '<span id=\"default-color\">' . catchbox_get_default_link_color( $options['color_scheme'] ) . '</span>' ); ?></span>\n\t<?php\n}",
"function wpforms_settings_color_callback( $args ) {\n\n\t$default = isset( $args['default'] ) ? esc_html( $args['default'] ) : '';\n\t$value = wpforms_setting( $args['id'], $default );\n\t$id = wpforms_sanitize_key( $args['id'] );\n\n\t$output = '<input type=\"text\" id=\"wpforms-setting-' . $id . '\" class=\"wpforms-color-picker\" name=\"' . $id . '\" value=\"' . esc_attr( $value ) . '\">';\n\n\tif ( ! empty( $args['desc'] ) ) {\n\t\t$output .= '<p class=\"desc\">' . wp_kses_post( $args['desc'] ) . '</p>';\n\t}\n\n\treturn $output;\n}",
"static public function COLOR(\n\n string $id = null\n ,string $class = null\n ,array|string $attr = null\n \n )\n {\n \n return Parent::HtmlELements_Optimizer(\n \n \"INLINE\",\n 'input', \n $attr = HTML::FORMTYPE( $attr, 'type', 'color' ) , \n $id, \n $class, \n METHOD_ASSOC\n \n );\n \n }",
"public function textColorsFieldsets()\r\n {\r\n $colors = array_get($this->model->colors, 'text', []);\r\n $this->grid->fieldset('text-color-main', function (Fieldset $fieldset) use($colors) {\r\n $fieldset->attributes(['classname' => 'cp-brand--primary']);\r\n\r\n $fieldset->control('input:text', 'colors[text][main][first]')\r\n ->attributes(['class' => 'cp', 'maxlength' => 7, 'num' => 1])\r\n ->value(array_get($colors, 'main.first', '#FFFFFF'));\r\n\r\n $fieldset->control('input:text', 'colors[text][main][second]')\r\n ->attributes(['class' => 'cp', 'maxlength' => 7, 'num' => 2])\r\n ->value(array_get($colors, 'main.second', '#FFFFFF'));\r\n\r\n $fieldset->layout('antares/foundation::brands.partials._fieldset_text_colors');\r\n });\r\n $this->grid->fieldset('text-color-secondary', function (Fieldset $fieldset) use($colors) {\r\n $fieldset->attributes(['classname' => 'cp-brand--secondary']);\r\n\r\n $fieldset->control('input:text', 'colors[text][secondary][first]')\r\n ->attributes(['class' => 'cp', 'maxlength' => 7, 'num' => 3])\r\n ->value(array_get($colors, 'secondary.first', '#8a8f99'));\r\n\r\n $fieldset->control('input:text', 'colors[text][secondary][second]')\r\n ->attributes(['class' => 'cp', 'maxlength' => 7, 'num' => 4])\r\n ->value(array_get($colors, 'secondary.second', '#FFFFFF'));\r\n\r\n $fieldset->layout('antares/foundation::brands.partials._fieldset_text_colors');\r\n });\r\n $this->grid->fieldset('text-color-background', function (Fieldset $fieldset) use($colors) {\r\n $fieldset->attributes(['classname' => 'cp-brand--tetriary']);\r\n\r\n $fieldset->control('input:text', 'colors[text][background][first]')\r\n ->attributes(['class' => 'cp', 'maxlength' => 7, 'num' => 5])\r\n ->value(array_get($colors, 'background.first', '#000000'));\r\n\r\n $fieldset->control('input:text', 'colors[text][background][second]')\r\n ->attributes(['class' => 'cp', 'maxlength' => 7, 'num' => 6])\r\n ->value(array_get($colors, 'background.second', '#000000'));\r\n\r\n $fieldset->layout('antares/foundation::brands.partials._fieldset_text_colors');\r\n });\r\n return;\r\n }",
"public static function generateFields()\n\t{\n\t\t$css = '';\n\t\t$query = (new \\App\\Db\\Query())->select(['tabid', 'fieldname', 'color'])->from('vtiger_field')->where(['presence' => [0, 2]])->andWhere(['<>', 'color', '']);\n\t\t$dataReader = $query->createCommand()->query();\n\t\twhile ($row = $dataReader->read()) {\n\t\t\tif (ltrim($row['color'], '#')) {\n\t\t\t\t$css .= '.flCT_' . Module::getModuleName($row['tabid']) . '_' . $row['fieldname'] . '{ color: ' . $row['color'] . '; }' . PHP_EOL;\n\t\t\t}\n\t\t}\n\t\tfile_put_contents(ROOT_DIRECTORY . '/public_html/layouts/resources/colors/fields.css', $css);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cart To Wishlist Transfers cart items to the wishlist | public function transferCartToWishlist($carItemID)
{
$cartItem = ShoppingCart::find($carItemID);
$listingOption = $cartItem->listingOptions;
$wish = $listingOption->wishlist->where('Account_Id', $cartItem->Account_Id)->first();
if(is_null($wish))
{
// Add to wishlist
$wish = new Wishlist();
$wish->Option_Id = $cartItem->Option_Id;
$wish->Account_Id = $cartItem->Account_Id;
$wish->save();
// Remove from shopping cart
$cartItem->delete();
}
// Redirect to the user's cart
header('Location: '. '/public/cartController');
return;
} | [
"public function switchToWishlist($id)\n {\n $item = Cart::get($id);\n\n Cart::remove($id);\n\n $duplicates = Cart::instance('wishlist')->search(function ($cartItem, $rowId) use ($id) {\n return $cartItem->id === $id;\n });\n\n if (!$duplicates->isEmpty()) {\n return redirect('cart')->withSuccessMessage('Item is already in your Wishlist!');\n }\n\n Cart::instance('wishlist')->add($item->id, $item->name, 1, $item->price)\n ->associate('App\\Product');\n\n return redirect('cart')->withSuccessMessage('Item has been moved to your Wishlist!');\n\n }",
"public function switchToWishlist($id)\n {\n $item = Cart::instance('shopping')->get($id);\n Cart::instance('shopping')->remove($id);\n $duplicates = Cart::instance('wishlist')->search(function ($cartItem, $rowId) use ($id) {\n return $cartItem->id === $id;\n });\n if (!$duplicates->isEmpty()) {\n $notification = [\n 'message' => 'Thanks! Item is already in your Wishlist!',\n 'alert-type' => 'success'\n ];\n return redirect('products/carts')->with($notification);\n }\n Cart::instance('wishlist')->add($item->id, $item->name, $item->qty, $item->price)\n ->associate(Product::class);\n $notification = [\n 'message' => 'Thanks! Item was removed from your Wishlist!',\n 'alert-type' => 'success'\n ];\n return redirect()->back()->with($notification);\n }",
"public function allcartAction()\n {\n if ($this->_isCheckFormKey && !$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n foreach ($collection as $item) {\n /** @var Mage_Wishlist_Model_Item */\n try {\n \n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct(); \n \n // Start: Get childProduct and overwrite stored product with loaded simple configurable because it holds stock info\n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null; \n if($itemBuyRequest['super_attribute']) {\n \n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n if($childProduct) {\n //$buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n $itemBuyRequest->setData('product', $childProduct->getId()); \n $item->mergeBuyRequest($itemBuyRequest); \n } \n } \n // End\n \n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n // Add to cart\n if ($item->addToCart($cart, $isOwner)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId());\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }",
"public function switchToWishlist($id)\n {\n $item = Cart::get($id);\n\n Cart::remove($id);\n\n $duplicates = Cart::instance('wishlist')->search(function ($cartItem, $rowId) use ($id) {\n return $cartItem->id === $id;\n });\n\n if (!$duplicates->isEmpty()) {\n return redirect('shopping/cart')->withSuccessMessage('Item is already in your Wishlist!');\n }\n\n Cart::instance('wishlist')->add($item->id, $item->name, 1, $item->price)\n ->associate('App\\Models\\Product');\n\n return redirect('shopping/cart')->withSuccessMessage('Item has been moved to your Wishlist!');\n\n }",
"public function moveToWishlist($itemId)\n {\n $customer = $this->simiObjectManager->get('Magento\\Customer\\Model\\Session')->getCustomer();\n if ($customer->getId() && ($customer->getId() != '')) {\n $wishlist = $this->simiObjectManager\n ->get('Magento\\Wishlist\\Model\\Wishlist')->loadByCustomerId($customer->getId(), true);\n } else {\n throw new \\Simi\\Simiconnector\\Helper\\SimiException(__('Please login first'), 4);\n }\n $cart = $this->_getCart();\n\n $item = $cart->getQuote()->getItemById($itemId);\n if (!$item) {\n throw new \\Simi\\Simiconnector\\Helper\\SimiException(__('Requested cart item doesn\\'t exist'), 4);\n }\n $productId = $item->getProductId();\n $buyRequest = $item->getBuyRequest();\n $wishlist->addNewItem($productId, $buyRequest);\n $productIds[] = $productId;\n $cart->getQuote()->removeItem($itemId);\n $cart->save();\n $this->simiObjectManager->get('Magento\\Wishlist\\Helper\\Data')->calculate();\n $this->RETURN_MESSAGE = __(\"Item has been moved to wishlist\");\n $wishlist->save();\n }",
"public function switchToWishlist($id)\n {\n $item = Cart::get($id);\n\n Cart::remove($id);\n\n $duplicates = Cart::instance('wishlist')->search(function ($cartItem, $rowId) use ($id) {\n return $cartItem->id === $id;\n });\n\n if (!$duplicates->isEmpty()) {\n return redirect('cart')->withSuccessMessage('Producto incluido anteriormente en Wishlist!');\n }\n\n Cart::instance('wishlist')->add($item->id, $item->name, 1, $item->price)\n ->associate('App\\Product');\n\n return redirect('cart')->withSuccessMessage('Producto enviado exitosamente a Wishlist!');\n\n }",
"function wolf_add_to_wishlist() {\n\t$wishlist = www_get_wishlist_product_ids();\n\n\t$product_id = get_the_ID();\n\t$is_in_wishlist = ( $wishlist ) ? ( in_array( $product_id, $wishlist ) ) : false;\n\n\t$class = ( $is_in_wishlist ) ? 'wolf_in_wishlist' : '';\n\t\n\t$text = ( $is_in_wishlist ) ? esc_html__( 'Remove from wishlist', 'wolf-woocommerce-wishlist' ) : esc_html__( 'Add to wishlist', 'wolf-woocommerce-wishlist' );\n\tdo_action( 'www_before_add_to_wishlist' );\n\n\t$class .= apply_filters( 'wolf_add_to_wishlist_class', ' wolf_add_to_wishlist button' );\n\n\t?>\n\t<a\n\tclass=\"<?php echo esc_attr( $class ); ?>\"\n\thref=\"?add_to_wishlist=<?php the_ID(); ?>\"\n\ttitle=\"<?php echo esc_attr( $text ); ?>\"\n\trel=\"nofollow\"\n\tdata-product-title=\"<?php echo esc_attr( get_the_title() ); ?>\"\n\tdata-product-id=\"<?php the_ID(); ?>\"><span class=\"wolf_add_to_wishlist_heart\"></span></a>\n\t<?php\n\tdo_action( 'www_after_add_to_wishlist' );\n}",
"public function action_move()\n {\n if ($this->BRequest->csrf('referrer', 'GET')) {\n $this->message('CSRF detected', 'error');\n $this->BResponse->redirect('wishlist');\n return;\n }\n\n $id = $this->BRequest->get('id');\n $pId = (int)$this->BRequest->get('product');\n $wlId = (int)$this->BRequest->get('wishlist');\n $wishlistItem = $this->Sellvana_Wishlist_Model_WishlistItem->loadOrCreate(['wishlist_id' => $wlId, 'product_id' => $pId]);\n\n if ($this->BRequest->xhr() && $wishlistItem) {\n if ($wishlistItem->set('wishlist_id', $id)->save()) {\n $wishlist = $this->Sellvana_Wishlist_Model_Wishlist->load($id);\n $r = [\n 'success' => true,\n 'wishlist_id' => $wishlist->id,\n 'wishlist_title' => $wishlist->title\n ];\n }\n \n $this->BResponse->json($r);\n }\n }",
"public function createOrderShipping()\r\n {\r\n $wishlist_id = $this->inputfilter->clean($this->app->get('PARAMS.id'), 'alnum');\r\n \r\n $flash = \\Dsc\\Flash::instance();\r\n \r\n $this->app->set('meta.title', 'Shipping | Create Order from Wishlist | Shop');\r\n \r\n $item = $this->getItem();\r\n \r\n if (empty($item->id)) \r\n {\r\n \\Dsc\\System::addMessage('Invalid Wishlist ID', 'error');\r\n $this->app->reroute('/admin/shop/wishlists');\r\n }\r\n \r\n $this->app->set('wishlist', $item);\r\n \r\n $view = $this->theme;\r\n $view->event = $view->trigger('onShopCreateOrderShipping', array(\r\n 'item' => $item,\r\n 'tabs' => array(),\r\n 'content' => array()\r\n ));\r\n echo $view->render('Shop/Admin/Views::wishlists/create_order.php');\r\n }",
"public function allcartAction()\n {\n if (!$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n if (Mage::helper('cminds_multiwishlist')->fillUpBundleOptions()) {\n Mage::register('pre-define-lowest-price', true);\n }\n\n foreach ($collection as $item) {\n /** @var Cminds_Multiwishlist_Model_Item $item*/\n try {\n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct();\n\n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n\n // Add to cart\n if ($item->addToCart($cart, false)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::getUrl('multiwishlist/index/view', array('wishlist_id' => $wishlist->getId()));\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }",
"static function redirect_to_wishlist() {\n\t\t\t$link = site_url( 'wishlist' ); // TODO: get this in a more reusable manner.\n\t\t\twp_redirect( $link, 302 );\n\t\t}",
"public function wishList(){\n\t\tif (Auth::check()){\n\t\t\t$authEmail = Auth::user()->email;\n\t\t\t$userCart = Wishlist::where('user_email',$authEmail)->get()->toArray();\n\t\t\tforeach($userCart as $key=>$cartIteam){\n\t\t\t\t$product_id = $cartIteam['product_id'];\n\t\t\t\t$productImage = Products::where('id',$product_id)->first()->toArray();\n\t\t\t\t$userCart[$key]['image'] = $productImage['image'];\n\t\t\t}\n\t\t\treturn view('products.wishlist')->with(['userCart'=>$userCart,'controller'=>'product','page_type'=>'front']);\n\t\t}else{\n\t\t\treturn redirect()->back()->with('flush_message_error','Please login to view wish list of products !');\n\t\t}\n\t}",
"public function switchToCart($id)\n {\n $item = Cart::instance('wishlist')->get($id); //0\n\n Cart::instance('wishlist')->remove($id); //1\n\n $duplicates = Cart::instance('default')->search(function ($cartItem, $rowId) use ($id){ //2\n return $cartItem->id === $id;\n });\n\n if (!$duplicates->isEmpty()) { //3\n return redirect('cart')->withSuccessMessage('Item is already in your shopping cart');\n }\n\n Cart::instance('default')->add($item->id, $item->name, 1, $item->price)->associate('App\\Item'); //4\n return redirect('wishlist')->withSuccessMessage('Item has been moved to your shopping cart');\n }",
"private function wishList() {\n $this->_template->title = 'Wish List';\n $this->_template->wishListProducts = $this->_model->wishListProducts($this->_userId);\n $this->_template->buildFromTemplates('header.php', 'sidebar.php', 'account_nav.php', 'main.wish.php', 'footer.php');\n }",
"protected function storeWishlist(): void\n {\n $this->wishlistProducts = array_values(array_unique($this->wishlistProducts)); //re-index array\n session(['wishlist' => $this->wishlistProducts]);\n if (auth::check()) {\n Auth::user()->wishlist()->updateOrCreate(['user_id' => Auth::id()], ['data' => $this->wishlistProducts]);\n }\n }",
"function m_modifyWishlist()\n\t{\n\t\t$libFunc=new c_libFunctions();\n\t\t$timestamp=time();\n\t\t#UPDATEING TO WISHLIST\n\t\t$cnt=count($this->request['wishlistid']);\n\t\tfor($i=0;$i<$cnt;$i++)\n\t\t{\n\t\t\t$this->obDb->query=\"UPDATE \".WISHLIST.\" SET vQuantity='\".$this->request['quantity'][$i].\"' WHERE (iShopWishid_PK='\".$this->request['wishlistid'][$i].\"')\";\n\t\t\t$this->obDb->updateQuery();\n\t\t}\n\t\tif(isset($this->request['remove']))\n\t\t{\n\t\t\tforeach($this->request['remove'] as $r=>$rid)\n\t\t\t{\n\t\t\t\t $this->obDb->query=\"DELETE FROM \".WISHLIST.\" WHERE (iShopWishid_PK='\".$r.\"')\";\n\t\t\t\t$this->obDb->updateQuery();\n\t\t\t}\n\t\t}\n\n\t\t$retUrl=$this->libFunc->m_safeUrl(SITE_URL.\"ecom/index.php?action=wishlist.display\");\n\t\t$this->libFunc->m_mosRedirect($retUrl);\t\n\t}",
"public function add_product_wishlist_post() {\n\n $user_id = $this->post('user_id') ? $this->post('user_id') : \"\";\n $wishlist_id = $this->post('wishlist_id') ? $this->post('wishlist_id') : \"\";\n $product_id = $this->post('product_id') ? $this->post('product_id') : \"\";\n $retailer_id = $this->post('retailer_id') ? $this->post('retailer_id') : \"\";\n $store_id = $this->post('store_id') ? $this->post('store_id') : \"\";\n $special_id = $this->post('special_id') ? $this->post('special_id') : \"\";\n\n $data = array(\n 'UserId' => $user_id,\n 'UserWishlistId' => $wishlist_id,\n 'ProductId' => $product_id,\n 'RetailerId' => $retailer_id,\n 'StoreId' => $store_id,\n 'SpecialId' => $special_id\n );\n\n $wishlist = $this->wishlistmodel->add_product_wishlist($data);\n\n if ($wishlist) {\n $retArr['status'] = SUCCESS;\n $retArr['wishlist_product_id'] = $wishlist;\n $this->response($retArr, 200); // 200 being the HTTP response code\n die;\n } else {\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Product already added to wishlist\";\n $this->response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n }",
"public function removewishList() {\n $sessionpatient = $this->Session->read('patient');\n if ((isset($this->request->data['wishlist_id'])) && (array_key_exists(\"wishlist_id\", $this->request->data))) {\n $resutl = $this->WishList->deleteAll(array('WishList.reward_id' => $this->request->data['wishlist_id'], 'WishList.user_id' => $sessionpatient['customer_info']['user']['id'], 'WishList.clinic_id' => $sessionpatient['clinic_id'], false));\n if ($resutl) {\n $options['fields'] = array('WishList.reward_id');\n $options['conditions'] = array('WishList.user_id' => $sessionpatient['customer_info']['user']['id'], 'WishList.clinic_id' => $sessionpatient['clinic_id']);\n $WishLists = $this->WishList->find('all', $options);\n\n $wishlist = array();\n foreach ($WishLists as $wl) {\n $wishlist[] = $wl['WishList']['reward_id'];\n }\n $wish = array();\n foreach ($sessionpatient['Reward'] as $reward) {\n if (in_array($reward['Reward']['id'], $wishlist)) {\n $wish[] = $reward;\n }\n }\n\n $xml = \"\";\n if (isset($sessionpatient['customer_info'])) {\n if ($sessionpatient['is_buzzydoc'] == 1) {\n $current_balance = $sessionpatient['customer_info']['user']['points'];\n } else {\n $current_balance = $sessionpatient['customer_info']['ClinicUser']['local_points'];\n }\n } else {\n $current_balance = '0';\n }\n\n foreach ($wish as $wishlist) {\n $xml .=\"<div style=\\\"position:relative;\\\" class=\\\"col-lg-4 col-md-4 col-sm-6 col-xs-6 profile clearfix\\\">\";\n $xml .=\"<div class=\\\"remove\\\" onclick=\\\"removeWishList(\" . $wishlist['Reward']['id'] . \")\\\">\";\n $xml .=\"<img src='\" . CDN . \"img/reward_imges/remove_btn.png' class='hand-icon'>\";\n $xml .=\"</div>\";\n\n $need_more = $wishlist['Reward']['points'] - $current_balance;\n if (intval($current_balance) >= intval($wishlist['Reward']['points'])) {\n if ($sessionpatient['is_mobile'] == 0) {\n $xml .=\"<div class=\\\"col-lg-4 col-md-4 col-sm-4 col-xs-12 productBoxSM l-margin box_wid\\\" >\";\n } else {\n $xml .=\"<div class=\\\"col-lg-4 col-md-4 col-sm-4 col-xs-12 productBoxSM l-margin\\\" >\";\n }\n } else {\n $xml .=\"<div class=\\\"col-lg-4 col-md-4 col-sm-4 col-xs-12 productBoxSM l-margin\\\">\";\n }\n\n $uploadFolder = \"rewards/\" . $sessionpatient['api_user'];\n $uploadPath = WWW_ROOT . 'img/' . $uploadFolder;\n\n if (strlen($wishlist['Reward']['description']) > 40) {\n $dis = substr($wishlist['Reward']['description'], 0, 40) . '...';\n } else {\n $dis = $wishlist['Reward']['description'];\n }\n $xml .=\"<p>\" . $dis . \"</p>\";\n\n\n $xml .=\"<img src='\" . $wishlist['Reward']['imagepath'] . \"' width=\\\"175\\\" height=\\\"117\\\">\";\n\n $xml .=\"<h3>\" . $wishlist['Reward']['points'] . \"points<br>\";\n\n if ($need_more > 0) {\n $xml .=\"<span>You need \" . $need_more . \" more points.</span>\";\n } else {\n if ($sessionpatient['is_mobile'] == 0) {\n $xml .=\"<span>Bravo! <a class=\\\"hand-icon\\\" onclick=\\\"lightbox(\" . $wishlist['Reward']['id'] . \");\\\">Click to redeem now</a></span>\";\n } else {\n $xml .=\"<span>Bravo! <a class=\\\"hand-icon\\\" onClick=\\\"document.reward_form_\" . $wishlist['Reward']['id'] . \".submit();\\\">Click to redeem now</a></span>\";\n }\n }\n $xml .=\"<span class=\\\"headTopCorner\\\"></span>\";\n $xml .=\"<span class=\\\"headrightcorner\\\"></span>\";\n $xml .=\"</h3>\";\n $xml .=\"</div>\";\n $xml .=\"</div>\";\n }\n if (count($wish) < 1) {\n\n $xml .=\"<div class=\\\"col-lg-12 settinproducBox l-margin no-item\\\">\";\n $xml .=\"<p>No items in wishlist</p>\";\n $xml .=\"</div>\";\n }\n\n echo $xml;\n exit;\n }\n }\n\n exit;\n }",
"public function Add_To_Wish_List()\n\t{\n\t\t$user_data\t=\t$this->session->userdata('user_id');\n\t\t$product_id\t=\t$_REQUEST['product_id'];\n\t\t\n\t\tif($user_data =='')\n\t\t{\t\t\t\n\t\t\t $this->session->set_userdata('user_wish_list',$product_id);\t\n\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"Please Login First\"));\n\t\t\t die();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$seller_id\t=\t_Product_SellerUserId(base64_decode($product_id));\n\t\t\tif($seller_id<>0){\n\t\t\t\tif($user_data!=$seller_id)\n\t\t\t\t{\n\t\t\t\t\tif($this->Product_model->AddWishList($product_id))\n\t\t\t\t\t{ \n\t\t\t\t\t\tprint json_encode(array(\"exists\"=>\"1\",\"message\"=>\"Product successfully Add to Your Dream Box.\"));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"All-Ready Added This product\")); \n\t\t\t\t\t}\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"You Can Only Add Other Seller Items In Your Dream Box.\")); \n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprint json_encode(array(\"exists\"=>\"0\" ,\"message\"=>\"Something Went Worng,Please Try After Some Time.\")); \n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
For each attachment information, create and save an App\Emails\Components\QuarantineEmailAttachment' instance in 'App\Collections\AttachmentCollection' | private final function setAttachmentsInformation(array $attachments) : void {
$this->attachments = new AttachmentCollection();
foreach ($attachments as $attachmentInformation) {
$attachment = new QuarantineEmailAttachment($attachmentInformation["name"], $attachmentInformation["type"],
$attachmentInformation["bytes"]);
$this->attachments->add($attachment);
}
} | [
"private function _save_attachment_listing()\n {\n // Data that will be stored\n $data = [];\n // Count of attachments, used to calculate metadata->score\n $count = count($this->attachments);\n\n foreach ($this->attachments as $identifier => $attachment) {\n if (!mgd_is_guid($attachment->guid)) {\n continue;\n }\n\n // Store score if is sortable and we have value\n if ( $this->sortable\n && isset($this->_sorted_list[$identifier])) {\n // Store the attachment score\n $attachment->metadata->score = $count - $this->_sorted_list[$identifier] + 1;\n }\n\n $data[] = \"{$identifier}:{$attachment->guid}\";\n }\n\n // We need to be selective when saving, excluding one case: empty list\n // with empty storage object. In that case we store nothing. If we have\n // an object, we set the parameter unconditionally, to get all deletions.\n if ($this->storage->object) {\n $this->storage->object->set_parameter('midcom.helper.datamanager2.type.blobs', \"guids_{$this->name}\", implode(',', $data));\n } elseif ($data) {\n debug_add('We were told to store attachment GUIDs, but no storage object was present. This should not happen, ignoring silently.',\n MIDCOM_LOG_WARN);\n debug_print_r('This data should have been stored:', $data);\n }\n }",
"private function setAttachments()\n {\n $attachments = $this->mailable->get('_attachments');\n\n if (!is_null($attachments)) {\n foreach ($attachments as $attachment) {\n if (in_array('name')) {\n $this->message->attach(Attachment::fromPath($attachment['file'])->setFilename($attachment['name']));\n } else {\n $this->message->attach(Attachment::fromPath($attachment['file']));\n }\n }\n }\n }",
"function __attachFiles() {\n\t\tforeach ($this->attachments as $attachment) {\n\t\t\t$files[] = $this->__findFiles($attachment);\n\t\t}\n\n\t\tforeach ($files as $file) {\n\t\t\t$handle = fopen($file, 'rb');\n\t\t\t$data = fread($handle, filesize($file));\n\t\t\t$data = chunk_split(base64_encode($data)) ;\n\t\t\t$filetype = trim(mime_content_type($file));\n\n\t\t\tif(empty($filetype)) {\n\t\t\t\tuser_error('Unable to get mimetype for e-mail attachment', E_USER_ERROR);\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->__message .= '--' . $this->__createBoundary() . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Type: ' . $filetype . '; name=\"' . basename($file) . '\"' . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Transfer-Encoding: base64' . $this->_newLine;\n\t\t\t$this->__message .= 'Content-Disposition: attachment; filename=\"' . basename($file) . '\"' . $this->_newLine . $this->_newLine;\n\t\t\t$this->__message .= $data . $this->_newLine . $this->_newLine;\n\t\t}\n\t}",
"private function set_attachments() {\n\t\t$args = array(\n\t\t\t'entry' => $this->entry,\n\t\t\t'email_key' => $this->email_key,\n\t\t);\n\n\t\t$this->attachments = apply_filters( 'frm_notification_attachment', array(), $this->form, $args );\n\t}",
"public function setAttachments()\n {\n foreach ($this->reports as $report) {\n $this->messageObject->attach(\n \\Swift_Attachment::fromPath(\n $report[AbstractReport::KEY_REPORT_PATH],\n $report[AbstractReport::KEY_REPORT_FILE_CONTENT_TYPE]\n )\n );\n }\n }",
"public function saveAttachments()\n\t{\n\t\t$userId = $this->getAccountOwner();\n\t\t$useTime = $this->get('date');\n\t\t$files = $this->get('files');\n\t\t$params = [\n\t\t\t'created_user_id' => $userId,\n\t\t\t'assigned_user_id' => $userId,\n\t\t\t'modifiedby' => $userId,\n\t\t\t'createdtime' => $useTime,\n\t\t\t'modifiedtime' => $useTime,\n\t\t\t'folderid' => 'T2',\n\t\t];\n\t\tif ($attachments = $this->get('attachments')) {\n\t\t\t$maxSize = \\App\\Config::getMaxUploadSize();\n\t\t\tforeach ($attachments as $attachment) {\n\t\t\t\tif ($maxSize < ($size = \\strlen($attachment['attachment']))) {\n\t\t\t\t\t\\App\\Log::error(\"Error - downloaded the file is too big '{$attachment['filename']}', size: {$size}, in mail: {$this->get('date')} | Folder: {$this->getFolder()} | ID: {$this->get('id')}\", __CLASS__);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$fileInstance = \\App\\Fields\\File::loadFromContent($attachment['attachment'], $attachment['filename'], ['validateAllCodeInjection' => true]);\n\t\t\t\tif ($fileInstance && $fileInstance->validateAndSecure() && ($id = App\\Fields\\File::saveFromContent($fileInstance, $params))) {\n\t\t\t\t\t$files[] = $id;\n\t\t\t\t} else {\n\t\t\t\t\t\\App\\Log::error(\"Error downloading the file '{$attachment['filename']}' in mail: {$this->get('date')} | Folder: {$this->getFolder()} | ID: {$this->get('id')}\", __CLASS__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$db = App\\Db::getInstance();\n\t\tforeach ($files as $file) {\n\t\t\t$db->createCommand()->insert('vtiger_ossmailview_files', [\n\t\t\t\t'ossmailviewid' => $this->mailCrmId,\n\t\t\t\t'documentsid' => $file['crmid'],\n\t\t\t\t'attachmentsid' => $file['attachmentsId'],\n\t\t\t])->execute();\n\t\t}\n\t\treturn $files;\n\t}",
"public function addAttachments()\n {\n $attachments_relations = [\n 'spots',\n 'plans',\n 'albumPhotos',\n 'areas',\n 'links'\n ];\n $this->addHidden($attachments_relations);\n $this->append('attachments');\n }",
"function saveAttachments($files, $assignment) {\n foreach ($files as $file) {\n $this->saveAttachment($file, $assignment);\n }\n }",
"private function requireAttachments () {\n // Attachments\n $this->tieInDatabase (new\n A (Array (static::$objAttachment)));\n }",
"function storeAttachments($imapMsg, $db, $params, $rowId)\n{\n $bSuccess = true;\n $pattern = '/^('.ATTACHMENT_FILE_EXT_REGEX.')$/';\n $uploadInbox = $params['uploadInbox'];\n\n // Load attachment data and save to database and local filesystem.\n\n // Prepare the SQL statement first, so it can be reused in the loop.\n $q = \"INSERT INTO nyss_inbox_attachments\n (email_id, file_name, file_full, size, mime_type, ext, rejection)\n VALUES (?, ?, ?, ?, ?, ?, ?)\";\n $sql_stmt = mysqli_prepare($db, $q);\n if ($sql_stmt === false) {\n bbscript_log(LL::ERROR, \"Unable to prepare SQL statement [$q]\");\n return false;\n }\n\n foreach ($imapMsg->fetchAttachments() as $attachment) {\n $fname = $attachment->name;\n $size = $attachment->size;\n $type = $attachment->type;\n $content = $attachment->data;\n $fileExt = substr(strrchr($fname, '.'), 1);\n $civiFilename = CRM_Utils_File::makeFileName($fname);\n $rej_reason = null;\n\n // Allow body type 3 (application) with certain file extensions,\n // and allow body types 4 (audio), 5 (image), 6 (video).\n if (($type == TYPEAPPLICATION && preg_match($pattern, $fileExt))\n || $type == TYPEAUDIO || $type == TYPEIMAGE || $type == TYPEVIDEO) {\n if ($size > MAX_ATTACHMENT_SIZE) {\n $rej_reason = \"File is larger than \".MAX_ATTACHMENT_SIZE.\" bytes\";\n }\n }\n else {\n $label = $imapMsg->getBodyTypeLabel($type);\n $rej_reason = \"File type [$label/$fileExt] not allowed\";\n }\n\n if ($rej_reason == null) {\n $fileFull = $uploadInbox.'/'.$civiFilename;\n bbscript_log(LL::INFO, \"Writing attachment data to $fileFull\");\n $fp = fopen(\"$fileFull\", \"w+\");\n fwrite($fp, $content);\n fclose($fp);\n bbscript_log(LL::DEBUG, \"Getting mime type of file $fileFull\");\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime = finfo_file($finfo, $fileFull);\n finfo_close($finfo);\n }\n else {\n $fileFull = '';\n $mime = '';\n }\n\n if (mysqli_stmt_bind_param($sql_stmt, 'ississs', $rowId, $fname, $fileFull,\n $size, $mime, $fileExt, $rej_reason) == false) {\n bbscript_log(LL::ERROR, \"Unable to bind params for attachment [$fname]\");\n $bSuccess = false;\n continue;\n }\n\n if (mysqli_stmt_execute($sql_stmt) == false) {\n bbscript_log(LL::ERROR, \"Unable to insert attachment [$fileFull] for msgid=$rowId\");\n $errorDetails = print_r(mysqli_stmt_error($sql_stmt), true);\n bbscript_log(LL::ERROR, \"<pre>{$errorDetails}</pre>\");\n $bSuccess = false;\n }\n }\n\n mysqli_stmt_close($sql_stmt);\n\n $q = \"SELECT id FROM nyss_inbox_attachments WHERE email_id=$rowId\";\n $res = mysqli_query($db, $q);\n $dbAttachmentCount = mysqli_num_rows($res);\n mysqli_free_result($res);\n\n if ($dbAttachmentCount > 0) {\n bbscript_log(LL::DEBUG, \"Inserted $dbAttachmentCount attachments\");\n }\n return $bSuccess;\n}",
"public function upload_attachments(Request $request){\n\n $attachments=[];\n\n \n if($request->file('attachments') && count($request->file('attachments'))){\n \n foreach ($request->file('attachments') as $key=>$file) {\n\n \n //upload new file\n $file_name = time().$key.'.'.$file->getClientOriginalName();\n\n $destinationPath = public_path('/uploads/message_attachments');\n \n $file->move($destinationPath, $file_name);\n $mime_type=$file->getClientMimeType();\n\n $file_type=Helper::get_file_type_by_mime_type($mime_type);\n\n $attachment=MessageAttachment::create([\n 'upload_unique_key'=>$request->upload_unique_key,\n 'file_name'=>$file_name,\n 'file_type'=>$file_type,\n ]);\n\n $attachments[]=$attachment;\n }\n }\n\n return response()->json($attachments);\n\n }",
"public function __construct()\n {\n $this->attachments = new ArrayCollection();\n }",
"private function addAttachments(Mime\\Message $body, array $attachments) : void\n {\n foreach ($attachments as $name => $attachmentPath) {\n $this->assertViableAttachment($name, $attachmentPath);\n $fileContent = fopen($attachmentPath, 'r');\n $attachment = new Mime\\Part($fileContent);\n $attachment->filename = $name;\n $attachment->type = $this->getMimeType($attachmentPath);\n $attachment->disposition = Mime\\Mime::DISPOSITION_ATTACHMENT;\n $attachment->encoding = Mime\\Mime::ENCODING_BASE64;\n $body->addPart($attachment);\n }\n }",
"private function _process_attachments($i)\n\t{\n\t\tif ($this->_boundary_section[$i]->headers['content-disposition'] === 'attachment' || $this->_boundary_section[$i]->headers['content-disposition'] === 'inline' || isset($this->_boundary_section[$i]->headers['content-id']))\n\t\t{\n\t\t\t// Get the attachments file name\n\t\t\tif (isset($this->_boundary_section[$i]->headers['x-parameters']['content-disposition']['filename']))\n\t\t\t{\n\t\t\t\t$file_name = $this->_boundary_section[$i]->headers['x-parameters']['content-disposition']['filename'];\n\t\t\t}\n\t\t\telseif (isset($this->_boundary_section[$i]->headers['x-parameters']['content-type']['name']))\n\t\t\t{\n\t\t\t\t$file_name = $this->_boundary_section[$i]->headers['x-parameters']['content-type']['name'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Load the attachment data\n\t\t\t$this->attachments[$file_name] = $this->_boundary_section[$i]->body;\n\n\t\t\t// Inline attachments are a bit more complicated.\n\t\t\tif (isset($this->_boundary_section[$i]->headers['content-id']) && $this->_boundary_section[$i]->headers['content-disposition'] === 'inline')\n\t\t\t{\n\t\t\t\t$this->inline_files[$file_name] = trim($this->_boundary_section[$i]->headers['content-id'], ' <>');\n\t\t\t}\n\t\t}\n\t}",
"public function attachment(){\n $app = JFactory::getApplication();\n if ($id = (int)$app->input->get('product_id')){\n $attachments = trim($app->input->get('arrayAttachments'), ',');\n $attachments = explode(',', $attachments);\n if (!JeproshopAttachmentModelAttachment::attachToProduct($id, $attachments))\n JError::raiseError(500, JText::_('An error occurred while saving product attachments.'));\n }\n }",
"private function addAttachments(IAttachments $parent, $bc_attachments_block) {\n\n if(is_foreachable($bc_attachments_block)) {\n foreach($bc_attachments_block as $bc_attachment) {\n //download attachment\n $path = $this->downloadAttachment($bc_attachment->url);\n\n $formated_attachments[] = array(\n 'path' => $path,\n 'filename' => $bc_attachment->name,\n 'type' => $bc_attachment->content_type,\n );\n } //foreach\n $parent->attachments()->attachFromArray($formated_attachments, true);\n\n //unlink tmp files\n if(is_foreachable($formated_attachments)) {\n foreach($formated_attachments as $attachment) {\n @unlink($attachment['path']);\n } //foreach\n } //if\n } //if\n }",
"public function saveAttachments($data, $model, $emptyPermission = false){\n foreach ($data as $valore){ \n $saved = false;\n\n $valore['model_type'] = get_class($model); \n $attachment = new Attachment($valore); \n $attachment->model()->associate($model);\n if (array_key_exists('filevalue',$valore) && $attachment->loadStream($valore['filevalue']) != null ){ \n $model->attachments()->save($attachment);\n $saved = true;\n }else{ \n if ($attachment->nrecord && $attachment->num_prot && $attachment->createLink($attachment->num_prot)){\n $model->attachments()->save($attachment);\n $saved = true;\n } else{\n if ($emptyPermission && $attachment->createEmptyFile()){\n $model->attachments()->save($attachment);\n $saved = true;\n } \n }\n }\n\n if (array_key_exists('id',$valore)){ \n $attach = Attachment::find($valore['id']);\n if ($saved){\n if ($attach)\n $attach->delete();\n }else{\n $attach->description = $valore['description'];\n $attach->save();\n }\n \n } \n \n }\n }",
"public function attachments(){\n// return $this->hasMany(ErpNET\\App\\Models\\Attachment::class);\n }",
"public function saveAttachments($data, $model, $emptyPermission = false){\n foreach ($data as $valore){ \n // $copy = false;\n // if (array_key_exists('id',$valore) && $valore['filename'] && !array_key_exists('filevalue',$valore)){\n // //va eseguita una lettura del file value\n // $attach = Attachment::find($valore['id']);\n // $valore['filevalue'] = base64_encode(Storage::get($attach->filepath)); \n // //sto eseguendo una copia \n // $copy=true;\n // } \n\n //nel caso in cui esiste il valore id \n //non c'è filename \n //implica che va rimosso \n $saved = false;\n $valore['model_type'] = get_class($model); \n $attachment = new Attachment($valore); \n $attachment->model()->associate($model);\n if (array_key_exists('filevalue',$valore) && $attachment->loadStream($valore['filevalue']) != null ){ \n $model->attachments()->save($attachment);\n $saved = true;\n }else{ \n if ($attachment->nrecord && $attachment->num_prot && $attachment->createLink($attachment->num_prot)){\n $model->attachments()->save($attachment);\n $saved = true;\n } else{\n if ($emptyPermission && $attachment->createEmptyFile()){\n $model->attachments()->save($attachment);\n $saved = true;\n } \n }\n }\n\n if (array_key_exists('id',$valore) && $saved && $valore['id']){ \n Attachment::find($valore['id'])->delete();\n } \n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
206: Partial content. Useful when you have to return a paginated list of resources. | public function PartialContent($data){
return $this->Content($data, HttpStatusCodes::PARTIAL_CONTENT);
} | [
"protected function partialContent(int $rangeFrom, int $rangeTo, int $totalSize): static\n {\n return $this\n ->status(206)\n ->header('Content-Range', \"bytes {$rangeFrom}-{$rangeTo}/{$totalSize}\")\n ->header('Content-Length', $rangeTo - $rangeFrom);\n }",
"abstract function getRemainingContent();",
"protected function rest_head()\n {\n // Should be Implemented in Resource\n return NULL;\n }",
"public function getPartialResponses()\n {\n return $this->partial_responses;\n }",
"protected function _setContent() {\n\t\tif (in_array($this->_status, array(304, 204))) {\n\t\t\t$this->body('');\n\t\t}\n\t}",
"public function noContent()\n {\n return \\response()->noContent();\n }",
"protected function head()\n {\n // The default function calls the instance's get() method, then sets\n // the resonse's body member to an empty string.\n\n $this->get();\n\n if ($this->response->getStatusCode() == 200) {\n $this->response->setBody('', false);\n }\n }",
"public function getPaginationPartial()\n\t{\n\t\treturn $this->paginationPartial;\n\t}",
"public function noContent()\n {\n return response()->noContent();\n }",
"private function fetchContents()\n {\n return $this->response->getBody()->getContents();\n }",
"protected function respondNoContent()\n {\n return $this->respond(null, Response::HTTP_NO_CONTENT);\n }",
"protected function updateRange() {\n $req = explode('=', $this->getRequest()->range);\n $ranges = explode(',', $req[1]);\n $ranges = explode('-', $ranges[0]);\n\n $fileSize = $this->_file->getSize();\n\n $start = (int) $ranges[0];\n $stop = (int) ($ranges[1] == '' ? $fileSize - 1 : $ranges[1]);\n\n $this->_downloadSize = $stop - $start + 1;\n $this->_downloadStart = $start;\n $downloadRange = \"bytes {$start}-{$stop}/{$fileSize}\";\n\n $this->setStatus(HttpStatus::PartialContent);\n $this->addHeader('Content-Range', $downloadRange);\n }",
"public function renderRichResponseItem()\n {\n }",
"function getExtendedContent($params) {\n if (!is_array($params)) $params = array('id' => $params);\n $path_chunks = array('assets', $params['id'], 'extended-content');\n $query_params = array();\n if (array_key_exists('limit', $params)) $query_params['max-results'] = $params['limit'];\n if (array_key_exists('offset', $params)) $query_params['start-index'] = $params['offset'] + 1;\n return $this->typepad->get($path_chunks, $query_params, 'AssetExtendedContent');\n }",
"private function adjustPrerequisites()\n {\n $size = $this->fileSize;\n\n // disable output buffering\n @ob_end_clean();\n // disable execution time limit\n set_time_limit(0);\n // required for IE, otherwise Content-Disposition may be ignored\n if (ini_get('zlib.output_compression')) ini_set('zlib.output_compression', 'Off');\n if (!$this->isFetch) {\n\n HelperHeader::contentType($this->mimeType, $this->charset);\n HelperHeader::contentDisposition($this->filename, $this->isAttachment);\n HelperHeader::contentTransferEncoding($this->transferEncoding);\n HelperHeader::acceptRanges('bytes');\n // clear cache\n HelperHeader::cacheControl('private');\n HelperHeader::pragma('private');\n HelperHeader::expires('0');\n }\n\n // multipart-download and download resuming support\n if (isset($_SERVER[\"HTTP_RANGE\"]) && $this->isMultiThreaded) {\n list($size_unit, $range) = explode(\"=\", $_SERVER[\"HTTP_RANGE\"], 2);\n if ($size_unit == 'bytes') {\n list($range) = explode(\",\", $range, 2);\n list($range_start, $range_end) = explode(\"-\", $range);\n $range_start = round(floatval($range_start), 0);\n if (!$range_end) $range_end = $size - 1;\n else $range_end = round(floatval($range_end), 0);\n $partial_length = $range_end - $range_start + 1;\n if (!$this->isFetch) {\n HelperHeader::generateStatusCodeHTTP('206 Partial Content');\n HelperHeader::contentRange('bytes', $range_start . '-' . $range_end, $size);\n }\n $this->mtOffset = $range_start;\n } else {\n $partial_length = $size;\n }\n } else {\n $partial_length = $size;\n }\n\n if (!$this->isFetch) {\n HelperHeader::contentLength($partial_length);\n }\n\n $this->partial_length = $partial_length;\n }",
"public function renderRichResponseItem();",
"protected function preparePaginatedResponse($request) {\n if ($this->preserveAllQueryParameters) {\n $this->resource->appends($request->query());\n } elseif (! is_null($this->queryParameters)) {\n $this->resource->appends($this->queryParameters);\n }\n\n return (new HeaderPaginateResourceResponse($this))->toResponse($request);\n }",
"public function test_partials_route_non_xmlhttprequest() {\n $this->_app['debug'] = false;\n $client = new Client($this->_app);\n $client->request('GET', '/partials/directives/wordBlockListItem.twig', array(), array(), array(\n // empty\n ));\n }",
"function wpts_no_content_limit() {\n\treturn '200';\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Unschedule job for fetching counts. | static function sharedcount_deactivate() {
wp_clear_scheduled_hook( 'sharedcount_fetch_counts' );
} | [
"public function resetJobCount()\n {\n $this->jobCount = 0;\n }",
"public static function unschedule_job_pruning() {\n\t\twp_clear_scheduled_hook( 'jobswp_scheduled_job_pruning' );\n\t}",
"public function scheduleClear() {\n $job = array(\n 'type' => $this->id,\n 'id' => $this->feed_nid,\n 'period' => 0,\n 'periodic' => TRUE,\n );\n // Remove job if batch is complete.\n if ($this->progressClearing() === FEEDS_BATCH_COMPLETE) {\n JobScheduler::get('feeds_source_clear')->remove($job);\n }\n // Schedule as soon as possible if batch is not complete.\n else {\n JobScheduler::get('feeds_source_clear')->set($job);\n }\n }",
"public function clearUnPublishJob()\n {\n // Cancel any in-progress unpublish job\n $job = $this->owner->UnPublishJob();\n if ($job && $job->exists()) {\n $job->delete();\n }\n $this->owner->UnPublishJobID = 0;\n }",
"function unschedule() {\n\t\t$this->as3cf->clear_scheduled_event( $this->cron_hook );\n\t}",
"function unschedule() {\n return $this->post_request($this->_campaigns_base_route.'unschedule.json', NULL);\n }",
"public function unsnoozeJob(int $jobId): void;",
"public function unpublishTask()\n\t{\n\t\t$this->stateTask(0);\n\t}",
"public function unsetScheduler() {}",
"public static function clear_cached_counts()\n {\n \\delete_transient(self::TRANSIENT_KEY_ERROR_INDEX_COUNTS);\n }",
"public function clear() {\n DelayedJobs::remove();\n }",
"public function shutdown() {\n\t\tif ($this->recordStats) {\n\t\t\tif ($this->hits) {\n\t\t\t\t$curr = $this->get(self::HIT_KEY);\n\t\t\t\t$curr += $this->hits; // don't count the hit on hit_key!\n\t\t\t\t$this->store(self::HIT_KEY, $curr);\n\t\t\t}\n\n\t\t\tif ($this->misses) {\n\t\t\t\t$curr = $this->get(self::MISS_KEY);\n\t\t\t\t$curr += $this->misses;\n\t\t\t\t$this->store(self::MISS_KEY, $curr);\n\t\t\t}\n\t\t}\n\t}",
"private function scheduleForUnindexation($entity)\n {\n $entityHash = spl_object_hash($entity);\n if ($this->isManaged($entity) && !isset($this->scheduledUnindexations[$entityHash])) {\n $this->scheduledUnindexations[$entityHash] = $entity;\n }\n }",
"public function deletePendingJobs(){\n\t\tMage::getModel('customweb_subscription/schedule')->getResource()->deleteBySubscription($this->getSubscription()->getId());\n\t}",
"public static function unschedule_cron() {\n\t\t$timestamp = wp_next_scheduled( 'smush_update_cdn_stats' );\n\t\twp_unschedule_event( $timestamp, 'smush_update_cdn_stats' );\n\t}",
"static function resetCounter() {\n $db = parent::connect();\n $query = \"UPDATE Ads set counter = 0\";\n $result = mysqli_query($db, $query);\n }",
"public function fetch_counts() {\n\t\tif ( WPSEO_GSC_Settings::get_profile() && $this->get_last_fetch() <= strtotime( '-12 hours' ) ) {\n\t\t\t// Remove the timestamp.\n\t\t\t$this->remove_last_fetch();\n\n\t\t\t// Getting the counts and parse them.\n\t\t\t$counts = $this->parse_counts( $this->service->get_crawl_issue_counts() );\n\n\t\t\t// Fetching the counts by setting an option.\n\t\t\t$this->set_counts( $counts );\n\n\t\t\t// Saving the current timestamp.\n\t\t\t$this->save_last_fetch();\n\t\t}\n\t}",
"private function resetCounts(): void\n {\n $this->connection->executeUpdate('UPDATE `promotion` SET `order_count` = 0, `orders_per_customer_count` = NULL');\n }",
"public static function clear_cached_counts() {\n\t\tdelete_transient( self::TRANSIENT_KEY_ERROR_INDEX_COUNTS );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Allow for custom template names by preprocessing template wrangler suggestions | function _tw_pre_process_template($tw_template){
if ($tw_template['name'] == "ww_widget" && !empty($tw_template['arguments']['widget']->custom_template_suggestion)){
// make this suggestion the first
array_unshift($tw_template['files'], 'widget-[custom_template_suggestion].php');
$tw_template['arguments']['custom_template_suggestion'] = $tw_template['arguments']['widget']->custom_template_suggestion;
}
return $tw_template;
} | [
"abstract public function templateName();",
"function _fix_template_name($template = '') \r\n {\r\n\r\n $template = ($template == '') ? $this->default_template : $template;\r\n \r\n $ext = pathinfo($template, PATHINFO_EXTENSION);\r\n \r\n $template = ($ext == '') ? $template.$this->default_ext : $template;\r\n \r\n return $template;\r\n \r\n }",
"function get_template_names() {\n\treturn array(\n\t\t'upcoming-renewal',\n\t\t'thanks-one-time-donation',\n\t\t'thanks-recurring-donation',\n\t);\n}",
"function site_create_custom_templating( $template ) {\n\n $title = false;\n \n if( is_post_type_archive() ) :\n \n $post_type = get_post_type(); \n $post_type_obj = get_post_type_object( $post_type ); \n \n $protected = bc_get_protected_name_query_obj( $post_type_obj->labels->name, 'page' );\n \n if( false != $protected ) :\n $title = get_field( 'protected_name', $protected->post->ID );\n endif;\n \n elseif( is_home() ) :\n \n $page_for_posts_id = get_option('page_for_posts' );\n $title = get_field( 'protected_name', $page_for_posts_id );\n \n elseif( is_singular() ) :\n \n $title = get_field( 'protected_name' );\n \n endif;\n \n \n if( false != $title ) : \n \n $new_template = locate_template( array( 'templates/custom-pages/'.sanitize_title($title).'.php' ) );\n \n if ( false != $new_template ) :\n return $new_template ;\n endif;\n \n endif;\n \n return $template;\n}",
"function custom($tag_name, $replacement) {\r\n\t\t$regex = '#([<]!--%'.$tag_name.'%--[>])#';\r\n\t\t$this->template = preg_replace($regex,$replacement,$this->template);\r\n\t}",
"function mymodule_foo_bar_phptemplate() {\n\n}",
"public function inject_autocomplete_templates() {\n\n\t\t$templates = array(\n\t\t\t'header' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-header.php',\n\t\t\t'post-suggestion' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-post-suggestion.php',\n\t\t\t'term-suggestion' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-term-suggestion.php',\n\t\t\t'user-suggestion' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-user-suggestion.php',\n\t\t\t'footer' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-footer.php',\n\t\t\t'empty' => plugin_dir_path( __FILE__ ) . 'partials/algolia-autocomplete-empty.php',\n\t\t);\n\n\t\t$templates = (array) apply_filters( 'algolia_autocomplete_templates', $templates );\n\n\t\tforeach ( $templates as $name => $file ) {\n\t\t\trequire_once $file;\n\t\t}\n\t}",
"function getTemplateNameCompiled()\r\n\t{\r\n\t\treturn( $this->getTemplateName() . '.cxsl' );\r\n\t}",
"public function getTemplate($name);",
"public function getTemplateName() {\n\t\treturn 'uitypes/String.tpl';\n\t}",
"function hook_extension() {\n // Extension for template base names in Twig.\n return '.html.twig';\n}",
"static private function template_name($form_name)\n\t{\n\t\t$parts = explode('[',str_replace(']','',$form_name));\n\n\t\tarray_shift($parts);\t// remove exec\n\n\t\t$name = array_shift($parts);\n\n\t\tif ($parts) $name .= '['.implode('][',$parts).']';\n\n\t\treturn $name;\n\t}",
"public function get_template_filename();",
"public function setTemplateName($templateName);",
"function beaver_extender_get_custom_template_paths( $template_file_name, $template_type ) {\r\n \r\n if ( $template_type == 'page_template' )\r\n return FL_CHILD_THEME_DIR . '/my-templates/' . $template_file_name . '.php';\r\n else\r\n return FL_CHILD_THEME_DIR . '/' . $template_file_name . '.php';\r\n \r\n}",
"private function templates() {\n\t\t\t\n\t\t\t$templates = array();\n\t\t\t\n\t\t\t//preg_match_all(\"#(\". preg_quote(\"{{\", \"#\") .\")(.*?)(\". preg_quote(\"}}\", \"#\") .\")#si\", $this->text, $matches);\n\t\t\t$text_templates = $this->_find_sub_templates($this->text);\n\t\t\t\n\t\t\tforeach($text_templates[0] as $text_template) {\n\t\t\t\tpreg_match(\"#^\\{\\{([^\\|]+)(.*?)\\}\\}$#si\", $text_template, $match);\n\t\t\t\t\n\t\t\t\t$template_name = trim($match[1]); // wikisyntax is very case sensitive, so don't use strtolower or similar\n\t\t\t\t\n\t\t\t\tif(!empty($this->options['ignore_template_matches'])) {\n\t\t\t\t\tforeach($this->options['ignore_template_matches'] as $ignore_template_match_regex) {\n\t\t\t\t\t\tif(preg_match($ignore_template_match_regex, $template_name)) {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$template_attributes = trim(ltrim(trim($match[2]), \"|\")); // remove trailing spaces and starting pipe\n\t\t\t\t\n\t\t\t\t$template = array(\n\t\t\t\t\t 'original'\t\t=> $text_template\n\t\t\t\t\t,'template'\t\t=> $template_name\n\t\t\t\t\t,'attributes'\t=> false\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif(strlen($template_attributes) > 0) {\n\t\t\t\t\t$template['attributes']\t= $template_attributes;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//$sub_templates = $this->_find_sub_templates($template['original']); // eventually...\n\t\t\t\t\n\t\t\t\t$templates[] = $template;\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($templates)) {\n\t\t\t\t$this->cargo['templates'] = $templates;\n\t\t\t}\n\t\t}",
"public static function template()\n\t{\n $called_class = get_called_class();\n if ($called_class::$_template !== null) return $called_class::$_template;\n return $called_class::$_template = strtolower(str_replace(array('Model_', '_', '\\\\'), array('', '/', '/'), $called_class)).'.twig';\n\t}",
"function gantry_get_template_page_filter($template)\n{\n\tif (defined('NONGANTRY_TEMPLATE')) return $template;\n\t/** @global $gantry Gantry */\n\tglobal $gantry;\n\t$newtemplate = $template;\n\t$gantry->addTemp('template', 'page_name', $newtemplate);\n\treturn $template;\n}",
"function custom_templates( $templates ) {\n $templates[] = array (\n 'id' => 'custom',\n 'name' => 'Custom template',\n 'path' => get_stylesheet_directory() . '/' . 'wpsl-templates/custom.php',\n );\n\n return $templates;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a Skin object containing information about this human's skin. | public function getSkin() : Skin{
return $this->skin;
} | [
"public function getSkin()\n {\n return $this->skin;\n }",
"public function getSkin();",
"public function getSkin() {\n\t\tif ( empty( $this->skin ) ) {\n\t\t\t$this->setSkin();\n\t\t}\n\t\t\n\t\treturn $this->skin;\n\t}",
"public function getUserSkin()\n {\n $name = $this->getUserSkinName();\n assert(isset($this->skins[$name]));\n return $this->skins[$name];\n }",
"public function getSkin()\n\t{\n\t\treturn new Application_Model_PlayerSkin($this->_username);\n\t}",
"private function skin() {\n\t\tif ( function_exists( 'wpex_active_skin' ) ) {\n\t\t\treturn wpex_active_skin();\n\t\t}\n\t}",
"public function skin($username)\n {\n return $this->get('skin/' . $username);\n }",
"public function getSkin(): \\Yana\\Views\\Skins\\IsSkin;",
"public static function getSteveSkin();",
"function get_skin($skin_id)\r\n {\r\n\r\n $obj_skin = new mysql_record(constant(\"table_prefix\"), 'skins', \"WHERE skin_id = '\" . $skin_id . \"'\");\r\n\r\n if ($obj_skin->fields['skin_id'] == \"\")\r\n return null;\r\n\r\n return $obj_skin;\r\n }",
"public function getSkinColor()\n {\n return $this->skinColor;\n }",
"public function getSkins()\n {\n return $this->skins;\n }",
"public function getSkinLabel() {\n\t\treturn ucfirst( $this->skinName );\n\t}",
"public function getSkinLabel() {\n\t\treturn ucfirst($this->skinName);\n\t}",
"function getskin($idskin){\n $query = $this->db->prepare(\"SELECT * FROM skin WHERE id = ?\");\n $query->execute([$idskin]);\n $skin = $query->fetch(PDO::FETCH_OBJ);\n return $skin;\n }",
"public static function active_skin() {\n\n\t\t\t// Get skin from Customizer setting\n\t\t\t$skin = athen_get_mod( 'lightbox_skin', 'minimal' );\n\n\t\t\t// Sanitize\n\t\t\t$skin = $skin ? $skin : 'minimal';\n\t\t\t\t\n\t\t\t// Apply filters\n\t\t\t$skin = apply_filters( 'athen_lightbox_skin', $skin );\n\n\t\t\t// Return\n\t\t\treturn $skin;\n\n\t\t}",
"public function getSkinUrl() {\n return \"http://skinsystem.ely.by/skins/{$this->getUsername()}.png\";\n }",
"public function __toString() {\n\t\treturn $this->skinName;\n\t}",
"public function get_first_skin() {\n\n\t\t\t$skins = tm_wizard_settings()->get( array( 'skins', 'advanced' ) );\n\n\t\t\tif ( ! is_array( $skins ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$skins = array_slice( $skins, 0, 1 );\n\n\t\t\tif ( empty( $skins ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$keys = array_keys( $skins );\n\t\t\t$data = array_values( $skins );\n\n\t\t\treturn array(\n\t\t\t\t'skin' => $keys[0],\n\t\t\t\t'data' => $data[0],\n\t\t\t);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads the extra questions and values for the listing into the $listing>e_extra_questions var for use in the question tags. | private static function _loadExtraQuestions ($listing)
{
if ($listing->e_extra_questions!==null) {
//already retrieved...
return;
}
$session_variables = self::$_session_vars;
if ($session_variables && isset($session_variables['question_value'])) {
$db = DataAccess::getInstance();
$language_id = geoSession::getInstance()->getLanguage();
$questions = array();
//use passed in array
$values = $session_variables['question_value'];
$other = $session_variables['question_value_other'];
$sql = $db->Prepare("SELECT `name`, `choices` FROM ".geoTables::questions_languages." WHERE `question_id`=? AND `language_id` = ?");
foreach ($values as $key => $val) {
if (strlen(trim($val)) == 0 && !(isset($other[$key]) && strlen(trim($other[$key])))) {
continue;
}
$show_special = $db->GetRow($sql, array($key, $language_id));
if ($show_special['choices'] == 'check') {
//this is a checkbox
continue;
}
$row = array();
$row['question'] = geoString::fromDB($show_special["name"]);
if (strlen(trim($other[$key]))) {
//"other" box in use -- replace value
$row['value'] = $other[$key];
} else {
$row['value'] = geoString::fromDB($val);
}
$row['link'] = false;
if ($show_special['choices'] == 'url') {
$href = $row['value'];
if (strpos($href, "://") === false && strpos($href, "mailto:") === false) {
//add http:// if there's no protocol given
$href = 'http://' . $href;
}
$row['link'] = $href;
} else if ($show_special['choices']=='date') {
//format it for date
$row['value'] = geoCalendar::display($row['value']);
}
$questions[$key] = $row;
}
$listing->e_extra_questions = $questions;
} else {
//let geoListing class populate it from the database
geoListing::getExtraQuestions($listing->id);
}
} | [
"public static function extra_question_name (geoListing $listing, $params, Smarty_Internal_Template $smarty)\r\n\t{\r\n\t\tself::_loadExtraQuestions($listing);\n\t\t\n\t\t$extra_questions = $listing->e_extra_questions;\n\t\t\n\t\tif (!$extra_questions) {\n\t\t\t//nothing here to show!\n\t\t\treturn;\n\t\t}\n\t\t//expecting to be in format questions => .., values => ...\n\t\t$tpl_vars = array();\n\t\tforeach ($extra_questions as $question_id => $info) {\n\t\t\t$tpl_vars['questions'][] = $info['question'];\n\t\t\t$tpl_vars['answers'][] = $info;\n\t\t}\n\t\t\r\n\t\treturn geoTemplate::loadInternalTemplate($params, $smarty, 'extra_question_name.tpl',\r\n\t\t\t\tgeoTemplate::SYSTEM, 'listing_details', $tpl_vars);\r\n\t}",
"protected function load_extra_data() : void {\n global $DB;\n\n $questionusageids = [];\n foreach ($this->rawdata as $attempt) {\n if (!response_export::is_qtype_has_response_contain_file($attempt->questiontype)) {\n continue;\n }\n\n if ($attempt->questionusageid > 0) {\n $questionusageids[] = $attempt->questionusageid;\n }\n }\n\n if (empty($questionusageids)) {\n return;\n }\n\n list($areasql, $areaparam) = $DB->get_in_or_equal(utils::get_qtype_fileareas());\n list($questionusageidsql, $questionusageidparam) = $DB->get_in_or_equal($questionusageids);\n $sql = \"SELECT DISTINCT qa.questionusageid\n FROM {question_attempts} as qa\n JOIN {question_attempt_steps} qas ON qas.questionattemptid = qa.id\n AND qas.sequencenumber = (\n SELECT MAX(sequencenumber)\n FROM {question_attempt_steps} qas1\n LEFT JOIN {question_attempt_step_data} qasd ON qasd.attemptstepid = qas1.id\n AND qasd.name $areasql\n WHERE questionattemptid = qas.questionattemptid and qasd.id IS NOT NULL\n )\n LEFT JOIN {files} f ON f.component = 'question'\n AND f.itemid = qas.id\n AND f.filename <> '.'\n WHERE qa.questionusageid $questionusageidsql AND f.filename IS NOT NULL\";\n $this->questionusagehasattachmentids = $DB->get_records_sql($sql, array_merge($areaparam, $questionusageidparam));\n }",
"public function extra_question_fields()\n {\n return array('question_usercode', 'init_code', 'grading_code', 'blacklist', 'whitelist', 'requirelist', 'system', 'breakpoints', 'runlimit');\n }",
"abstract protected function extra_question_properties();",
"public function extra_question_fields() {\n return array();\n }",
"public function getValuesForAdd()\n {\n $extraFields = $this->getSettings();\n\n foreach ($extraFields as $index => $data)\n {\n switch ($data['extraFieldType'])\n {\n case EXTRA_FIELD_CHECKBOX:\n $extraFields[$index]['addHTML'] = '\n <input type=\"checkbox\" class=\"inputbox\" id=\"extraFieldCB'.$index.'\" name=\"extraFieldCB'.$index.'\" onclick=\"if (this.checked) {document.getElementById(\\'extraField'.$index.'\\').value=\\'Yes\\';} else {document.getElementById(\\'extraField'.$index.'\\').value=\\'No\\';}\" />\n <input type=\"hidden\" id=\"extraField'.$index.'\" name=\"extraField'.$index.'\" />\n ';\n break;\n\n case EXTRA_FIELD_TEXTAREA:\n $extraFields[$index]['addHTML'] = '\n <textarea id=\"extraField'.$index.'\" class=\"inputbox\" name=\"extraField'.$index.'\" style=\"width: 150px;\" ></textarea>\n ';\n $extraFields[$index]['careersAddHTML'] = '\n <textarea id=\"extraField'.$index.'\" class=\"inputBoxArea\" name=\"extraField'.$index.'\"></textarea>\n ';\n break;\n\n case EXTRA_FIELD_DROPDOWN:\n $extraFields[$index]['addHTML'] = '\n <select id=\"extraField'.$index.'\" class=\"selectBox\" name=\"extraField'.$index.'\" style=\"width: 150px;\">\n <option value=\"\" selected>- Select from List -</option>\n ';\n $extraFields[$index]['careersAddHTML'] = '\n <select id=\"extraField'.$index.'\" class=\"inputBoxNormal\" name=\"extraField'.$index.'\">\n <option value=\"\" selected>- Select from List -</option>\n ';\n\n $options = explode(',', $data['extraFieldOptions']);\n\n foreach($options as $option)\n {\n if ($option != '')\n {\n $extraFields[$index]['addHTML'] .= '<option value=\"'.htmlspecialchars(urldecode($option)).'\">'.htmlspecialchars(urldecode($option)).'</option>';\n $extraFields[$index]['careersAddHTML'] .= '<option value=\"'.htmlspecialchars(urldecode($option)).'\">'.htmlspecialchars(urldecode($option)).'</option>';\n }\n }\n\n $extraFields[$index]['addHTML'] .= '</select>';\n $extraFields[$index]['careersAddHTML'] .= '</select>';\n break;\n\n case EXTRA_FIELD_RADIO:\n $options = explode(',', $data['extraFieldOptions']);\n\n $extraFields[$index]['addHTML'] ='';\n\n foreach($options as $option)\n {\n if ($option != '')\n {\n $extraFields[$index]['addHTML'] .= '<input type=\"radio\" name=\"extraField'.$index.'\" value=\"'.htmlspecialchars(urldecode($option)).'\">'.htmlspecialchars(urldecode($option)).'<br \\>';\n }\n }\n break;\n\n case EXTRA_FIELD_DATE:\n $extraFields[$index]['addHTML'] = '<script type=\"text/javascript\">DateInput(\\'extraField'.$index.'\\', false, \\'MM-DD-YY\\', \\'\\');</script>';\n break;\n\n case EXTRA_FIELD_TEXT:\n default:\n $extraFields[$index]['addHTML'] = '\n <input id=\"extraField'.$index.'\" class=\"inputbox\" name=\"extraField'.$index.'\" style=\"width: 150px;\" />\n ';\n $extraFields[$index]['careersAddHTML'] = '\n <input id=\"extraField'.$index.'\" class=\"inputBoxNormal\" name=\"extraField'.$index.'\"/>\n ';\n break;\n }\n }\n\n return $extraFields;\n }",
"function load_podcast_questions() {\n\t\tglobal $I2_SQL;\n\n\t\t$qs = $I2_SQL->query('SELECT qid FROM podcast_questions WHERE '.\n\t\t\t'pid=%d',$this->pid)->fetch_all_single_values();\n\t\tforeach ($qs as $q) {\n\t\t\t$this->qs[$q] = new PodcastQuestion($this->pid, $q);\n\t\t}\n\t }",
"private function configureFrontendExtras(): void\n {\n $this->faqBlockId = $this->insertExtra($this->getModule(), ModuleExtraType::block(), $this->getModule());\n $this->insertExtra($this->getModule(), ModuleExtraType::widget(), 'MostReadQuestions', 'MostReadQuestions');\n $this->insertExtra($this->getModule(), ModuleExtraType::widget(), 'AskOwnQuestion', 'AskOwnQuestion');\n $this->insertExtra($this->getModule(), ModuleExtraType::widget(), 'Categories', 'Categories');\n }",
"private function extraFields() {\n return [\n [\n \"feed_key\" => \"enclosure\",\n \"fapi_key\" => \"enclosure_url\",\n \"fapi_title\" => \"mp3 url\",\n \"fapi_description\" => \"absolute url to mp3 file\",\n ],\n [\n \"feed_key\" => \"enclosure_size\",\n \"fapi_key\" => \"enclosure_size\",\n \"fapi_title\" => \"mp3 file size\",\n \"fapi_description\" => \"An unformatted integer\",\n ],\n [\n \"feed_key\" => \"enclosure_type\",\n \"fapi_key\" => \"enclosure_type\",\n \"fapi_title\" => \"mp3 file type\",\n \"fapi_description\" => \"Mime type\",\n ],\n [\n \"feed_key\" => \"itunes:author\",\n \"fapi_key\" => \"itunes_author\",\n \"fapi_title\" => \"Itunes author duration\",\n \"fapi_description\" => \"text to appear in itunes:author\",\n ],\n [\n \"feed_key\" => \"itunes:image\",\n \"fapi_key\" => \"image_field\",\n \"fapi_title\" => \"Itunes image\",\n \"fapi_description\" => \"Absolute url for image\",\n ],\n [\n \"feed_key\" => \"itunes:explicit\",\n \"fapi_key\" => \"explicit_field\",\n \"fapi_title\" => \"Itunes explicit\",\n \"fapi_description\" => \"yes or no\",\n ],\n [\n \"feed_key\" => \"itunes:duration\",\n \"fapi_key\" => \"duration_field\",\n \"fapi_title\" => \"Itunes item duration\",\n \"fapi_description\" => \"The number of seconds in the mp3\",\n ],\n [\n \"feed_key\" => \"itunes:summary\",\n \"fapi_key\" => \"summary_field\",\n \"fapi_title\" => \"Itunes item summary\",\n \"fapi_description\" => \"The description of the item\",\n ],\n ];\n }",
"public function hookListingDetailsBeforeMetaData()\n {\n global $lang, $cat_bread_crumbs, $listing_data, $rlListingTypes;\n\n $this->prepareListingLocationData();\n\n $meta = array('meta_description', 'meta_keywords', 'meta_title');\n foreach ($meta as $area) {\n $pattern_found = false;\n\n foreach (array_reverse($cat_bread_crumbs) as $category) {\n if ($lang['categories+listing_' . $area . '+' . $category['Key']]) {\n $this->adaptLocString($lang['categories+listing_' . $area . '+' . $category['Key']]);\n $pattern_found = true;\n break;\n }\n }\n }\n\n // Search in general category\n if (!$pattern_found && $general_id = $rlListingTypes->types[$listing_data['Cat_type']]['Cat_general_cat']) {\n $general_key = $GLOBALS['rlDb']->getOne('Key', \"`ID` = {$general_id}\", 'categories');\n\n foreach ($meta as $area) {\n if ($lang['categories+listing_' . $area . '+' . $general_key]) {\n $this->adaptLocString($lang['categories+listing_' . $area . '+' . $general_key]);\n }\n }\n }\n }",
"function display_additional_meta_data(){}",
"public static function geoCart_initSteps_addOtherDetails()\n {\n //normally we'd check with the children on this one, but\n //listing edit is designed to NOT use other details, so not\n //going to.\n return false;\n }",
"private function customizeExtraFields()\r\n {\r\n if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO)\r\n {\r\n CommonErrors::fatal(COMMONERROR_PERMISSION, $this);\r\n return;\r\n //$this->fatal(ERROR_NO_PERMISSION);\r\n }\r\n\r\n $candidates = new Candidates($this->_siteID);\r\n $candidatesRS = $candidates->extraFields->getSettings();\r\n\r\n $contacts = new Contacts($this->_siteID);\r\n $contactsRS = $contacts->extraFields->getSettings();\r\n\r\n $companies = new Companies($this->_siteID);\r\n $companiesRS = $companies->extraFields->getSettings();\r\n\r\n $jobOrders = new JobOrders($this->_siteID);\r\n $jobOrdersRS = $jobOrders->extraFields->getSettings();\r\n\r\n $extraFieldTypes = $candidates->extraFields->getValuesTypes();\r\n\r\n $this->_template->assign('extraFieldSettingsCandidatesRS', $candidatesRS);\r\n $this->_template->assign('extraFieldSettingsContactsRS', $contactsRS);\r\n $this->_template->assign('extraFieldSettingsCompaniesRS', $companiesRS);\r\n $this->_template->assign('extraFieldSettingsJobOrdersRS', $jobOrdersRS);\r\n $this->_template->assign('extraFieldTypes', $extraFieldTypes);\r\n $this->_template->assign('active', $this);\r\n $this->_template->display('./modules/settings/CustomizeExtraFields.tpl');\r\n }",
"public function populate() {\n\t\t$quiz = $this->quizesModel->getRandomQuiz();\n\t\t$this->id = $quiz['id'];\n\t\t$this->description = $quiz['description'];\n\t\t$questions = $this->quizQuestionsModel->getRecordsByKeys(array('quizId'=>$quiz['id']));\n\t\tif(is_array($questions)) {\n\t\t\tshuffle($questions);\n\t\t\tforeach (array_reverse($questions) as $question) {\n\t\t\t\t$answers = $this->quizAnswersModel->getRecordsByKeys(array('questionId'=>$question['id']));\n\t\t\t\tif(is_array($answers)) {\n\t\t\t\t\tshuffle($answers);\n\t\t\t\t\t$quizQuestion = new MowattMedia_Components_QuizQuestion($question['id'], ucwords($question['question']), $answers);\n\t\t\t\t\t$this->available[$question['id']] = $quizQuestion;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->totalQuestions = count($this->available);\n\t\t}\n\t}",
"public function extra_question_fields() {\r\n // Retrieve parent extra fields from shortanswer, like case sensivity and other fields from shortanswer.\r\n //$result = array_diff(parent::extra_question_fields(), array('answers'));// We unset answers fields, because we do not need them\r\n $result = parent::extra_question_fields();\r\n // Replace shortanswer table with our table\r\n $result[0]= 'qtype_correctwriting';\r\n // Language, which will be used for analysis\r\n $result[] = 'langid';\r\n // Penalty for absent lexeme mistake\r\n foreach($this->analyzers() as $value) {\r\n $classname = 'qtype_correctwriting_' . $value;\r\n /** @var qtype_correctwriting_abstract_analyzer $analyzer */\r\n $analyzer = new $classname();\r\n $fields = $analyzer->extra_question_fields();\r\n if (count($fields)) {\r\n foreach($fields as $field) {\r\n $result[] = $field;\r\n }\r\n }\r\n }\r\n // Minimal grade for answer to be approximately matched with student response\r\n $result[] = 'hintgradeborder';\r\n // Maximum fraction of mistakes to length of teacher answer in lexemes\r\n $result[] = 'maxmistakepercentage';\r\n //Penalty for \"what is\" hint.\r\n $result[] = 'whatishintpenalty';\r\n //Penalty for \"where\" text hint.\r\n $result[] = 'wheretxthintpenalty';\r\n //Absent token hints penalty factor\r\n $result[] = 'absenthintpenaltyfactor';\r\n //Penalty for \"where\" picture hint.\r\n $result[] = 'wherepichintpenalty';\r\n\r\n //Is enabled fields\r\n $result[] = 'islexicalanalyzerenabled';\r\n $result[] = 'isenumanalyzerenabled';\r\n $result[] = 'issequenceanalyzerenabled';\r\n $result[] = 'issyntaxanalyzerenabled';\r\n\r\n //Penalty for \"how to fix pic\" picture hint.\r\n $result[] = 'howtofixpichintpenalty';\r\n\r\n\r\n return $result;\r\n }",
"function fill_in_additional_detail_fields()\n\t{\n\t}",
"public function preparedQuestionHasAdditionalAnswers(): void\n {\n $multipleChoiceQuestion = QuestionHelper::newMCQ();\n\n /** @var Question $question */\n $question = Question::find($multipleChoiceQuestion)->first();\n\n $question = $question->preparedForView();\n\n $expectedAnswers = $question->answer()->first()->additional_answers;\n\n $this->assertNotNull($question['additionalAnswers']);\n $this->assertEquals($question['additionalAnswers'], $expectedAnswers);\n }",
"public function import_from_xml($data, $question, qformat_xml $format, $extra=null) {\n $question_type = $data['@']['type'];\n if ($question_type != $this->name()) {\n return false;\n }\n\n $qo = $format->import_headers($data);\n $qo->qtype = $question_type;\n\n\n $extraquestionfields = array('defaultanswer','selectedpalettes','customlibs');\n foreach ($extraquestionfields as $field) {\n $qo->$field = $format->getpath($data, array('#', $field, 0, '#'), '');\n }\n\n $qo->graderinfo=$format->import_text_with_files($data, array('#', 'graderinfo', 0));\n\n // Run through the answers.\n $answers = $data['#']['answer'];\n $a_count = 0;\n $extraanswersfields = $this->extra_answer_fields();\n if (is_array($extraanswersfields)) {\n array_shift($extraanswersfields);\n }\n foreach ($answers as $answer) {\n $ans = $format->import_answer($answer);\n if (!$this->has_html_answers()) {\n $qo->answer[$a_count] = $ans->answer['text'];\n } else {\n $qo->answer[$a_count] = $ans->answer;\n }\n $qo->fraction[$a_count] = $ans->fraction;\n $qo->feedback[$a_count] = $ans->feedback;\n if (is_array($extraanswersfields)) {\n foreach ($extraanswersfields as $field) {\n $qo->{$field}[$a_count] =\n $format->getpath($answer, array('#', $field, 0, '#'), '');\n }\n }\n ++$a_count;\n }\n return $qo;\n }",
"protected function initialize_questions()\n {\n $question_ids = $this->get_parent()->get_registered_question_ids();\n $order_by = array();\n\n if (!is_array($question_ids) || count($question_ids) == 0)\n {\n $question_ids = $this->get_question_ids_for_assessment();\n $this->get_parent()->register_question_ids($question_ids);\n }\n\n $order_by[] = new OrderBy(\n new PropertyConditionVariable(\n ComplexContentObjectItem:: class_name(),\n ComplexContentObjectItem :: PROPERTY_DISPLAY_ORDER\n )\n );\n\n $condition = new InCondition(\n new PropertyConditionVariable(\n ComplexContentObjectItem:: class_name(),\n ComplexContentObjectItem :: PROPERTY_ID\n ),\n $question_ids\n );\n\n $this->questions = \\Chamilo\\Core\\Repository\\Storage\\DataManager:: retrieve_complex_content_object_items(\n ComplexContentObjectItem:: class_name(),\n new DataClassRetrievesParameters($condition, null, null, $order_by)\n )->as_array();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtains a new inputs object. Includes setters appropriate for this GetSubscriptions Choreo. | public function newInputs($inputs = array())
{
return new Twitter_Lists_GetSubscriptions_Inputs($inputs);
} | [
"public function newInputs($inputs = array())\n {\n return new Amazon_SNS_ListSubscriptions_Inputs($inputs);\n }",
"public function newInputs($inputs = array())\n {\n return new Withings_Notification_ListSubscriptions_Inputs($inputs);\n }",
"protected function build_subscriptions_integration() {\n\n\t\treturn new SV_WC_Payment_Gateway_Integration_Subscriptions( $this );\n\t}",
"public function newInputs($inputs = array())\n {\n return new Stripe_Subscriptions_UpdateSubscription_Inputs($inputs);\n }",
"function subscriptions() {\n\t\tparent::validate();\n\t\tSubscriptionHandler::setupTemplate();\n\n\t\t$journal = &Request::getJournal();\n\t\t$rangeInfo = &Handler::getRangeInfo('subscriptions');\n\t\t$subscriptionDao = &DAORegistry::getDAO('SubscriptionDAO');\n\n\t\t// Get the user's search conditions, if any\n\t\t$searchField = Request::getUserVar('searchField');\n\t\t$dateSearchField = Request::getUserVar('dateSearchField');\n\t\t$searchMatch = Request::getUserVar('searchMatch');\n\t\t$search = Request::getUserVar('search');\n\n\t\t$fromDate = Request::getUserDateVar('dateFrom', 1, 1);\n\t\tif ($fromDate !== null) $fromDate = date('Y-m-d H:i:s', $fromDate);\n\t\t$toDate = Request::getUserDateVar('dateTo', 32, 12, null, 23, 59, 59);\n\t\tif ($toDate !== null) $toDate = date('Y-m-d H:i:s', $toDate);\n\n\t\t$subscriptions = &$subscriptionDao->getSubscriptionsByJournalId($journal->getJournalId(), $searchField, $searchMatch, $search, $dateSearchField, $fromDate, $toDate, $rangeInfo);\n\n\t\t$templateMgr = &TemplateManager::getManager();\n\t\t$templateMgr->assign_by_ref('subscriptions', $subscriptions);\n\t\t$templateMgr->assign('helpTopicId', 'journal.managementPages.subscriptions');\n\n\t\t// Set search parameters\n\t\tforeach (SubscriptionHandler::getSearchFormDuplicateParameters() as $param)\n\t\t\t$templateMgr->assign($param, Request::getUserVar($param));\n\n\t\t$templateMgr->assign('dateFrom', $fromDate);\n\t\t$templateMgr->assign('dateTo', $toDate);\n\t\t$templateMgr->assign('fieldOptions', SubscriptionHandler::getSearchFieldOptions());\n\t\t$templateMgr->assign('dateFieldOptions', SubscriptionHandler::getDateFieldOptions());\n\n\t\t$templateMgr->display('subscription/subscriptions.tpl');\n\t}",
"public function generateSubscriptions();",
"private function _convertGetSubscription($request)\n {\n $parameters = array();\n $parameters['Action'] = 'GetSubscription';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetMWSAuthToken()) {\n $parameters['MWSAuthToken'] = $request->getMWSAuthToken();\n }\n if ($request->isSetMarketplaceId()) {\n $parameters['MarketplaceId'] = $request->getMarketplaceId();\n }\n if ($request->isSetNotificationType()) {\n $parameters['NotificationType'] = $request->getNotificationType();\n }\n if ($request->isSetDestination()) {\n $DestinationGetSubscriptionInput = $request->getDestination();\n foreach ($DestinationGetSubscriptionInput->getDeliveryChannel() as $DeliveryChannelDestinationIndex => $DeliveryChannelDestination) {\n $parameters['Destination' . '.' . 'DeliveryChannel' . '.' . ($DeliveryChannelDestinationIndex + 1)] = $DeliveryChannelDestination;\n }\n }\n\n return $parameters;\n }",
"public function createSubscription($request);",
"public function newInputs($inputs = array())\n {\n return new Stripe_Subscriptions_CancelSubscription_Inputs($inputs);\n }",
"protected function getPushNotificationSubscriptionsRequest()\n {\n\n $resourcePath = '/retailer/subscriptions';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/vnd.retailer.v4+json', 'application/vnd.retailer.v4+xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/vnd.retailer.v4+json', 'application/vnd.retailer.v4+xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function get_subscriptions( $args ) {\n\t\t$wpdb = Follow_Up_Emails::instance()->wpdb;\n\n\t\t$default = array(\n\t\t\t'subscriptions_per_page' => -1,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'category_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => 'any',\n\t\t\t'meta_query_relation' => 'AND',\n\t\t);\n\t\t$args = wp_parse_args( $args, $default );\n\n\t\t// Make sure status starts with 'wc-'\n\t\tif ( ! in_array( $args['subscription_status'], array( 'any', 'trash' ) ) ) {\n\t\t\t$args['subscription_status'] = wcs_sanitize_subscription_status_key( $args['subscription_status'] );\n\t\t}\n\n\t\t// Prepare the args for WP_Query\n\t\t$query_args = array(\n\t\t\t'post_type' => 'shop_subscription',\n\t\t\t'post_status' => $args['subscription_status'],\n\t\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t\t'paged' => $args['paged'],\n\t\t\t'offset' => $args['offset'],\n\t\t\t'order' => $args['order'],\n\t\t\t'fields' => 'ids',\n\t\t\t'meta_query' => array(), // just in case we need to filter or order by meta values later\n\t\t);\n\n\t\t// We need to restrict subscriptions to those which contain a certain product/variation\n\t\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t\t} elseif ( 0 != $args['category_id'] && is_numeric( $args['category_id'] ) ) {\n\t\t\t$category_products = get_posts( array(\n\t\t\t\t'post_type' => 'product',\n\t\t\t\t'nopaging' => true,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'fields' => 'ids',\n\t\t\t\t'tax_query' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'taxonomy' => 'product_cat',\n\t\t\t\t\t\t'field' => 'term_id',\n\t\t\t\t\t\t'terms' => $args['category_id']\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t) );\n\n\t\t\tif ( !empty( $category_products ) ) {\n\t\t\t\tforeach ( $category_products as $idx => $product_id ) {\n\t\t\t\t\t$product = WC_FUE_Compatibility::wc_get_product( $product_id );\n\t\t\t\t\tif ( !$product->is_type( array('subscription', 'subscription_variation', 'variable-subscription') ) ) {\n\t\t\t\t\t\tunset( $category_products[ $idx ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !empty( $category_products ) ) {\n\t\t\t\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( $category_products );\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t\t}\n\n\t\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t\t}\n\n\t\t$subscription_post_ids = get_posts( $query_args );\n\t\t$subscriptions = array();\n\n\t\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t\t$subscriptions[] = $wpdb->get_row(\"SELECT ID, post_parent, post_status FROM {$wpdb->posts} WHERE ID = {$post_id}\");\n\t\t}\n\n\t\treturn $subscriptions;\n\t}",
"public function newInputs($inputs = array())\n {\n return new Twilio_Conferences_GetConference_Inputs($inputs);\n }",
"public function getSubscriptions()\n\t{\n\t\t$query = \"SELECT nl.* as sub FROM \" . \n\t\t\t\tNEWSLETTER_TABLE . \" nl \n\t\t\t\tJOIN \" . NEWSLETTER_PERMISSION_TABLE . \" p ON p.newsletter_id = nl.id\n\t\t\t\tJOIN \" . SUBSCRIPTION_TABLE . \" st ON st.newsletter_id = nl.id \n\t\t\t\tJOIN \" . SUBSCRIBER_TABLE . \" s ON s.id = st.subscriber_id\n\t\t\t\tWHERE \n\t\t\t\t\ts.id = {$this->id}\";\n\t\t$subscriptions = SqlQuery::getInstance()->simpleQuery($query);\n\t\t\n\t\treturn $subscriptions;\n\t}",
"public function subscriptions()\n {\n return Subscription::byCustomer($this->id);\n }",
"public function getMessageSubscriptions();",
"public function getSubscriptions()\n {\n return $this->subscriptions;\n }",
"public function getSubscription($subscription_id);",
"function listSubscriptions() {\n\n\t\treturn $this->httpGet($this->_baseUrl.'subscriptions');\n\n\t}",
"function &subscriptions() {\n if(empty($this->subscriptions)) {\n $this->subscriptions = new ISubscriptionsImplementation($this);\n } // if\n \n return $this->subscriptions;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the css class name for a letter grade | public function convertLetterGradeToCSSClass($letter_grade)
{
$class = new \ReflectionClass(__CLASS__);
$constants = $class->getConstants();
foreach ($constants as $name=>$value) {
if ($value == $letter_grade) {
return strtolower(str_replace('_', '-', $name));
}
}
return 'grade-unknown';
} | [
"public function getCSSName()\n {\n return strtolower(preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $this->getClassName()));\n }",
"public function getCssClassName()\n\t{\n\t\treturn $this->cssClassName . $this->counter;\n\t}",
"public function getClassGpa() :string\n {\n if (!is_array($this->grades[0])) {\n throw new Exception(\"Invalid grades\");\n }\n\n $grades = [];\n $gradeVals = [];\n $gpa = \"\";\n\n foreach ($this->grades as $studentGrades) {\n $gpa = new Gpa($studentGrades);\n $grades[] = $gpa->getStudentGpa();\n }\n \n foreach ($grades as $grade) {\n $gradeVals[] = array_search($grade, $this->gradeOrder) + 1;\n }\n\n return $this->gradeOrder[round(array_sum($gradeVals) / count($gradeVals)) - 1];\n }",
"function getGrade($letter){\n if($letter == \"A\"){\n return 5;\n } elseif($letter == \"B\"){\n return 4;\n } elseif($letter == \"C\"){\n return 3;\n } elseif($letter == \"D\"){\n return 2;\n } elseif($letter == \"E\"){\n return 1;\n } else {\n return 0;\n }\n }",
"function getClassName($class) {\r\n\tswitch($class) {\r\n\t\tcase '1': return \"Warrior\"; break;\r\n\t\tcase '2': return \"Cleric\"; break;\r\n\t\tcase '3': return \"Paladin\"; break;\r\n\t\tcase '4': return \"Ranger\"; break;\r\n\t\tcase '5': return \"Shadow Knight\"; break;\r\n\t\tcase '6': return \"Druid\"; break;\r\n\t\tcase '7': return \"Monk\"; break;\r\n\t\tcase '8': return \"Bard\"; break;\r\n\t\tcase '9': return \"Rogue\"; break;\r\n\t\tcase '10': return \"Shaman\"; break;\r\n\t\tcase '11': return \"Necromancer\"; break;\r\n\t\tcase '12': return \"Wizard\"; break;\r\n\t\tcase '13': return \"Magician\"; break;\r\n\t\tcase '14': return \"Enchanter\"; break;\r\n\t\tcase '15': return \"Beastlord\"; break;\r\n\t\tcase '16': return \"Berserker\"; break;\r\n\t\tdefault: return \"Unknown Class\"; break;\r\n\t}\r\n}",
"abstract public function getCssName();",
"public function getClassByClassName($clz_grade,$clz_class) {\n $stmt = $this->conn->prepare(\"SELECT clz_grade, clz_class, status, recode_added_at, recode_added_by FROM class WHERE clz_grade = ? and clz_class = ? and status=1\");\n $stmt->bind_param(\"is\", $clz_grade,$clz_class);\n if ($stmt->execute()) {\n $stmt->bind_result($clz_grade, $clz_class, $status, $recode_added_at, $recode_added_by);\n $stmt->fetch();\n $class = array();\n $class[\"clz_grade\"] = $clz_grade;\n $class[\"clz_class\"] = $clz_class;\n $class[\"status\"] = $status;\n $class[\"recode_added_at\"] = $recode_added_at;\n\t\t\t$class[\"recode_added_by\"] = $recode_added_by;\n\n $stmt->close();\n return $class;\n } else {\n return NULL;\n }\n }",
"public function getScoreCssClass() {\n switch ($this->score) {\n case SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_PASS:\n return 'success';\n\n case SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_WARN:\n return 'warning';\n\n case SiteAuditCheckAbstract::AUDIT_CHECK_SCORE_INFO:\n return 'info';\n\n default:\n return 'danger';\n\n }\n }",
"public function scoreLetter(): string\n {\n return $this->scoreLetter;\n }",
"protected final function _getCSSClassString()\n {\n $classString = null;\n $classNames = $this->_getCSSClassNames();\n \n if (0 < count($classNames)) {\n $classString = implode(' ', $classNames);\n }\n\n return $classString;\n }",
"public function getCssClass();",
"function get_grade_level($grade_level) {\n\tif ($grade_level == 1) return \"Freshman\";\n\tif ($grade_level == 2) return \"Sophomore\";\n\tif ($grade_level == 3) return \"Junior\";\n\tif ($grade_level == 4) return \"Senior\";\n\treturn \"None\";\n}",
"private function letterGrade($value) {\t\n\t\tswitch(true) {\n\t\t\tcase ($value > 93):\n\t\t\t\treturn 'A';\n\t\t\t\tbreak;\n\t\t\tcase (($value < 92.9) && ($value > 90)):\n\t\t\t\treturn 'A-';\n\t\t\t\tbreak;\n\t\t\tcase (($value < 89.9) && ($value > 87)):\n\t\t\t\treturn 'B+';\n\t\t\t\tbreak;\n\t\t\tcase (($value < 86.9) && ($value > 83)):\n\t\t\t\treturn 'B';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 82.9) && ($value > 80)):\n\t\t\t\treturn 'B-';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 79.9) && ($value > 77)):\n\t\t\t\treturn 'C+';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 76.9) && ($value > 73)):\n\t\t\t\treturn 'C';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 72.9) && ($value > 70)):\n\t\t\t\treturn 'C-';\n\t\t\t\tbreak;\n\n\t\t\tcase (($value < 69.9) && ($value > 65)):\n\t\t\t\treturn 'D';\n\t\t\t\tbreak;\n\t\t\tcase ($value < 65):\n\t\t\t\treturn 'E';\n\t\t\t\tbreak;\n\t\t}\n\n\t}",
"public function getHtmlClass(): string\n\t{\n\t\t$classMap = [\n\t\t\tself::SUCCESS => 'success',\n\t\t\tself::INFO => 'info',\n\t\t\tself::WARNING => 'warning',\n\t\t\tself::FAILURE => 'danger'\n\t\t];\n\n\t\treturn $classMap[$this->getType()];\n\t}",
"public function computeLetterGrade(Page\\MetricGrade $grade)\n {\n $grade_helper = new GradingHelper();\n \n if ($grade->isIncomplete()) {\n return GradingHelper::GRADE_INCOMPLETE;\n }\n \n if ($grade->isPassFail()) {\n if ($grade->point_grade != $grade->points_available) {\n return GradingHelper::GRADE_NO_PASS;\n }\n\n return GradingHelper::GRADE_PASS;\n }\n\n return $grade_helper->convertPercentToLetterGrade($grade->getPercentGrade());\n }",
"protected function get_css_class()\n\t{\n\t\treturn $this->css_class();\n\t}",
"public function getReviewedCSSClass(){\n\t\treturn ($this->reviewed) ? \"\" : \"not-reviewed\";\n\t}",
"public function getGrade($marks){\n if($marks != null){\n if($marks >= 80 && $marks < 100){\n return 'A';\n } else if($marks >=75){\n return 'A-';\n } else if($marks >= 70){\n return 'B+';\n } else if($marks >= 65){\n return 'B';\n } else if($marks >= 60){\n return 'B-';\n } else if($marks >= 55){\n return 'C+';\n } else if($marks >= 50){\n return 'C';\n } else if($marks >= 45){\n return 'C-';\n } else if($marks >= 40){\n return 'D+';\n } else if($marks >= 35){\n return 'D';\n } else if($marks >= 30){\n return 'D-';\n } else{\n return 'E';\n }\n }\n }",
"function Compute_ArmourClass_Char() {\r\n\t\t$arm_bonus = 0;\r\n\t\t$ac = 10 + $arm_bonus + $_SESSION['modifiers']['dex'];\r\n\t\treturn $ac;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns warehouse erection sum | function returnWarehouseErectionSum ($userData) {
$sum = 0;
foreach ($userData as $warehouseMaxLevel) {
for ($level = 1; $level <= $warehouseMaxLevel; $level += 1) {
$sum += pow ($level - 1, 2) * 1250000;
}
}
return $sum;
} | [
"public function calculateAdjustmentsTotal();",
"public function getAllotmentSum() {\n\t\t\n\t\t$result = 0;\n\t\t\n\t\t$allotmentFullDayQuery = \\OOEntryQuery::create()\n\t\t\t\t\t\t\t\t\t->useOOBookingQuery()\n\t\t\t\t\t\t\t\t\t\t->filterById($this->getId())\n\t\t\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t\t\t\t->filterByType(\\OOEntry::TYPE_ALLOTMENT_FULL_DAY)\n\t\t\t\t\t\t\t\t\t->withColumn('COUNT(*)', 'totalFullDayAllotments')\n\t\t\t\t\t\t\t\t\t->groupBy('OOBooking.id')\n\t\t\t\t\t\t\t\t\t->findOne();\n\t\t\t\t\t\t\t\t\t\n\t\t$allotmentHalfDayQuery = \\OOEntryQuery::create()\n\t\t\t\t\t\t\t\t\t->useOOBookingQuery()\n\t\t\t\t\t\t\t\t\t\t->filterById($this->getId())\n\t\t\t\t\t\t\t\t\t->endUse()\n\t\t\t\t\t\t\t\t\t->filterByType(\\OOEntry::TYPE_ALLOTMENT_HALF_DAY_AM)\n\t\t\t\t\t\t\t\t\t->_or()\n\t\t\t\t\t\t\t\t\t->filterByType(\\OOEntry::TYPE_ALLOTMENT_HALF_DAY_PM)\n\t\t\t\t\t\t\t\t\t->withColumn('COUNT(*)', 'totalHalfDayAllotments')\n\t\t\t\t\t\t\t\t\t->groupBy('OOBooking.id')\n\t\t\t\t\t\t\t\t\t->findOne();\n\n\t\t\t\t\t\t\t\t\t\n\t\tif ( $allotmentFullDayQuery !== null ) {\n\t\t\t$result += $allotmentFullDayQuery->getTotalFullDayAllotments(); \n\t\t}\t\t\n\n\t\tif ( $allotmentHalfDayQuery !== null ) {\n\t\t\t$result += 0.5 * $allotmentHalfDayQuery->getTotalHalfDayAllotments();\t\t\t\t \n\t\t}\t\t\n\t\t\t\t\t\t\t\t\n\t\treturn $result;\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t}",
"public function sum(){\n $sum = 0;\n foreach($this->collection as $investment){\n $sum += $investment->sum();\n }\n return $sum;\n }",
"public function calcSum()\n {\n return array_sum($this->outcome);\n }",
"public function getSummatoryTotal(){\n $total=0;\n foreach ($this->orderdetail as $det) {\n $total+=$det->total;\n }\n\n return $total;\n }",
"private function calculateSUM(){\n\t\t$db = new DB();\n\t\t$this->SUM = 0;\n\t\t$sql = \"SELECT SUM(lieu_ot) AS toil_remaining FROM tbl_office_time_sheet \n\t\t\t\tWHERE staffrefid = \".$this->employeeRefid.\" AND submitted = true AND lieu_ot <> 0\n\t\t\t\tAND enddate < timestamp \".$db->quote($this->timeSheetEnddate).\"\n\t\t\t\tAND enddate >= timestamp \".$db->quote($this->timeSheetEnddate).\" - interval \".$db->quote((TOIL_EXPIRATION_DAYS + 7).' days');\n\t\t$db->query($sql,Array('float'));\n\t\tif($db->numRows() > 0){\n\t\t\t$this->SUM = floatval($db->getElement(\"toil_remaining\"));\n\t\t}\n\t\t//adding the toilAdjustment which aids the decision if we should go further or tell the employee they don't have enough TOIL accrued\n\t\t$this->SUM += $this->toilAdjustmentValue;\n\t\tif($this->debug){\n\t\t\techo \"SUM = \".$this->SUM.\"<br/>\";\n\t\t}\n\t}",
"function summerSalg(){\n\t $res = $this->query('SELECT SUM(kroner) FROM (pengeflytting LEFT JOIN kontoer ON pengeflytting.fra=kontoer.nummer) WHERE kontoer.type=\\'6\\' AND (pengeflytting.dato > (CURDATE() - INTERVAL 1 YEAR))');\n\t return $res[0][0]['SUM(kroner)'];\n\t}",
"public function sumItemsQuantity();",
"public function legsCostRollup(){\n\t\t$legs = $this->getLegs();\n\t\t$total = 0;\n\t\tforeach ($legs as $leg){\n\t\t\t$total += $leg->total;\n\t\t}\n\t\treturn $total;\n\t}",
"public function getTotalAdjustmentAmount();",
"protected function _getTotalWeight()\n {\n /* Calculates our own weight plus everything we carry/contain */\n $weight = $this->getDpProperty('weight');\n\n $inv = $this->mrMotherObject->getInventory();\n foreach ($inv as &$ob) {\n $tmp = $ob->weight;\n if (is_int($tmp)) {\n $weight += $tmp;\n }\n }\n\n return $weight;\n }",
"public function total_applied()\n {\n return $this->applied_payments()->sum('amount') +\n $this->applied_invoices()->sum('amount');\n }",
"public function GetTotalEarningAdmin() {\n\n try {\n\n $sqlQuery = \"select sum(`total_fare`) from `\".self::table_ride.\"` where `status`='2'\";\n\n $result = $this->connect->query($sqlQuery);\n\n if($result->num_rows>0) {\n\n $row = $result->fetch_assoc();\n\n }\n \n\n return $row;\n\n } catch(Exception $e) {\n\n return $e;\n\n }\n\n }",
"public function getBillTotal() {\n\t\t// alle Positionen einer Rechnungen ermitteln \n\t\t\n\t\t// und den Positionspreis errechnen und speichern\n\t\t\n\t\t// die Summe aller Positionspreise ist der Rechnungspreis\n\t\t\n\t\t\n\t\t// steuersatz umrechnen\n\t\t//$tax = $this->tax / 100;\n\t\t//$tax = $tax + 1; \n\t\treturn $this->quantity * $this->price * $tax;\n\t}",
"public function getSummatoryPrice(){\n $total=0;\n foreach ($this->orderdetail as $det) {\n $total+=$det->price;\n }\n\n return $total;\n }",
"public function getAppliedOweAmountAttribute()\n {\n $company_id = $this->id;\n $company_owe = Trips::CompanyTripsOnly($company_id)->sum('applied_owe_amount');\n $driver_owe_amount_paymnt = DriverOweAmountPayment::whereHas('user',function($q) use ($company_id){\n $q->where('company_id',$company_id);\n })->sum('amount');\n\n $applied_owe_amount = $company_owe + $driver_owe_amount_paymnt;\n return $applied_owe_amount;\n }",
"public function getWeeeTaxAppliedAmount();",
"public function getSummatoryTotalPlusTax(){\n $total=0;\n foreach ($this->orderdetail as $det) {\n $total+=($det->total + $det->tax);\n }\n\n return $total;\n }",
"public function sum()\n {\n return array_sum($this->toArray());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the total number of admin users registered on the website (including super admin) | public function totalAdminUsers() {
//$total = $this->find('all', array('conditions'=>array('OR'=>array('role'=>array('super-admin','admin')))));
$total = $this->find('count', array(
'conditions'=>array('OR'=>array('role'=>array('super-admin','admin')))
));
return $total;
} | [
"public static function adminCount()\n {\n return count(User::whereRole(User::ROLE_ADMIN)->get());\n }",
"public function getAdminCount()\n {\n $query = \"SELECT COUNT(id) AS count FROM users WHERE is_admin = 1 AND \" . $this->getActiveUsersWhere();\n return $this->db->getOne($query, false, 'fetching admin count');\n }",
"public function getCountAdmins()\n\t{\n\t\treturn count($this->getAdmins());\n\t}",
"public function getNumberOfUsersPagesFromAdmin()\n {\n $total_users_count = $this->getTotalOfUsers();\n $number_of_users_pages = ceil($total_users_count / $this->number_of_users_by_page);\n return $number_of_users_pages;\n }",
"public function countAdminMembers(){\r\n \r\n $dbs = $this->getDB()->prepare\r\n ('select * from admin');\r\n $dbs->execute();\r\n $countAdmin = $dbs->rowCount();\r\n \r\n return $countAdmin;\r\n }",
"function getadminCount(){\n$collection = $GLOBALS['db']->users;\nreturn $collection->count(array('user_type'=>'superadmin','status' =>1));\n}",
"static function countAdministrators() {\n return Users::count(\"type = 'Administrator' AND state = '\" . STATE_VISIBLE . \"'\");\n }",
"public static function numberAdmins(){\n\t\t\t$select = \"SELECT * FROM Admins\";\n\t\t\t$result = mysql_query($select);\n\t\t\t$count = 0;\n\t\t\twhile($v = mysql_fetch_array($result)){\n\t\t\t\t$count = $count + 1;\n\t\t\t}\n\t\t\treturn $count;\n\t\t}",
"function get_admin_count()\n\t{\n\t\t$query=$this->db->query(\"SELECT * FROM admin\");\n\t\treturn $query->num_rows();\n\t}",
"public function getTotalOfUsers()\n {\n $id_admin = ID_ADMIN;\n $sql = 'SELECT COUNT(id_user) as counter\n FROM users\n WHERE id_user != :id_admin AND bin != \"yes\"\n ';\n $users = $this->dbConnect($sql, array(\n ':id_admin' => \"$id_admin\"\n ));\n $this->users_count = $users->fetch(\\PDO::FETCH_ASSOC);\n $total_users_count = $this->users_count['counter'];\n return $total_users_count;\n }",
"public function getAdminCount()\n {\n $query = $this\n ->getEntityManager()\n ->createQueryBuilder()\n\n ->select('COUNT(admin)')\n ->from('UserBundle:Administrator', 'admin')\n\n ->join('admin.role', 'role')\n ->where('role.value = :role_admin')\n\n ->setParameter('role_admin', Role::ROLE_ADMIN);\n ;\n\n return $query\n ->getQuery()\n ->getSingleScalarResult()\n ;\n }",
"function getNumPortalUsers(){\n $admin = Administration::getSettings('license');\n if (!isset($admin->settings['license_num_portal_users'])) {\n return 0;\n }\n return $admin->settings['license_num_portal_users'];\n }",
"public static function rootAdminCount()\n\t\t{\n\t\t\tSQLDB::connect(\"bcc_admin\");\n\t\t\t$rootAccessID = ROOT_ACCESS_ID;\n\t\t\t$query = \"SELECT COUNT(*) FROM bcc_admin.administrators WHERE access_id = {$rootAccessID}\";\n\t\t\t$result = mysql_query($query);\n\t\t\t$adminCount = -1;\n\t\t\tif ($row = mysql_fetch_array($result))\n\t\t\t{\n\t\t\t\t$adminCount = $row[0];\n\t\t\t}\n\t\t\treturn $adminCount;\n\t\t}",
"function show_admin()\r\n\t{\r\n\t\t$admin = mysql_query(\"SELECT * FROM admin\");\r\n\t\t$total_admin = mysql_num_rows($admin);\r\n\t\treturn $total_admin;\r\n\t}",
"function UserCount()\n{\n\tglobal $log;\n\t$log->debug(\"Entering UserCount() method ...\");\n\tglobal $adb;\n\t$result=$adb->query(\"select * from ec_users where deleted =0;\");\n\t$user_count=$adb->num_rows($result);\n\t$result=$adb->query(\"select * from ec_users where deleted =0 AND is_admin != 'on';\");\n\t$nonadmin_count = $adb->num_rows($result);\n\t$admin_count = $user_count-$nonadmin_count;\n\t$count=array('user'=>$user_count,'admin'=>$admin_count,'nonadmin'=>$nonadmin_count);\n\t$log->debug(\"Exiting UserCount method ...\");\n\treturn $count;\n}",
"function UserCount()\r\n{\r\n\tglobal $log;\r\n\t$log->debug(\"Entering UserCount() method ...\");\r\n\tglobal $adb;\r\n\t$result=$adb->mquery(\"select * from vtiger_users where deleted =0\", array());\r\n\t$user_count=$adb->num_rows($result);\r\n\t$result=$adb->mquery(\"select * from vtiger_users where deleted =0 AND is_admin != 'on'\", array());\r\n\t$nonadmin_count = $adb->num_rows($result);\r\n\t$admin_count = $user_count-$nonadmin_count;\r\n\t$count=array('user'=>$user_count,'admin'=>$admin_count,'nonadmin'=>$nonadmin_count);\r\n\t$log->debug(\"Exiting UserCount method ...\");\r\n\treturn $count;\r\n}",
"function total_users() {\n return count($this->data['useronline']);\n }",
"function wp_statistics_countusers() {\r\n\t\r\n\t\t$result = count_users();\r\n\t\treturn $result['total_users'];\r\n\t}",
"public function getTotalUsersCount(){\n\t\treturn number_format(Member::get()->count());\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print out the dropdown content of the available tasktypes | public function printTypeSelect ($selectedType = "") {
$db = new DB();
$db->connect();
$sql = "SELECT * FROM tasktype";
$query = $db->query($sql);
while ($oneRow = $query->fetch_assoc()) {
$selectedText = "";
if ($selectedType == $oneRow["id"]) {
$selectedText = ' selected="selected" ';
}
echo '<option value="'.$oneRow["id"].'" '.$selectedText.'>'.$oneRow["name"].'</option>';
}
} | [
"public function listTypes()\n { \n $result = \"<option value=''>Pick a type</option>\";\n foreach (static::$classes as $value) { \n $result .= \"<option value='$value'>$value</option>\";\n }\n return $result;\n }",
"public function post_types_display() {\r\n\t\techo '\r\n\t\t<div id=\"pvc_post_types_display\">\r\n\t\t\t<fieldset>\r\n\t\t\t\t<select class=\"pvc-chosen\" data-placeholder=\"' . esc_attr__( 'Select groups', 'post-views-counter' ) . '\" name=\"post_views_counter_settings_display[post_types_display][]\" multiple=\"multiple\">';\r\n\r\n\t\tforeach ( $this->post_types as $post_type => $post_type_name ) {\r\n\t\t\techo '\r\n\t\t\t\t\t<option value=\"' . esc_attr( $post_type ) . '\" ' . selected( in_array( $post_type, Post_Views_Counter()->get_attribute( 'options', 'display', 'post_types_display' ), true ), true, false ) . '>' . esc_html( $post_type_name ) . '</option>';\r\n\t\t}\r\n\r\n\t\techo '\r\n\t\t\t\t</select>\r\n\t\t\t\t<br/>\r\n\t\t\t\t<span class=\"description\">' . esc_html__( 'Select post types for which post views will be displayed.', 'post-views-counter' ) . '</span>\r\n\t\t\t</fieldset>\r\n\t\t</div>';\r\n\t}",
"function task_get_types() {\n return array(\n 'classic' => 'Clasică',\n 'interactive' => 'Interactivă',\n // 'output-only' => 'Doar de output',\n );\n}",
"function outputTypeSelect()\n {\n $values = array(\n array(\n 'value' => 'all',\n 'contents' => getMsg('ML', 'ML_ALL_LABELS')\n ),\n array(\n 'value' => 'storefront',\n 'contents' => getMsg('ML', 'ML_STOREFRONT_LABELS')\n ),\n array(\n 'value' => 'storefront_cz',\n 'contents' => ' ' .\n getMsg('ML', 'ML_AVACTIS_LABELS')\n ),\n array(\n 'value' => 'CZ_CUSTOM',\n 'contents' => ' ' .\n getMsg('ML', 'ML_CUSTOM_LABELS')\n ),\n array(\n 'value' => 'admin',\n 'contents' => getMsg('ML', 'ML_ADMINZONE_LABELS'),\n )\n );\n\n if (is_array($this -> _modules))\n foreach($this -> _modules as $m)\n $values[] = array(\n 'value' => $m['shortname'],\n 'contents' => ' ' . $m['module']\n );\n\n return HtmlForm :: genDropdownSingleChoice(array(\n 'select_name' => 'type',\n 'selected_value' => @$this -> _search_filter['type'],\n 'id' => 'type',\n 'values' => $values\n ));\n }",
"public function selectItemTypeSelectds()\n {\n \n // $itemTypeIds = !empty($_GET['itemTypeIds']) ? $_GET['itemTypeIds'] : '';\n \n\n // if (!empty($itemTypeIds)) {\n\n $getItemTypeIdDatas = DB::select('SELECT * FROM item_type_master WHERE is_deleted_status = \"N\"');\n\n if (!empty($getItemTypeIdDatas)) {\n\n foreach ($getItemTypeIdDatas as $itemTypes) {\n\n $itemTpyesListHtml = '<option value=\"'.$itemTypes->id.'\"';\n \n \n\n $itemTpyesListHtml .= '>'.$itemTypes->name.'</option>';\n\n echo $itemTpyesListHtml; \n\n }\n\n }\n // }\n }",
"public function posttypes_gui() {\n $posttypes = $this->common->get_posttypes();\n echo '<input type=\"text\" class=\"regular-text\" name=\"amazon_polly_posttypes\" id=\"amazon_polly_posttypes\" value=\"' . esc_attr( $posttypes ) . '\"> ';\n echo '<p class=\"description\" for=\"amazon_polly_posttypes\">Post types in your WordPress environment</p>';\n }",
"protected function _listTasks() {\n\t\t$this->out('Available tasks:');\n\t\tforeach ($this->taskNames as $loadedTask) {\n\t\t\t$this->out('\t- ' . $loadedTask);\n\t\t}\n\t}",
"public function get_submenu_types() {\n\t\t\t\t$type = $this->input->post('types');\n\t\t\t\t$HTML = \"\";\n\t\t\t\t$data = $this->Menus_model->populate_submenu($type);\n\t\t\t\tif (!empty ($data)) {\n\t\t\t\t\t\tforeach ($data as $d2) {\n\t\t\t\t\t\t\t\t$HTML .= \"\n\n<option value='\" . $d2->id . \"' data-label='\" . $d2->label . \"'>\" . $d2->label . \"</option>\n\n\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo $HTML;\n\t\t}",
"public function displayModuleTasks($moduleCode){\n $modules = $this->database->getAllModuleTasks($this->user, $moduleCode); //Get all tasks\n if($modules){\n foreach ($modules as $row){\n echo \"$('#taskChoice').append('<option value='\" . $row['task_id'] . \"'>\" . $row['task_name'] . \" - \" . $row['module_code'] . \"</option>')\";\n } //Echo each module task as option\n }\n }",
"function optTASK(){\n\t\tglobal $_CON;\n\t\t$sqlSearch = mysqli_query($_CON,\"SELECT JOB_ID, JOB_NAME \n\t\tFROM job_table ORDER BY JOB_NAME ASC\");\n\t\t$count = mysqli_num_rows($sqlSearch);\n\t\tif($count > 0){\n\t\t\twhile($row=mysqli_fetch_array($sqlSearch)){\n\t\t\t\t$_ID = mysqli_real_escape_string($_CON, $row['JOB_ID']);\n\t\t\t\t$name = mysqli_real_escape_string($_CON, $row['JOB_NAME']);\n\t\t\t\techo\"\t<option value='$_ID'> $name </option>\";\n\t\t\t}\n\t\t}else{\n\t\t\techo\"\t\t<option value=''>No data to show</option>\";\n\t\t}\n\t}",
"function caseTypeHTML($typeId){\n\t\techo '<select name=\"case_type\" id=\"case_type\" class=\"form-control\" readonly>';\n\t\tforeach ($this->caseType as $key => $value){\n\t\t\tif ($key ==$typeId){\n\t\t\t\techo '<option selected=\"selected\" value=\"'.$key.'\">'.$value.'</option>';\n\t\t\t} else {\n\t\t\t\techo '<option value=\"'.$key.'\">'.$value.'</option>';\n\t\t\t}\n\t\t}\n\t\techo '</select>';\n\t}",
"public function display_post_types() : void {\n\t\t$post_types = get_post_types( [\n\t\t\t'public' => true\n\t\t] );\n\t\tforeach ( $post_types as $post_type ):\n\t\t\t?>\n\t\t\t<label class=\"post_type_involved\">\n\t\t\t\t<input type=\"checkbox\"\n\t\t\t\t\tname=\"itph_plugin_options[post_types][]\"\n\t\t\t\t\tvalue=\"<?php echo $post_type; ?>\"\n\t\t\t\t\t<?php checked( in_array( $post_type, $this->options['post_types'] ) ); ?> />\n\t\t\t\t<span><?php echo $post_type; ?></span>\n\t\t\t</label>\n\t\t\t<?php\n\t\tendforeach;\n\t}",
"function application_type_dropdown() {\n\t\t\t$query_vars = $this->get_query_vars();\n\t\t\t$types \t\t= $this->application_types;\n\n\t\t\t$output = '<select name=\"app_type\" id=\"app_type\">';\n\t\t\t$output .= '<option value=\"all\">App Type</option>';\n\n\t\t\tforeach( $types as $type => $val ) {\n\t\t\t\tif ( ! in_array( $type, $types ) )\n\t\t\t\t\t$output .= '<option value=\"' . esc_attr( $val ) . '\"' . selected( $query_vars['app_type'], esc_attr( $val ), false ) . '>' . esc_html( $type ) . '</option>';\n\t\t\t}\n\n\t\t\t$output .= '</select>';\n\n\t\t\treturn $output;\n\t\t}",
"function get_types($actual_type) {\n\treturn getDropdownOptions('name', 'event_types', $actual_type);\n}",
"function subTypeHTML($parentId,$typeId){\n\t\techo '<select name=\"case_subtype\" id=\"case_subtype\" class=\"form-control\" readonly>';\n\t\tforeach ($this->subType as $key => $value){\n\t\t\tif ($value['parent'] == $parentId || empty($parentId)){\n\t\t\t\tif ($key ==$typeId){\n\t\t\t\t\techo '<option selected=\"selected\" value=\"'.$key.'\">'.$value[\"value\"].'</option>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<option value=\"'.$key.'\">'.$value[\"value\"].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo '</select>';\n\t}",
"function listMarkupAsOptions ($type) {\n\t\t$files = array();\n\t\t$handle=opendir('markup/'.$type);\n\t\twhile (false !== ($file = readdir($handle))):\n\t\t\tif(stristr($file,'.html')):\n\t\t\t\t\t$files[] = $file;\n\t\t\tendif;\n\t\tendwhile;\n\n\t\tsort($files);\n\t\tforeach ($files as $file):\n\t\t\t$filename = preg_replace(\"/^[0-9]*_/i\", \"\", $file);\n\t\t\t$filename = preg_replace(\"/\\.html$/i\", \"\", $filename);\n\t\t\t$title = preg_replace(\"/\\-/i\", \" \", $filename);\n\t\t\t$title = ucwords($title);\n\t\t\techo '<option value=\"#sg-'.$filename.'\">'.$title.'</option>';\n\t\tendforeach;\n\t}",
"private function genContTypeDropdown()\r\n\t{\t\r\n\t\t$dropdown = \"<br><label class='control-label' for='contTypeDrop'>Content type</label>\";\r\n\t\t$dropdown .= \"<select class='form-control' id='contTypeDrop' name='contTypeDropdown'>\";\r\n\t\t$dropdown .= \"<option value='article'>Article</option>\";\r\n\t\t$dropdown .= \"<option value='book'>Book</option>\";\r\n\t\t$dropdown .= \"<option value='video'>Video</option>\";\r\n\t\t$dropdown .= \"<option value='test'>Test</option>\";\r\n\t\t$dropdown .= \"</select>\";\r\n\r\n\t\treturn $dropdown;\r\n\t}",
"function category_type_list() {\n foreach (Program::category_types() as $key => $type) {\n $safe_type = html_entities($type);\n echo '<input type=\"checkbox\" name=\"ctype[]\" id=\"ctype_', $key,\n '\" value=\"',$safe_type, '\"';\n if (in_array($type, $_SESSION['search']['ctype']))\n echo ' CHECKED';\n echo '><label for=\"ctype_', $key, '\">', $safe_type, '</label>';\n if ($type == 'movie') {\n echo ': ',\n movie_star_select('stars_gt'),\n ' to ',\n movie_star_select('stars_lt');\n }\n echo '<br>';\n }\n }",
"function print_bank_account_type_pulldown($selected = '', $fieldname = 'form[bank_account_type]')\n {\n $options = array('checking', 'savings');\n foreach ($options AS $type)\n {\n\t\t\t$values[$type] = '{_' . $type . '}';\n }\n return construct_pulldown($fieldname, $fieldname, $values, $selected, 'style=\"font-family: Verdana\"');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the context containing the specified property. | public function with(string $property): ?Context
{
if ($this->is($property)) {
return $this;
}
if ($this->parent !== null) {
return $this->parent->with($property);
}
return null;
} | [
"public function __get($property) {\n return $this->apply(function($item) use ($property){\n return $item->$property;\n });\n\t}",
"protected function get_prop($prop, $context = 'view')\n {\n }",
"protected function get_prop( $prop, $context = 'view' ) {\n $value = null;\n \n if ( array_key_exists( $prop, $this->data ) ) {\n $value = array_key_exists( $prop, $this->changes ) ? $this->changes[ $prop ] : $this->data[ $prop ];\n \n if ( 'view' === $context ) {\n $value = apply_filters( $this->get_hook_prefix() . $prop, $value, $this );\n }\n }\n \n return $value;\n }",
"function getProperty( $property ) {\n\t\treturn $this->property;\n\t}",
"public function __get($property)\n {\n $result = null;\n\n if (! isset($this->_object->$property)) {\n $property = $this->_inflect($property);\n }\n\n if (isset($this->_object->$property)) {\n $result = $this->_object->$property;\n $result = $this->_decorate($result);\n }\n return $result;\n }",
"public function __get($property)\n {\n // check if queryset is already evaluated\n $this->getResults();\n\n return $this->_resultsCache->{$property};\n }",
"public function getProperty($property)\n {\n return isset($this->entity[$property])\n ? $this->entity[$property]\n : null;\n }",
"public static function getPropertyLocationOfProperty(Property $property)\n {\n return PropertyLocation::wherePropertyId($property->id)->first();\n }",
"public function withProperty(ReflectionProperty $property)\n {\n $context = clone $this;\n $context->property = $property;\n $context->declaringClass = $property->getDeclaringClass();\n $context->target = Target::TARGET_PROPERTY;\n $context->reflectionFile = $this->reflectionFileFactory->create($context->declaringClass->getFileName());\n\n return $context;\n }",
"function property_exists($context, $property) {\n $vars = is_object($context) ? \n get_object_vars($context) : \n get_class_vars($context);\n return array_key_exists($property, $vars);\n }",
"public function getExpressionContext();",
"protected function getFromMemo($property)\n {\n if (! is_null($this->{$property})) {\n return $this->{$property};\n }\n\n return ;\n }",
"public function getContextProperties() {\n return $this->contextProperties;\n }",
"public function __get($property)\n\t{\n\t\tswitch ($property) {\n\t\t\tcase 'interactId':\n\t\t\t\treturn $this->interactId;\n\n\t\t\tdefault:\n\t\t\t\treturn parent::__get($property);\n\t\t}\n\t}",
"public function getByProperty($property, $value);",
"protected function prepare_property( $property ) {\n\t\tif ( papi_is_property( $property ) ) {\n\t\t\t$property->set_store( $this );\n\t\t}\n\n\t\treturn $property;\n\t}",
"public function get_context();",
"public function __get($property)\n {\n $properties = array();\n foreach($this->_models as $key => $model) {\n $properties[$key] = $model[$property];\n }\n \n return $properties;\n }",
"public function __get($property)\n {\n if (array_key_exists($property, $this->request)):\n return $this->request[$property];\n else:\n return null;\n endif;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the deprecation status of an image. If no message body is given, clears the deprecation status instead. (images.deprecate) | public function deprecate($project, $image, Google_DeprecationStatus $postBody, $optParams = array()) {
$params = array('project' => $project, 'image' => $image, 'postBody' => $postBody);
$params = array_merge($params, $optParams);
$data = $this->__call('deprecate', array($params));
if ($this->useObjects()) {
return new Google_Operation($data);
} else {
return $data;
}
} | [
"public function deprecate($project, $image, Appointments_Google_Service_Compute_DeprecationStatus $postBody, $optParams = array())\n {\n $params = array('project' => $project, 'image' => $image, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('deprecate', array($params), \"Appointments_Google_Service_Compute_Operation\");\n }",
"public function setDeprecated($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Compute\\V1\\DeprecationStatus::class);\n $this->deprecated = $var;\n\n return $this;\n }",
"public static function deprecated($message = NULL)\n {\n //trigger_error($message, E_USER_DEPRECATED);\n self::notice('DEPRECTATED : ' . $message);\n }",
"public function logDeprecated($message);",
"public function addDeprecated($msg)\n {\n }",
"function vip_remove_enhanced_feed_images() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}",
"public function testDeprecationWarning(): void\n {\n $current = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($current);\n\n $this->expectDeprecation();\n $this->expectExceptionMessageMatches('/^This method is deprecated/');\n $this->expectExceptionMessageMatches('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }",
"public function setDeprecation($value)\n {\n return $this->set(self::DEPRECATION, $value);\n }",
"public function testDeprecationWarning()\n {\n $currentErrorReporting = error_reporting(E_ALL & ~E_USER_DEPRECATED);\n deprecationWarning('This method is deprecated');\n error_reporting($currentErrorReporting);\n\n $this->expectException(Deprecated::class);\n $this->expectExceptionMessageRegExp('/^This method is deprecated/');\n $this->expectExceptionMessageRegExp('/You can disable deprecation warnings by setting `error_reporting\\(\\)` to `E_ALL & ~E_USER_DEPRECATED`\\.$/');\n deprecationWarning('This method is deprecated');\n }",
"public function deprecated($message)\n {\n $this->preload()->triggerEvent('core.deprecated', array($message));\n }",
"public function testDeprecationWarningLevelDisabled(): void\n {\n $this->expectNotToPerformAssertions();\n\n $this->withErrorReporting(E_ALL ^ E_USER_DEPRECATED, function (): void {\n deprecationWarning('This is leaving');\n });\n }",
"protected function logDeprecation() {}",
"public function setDeprecated(?bool $value): void {\n $this->getBackingStore()->set('deprecated', $value);\n }",
"protected function getDeprecationLogStatus() {}",
"function do_action_deprecated($tag, $args, $version, $replacement = \\false, $message = \\null)\n{\n}",
"public function cleanupDeprecatedPHPUnitMethodsWarnings()\n {\n $currentWarnings = readPrivateProperty($this, 'warnings');\n\n $warnings = array_filter($currentWarnings, static function ($warning) {\n return strpos($warning, 'assertFileNotExists() is deprecated') === false;\n });\n\n setPrivateProperties($this, [ 'warnings' => $warnings ]);\n }",
"public function setDeprecated($deprecated)\n {\n if((bool) $deprecated) {\n $this->options['deprecated'] = null;\n }\n }",
"public function isDeprecated();",
"public function testDeprecationHeaders() {\n $this->drupalGet('/test-deprecations');\n\n $deprecation_messages = [];\n foreach ($this->getSession()->getResponseHeaders() as $name => $values) {\n if (preg_match('/^X-Drupal-Assertion-[0-9]+$/', $name, $matches)) {\n foreach ($values as $value) {\n $parameters = unserialize(urldecode($value));\n if (count($parameters) === 3) {\n if ($parameters[1] === 'User deprecated function') {\n $deprecation_messages[] = (string) $parameters[0];\n }\n }\n }\n }\n }\n\n $this->assertContains('Test deprecation message', $deprecation_messages);\n $test_deprecation_messages = array_filter($deprecation_messages, function ($message) {\n return $message === 'Test deprecation message';\n });\n $this->assertCount(1, $test_deprecation_messages);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the private 'api_platform.listener.request.deserialize' shared service. | protected function getApiPlatform_Listener_Request_DeserializeService()
{
return $this->privates['api_platform.listener.request.deserialize'] = new \ApiPlatform\Core\EventListener\DeserializeListener(($this->services['serializer'] ?? $this->getSerializerService()), ($this->privates['api_platform.serializer.context_builder.filter'] ?? $this->getApiPlatform_Serializer_ContextBuilder_FilterService()), ($this->privates['api_platform.formats_provider'] ?? $this->getApiPlatform_FormatsProviderService()));
} | [
"protected function getApiPlatform_Listener_Request_DeserializeService()\n {\n return $this->privates['api_platform.listener.request.deserialize'] = new \\ApiPlatform\\Core\\EventListener\\DeserializeListener(($this->services['.container.private.serializer'] ?? $this->get_Container_Private_SerializerService()), ($this->privates['api_platform.serializer.context_builder.filter'] ?? $this->getApiPlatform_Serializer_ContextBuilder_FilterService()), ($this->privates['api_platform.metadata.resource.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Resource_MetadataFactory_CachedService()));\n }",
"public function deserialize(Request $request);",
"protected function getRequestListenerService()\n {\n return $this->privates['Sentry\\\\SentryBundle\\\\EventListener\\\\RequestListener'] = new \\Sentry\\SentryBundle\\EventListener\\RequestListener(($this->privates['Sentry\\\\State\\\\HubInterface'] ?? $this->getHubInterfaceService()), ($this->services['security.token_storage'] ?? $this->getSecurity_TokenStorageService()));\n }",
"protected function getApiPlatform_Listener_Request_ReadService()\n {\n return $this->privates['api_platform.listener.request.read'] = new \\ApiPlatform\\Core\\EventListener\\ReadListener(($this->privates['debug.api_platform.collection_data_provider'] ?? $this->getDebug_ApiPlatform_CollectionDataProviderService()), ($this->privates['debug.api_platform.item_data_provider'] ?? $this->getDebug_ApiPlatform_ItemDataProviderService()), ($this->privates['debug.api_platform.subresource_data_provider'] ?? $this->getDebug_ApiPlatform_SubresourceDataProviderService()), ($this->privates['api_platform.serializer.context_builder.filter'] ?? $this->getApiPlatform_Serializer_ContextBuilder_FilterService()), ($this->privates['api_platform.identifier.converter'] ?? $this->getApiPlatform_Identifier_ConverterService()), ($this->privates['api_platform.metadata.resource.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Resource_MetadataFactory_CachedService()));\n }",
"protected function getRequestService()\n {\n return $this->services['request'] = \\Slim\\Http\\Request::createFromEnvironment($this->get('environment'));\n }",
"protected function getApiPlatform_Listener_View_SerializeService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/api-platform/core/src/EventListener/SerializeListener.php';\n\n return $this->privates['api_platform.listener.view.serialize'] = new \\ApiPlatform\\Core\\EventListener\\SerializeListener(($this->services['serializer'] ?? $this->getSerializerService()), ($this->privates['api_platform.serializer.context_builder.filter'] ?? $this->getApiPlatform_Serializer_ContextBuilder_FilterService()), ($this->privates['api_platform.metadata.resource.metadata_factory.cached'] ?? $this->getApiPlatform_Metadata_Resource_MetadataFactory_CachedService()));\n }",
"public function getRequestSerializer(){\n if( ! $this->requestSerializer ){\n // Use the default request serializer if none was found\n $this->requestSerializer = LocoRequestSerializer::getInstance();\n }\n return $this->requestSerializer;\n }",
"public function getRequest()\n\t{\n\t\treturn $this->container->getInstanceOf('request_service');\n\t}",
"protected function getValidateRequestListenerService()\n {\n return $this->services['validate_request_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ValidateRequestListener();\n }",
"protected function getVictoireI18n_Kernelrequest_ListenerService()\n {\n return $this->services['victoire_i18n.kernelrequest.listener'] = new \\Victoire\\Bundle\\I18nBundle\\Listener\\KernelRequestListener($this->get('twig'), array(0 => 'fr', 1 => 'en'));\n }",
"public function getRequestSerializer()\n {\n return $this->serializer;\n }",
"protected function getResponseListenerService()\n {\n return $this->privates['response_listener'] = new \\Symfony\\Component\\HttpKernel\\EventListener\\ResponseListener('UTF-8');\n }",
"protected function getDataCollector_RequestService()\n {\n return $this->privates['data_collector.request'] = new \\Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector();\n }",
"private function getDecoder()\n {\n return new RequestDecoder($this->getDataParser());\n }",
"protected function getDataCollector_RequestService()\n {\n return $this->services['data_collector.request'] = new \\Symfony\\Bundle\\FrameworkBundle\\DataCollector\\RequestDataCollector();\n }",
"protected function getJmsSerializer_XmlDeserializationVisitorService()\n {\n $this->services['jms_serializer.xml_deserialization_visitor'] = $instance = new \\JMS\\Serializer\\XmlDeserializationVisitor(${($_ = isset($this->services['jms_serializer.naming_strategy']) ? $this->services['jms_serializer.naming_strategy'] : $this->get('jms_serializer.naming_strategy')) && false ?: '_'});\n\n $instance->setDoctypeWhitelist(array());\n\n return $instance;\n }",
"public function getRequestService(): RequestServiceInterface\n {\n return $this->requestService;\n }",
"public function request()\n {\n if (!$this->container->bound('json-api.request')) {\n return null;\n }\n\n return $this->container->make('json-api.request');\n }",
"protected function getDataCollector_RequestService()\n {\n return $this->services['data_collector.request'] = new \\Symfony\\Component\\HttpKernel\\DataCollector\\RequestDataCollector();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notify new comment in publication to owner. | public function created(Comment $comment)
{
$publication = $comment->publication()->first();
if($publication && $user = $publication->user()->first()){
$user->notify(new NewCommentNotification($publication));
}
} | [
"public function notifyCommentAction()\n {\n $commentId = $this->getRequest()->getParam('id');\n $repository = $this->getEntityManager()->getRepository(\\Application\\Model\\Comment::class);\n $comment = $repository->findOneById($commentId);\n $discussion = $comment->getDiscussion();\n $users = $this->getEntityManager()->getRepository(\\Application\\Model\\User::class)->getAllForCommentNotification($comment);\n\n $subject = 'Discussion - ' . $discussion->getName();\n $mailParams = [\n 'comment' => $comment,\n 'discussion' => $discussion,\n ];\n\n $this->sendMail($users, $subject, new ViewModel($mailParams));\n }",
"public function fireNewCommentEvent()\n {\n DomainEventManager::getInstance()->dispatchEvent(DomainEventManager::EVENT_NEWCOMMENT, [ 'urlComment' => $this ]);\n }",
"function resources_handle_on_comment_added(&$comment, &$parent) {\n if(instance_of($parent, 'ProjectObject')) {\n $parent->refreshCommentsCount();\n \n if($comment->send_notification) {\n $created_by = $comment->getCreatedBy();\n $parent->sendToSubscribers('resources/new_comment', array(\n 'comment_body' => $comment->getFormattedBody(),\n 'comment_url' => $comment->getViewUrl(),\n 'created_by_url' => $created_by->getViewUrl(),\n 'created_by_name' => $created_by->getDisplayName(),\n ), $comment->getCreatedById(), $parent);\n } // if\n } // if\n }",
"function after_create(){\n $referer_id = $this->getObject()->user_id;\n $membre = User::find($this->user_id);\n if ($this->user_id == $referer_id) {\n return;\n }\n $notif = Notification::create(\n array(\n 'user_id' => $membre->id,\n 'to_user_id' => $referer_id,\n 'content' => $membre->name().' a commenté votre publication',\n 'picture' => $membre->picture,\n 'action' => $this->getObject()->asLink(),\n 'status' => 0,\n 'model' => $this->model,\n 'record' => $this->record,\n )\n );\n }",
"public function notifyCreated()\n {\n $ticketRecord = $this->_model->fetch();\n $ticketCommentRecord = $this->_ticketCommentModel->fetch();\n $contactModel = new Core_Model_Contact($ticketRecord['contact_id']);\n\n $email = $contactModel->getWorkEmail();\n $fullName = $contactModel->getFullName();\n\n $message = \"Hello \" . $fullName . \",\\n\\n\";\n $message .= \"A comment was added to the ticket. The ticket and comment details are as below:\" . \"\\n\\n\";\n $message .= \"Latest Comment:\\n\\n\";\n $message .= $this->getCommentTextTable();\n $message .= \"\\n\\n\";\n $message .= \"Ticket Details:\\n\\n\";\n $message .= $this->getTicketTextTable();\n $message .= \"\\n\\n\";\n $this->sendEmail($email, $fullName, $message, 'Comment has been added to ticket');\n }",
"function ac_notifier_notify( $comment_id, $params ) {\n global $bp;\n extract( $params );\n\n $users = ac_notifier_find_involved_persons( $activity_id );\n $activity=new BP_Activity_Activity( $activity_id );\n //since there is a bug in bp 1.2.9 and causes trouble with private notificatin, so let us not notify for any of the private activities\n if( $activity->hide_sitewide )\n return;\n //push the original poster user_id, if the original poster has not commented on his/her status yet\n if( !in_array( $activity->user_id, $users ) && ( get_current_user_id() != $activity->user_id ) )//if someone else is commenting\n array_push ( $users, $activity->user_id );\n \n foreach( (array)$users as $user_id ){\n //create a notification\n bp_notifications_add_notification( array(\n \n 'item_id' => $activity_id,\n 'user_id' => $user_id,\n 'component_name' => $bp->ac_notifier->id,\n 'component_action' => 'new_activity_comment_'.$activity_id \n \n ));//a hack to not allow grouping by component,action, rather group by component and individual action item\n }\n }",
"function wp_notify_postauthor($comment_id, $deprecated = \\null)\n {\n }",
"public function sendAuthorMailWhenCommentHasBeenApprovedAction() {\n\t\t/** @var Comment $comment */\n\t\t$comment = $this->commentRepository->findByCommentUid($this->settings['_commentUid']);\n\n\t\tif ($this->settings['moderateNewComments'] && $this->settings['sendMailToAuthorAfterPublish']) {\n\t\t\t$this->mailUtility->setSettings($this->settings);\n\t\t\t$this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject());\n\t\t\t$this->mailUtility->setControllerContext($this->controllerContext);\n\t\t\t$this->mailUtility->setReceivers($comment->getCommentAuthorMailAddress());\n\t\t\t$this->mailUtility->setTemplatePath($this->settings['sendMailToAuthorAfterPublishTemplate']);\n\t\t\t$this->mailUtility->setSubjectLocallangKey('tx_pwcomments.mailToAuthorAfterPublish.subject');\n\t\t\t$this->mailUtility->setAddQueryStringToLinks(FALSE);\n\t\t\t$this->mailUtility->sendMail($comment);\n\t\t\t$this->addFlashMessage(\n\t\t\t\tLocalizationUtility::translate('mailSentToAuthorAfterPublish', 'PwComments', array($comment->getCommentAuthorMailAddress()))\n\t\t\t);\n\t\t}\n\t}",
"public function comment_notify( $comment_obj ){\n\t\t\n\t\t//This is a message about an assignment\n\t\t$this->type = 'comment_notify';\n\t\t\n\t\t//This code figures out what messages to send related to the assignment being submitted. \n\t\t$asmt = get_post( $comment_obj->comment_post_ID );\t\n\t\t$author = get_user_by( 'email', $comment_obj->comment_author_email );\n\t\t//$asmt_meta = array_map( function( $a ){ return $a[0]; }, get_post_meta( $asmt->ID) );\n\t\t$course_id = $asmt->post_parent; //\n\t\t\t\n\t\t$asmt_url = home_url('/?p=').$course_id.\"#comment-\".$comment_obj->comment_ID;\n\t\t$asmt_admin_url = admin_url('post.php?action=edit&post=').$asmt->ID.\"#comment-\".$comment_obj->comment_ID;\n\t\t$std_admin_url = admin_url('admin.php?page=edit_student&student_id=').$author->ID;\n\t\t$home_url = home_url();\n\t\t\n\t\t//determine source of comment (admin or student)\n\t\t$is_admin = ( is_super_admin( $author->ID ) )? TRUE : FALSE ;\n\t\t\n\t\t/* ob_start();\n\t\tvar_dump($asmt);\n\t\t$results = ob_flush(); */\n\t\t\n\t\tif( $is_admin ){ //if the comment was made by an admin\n\n\t\t\t//student notify\n\t\t\t$this->content = \"A new comment from the course instructor has been posted on the following assignment: \n\n========================\nAssignment Title: {$asmt->post_title}\nAssignment ID: {$asmt->ID}\nLink: {$asmt_url}\n=========================\nNote: You may need to log-in first ({$home_url}), before using the direct assignment link. \n{$this->system_ftr_msg}\";\n \n\t\t\t$this->subject = \"New Instructor Comment on {$asmt->post_title}\";\n\t\t\t$this->recipient = $asmt->post_author; \n\t\t\t$this->status = 'POSTED'; \n\t\t\t$this->active = 'y';\n\t\t\t\n\t\t\t$sent = $this->send_email();\n\t\t\t$this->status .= ( !$sent )? ' UNSENT' : ' SENT' ;\n\t\t\t\n\t\t\t$this->commit();\n\t\t\n\t\t} else {\n\t\t\n\t\t\t//admin notify\n\t\t\t$this->content = \"A new comment from <a href='{$std_admin_url}' target='_blank'>{$author->display_name}</a> has been posted on the following assignment: \n<a href='{$asmt_admin_url}' target='_blank'>{$asmt->post_title}</a>\"; \n\t\t\t$this->recipient = self::INSTRUCTOR; \n\t\t\t$this->status = 'POSTED'; \n\t\t\t$this->active = 'y';\n\t\t\t$this->commit();\n\t\t}\n\t}",
"function open_question_new_feedback_comment_notify($comment, $feedback) {\n if (!module_exists('newsfeed')) {\n watchdog('open_question', 'Enable newsfeed module to notify users of new content.', array(), WATCHDOG_WARNING);\n return;\n }\n $feedback_wrapper = entity_metadata_wrapper('node', $feedback);\n if ($comment->uid == $feedback_wrapper->field_open_question_answer->value()->uid) {\n // If comment author is answer author, send message to feedback author.\n $type = 'oqaf_reviewer_comment_notification';\n $uid = $feedback->uid;\n } elseif ($comment->uid == $feedback->uid) {\n // If comment author is feedback author, send message to answer author.\n $type = 'oqaf_author_comment_notification';\n $uid = $feedback_wrapper->field_open_question_answer->value()->uid;\n } else {\n $uid = FALSE;\n }\n if (!$uid) {\n watchdog('open_question', 'Wrong uid on inserting new comment # @cid for feedback # @nid', array('@cid' => $comment->cid, '@nid' => $feedback->nid), WATCHDOG_WARNING);\n return;\n }\n $fields = array(\n 'field_message_comment' => $comment->cid,\n 'field_message_feedback' => $feedback->nid,\n 'field_message_open_question' => $feedback_wrapper->field_open_question_answer->field_open_question->value()->nid,\n );\n $uids = array(\n $uid => array(\n 'notifiers' => variable_get('message_subscribe_default_notifiers', array('internal' => 'internal')),\n )\n );\n newsfeed_create_message($type, $comment->uid, $feedback, $fields, $uids);\n}",
"public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }",
"function _c4m_user_notifications_comment_insert($comment) {\n if (_c4m_user_notifications_is_cli()) {\n return;\n }\n\n if (_c4m_user_notifications_has_skip_notification($comment)) {\n return;\n }\n\n $node = node_load($comment->nid);\n\n if (_c4m_user_notifications_is_node_unpublished($node)) {\n return;\n }\n\n // Not all content types will trigger notifications.\n $comment_notification_types = c4m_og_get_extended_content_notification_types();\n if (!$node->type || !in_array($node->type, $comment_notification_types)) {\n return;\n }\n\n $wrapper = entity_metadata_wrapper('node', $node);\n\n // Do not notify if it's group content and it's group state is not published.\n if (!empty($wrapper->{OG_AUDIENCE_FIELD}) && $wrapper->{OG_AUDIENCE_FIELD}->c4m_og_status->value() != 'published') {\n return;\n }\n\n // Send MT26 - Users subscribed to comments on this node will receive a\n // notification when they are ALSO subscribed to the node and a new comment\n // is added.\n _c4m_user_notifications_notify_subscribe_commenter_new_comment($comment);\n\n // Send MT22 - Users subscribed to comments on this node will receive a\n // notification when they are NOT ALSO subscribed to the node and a new\n // comment is added. This notification complements MT26 above.\n _c4m_user_notifications_notify_subscribe_follower_new_comment($comment);\n}",
"function wp_new_comment_notify_moderator($comment_ID)\n{\n}",
"public function created(Comment $comment): void\n {\n $comment->createCustomevent()->sendEmailNotification()->setFlashMess();\n }",
"public function publishComment(Comment $comment): void\n {\n if (Comment::STATUS_PUBLISHED === $comment->getStatus()) {\n return;\n }\n\n $comment->setStatus(Comment::STATUS_PUBLISHED);\n $comment->setDatePublished($this->getCurrentTime());\n $this->entityManager->flush($comment);\n }",
"function release_comment_notification($event, $type, $comment) {\n\t\n\tif (!elgg_instanceof($comment, 'object', 'comment')) {\n\t\treturn true;\n\t}\n\t\n\t$release = $comment->getContainerEntity();\n\tif (!elgg_instanceof($release, 'object', 'plugin_release')) {\n\t\treturn true;\n\t}\n\t\n\t$entity = $release->getContainerEntity();\n\t\n\t// plugin releases are owned by the projects, so we need to notify\n\t// plugin owners manually\n\t// Notify if poster wasn't owner\n\t$user = $comment->getOwnerEntity();\n\tif ($entity->owner_guid != $user->guid) {\n\t\t$owner = $entity->getOwnerEntity();\n\n\t\tnotify_user($owner->guid,\n\t\t\t$user->guid,\n\t\t\telgg_echo('generic_comment:email:subject', array(), $owner->language),\n\t\t\telgg_echo('generic_comment:email:body', array(\n\t\t\t\t$entity->title,\n\t\t\t\t$user->name,\n\t\t\t\t$comment->description,\n\t\t\t\t$release->getURL(),\n\t\t\t\t$user->name,\n\t\t\t\t$user->getURL()\n\t\t\t), $owner->language),\n\t\t\tarray(\n\t\t\t\t'object' => $comment,\n\t\t\t\t'action' => 'create',\n\t\t\t)\n\t\t);\n\t}\n\t\n\treturn true;\n}",
"static function notify($author, $body, $post) {\n $post = new Post($post);\n $emails = SQL::current()->select(\"comments\",\n \"author_email\",\n array(\"notify\" => 1, \"post_id\" => $post->id))->fetchAll();\n\n $list = array();\n foreach ($emails as $email)\n $list[] = $email[\"author_email\"];\n\n $config = Config::current();\n\n $to = implode(\", \", $list);\n $subject = $config->name.__(\"New Comment\");\n $message = __(\"There is a new comment at \").$post->url().\"\\n Poster: \".fix($author).\"\\n Message: \".fix($body);\n $headers = \"From:\".$config->email.\"\\r\\n\" .\n \"Reply-To:\".$config->email.\"\\r\\n\".\n \"X-Mailer: PHP/\".phpversion();\n $sent = email($to, $subject, $message, $headers);\n }",
"public function sendAuthorMailWhenCommentHasBeenApprovedAction()\n {\n /** @var Comment $comment */\n $comment = $this->commentRepository->findByCommentUid($this->settings['_commentUid']);\n\n if (isset($this->settings['moderateNewComments']) && $this->settings['moderateNewComments'] &&\n isset($this->settings['sendMailToAuthorAfterPublish']) && $this->settings['sendMailToAuthorAfterPublish']\n ) {\n $this->mailUtility->setFluidTemplate($this->makeFluidTemplateObject());\n $this->mailUtility->setControllerContext($this->controllerContext);\n $this->mailUtility->setReceivers($comment->getCommentAuthorMailAddress());\n $this->mailUtility->setTemplatePath($this->settings['sendMailToAuthorAfterPublishTemplate']);\n $this->mailUtility->setSubjectLocallangKey('tx_pwcomments.mailToAuthorAfterPublish.subject');\n $this->mailUtility->setAddQueryStringToLinks(false);\n $this->mailUtility->sendMail($comment);\n $this->addFlashMessage(\n LocalizationUtility::translate(\n 'mailSentToAuthorAfterPublish',\n 'PwComments',\n [$comment->getCommentAuthorMailAddress()]\n )\n );\n }\n\n return '';\n }",
"public function notify()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get All Banner by type | public function getAllBannerByType($type)
{
$collection = $this->_imageCollectionFactory->create();
$iCollection = $collection->getCollection()
->addFieldToFilter('image', array('notnull' => true))
->addFieldToFilter('layout', $type);
$dd = $iCollection->getData();
return $dd;
} | [
"public function getBannersList() {\n $sql = 'SELECT bwb.*, bwbl.`title`, bwbl.`url`, bwbl.`image`\n FROM `' . _DB_PREFIX_ . 'bwcatbanner_banner` bwb\n LEFT JOIN `' . _DB_PREFIX_ . 'bwcatbanner_banner_lang` bwbl\n ON (bwb.`id_item` = bwbl.`id_item`)\n WHERE bwb.`id_shop` = ' . (int) Context::getContext()->shop->id . '\n AND bwbl.`id_lang` = ' . (int) Context::getContext()->language->id;\n\n return Db::getInstance()->executeS($sql);\n }",
"function banners_get_banners_list_html($language, $type)\n{\n\tglobal $_cms_banners_table;\n\n\t$res=query(\"select * from $_cms_banners_table where language='$language' and type='$type' order by menu_item, sort desc, id desc\");\n\t$html='';\n\twhile($r=mysql_fetch_assoc($res))\n\t\t$html.=banners_get_single_banner_html($r);\n\tmysql_free_result($res);\n\treturn $html;\n}",
"public function getListBanners(): array\n {\n return self::find()\n ->select(['id', 'image'])\n ->where(['status' => 1])\n ->andWhere(['>', 'end_date', time()])\n ->andWhere(['<', 'start_date', time()])\n ->all();\n }",
"function getBanners() {\n\n\t\t$items = array();\n\n\t\t$advertiserList = $this->service->getAdvertiserListByAgencyId($this->agencyId);\n\t\tforeach ($advertiserList as $advertiser) {\n\n\t\t\t// Get every campaigns on this website\n\t\t\t$campaignList = $this->service->getCampaignListByAdvertiserId($advertiser->advertiserId);\n\t\t\tforeach ($campaignList as $campaign) {\n\n\t\t\t\t// Get every campaigns on this website\n\t\t\t\t$bannerList = $this->service->getBannerListByCampaignId($campaign->campaignId);\n\t\t\t\tforeach ($bannerList as $banner) {\n\n\t\t\t\t\t$items[] = array(0 => $advertiser->advertiserName.' >> '.$campaign->campaignName.' >> '.$banner->bannerName, 1 => $banner->bannerId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}",
"public function getBanners(){\r\n\t\t//GET: banners list.\r\n\t\t$banners = $this->Banner->find('all',array('conditions'=>array('Banner.status'=>0),'order'=>array('Banner.id'=>'DESC')));\r\n\t\t$banners = Set::extract('{n}.Banner',$banners);\r\n\t\t//GET: refresh rate.\r\n\t\t$refreshRate = $this->RefreshRate->find('first');\r\n\t\t$refreshRate = Set::extract('RefreshRate',$refreshRate);\r\n\t\t$refreshRate = $refreshRate['refresh_rate'];\r\n\t\t//CREATE: a response array.\r\n\t\t$responsearray = array();\r\n\t\t$responsearray['refresh_rate'] = $refreshRate;\r\n\t\t$responsearray['banners'] = $banners;\r\n\t\t//ENCODE: the response in the json format.\r\n\t\t$this->_jsonEncode(0,'Banners List',$responsearray);\r\n\t}",
"public function getBannerCollection()\r\n {\r\n $banners = $this->_block->getBanners();\r\n $dateTimeNow = $this->_stdTimezone->date()->format('Y-m-d H:i:s');\r\n\r\n $bannerCollection = $this->_bannerCollectionFactory->create()\r\n ->addFieldToFilter('banner_id', ['in' => $banners])\r\n ->addFieldToFilter('is_active', 1)\r\n ->addFieldToFilter('start_time', [['to' => $dateTimeNow], ['start_time', 'null' => '']])\r\n ->addFieldToFilter('end_time', [['gteq' => $dateTimeNow], ['end_time', 'null' => '']])\r\n ->setOrder('sort_order', 'ASC');\r\n\r\n if ($this->_block->getDisplayType() == 2) {\r\n $bannerCollection->getSelect()->order('rand()');\r\n $bannerCollection->setPageSize(1);\r\n }\r\n\r\n return $bannerCollection;\r\n }",
"public function getBanners()\n {\n //select 3 newest banners\n $result =$this->conn->query(\"SELECT *FROM Banner ORDER BY ID LIMIT 3\");\n\n $banners = array();\n\n while ($item =$result->fetch_assoc())\n $banners[] =$item;\n return $banners;\n\n }",
"public function getBanners($langCode, $locationType = null, $location = null) {\n $qb = $this->createQueryBuilder('b')\n ->select('b, country, region, subregion, city, language')\n ->leftJoin('b.languages', 'language')\n ->leftJoin('b.country', 'country')\n ->leftJoin('b.region', 'region')\n ->leftJoin('b.subregion', 'subregion')\n ->leftJoin('b.city', 'city')\n ->leftJoin('city.region', 'cityRegion')\n ->leftJoin('cityRegion.country', 'cityCountry')\n ->andWhere('language.code = :langCode')\n ->setParameter('langCode', $langCode);\n\n if(!is_null($locationType) && !is_null($location)) {\n switch($locationType) {\n case 'country':\n $qb->andWhere('country.en = :location');\n break;\n case 'region':\n $qb\n ->andWhere('region.en = :location OR country.en = :country')\n ->setParameter('country', $location->getCountry()->getEn());\n break;\n case 'subregion':\n $qb\n ->andWhere('subregion.en = :location OR region.en = :region OR country.en = :country')\n ->setParameter('country', $location->getRegion()->getCountry()->getEn())\n ->setParameter('region', $location->getRegion()->getEn());\n break;\n case 'city':\n $qb\n ->andWhere('city.en = :location OR country.en = :country OR region.en = :region OR subregion.en = :subregion')\n ->setParameter('country', $location->getRegion()->getCountry()->getEn())\n ->setParameter('region', $location->getRegion()->getEn())\n ->setParameter('subregion', $location->getSubregion()->getEn());\n\n break;\n default:\n $qb->andWhere('country.en = :location');\n break;\n }\n\n $qb->setParameter('location', $location->getEn());\n }\n\n $result = $qb->getQuery()->getResult();\n $numResults = count($result);\n\n if($numResults >= 3)\n return $result;\n\n $keys = array();\n foreach($result as $res) {\n array_push($keys, $res->getId());\n }\n\n $limit = 3 - $numResults;\n\n # Search for more accommodations\n $qb2 = $this->createQueryBuilder('b')\n ->select('b')\n ->groupBy('b.id')\n ->where(\"b.id NOT IN (:keys)\")\n ->setParameter('keys', $keys)\n ->setMaxResults($limit);\n\n foreach($qb2->getQuery()->getResult() as $acc) {\n array_push($result, $acc);\n }\n\n return $result;\n }",
"public function getBanners()\n {\n return $this->banners;\n }",
"public function getItems($type);",
"public static function find_all($type = 3) {\n if ($type==1){\n return static::find_by_sql(\"SELECT * FROM category WHERE is_reward=0\");\n } elseif ($type==2) {\n return static::find_by_sql(\"SELECT * FROM category WHERE is_reward=1\");\n } elseif ($type==4) {\n return static::find_by_sql(\"SELECT * FROM category WHERE is_reward=2\");\n } else {\n return static::find_by_sql(\"SELECT * FROM category\");\n }\n \n }",
"function getCarbyType($type){\n $query = $this->db->prepare(\"SELECT * FROM car WHERE Type = :type \");\n $query->execute(array(\"type\" => $type,));\n $allcars = $query->fetchAll(PDO::FETCH_ASSOC);\n $cars = [];\n foreach ($allcars as $car) {\n $cars[] = new Cars($car);\n }\n return $cars;\n \n }",
"public function hasBanner($type);",
"public function testFindDisplayByBannerTypeMultiple()\n {\n $this->addFixture(new MoreBannerData);\n $this->executeFixtures();\n $banners = $this->em->getRepository('NiftyThriftyShopBundle:Banner')->findByBannerType('home_upper_right');\n $this->assertTrue(sizeof($banners) > 0);\n \n $bannersFound = array();\n \n // Run through the banner finder a bunch of times and presume both will be returned.\n for ($i=0; $i<100; $i++) {\n $banner = $this->em->getRepository('NiftyThriftyShopBundle:Banner')->findDisplayBannerByType('home_upper_right');\n if (!(in_array($banner->getBannerId(), $bannersFound))) $bannersFound[] = $banner->getBannerId();\n }\n\n $this->assertTrue(in_array(1, $bannersFound));\n $this->assertTrue(in_array(6, $bannersFound));\n }",
"public function allBooksOderedByType()\n {\n $qb = $this->createQueryBuilder('b')\n ->select('b.title, b.type, b.isbn, b.author')\n ->orderBy('b.type');\n\n $query = $qb->getquery();\n \n return $query->execute();\n }",
"public function getBookByType($type = null)\n {\n $result = $this->find('All')->toArray();\n return $result;\n }",
"public function getAllItems($type = 0){\n \t\t\n\t\t$sql = \"SELECT idItem, iTipoItem, cNombre, cDescripcion, cUbicacion, cTramo, fLatitud, fLongitud, cIp, \n\t\t\t\tiExtension, ipCamara, puertoCamara, usuarioCamara, passCamara,bVideo\n \t\t\t\tFROM items \n\t\t\t\tWHERE iTipoItem = $type \n\t\t\t\tORDER BY idItem ASC\";\n \t\n \t\t$result = $this->query($sql);\n \t\n \t\treturn $result;\n \t}",
"public function getBanners($options = array()) {\r\n\t\t$sql = \"SELECT `id`, `name`, `image`, `link`, `last_update`, `dateline`, `active`, `width`, `height`, `video`,`flash`,`note`,`hash_folder` \";\r\n\t\t$from = \" FROM `banner` \";\r\n\t\t$where = \" WHERE 1 = 1 \";\r\n\t\tif($options['id']) {\r\n\t\t\t$where .= \" AND `id` = {$this->_db->quote($options['id'], 'INTEGER')} \";\r\n\t\t}\r\n\t\t\r\n\t\t$order = \" ORDER BY `id` DESC \";\r\n\t\tif($options['order'] && $options['by']) {\r\n\t\t\t$order = \" ORDER BY `{$options['order']}` {$options['by']} \";\r\n\t\t}\r\n\t\t\r\n\t\t$limit = \"\";\r\n\t\t\r\n\t\tif(isset($options['offset']) && $options['offset'] >=0 && $options['limit'] >0) {\r\n\t\t\t$limit = \" limit {$this->_db->quote($options['offset'], 'INTEGER')}, {$this->_db->quote($options['limit'], 'INTEGER')} \"; \r\n\t\t}\r\n\t\tif($options['id']) {\r\n\t\t\t$result = $this->_db->fetchRow( $sql . $from . $where . $order . $limit );\r\n\t\t} else {\r\n\t\t\t$result = $this->_db->fetchAll ( $sql . $from . $where . $order . $limit );\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"private function get_all_by_type( $type ){\n $arr = array();\n switch( $type ){\n case 1: //Page\n $exclude = $this->get_shortcut_pages();\n $exclude =\n array_merge( $exclude, array(@intval( $_REQUEST['post'] )) ); //Exclude edited page to avoid loops\n $args = array(\n 'post__not_in' => $exclude,\n 'post_type' => 'page',\n 'posts_per_page' => -1,\n 'post_status' => 'publish',\n 'orderby' => 'title',\n 'order' => 'ASC'\n );\n $query = new WP_Query( $args );\n if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post();\n $arr[get_the_ID()] = get_the_title();\n endwhile;endif;\n break;\n case 2: //External\n break;\n case 3: //PDF\n $args = array(\n 'post_type' => 'attachment',\n 'numberposts' => NULL,\n 'post_status' => NULL,\n 'post_mime_type' => 'application/pdf'\n );\n $attachments = get_posts( $args );\n if( $attachments ){\n foreach( $attachments as $attachment ){\n $arr[$attachment->ID] = apply_filters( 'the_title', $attachment->post_title );\n }\n }\n break;\n }\n return $arr;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load a data fixture class. | private function loadFixtureClass(DataFixturesLoader $loader, $className)
{
$fixture = new $className();
if ($loader->hasFixture($fixture)) {
unset($fixture);
return;
}
$loader->addFixture($fixture);
if ($fixture instanceof DependentFixtureInterface) {
foreach ($fixture->getDependencies() as $dependency) {
$this->loadFixtureClass($loader, $dependency);
}
}
} | [
"function loadFixtures() {\n\t\t$args = func_get_args();\n\t\tforeach ($args as $class) {\n\t\t\tCakeFixtureManager::loadSingle($class);\n\t\t}\n\t}",
"public function load($fixture_data) {\n $this->created_at = new \\DateTime($fixture_data['created_at']);\n $this->teams = array(\n new Team($fixture_data['teams'][0]),\n new Team($fixture_data['teams'][1])\n );\n $this->location = new Ground($fixture_data['location']);\n $this->kickoff = new \\DateTime($fixture_data['kickoff']);\n $this->result = array_key_exists('result', $fixture_data) && count($fixture_data['result']) === 2 ? $fixture_data['result'] : null;\n return $this;\n }",
"public static function load($class);",
"abstract protected function willLoadFixture();",
"public function load()\n {\n $this->fixtures = [];\n $files = $this->getFilesystem()->listFiles();\n\n foreach ($files as $file)\n {\n $fixture = new \\stdClass();\n $fixture->table = $file['filename'];\n $fixture->format = $file['extension'];\n $fixture->path = $file['path'];\n\n $this->fixtures[$fixture->table] = $fixture;\n }\n }",
"public static function load($class){}",
"static function Load($name,$options = array()){\n\t\tglobal $ATK14_GLOBAL;\n\n\t\t$options += array(\n\t\t\t\"class_name\" => null,\n\t\t\t\"dbmole\" => $GLOBALS[\"dbmole\"],\n\n\t\t\t\"reload_fixture\" => false,\n\t\t);\n\n\t\tif(!$options[\"reload_fixture\"] && isset(self::$loaded_fixtures[$name])){\n\t\t\treturn self::$loaded_fixtures[$name];\n\t\t}\n\n\t\t$dbmole = $options[\"dbmole\"];\n\t\n\t\t$dir = $ATK14_GLOBAL->getApplicationPath().\"/../test/fixtures/\";\n\t\t$filename = \"$dir/$name.yml\";\n\n\t\tif (!file_exists($filename)) {\n\t\t\tthrow new Exception(\"Fixture $name not found ($filename)\");\n\t\t}\n\n\t\t$content = Files::GetFilecontent($filename);\n\n\t\t// Getting all fixtures from the fixtures directory\n\t\t$all_fixtures = array();\n\t\tforeach(Files::FindFiles($dir,array(\"maxdepth\" => 1, \"pattern\" => '/^[a-z0-9_]+\\.yml/')) as $_f){\n\t\t\t$all_fixtures[] = preg_replace('/^.*\\/([^\\/]+)\\.yml/','\\1',$_f);\n\t\t}\n\n\t\t// Getting all fixtures which are used in the requested fixture\n\t\t// I know that the method may not be totally accurate but it's okay to load a bit more fixtures then is actually needed.\n\t\tpreg_match_all('/\\$('.join('|',$all_fixtures).'\\b)/',$content,$matches);\n\t\t$required_fixtures = $matches[1] ? array_combine($matches[1],$matches[1]) : array(); // PHP5.3 Warning: array_combine(): Both parameters should have at least 1 element\n\t\tunset($required_fixtures[$name]);\n\t\t$required_fixtures = array_values($required_fixtures);\n\n\t\t// Auto-loading of all used fixtures\n\t\tforeach($required_fixtures as $required_fixture){\n\t\t\tAtk14Fixture::Load($required_fixture);\n\t\t}\n\n\t\tif(!$options[\"reload_fixture\"] && isset(self::$loaded_fixtures[$name])){\n\t\t\treturn self::$loaded_fixtures[$name];\n\t\t}\n\n\t\t$class_name = $options[\"class_name\"];\n\t\tif(is_null($class_name)){\n\t\t\t// In the fixture YAML file there can be class set this way:\n\t\t\t//\n\t\t\t// # class_name: Article\n\t\t\tif(preg_match('/^(.*\\n|)# *class_name: +\"?(?P<class_name>[a-zA-Z0-9_]+)\"?\\s*(\\n.*|)$/s',$content,$matches)){\n\t\t\t\t$class_name = $matches[\"class_name\"];\n\t\t\t}\n\t\t}\n\n\t\t$table_name = \"\";\n\t\tif(preg_match('/^(.*\\n|)# *table_name: +\"?(?P<table_name>[a-zA-Z0-9_]+)\"?\\s*(\\n.*|)$/s',$content,$matches)){\n\t\t\t// In the fixture YAML file there can be table_name set this way:\n\t\t\t//\n\t\t\t// # table_name: article_images\n\t\t\t$table_name = $matches[\"table_name\"];\n\t\t}\n\n\t\tif(strlen($class_name)==0 && strlen($table_name)==0){\n\t\t\t$class_name = String4::ToObject($name)->singularize()->camelize()->toString(); // \"gallery_items\" -> \"GalleryItem\"\n\t\t\tif(!class_exists($class_name) || !method_exists($class_name,'CreateNewRecord')){\n\t\t\t\t$class_name = \"\";\n\t\t\t}\n\t\t}\n\n\t\t$data = miniYAML::Load(Files::GetFileContent($filename),array(\n\t\t\t\"interpret_php\" => true,\n\t\t\t\"values\" => &self::$loaded_fixtures, // [\"products\" => [...], \"\"]\n\t\t));\n\t\tif(!$data){\n\t\t\tthrow new Exception(\"Parsing YAML failed in $filename\");\n\t\t}\n\n\t\t$list = new Atk14FixtureList($class_name);\n\t\tforeach($data as $k => $values) {\n\t\t\tif($class_name){\n\t\t\t\t$o = $class_name::CreateNewRecord($values);\n\t\t\t}elseif($table_name){\n\t\t\t\t$dbmole->insertIntoTable($table_name,$values);\n\t\t\t\t$o = $values;\n\t\t\t}else{\n\t\t\t\t// default\n\t\t\t\t$dbmole->insertIntoTable($name,$values);\n\t\t\t\t$o = $values;\n\t\t\t}\n\t\t\t//$list[$k] = $o->getId();\n\t\t\t$list[$k] = $o;\n\t\t}\n\n\t\tself::$loaded_fixtures[$name] = $list;\n\n\t\treturn $list;\n\t}",
"public static function loadDataFixtures()\n {\n static::loadWebsiteFixtures();\n }",
"protected function loadFromFile(DataFixturesLoader $loader, $path)\n {\n $sourceFile = realpath($path);\n require_once $sourceFile;\n\n $declared = get_declared_classes();\n\n foreach ($declared as $className) {\n $reflClass = new ReflectionClass($className);\n\n if ($reflClass->getFileName() == $sourceFile\n && !$loader->isTransient($className))\n {\n $fixture = new $className;\n $loader->addFixture($fixture);\n }\n }\n }",
"protected static function loadFixtures()\n {\n $entityManager = static::$container->get('doctrine')->getManager();\n $loader = new Loader();\n\n static::addFixtures($loader, static::getFixtures());\n\n $purger = new ORMPurger($entityManager);\n $executor = new ORMExecutor($entityManager, $purger);\n $executor->execute($loader->getFixtures());\n }",
"public function load()\n {\n $this->resetIndex();\n $this->data = [];\n\n $idField = '_id';\n\n foreach ($this->getData() as $alias => $row) {\n $options = [];\n $id = isset($row[$idField]) ? $row[$idField] : null;\n unset($row[$idField]);\n if (isset($row['_parent'])) {\n $options['parent'] = $row['_parent'];\n unset($row['_parent']);\n }\n\n try {\n $response = $this->db->createCommand()->insert($this->index, $this->type, $row, $id, $options);\n } catch(\\yii\\db\\Exception $e) {\n throw new \\yii\\base\\Exception(\"Failed to insert fixture data \\\"$alias\\\": \" . $e->getMessage() . \"\\n\" . print_r($e->errorInfo, true), $e->getCode(), $e);\n }\n if ($id === null) {\n $row[$idField] = $response['_id'];\n }\n $this->data[$alias] = $row;\n }\n // ensure all data is flushed and immediately available in the test\n $this->db->createCommand()->refreshIndex($this->index);\n }",
"protected function loadData()\n {\n return Yaml::parse(\n file_get_contents(\n realpath(__DIR__ . '/../fixtures/bible_books.yaml')\n )\n );\n }",
"private function loadFixtureFile()\n {\n $this->sqlFile = file_get_contents(__DIR__.'/Fixtures/'.$this->sqlFileName.'.sql');\n }",
"protected function loadIfNecessary($class)\r\n {\r\n if (class_exists($class, false)) {\r\n // Class is already loaded.\r\n return;\r\n }\r\n $pathSegment = str_replace('_', '/', $class);\r\n require_once(dirname(__FILE__) . '/TestData/'. $pathSegment . '.php');\r\n }",
"public function setUpFixtures($class_file = NULL) {\n\n $pattern = $this->fixturePath($class_file) . '/*.txt';\n\n foreach (glob($pattern) as $file) {\n $property = basename($file, '.txt');\n $this->{$property} = unserialize(file_get_contents($file));\n }\n }",
"public function load()\n\t{\n\t\t$this->data = [];\n\t\t$table = $this->getTableSchema();\n\t\t// we will check that our fixture data has real db column keys and ignore missing in DB\n\t\t$columns = array_keys($table->columns);\n\t\t$columns = array_flip($columns);\n\t\tforeach ($this->getData() as $alias => $row) {\n\t\t\t$safeRow = array_intersect_key($row, $columns);\n\t\t\t$primaryKeys = $this->db->schema->insert($table->fullName, $safeRow);\n\t\t\t$this->data[$alias] = array_merge($row, $primaryKeys);\n\t\t}\n\t}",
"private function getFixtures()\n {\n $fixtures = [\n 'AppBundle\\DataFixtures\\ORM\\LoadCountryData',\n 'AppBundle\\DataFixtures\\ORM\\LoadLocalityData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightTypeData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightData',\n 'AppBundle\\DataFixtures\\ORM\\LoadUserData',\n 'AppBundle\\DataFixtures\\ORM\\LoadSightReviewData',\n ];\n\n $this->loadFixtures($fixtures);\n }",
"public function loadClass($class);",
"public function fixtures($args)\n {\n $ymlFiles = func_get_args();\n $last = end($ymlFiles);\n $options = is_array($last) ? array_pop($ymlFiles) : array();\n\n // don't load fixtures for these methods\n if (isset($options['except'])) {\n if (in_array($this->getName(), $options['except'])) return;\n }\n // only load fixtures for these methods\n if (isset($options['only'])) {\n if (!in_array($this->getName(), $options['only'])) return;\n }\n\n // Add fixtures to the existing fixtures when called more than once\n if (empty($this->_fixtures)) {\n $this->_fixtures = new Mad_Test_Fixture_Collection($this->_conn, $ymlFiles);\n } else {\n $this->_fixtures->addFixture($ymlFiles);\n }\n\n // Build models from fixture records\n foreach ($this->_fixtures->getFixtures() as $fixture) {\n $name = $fixture->getYmlName();\n if (isset($this->_fixtureClassNames[$name])) {\n $class = $this->_fixtureClassNames[$name];\n } else {\n $table = $fixture->getTableName();\n $class = Mad_Support_Inflector::classify($table);\n }\n \n // skip building model if class doesn't exist\n if (!Mad_Support_Base::modelExists($class)) { break; }\n $model = new $class;\n\n $this->_records[$name] = array();\n foreach ($fixture->getRecords() as $recordName => $attrs) {\n $this->_records[$name][$recordName] = $model->instantiate($attrs); \n }\n }\n\n // @deprecated - assign public properties based on fixture names\n foreach ($this->_fixtures->getRecords() as $recordName => $values) { \n if (isset($this->$recordName)) {\n $this->$recordName = array_merge($this->$recordName, $values);\n } else {\n $this->$recordName = $values;\n }\n // make all values strings\n foreach ($this->$recordName as &$value) $value = (string) $value;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the list of departments indexed by the DeptID | public static function GetDepartmentListIndexedbyID() {
global $dbh;
$deptList = array();
$stmt = $dbh->prepare('SELECT * FROM fac_Department ORDER BY Name ASC');
$stmt->execute();
while ($row = $stmt->fetch()) {
$dept = Department::RowToObject($row);
$deptList[$dept->DeptID] = $dept;
}
return $deptList;
} | [
"function getDepartments() {\n\n if(!$this->departments) {\n $sql='SELECT dept_id FROM '.GROUP_DEPT_TABLE\n .' WHERE group_id='.db_input($this->getId());\n if(($res=db_query($sql)) && db_num_rows($res)) {\n while(list($id)=db_fetch_row($res))\n $this->departments[]= $id;\n }\n }\n\n return $this->departments;\n }",
"public function getDepartmentList() {\n $deptListQuery = \"select es_departmentsid,es_deptname from dlvry_departments\";\n $deptListData = $this->db->query($deptListQuery);\n $deptListResult = $deptListData->result_array();\n\n return $deptListResult;\n }",
"public static function getDepartmentList()\n {\n $droptions = Department::find()->asArray()->all();\n return ArrayHelper::map($droptions, 'id', 'dept_name');\n }",
"public function getAllDepartments()\n {\n $query = 'SELECT * FROM ' . $this->tableName;\n return $this->getAll($query);\n }",
"public function getDepartments()\n {\n $api = sprintf('department/list?access_token=%s', $this->accessToken);\n\n return $this->output($this->guzzleClient->get($api), true);\n }",
"public function getDepartmentList()\n {\n return $this->departmentRepository->findAll();\n\n }",
"public function getDepartments()\n {\n // TODO\n return array();\n }",
"public static function get_department_list() {\n\n\t\t$departments = array(\n\n\t\t\t'arts' => array(\n\t\t\t\t'philosophy' => 'Philosophy',\n\t\t\t\t'drama' => 'Drama',\n\t\t\t),\n\n\t\t\t'medicine' => array(\n\t\t\t\t'nursing' => 'Nursing',\n\t\t\t\t'midwifery' => 'Midwifery',\n\t\t\t),\n\n\t\t\t'sauder' => array(\n\t\t\t\t'sauder' => 'Sauder',\n\t\t\t),\n\n\t\t);\n\n\t\treturn apply_filters( 'ubc_press_departments_list', $departments );\n\n\t}",
"public function getDepartment(){\n\t\t\t$sql = \"select * from \".self::departmentTable;\n\t\t\t$rows = $this->executeGenericDQLQuery($sql);\n\t\t\t$department = array();\n\t\t\tfor($i = 0; $i < sizeof($rows); $i ++){\n\t\t\t\t$department[$i]['id'] = $rows[$i]['dep_id'];\n\t\t\t\t$department[$i]['name'] = $rows[$i]['dep_name'];\n\t\t\t}\n\t\t\t$this->sendResponse(200,$this->messages['dataFetched'],$department);\n\t\t}",
"public function consultAllDepartments() {\n\n $departments = new Departments();\n return $departments->allDepartments();\n }",
"function get_departments() {\n global $conn;\n\n $query = \"SELECT * FROM departments ORDER BY department_name\";\n $departments = $conn->GetAll($query);\n return $departments;\n }",
"public static function getAllDepartments()\n {\n return self::with('employerDepartments')->get();\n }",
"public static function getAllDepartments()\n {\n if (! $departmentListArray = self::$cache->get('allDepartments')) {\n $query = self::$db->select('id, name')\n ->order_by('name')\n ->get('department');\n $departmentListArray = $query->result();\n \n self::$cache->save('allDepartments', $departmentListArray, 1200);\n }\n return $departmentListArray;\n }",
"public function getDepartment()\n\t{\n\t\t$this->load->database();\n\t\t$info = $this->db->query(\"Select department_name FROM departments WHERE department_id = \". $this->department_id);\n\t\treturn $info->row_array();\n\t}",
"public function get_department_dropdown_items() {\n $this->db->query('SELECT id, name FROM departments WHERE id > 0');\n\n // Fetching id and name of all department(s)\n return $this->db->resultSet();\n\n }",
"public function getByDeptName(string $dept_name): ?array {\n $query = $this->entityTypeManager->getStorage('taxonomy_term')->getQuery()\n ->condition('vid', 'team_departments')\n ->condition('name', $dept_name)\n ->range(0, 1);\n\n if (!$dept_ids = $query->execute()) {\n return NULL;\n }\n\n return $this->getByDeptId((int) array_pop($dept_ids));\n }",
"function getdeptlist()\r\n\t{\r\n\t\t$sql = 'select deptname, empname from dept, emp where emp.desig_id = 2 AND emp.dept_id = dept.id';\r\n\t\t$query = $this->db->query($sql);\r\n\t\t$result = $query->result();\r\n\t\treturn $result;\r\n\t}",
"private function selectDepartments () {\n\t\t$arFilter = array('IBLOCK_ID'=>self::depBlockID, 'GLOBAL_ACTIVE'=>'Y');\n\t\t$rsSect = CIBlockSection::GetList(array($by=>$order), $arFilter, false);\n\n\t\twhile($arSect = $rsSect->Fetch()) {\n\t\t\tif (strlen(trim($arSect['XML_ID'])) > 0) {\n\t\t\t\t$this->arDepartments[trim($arSect['XML_ID'])] = $arSect['ID'];\n\t\t\t}\n\t\t}\n\t}",
"public function getLivechatDepartments()\n {\n $list = $this->loadLivechatDepartments();\n if(!$list) return [];\n\n $result = [];\n foreach($list as $livechatDepartmentData){\n $livechatDepartment = new Model\\Livechat\\Department();\n $livechatDepartment->setRemoteData($livechatDepartmentData);\n $livechatDepartment->loadInfo();\n $result[$livechatDepartment->id] = $livechatDepartment;\n }\n return $result;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ensures that removeSuffix() removes the suffix only once. | public function testRemoveSuffixRemovesSuffixOnlyOnce()
{
$result = StringUtil::removeSuffix('demotesttest', 'test');
$this->assertEquals('demotest', $result);
} | [
"public function testRemoveSuffixRemovesProvidedSuffix()\n {\n $result = StringUtil::removeSuffix('this is a test string', ' string');\n $this->assertEquals('this is a test', $result);\n }",
"public function testLengthWithoutSuffixesStringWithDoubleSuffixMatchSubtractOnce()\n {\n static::assertSame(7, Strings::lengthWithoutSuffixes('UnitFooBar', array('Foo', 'Bar')));\n }",
"public function testRemovePrefixRemovesPrefixOnlyOnce()\n {\n $result = StringUtil::removePrefix('testtestdemo', 'test');\n $this->assertEquals('testdemo', $result);\n }",
"public function removeBySuffix($keySuffix) { }",
"public function hasSuffix() {\n return $this->suffix != null;\n }",
"public function hasSuffix(): bool\n {\n return false !== strpos($this->getVersion(), '-');\n }",
"public function testLengthWithoutSuffixesStringWithoutSubtractSuffixMatch()\n {\n static::assertSame(8, Strings::lengthWithoutSuffixes('UnitTest', array('Foo', 'Bar')));\n }",
"function _remove_url_suffix(){\n\t\t\tif ($this->core->get_config_item('url_suffix') != \"\"){\n\t\t\t\t$this->uri_string = preg_replace(\"|\".preg_quote($this->core->get_config_item('url_suffix')).\"$|\", \"\", $this->uri_string);\n\t\t\t}\n\t\t}",
"function zuhaus_mikado_filter_suffix( $value, $suffix ) {\n\t\tif ( $value !== '' && zuhaus_mikado_string_ends_with( $value, $suffix ) ) {\n\t\t\t$value = substr( $value, 0, strpos( $value, $suffix ) );\n\t\t}\n\t\t\n\t\treturn $value;\n\t}",
"function moments_qodef_filter_suffix( $value, $suffix ) {\n\t\tif ( $value !== '' && moments_qodef_string_ends_with( $value, $suffix ) ) {\n\t\t\t$value = substr( $value, 0, strpos( $value, $suffix ) );\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function setSuffix(string $suffix);",
"public static function removeSuffix($subject, $suffix)\n {\n if (!self::endsWith($subject, $suffix)) {\n // Nothing to remove.\n return $subject;\n }\n return substr($subject, 0, strlen($subject) - strlen($suffix));\n }",
"public static function assertStringEndsWith(string $suffix, string $string, string $message = ''): \\void {}",
"public function testBeforeSaveSuffix() {\n\t\t$suffix = '_cleaned';\n\t\t$this->TestPurifiableModel->Behaviors->unload('Purifiable.Purifiable');\n\t\t$this->TestPurifiableModel->Behaviors->load('Purifiable.Purifiable', array('fields' => array('body'), 'affix' => $suffix));\n\t\t$data = array(\n\t\t\t'TestPurifiableModel' => array(\n\t\t\t\t'body' => $this->str\n\t\t\t)\n\t\t);\n\t\t$result = $this->TestPurifiableModel->save($data);\n\t\t$this->assertEquals($this->expectedStr, $result['TestPurifiableModel']['body' . $suffix]);\n\t}",
"public function endsWith($suffix)\n {\n $suffix = $this->toValue($suffix);\n $expectedPosition = mb_strlen($this->value) - mb_strlen($suffix);\n return mb_strrpos($this->value, $suffix) === $expectedPosition;\n }",
"function isMoveToNewSuffix(){\n $orig_suffix = extractDNSuffix($this->getAccountContainer()->dn_orig);\n if (strcmp($orig_suffix, $this->getAccountContainer()->dnSuffix) != 0 && !$this->getAccountContainer()->isNewAccount){\n return true;\n }\n return false;\n }",
"function endsWith(string $suffix)\n {\n if (!$suffix) return false;\n $suffix_len = (strlen($suffix) * -1);\n if (substr($this->str,$suffix_len) == $suffix) return true;\n return false;\n }",
"public static function uniquePathSuffix(string $path, string $suffixPrefix = ''): string {\n\t\t$i = 1;\n\t\t$suffix = $suffixPrefix;\n\n\t\twhile (file_exists(self::appendSuffixToPath(self::fullPagePath($path), $suffix))) {\n\t\t\t$suffix = $suffixPrefix . '-' . $i++;\n\t\t}\n\n\t\treturn $suffix;\n\t}",
"public function _removeUrlSuffix()\r\n {\r\n global $config;\r\n\r\n if ($config['url_suffix'] != '') {\r\n $this->uri_string = preg_replace(\"|\" . preg_quote($config['url_suffix']) . \"$|\", '', $this->uri_string);\r\n }\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Validation Stem Numeration \ Numeration character to be displayed to the left of the validation label. \ | public function get_validation_stem_numeration()
{
return $this->validation_stem_numeration;
} | [
"public function get_validation_stem_numeration() {\n return $this->validation_stem_numeration;\n }",
"function get_sexe($sexe){\r\n\t\treturn ($sexe == 'M' ? 'Masculin' : 'Féminin');\r\n\t}",
"public function getDlblNumFormat(): string\n {\n return $this->DlblNumFormat;\n }",
"public function getRequiredSymbol(): string\n {\n return $this->requiredSimbol;\n }",
"function _make_nom() {\n $info = $this->_make_label();\n return $info['nom'];\n }",
"protected function get_k()\n {\n global $do_thousands, $app_strings;\n if ($do_thousands) {\n return $app_strings['LBL_THOUSANDS_SYMBOL'];\n } else {\n return '';\n }\n }",
"public function getNumericalMark()\n\t{\n\t\treturn $this->numerical_mark;\n\t}",
"function getSwimmerLabelFormatCode()\n {\n return ($this->__swimmer_label_format_code) ;\n }",
"public function getLabel()\n {\n \\System::loadLanguageFile('zodiacsigns');\n\n $strKey = $this->getLatin();\n\n return $GLOBALS['TL_LANG']['ZODIACSIGN'][$strKey] ?: $strKey;\n }",
"protected function _getErrorNumber()\n {\n return '';\n }",
"public function getMaskingCharacter()\n {\n return $this->masking_character;\n }",
"public function getTextKerning(): float {}",
"protected function getSpaceString() {\n\t\t$spacestr = chr(32);\n\t\tif ($this->isUnicodeFont()) {\n\t\t\t$spacestr = chr(0).chr(32);\n\t\t}\n\t\treturn $spacestr;\n\t}",
"public function getTaxNumberFormatted(){\n return '<span class=\"label label-success \">' . strtoupper($this->tax_no) . '</span>';\n }",
"function ecgValueToText($value){\n\t\tswitch ($value) {\n\t\t\tcase '0':\n\t\t\t\t$text = \"Normal\";\n\t\t\t\tbreak;\n\t\t\tcase '1':\n\t\t\t\t$text = \"ST-T Wave abnormality\";\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$text = \"Left ventricular hypertrophy\";\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $text;\n\t}",
"public function set_validation_stem_numeration ($validation_stem_numeration) {\n $this->validation_stem_numeration = $validation_stem_numeration;\n }",
"function getCleanScientificTitle() {\n\t\treturn $this->getData('cleanScientificTitle');\n\t}",
"function fluid_edge_get_font_option_val($option_val) {\n $option_val = str_replace('+', ' ', $option_val);\n\n return $option_val;\n }",
"public function getDefaultRequiredLabelSuffix() {\n return $this->_defaultRequiredLabelSuffix;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the error page | public function getErrorPage()
{
return $this->_errorPage;
} | [
"public function getErrorPage()\n {\n return $this->errorPage;\n }",
"public function getErrorPage()\n {\n \treturn $this->_errorPage;\n }",
"private function getErrorPage() {\n\t\t\treturn defined('ERROR_PAGE') ? ERROR_PAGE : NULL;\n\t\t}",
"public function getFormErrorPage();",
"private function DefaultErrorPage()\n {\n return $_SERVER['REQUEST_METHOD'] == \"POST\" ? header(\"HTTP/1.0 404 Not Found\") : page_error(404);\n }",
"public function get_review_error_page() {\n $this->do_review_error_page();\n return $this->c_review_error_page;\n }",
"protected function defaultErrorPage(){}",
"public function makeUnexpectedErrorPage() {\n\t\t$this->title = \"Erreur\";\n\t\t$this->content = \"Une erreur inattendue s'est produite.\";\n\t}",
"public function errorAction()\n {\n $view = new View('errorPage');\n echo $view->render();\n }",
"public static function setErrorPage() {\n $url = URI::getURL(\"mod_error\", \"page_error\");\n UTIL::redirect($url);\n }",
"public function error() {\n \trequire_once 'views/pages/error.php';\n \t\t ErrorView::displayError();\n }",
"public function error()\n\t{\n\t\t$view = new Renderer('views/main/');\n\t\t$view->render('error.php');\n\t}",
"public static function htmlError(){\n $run = new Run;\n $run->pushHandler(new PrettyPageHandler);\n $run->register();\n }",
"abstract protected function getErrorURL();",
"public function error_page($options){\n\t\tif(isset($this->_options['404_template'])){\n\t\t\t$template = AisisCore_Factory_Pattern::create('AisisCore_Template_Builder');\n\t\t\t$template->render_view($this->_options['404_template']);\n\t\t}else{\n\t\t\techo \"Sorry. No posts were found.\";\n\t\t}\n\t}",
"public function sendErrorPage() {\n $errorPage = $this->modx->getOption('discuss.error_page',null,0);\n if (!empty($errorPage)) {\n $url = $this->modx->makeUrl($errorPage,'','?discuss=1','full');\n $this->modx->sendRedirect($url);\n } else if ($this->modx->getOption('discuss.error_page_to_index',null,true)) {\n $this->modx->sendRedirect($this->url);\n } else {\n $this->modx->sendErrorPage();\n }\n }",
"function page404(){\n\t\t// Display error data\n\t\t$rce=new rce();\n\t\t$tags=$rce->addtags('');\n\t\t$out=$rce->render('system/err_404.tpl',$tags,'');\n\t\t// Server data\n\t\t$url=$_SERVER['REQUEST_URI'];\n\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t// Creating error log\n\t\t$db=new db();\n\t\t$data=array(\n\t\t\t'type'=>'err_404',\n\t\t\t'url'=>$url,\n\t\t\t'ip'=>$ip\n\t\t);\n\t\t$query=$db->insert('rce_logs_errors',$data);\n\t\treturn $out;\n\t}",
"function generateErrorPage($message) {\n\trequire_once APPROOT . '/controllers/Pages.php';\n\t$controller = new Pages();\n\t$controller->error($message);\n}",
"public function error($page=null){\n \n $data=array(\n \"heading\"=>\"Errore nei permessi\",\n \"message\"=>\"<p>Errore di accesso nella pagina</p>\"\n . \"<p>Tutti i tentativi di accesso a pagine non autorizzate sono loggati nel sistema.</p>\");\n \n \n $this->parser->parse(\"errors/html/error_general\",$data);\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Search content (articles). The SQL must return the following fields that are used in a common display routine: href, title, section, created, text, browsernav. | public function onContentSearch(SearchEvent $event)
{
if (!$news = App::module('news')) {return array();}
$params = App::module('search')->config('defaults');
$limit = isset($params['limit_search_result']) ? $params['limit_search_result'] : self::PAGES_PER_PAGE;
$markdown = isset($params['markdown_enabled']) ? $params['markdown_enabled'] : true ;
$parameters = $event->getParameters();
$text = $parameters[0];
$phrase = $parameters[1];
$ordering = $parameters[2];
$areas = $parameters[3];
$searchText = $text;
if (is_array($areas))
{
if (count($areas))
{
if (!array_intersect($areas, array_keys($this->onContentSearchAreasL())))
{
$a = array();
$event->setSearchData($a);
return $a;
}
}
}
if (App::db()->getDatabasePlatform()->getName() === 'sqlite') $b_sqlite = true; else $b_sqlite = false;
$text = trim($text);
if ($text == '')
{
return array();
}
$text = EXSearchHelper::strip_data(trim($text));
$text = stripslashes($text);
$text = htmlspecialchars($text);
$matches = array();
switch ($phrase)
{
case 'exact':
$word =App::db()->quote('%' . $text . '%', false);
$wheres2 = array();
$wheres2[] = 'a.title LIKE ' . $word;
$wheres2[] = 'a.excerpt LIKE ' . $word;
$wheres2[] = 'a.content LIKE ' . $word;
$where = '(' . implode(') OR (', $wheres2) . ')';
break;
case 'all':
case 'any':
default:
$words = explode(' ', $text);
$wheres = array();
foreach ($words as $word)
{
$word = App::db()->quote('%' . $word . '%', false);
$wheres2 = array();
$wheres2[] = 'a.title LIKE ' . $word;
$wheres2[] = 'a.excerpt LIKE ' . $word;
$wheres2[] = 'a.content LIKE ' . $word;
$wheres[] = implode(' OR ', $wheres2);
}
$where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')';
break;
}
switch ($ordering)
{
case 'oldest':
$order = 'date, ASC';
break;
case 'popular':
//$order = "'a.hits DESC'";
//break;
case 'alpha':
$order = 'title, ASC';
break;
case 'category':
$order = 'title, ASC';
break;
case 'newest':
default:
$order = 'date, DESC';
break;
}
$rows = array();
$where = '(a.status = :v0 AND a.date < :v00) AND (' . $where;
$matches['v0'] = Posts::STATUS_PUBLISHED;//"$b";
$matches['v00'] = new \DateTime;
// ----- "PDO" -----
if (!$b_sqlite) $concatestr = 'CONCAT (a.excerpt, a.content) AS text';
else $concatestr = ' (a.excerpt || a.content) AS text';
$query = App::db()->createQueryBuilder()
->from('@news_posts a')
->select('a.title title, a.id id, a.date date')
->select($concatestr)
->where( $where .')', $matches)
->groupBy('a.title', 'a.content', 'a.excerpt');
/* $limit = self::PAGES_PER_PAGE;
$count = $query->count();
$total = ceil($count / $limit);
$page = max(0, min($total - 1, $page)); */
$orders = explode(",", $order);
if ($orders) {
$query->orderBy($orders[0], $orders[1]);
}
$query->offset(0)->limit($limit);
$query->where(function ($query) { return $query->where('roles IS NULL')->whereInSet('roles', App::user()->roles, false, 'OR');});
$rows = $query->get();
$limit -= count($rows);
$index = '0';
if (!empty($rows))
// ----- "PDO" -----
{
foreach ($rows as $key => $item)
{
$list[$index]= new \stdclass();
$list[$index]->title = $item['title'];
$list[$index]->metadesc = '';
$list[$index]->metakey = '';
$list[$index]->created = $item['date'];
//$list[$index]->text = $item['text'];
$list[$index]->text = App::content()->applyPlugins($item['text'], ['item' => $item, 'markdown' => $markdown]);
$list[$index]->section = __('News'); // PAGE NOT HAVING A SECTION
$list[$index]->catslug = '';
$list[$index]->browsernav = '';
$list[$index]->href = App::url('@newslist/id', ['id' => $item['id']], true);
$list[$index]->id = $item['id'];
$index++;
}
$rows[] = $list;
}
// Comments find
$user = App::user();
//if ($user->hasAccess('news: post comments')){ // ! Hu can read post comments? no have this permission in now realise 1.05
$matches = array();
switch ($phrase)
{
case 'exact':
$word = App::db()->quote('%' . $text . '%', false);
$wheres2 = array();
$wheres2[] = 'content LIKE '. $word;
$where = '(' . implode(') OR (', $wheres2) . ')';
break;
case 'all':
case 'any':
default:
$words = explode(' ', $text);
$wheres = array();
foreach ($words as $word)
{
$wheres2 = array();
$word = App::db()->quote('%' . $word . '%', false);
$wheres2[] = 'content LIKE '. $word;
$wheres[] = implode(' OR ', $wheres2);
}
$where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')';
break;
}
/* $limit = self::PAGES_PER_PAGE;
$limit -= count($rows);
$count = $query->count();
$total = ceil($count / $limit);
$page = max(0, min($total - 1, $page)); */
//$posts = Post::query()->where(['status = ?', 'date < ?'], [Post::STATUS_PUBLISHED, new \DateTime])->offset($page * $limit)->limit($limit);
$posts = Posts::query()->where(['status = ?', 'date < ?'], [Posts::STATUS_PUBLISHED, new \DateTime])->offset(0)->limit($limit);
$orders = explode(",", $order);
if ($orders) {
$posts->orderBy($orders[0], $orders[1]);
}
else {
$posts->orderBy('date', 'DESC');
}
$posts->where(function ($query) { return $query->where('roles IS NULL')->whereInSet('roles', App::user()->roles, false, 'OR');});
$posts = $posts->get();
$where = '(status = :v0) AND (' . $where;
$matches['v0'] = Comment::STATUS_APPROVED;//"$b";
if ($posts) {
$pending = App::db()->createQueryBuilder()
->from('@news_comment')
->select('id, post_id, content, created')
->where( $where .')', $matches)
->whereIn('post_id', array_keys($posts))
//->offset($page * $limit)->limit($limit)
->offset(0)->limit($limit)
->groupBy('post_id','content');
$pending = $pending->get();
} else {
$pending = [];
}
$list = null;
$index = '0';
if (!empty($pending))
// ----- query "PDO" -----
{
foreach ($pending as $key => $item)
{
if (!$this->has_same_id($item['post_id'], $rows)){
$list[$index]= new \stdclass();
$list[$index]->title = Posts::find((int) $item['post_id'] )->title;//->getTitle(); //$item['title'];
$list[$index]->metadesc = '';
$list[$index]->metakey = '';
$list[$index]->created = $item['created'];
//$list[$index]->text = $item['content'];
$list[$index]->text = App::content()->applyPlugins($item['content'], ['item' => $item, 'markdown' => $markdown]);
$list[$index]->section = __('News comments'); // PAGE NOT HAVING A SECTION
$list[$index]->catslug = '';
$list[$index]->browsernav = '';
$list[$index]->href = App::url('@newslist/id', ['id' => $item['post_id']], true).'#comment-'.$item['id'];
//$list[$index]->href = '@news/'.$item['post_id'].'#comment-'.$item['id'];
$list[$index]->id = $item['post_id'];
$index++;
}
}
if (!empty($list)){
$rows[] = $list;
}
}
//} // Permision Users
$results = array();
if (count($rows))
{
foreach ($rows as $row)
{
$new_row = array();
foreach ($row as $article)
{
//if (EXSearchHelper::checkNoHTML($article, $searchText, array('text', 'title', 'metadesc', 'metakey')))
if (EXSearchHelper::checkNoHTML($article, $searchText, array('text', 'title')))
{
$new_row[] = $article;
}
}
$results = array_merge($results, (array) $new_row);
}
}
$event->setSearchData($results);
//}
return array();
} | [
"function search_in_article($article, $find)\n{\n$out = array();\n$articles = new articles();\n$articles -> setWorkContainer($article);\n$categories = $articles -> getCategories();\nif (!empty($categories)) {\n\tforeach ($categories as $catkey => $katval) {\n if (access_chk($katval['accesslevel'])){\n to_result($katval['description'],$find,'?module=articles&c='.$article.'&b='.$katval['id'],$out);\n to_result($katval['title'],$find,'?module=articles&c='.$article.'&b='.$katval['id'],$out);\n\t\t$articls = $articles -> getArticles($katval, true, true, true);\n\t\tif (!empty($articls)) {\n\t\t\tforeach ($articls as $akey => $aval) {\n $link = '?module=articles&c='.$article.'&b='.$aval['catid'].'&a='.$aval['id'];\n to_result($aval['text'],$find,$link,$out);\n to_result($aval['desc'],$find,$link,$out);\n to_result($aval['keywords'],$find,$link,$out);\n to_result($aval['sef_desc'],$find,$link,$out);\n to_result($aval['title'],$find,$link,$out);\n to_result($aval['author_nick'],$find,$link,$out);\n\t\t\t}\n\t\t}\n }\n\t}\n}\nreturn $out;\n}",
"function onContentSearch($text, $phrase='', $ordering='', $areas=null, $categories =null, $fieldsfilter=null, $limit=50)\n\t{\n if(is_array($categories)) $categories=implode(\",\", $categories);\n $results\t=array();\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$app\t= JFactory::getApplication();\n\t\t$user\t= JFactory::getUser();\n\t\t$groups\t= implode(',', $user->getAuthorisedViewLevels());\n\t\t$tag = JFactory::getLanguage()->getTag();\n\n\t\trequire_once JPATH_SITE.'/components/com_content/helpers/route.php';\n\t\trequire_once JPATH_SITE.'/administrator/components/com_search/helpers/search.php';\n\n\n\t\t$sContent\t\t= $this->params->get('search_content',\t\t1);\n\t\t$sArchived\t\t= $this->params->get('search_archived',\t\t1);\n $limit\t\t\t= $this->params->def('search_limit2',\t\t200);\n\n\n\n $ordering = $this->params->def('ordering',\t\t\"\");\n\n\n\n\n $menuitemid = JRequest::getInt( 'Itemid' );\n if ($menuitemid)\n {\n $menu = JSite::getMenu();\n $menuparams = $menu->getParams($menuitemid);\n //echo $menuparams;\n $params = new JRegistry( $menuparams );\n $params->merge( $menuparams );\n }else{\n //If not menu associate search menu\n $params = new JRegistry( );\n JError::raiseWarning( 100, JText::_(\"MOD_FIELDSATTACHSEARCH_ERROR_LINK_MENU\") );\n }\n\n $ordering= $params->get('ordering');\n\n $rules\t= $params->get('paramrules');\n\t\t$condition\t\t= $params->get('conditionmode',\t\t\"OR\");\n $linkconditions=$params->get('paramlinkconditions');\n $linkconditionsarray=explode(\",\", $linkconditions);\n\n\n\t\t$nullDate = $db->getNullDate();\n\t\t$date = JFactory::getDate();\n\n\n\t\t$wheres = array();\n\n\t\t$morder = '';\n\n\t\tswitch ($ordering) {\n\t\t\tcase 'oldest':\n\t\t\t\t$order = '5 ASC';\n\t\t\t\tbreak;\n\n\n\n\t\t\tcase 'alpha':\n\t\t\t\t$order = '2 ASC';\n\t\t\t\tbreak;\n\n\t\t\tcase 'category':\n\t\t\t\t$order = '10 ASC, 2 ASC';\n\t\t\t\t$morder = '2 ASC';\n\t\t\t\tbreak;\n\n\t\t\tcase 'newest':\n default :\n\t\t\t\t$order = '5 DESC';\n\t\t\t\tbreak;\n\t\t}\n\n //\n\n\t\t/*\n if(count($orderidtmp)==2){\n if(is_numeric($orderidtmp[0]))\n {\n $order = '14 '.$orderidtmp[1];\n\t\t $specialSort = true;\n }\n }else{\n if(is_numeric($orderidtmp[0]))\n {\n $order = '14 ';\n\t\t $specialSort = true;\n }\n }\n */\n\n\n\n\t\t$rows = array();\n\t\t$query\t= $db->getQuery(true);\n $query2\t= $db->getQuery(true);\n\n\t\t$specialSort = false;\n\n\n\n\t\t//QUERY GENERAL\n\t $query = plgAdvancedsearchfieldsattachment::getQuerySorted($text, $phrase, $order, $areas, $categories, $fieldsfilter, $limit,\"\",\"\",\"\", $rules);\n\n\t //echo \"<br><br>\".$query;\n\t $db->setQuery($query, 0, $limit);\n\n\n\t $list = $db->loadObjectList();\n\n\n\n\t //GET LINK URL\n\t $limit -= count($list);\n\t if (isset($list))\n\t {\n\t\t foreach($list as $key => $item)\n\t\t {\n\t\t\t $list[$key]->href = ContentHelperRoute::getArticleRoute($item->slug, $item->catslug);\n\t\t }\n\t }\n\t //Determine num of filter *******\n\t $maxnumfilters=0;\n\t //echo \"<br>--->\".$fieldsfilter.\"<br>\";\n\t $arrayfieldsid = explode(\",\",$fieldsfilter);\n\n\t\tforeach ($arrayfieldsid as $fieldsid)\n\t\t{\n\n\t\t $tmp1= explode(\"_\",$fieldsid);\n\t\t $tmpfieldid= $tmp1[0];\n\t\t $valuefieldid=\"\";\n\t\t if(count($tmp1)>1) {\n\t\t\t$valuefieldid = $tmp1[1];\n\t\t }\n\n\t\t if(!empty($valuefieldid)){\n\t\t\t $maxnumfilters++;\n\n\t\t }\n\n\t\t}\n\n\n\t $fieldsarray = array();\n\n\t //Build a array with all fieldsattach an ID *********************************\n\t //Example COL: \tarticleId, total, \tfield1id, \tfield2id, \tfield3id\n\t //\t\t2, \t\t2\tValor1, \tValor2, \tValor3\n\t //\t\t3, \t\t2 \tValor12, \tValor22, \tValor33\n\t //***************************************************************************\n\n\t if (isset($list))\n\t {\n\t\t\t//Build\n\t\t\tforeach($list as $key => $item)\n\t\t\t{\n\t\t\t $fieldsarray[$item->id]->{'fields_'.$item->fieldsid} = $item->value;\n\t\t\t if(isset($fieldsarray[$item->id]->total)) $fieldsarray[$item->id]->total = $fieldsarray[$item->id]->total+1;\n\t\t\t else{ $fieldsarray[$item->id]->total = 1; }\n\t\t\t}\n\n\t\t\t//DELETE FILTER IF AND\n\t\t\tif($condition==\"AND\"){\n\t\t\t\t foreach($fieldsarray as $key => $item)\n\t\t\t\t {\n\n\t\t\t\t\t if($item->total<$maxnumfilters) {\n\t\t\t\t\t\t unset($fieldsarray[$key]);\n\t\t\t\t\t }\n\n\t\t\t\t }\n\t\t\t}\n\t\t\t//print_r($fieldsarray);\n\n\t\t\t//ADD Others extra fields\n\t\t\tforeach ($fieldsarray as $key => $item)\n\t\t\t{\n\t\t\t\t//echo \"<br>--------------<br>KEY: ->\".$key;\n\t\t\t\tforeach ($arrayfieldsid as $fieldsid)\n\t\t\t\t{\n\t\t\t\t\t//echo \"<br>REPASAR: ->\".$fieldsid;\n\t\t\t\t\t$tmp1= explode(\"_\",$fieldsid);\n\t\t\t\t\t$tmpfieldid= $tmp1[0];\n\t\t\t\t\tif(!isset($fieldsarray[$key]->{'fields_'.$tmpfieldid} ))\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo \"<br>CREATE::: \".$key.' -> fields_'.$tmpfieldid;\n\t\t\t\t\t\t$fieldsarray[$key]->{'fields_'.$tmpfieldid} = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t //echo \"<br>******************<br>\";\n\t\t\t}\n\n\t\t\t//print_r($fieldsarray);\n\n\t\t\t//ADD PROPIETIES TO ARRAY OBJECTS\n\t\t\tforeach($fieldsarray as $key => $item)\n\t\t\t{\n\t\t\t\tforeach($list as $key2 => $item2)\n\t\t\t\t{\n\t\t\t\t\tif($item2->id == $key)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($item2 as $key3 => $item3)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fieldsarray[$key]->{$key3}= $item3;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t }\n\n\n\t\t$tmp = array();\n\n\t\tforeach($fieldsarray as $key => $item)\n\t\t{\n\t\t\tif(!empty($item->id)) $tmp[] = $item;\n\t\t}\n\t $fieldsarray = $tmp;\n\n\t\t//echo count($fieldsarray).\" ---- cc\";\n\t\t/*\n\t\tfor($cont=0; count($fieldsarray)>$cont; $cont++)\n\t\t{\n\t\t\techo \"<br>\".$cont.\" --> \".$fieldsarray[$cont]->id.\" \".$fieldsarray[$cont]->fields_10;\n\t\t}\n\t */\n\n\t\t$orderidtmp = explode(\" \",$ordering);\n\n\t\tif(is_numeric($orderidtmp[0]))\n {\n\t\t\t//Recovery all data of $orderidtmp\n\t\t\t$allvalues = plgAdvancedsearchfieldsattachment::getQueryFiedsvalue($orderidtmp[0]);\n\t\t\t//ADD PROPIETIES TO ARRAY OBJECTS\n\t\t\tforeach($fieldsarray as $key => $item)\n\t\t\t{\n\t\t\t\tforeach($allvalues as $key2 => $item2)\n\t\t\t\t{\n\t\t\t\t\t//echo \"<br>AÑADIR\".$item2->articleid.\" == \".$item->id;\n\t\t\t\t\tif($item2->articleid == $item->id)\n\t\t\t\t\t{\n\t\t\t\t\t\t//echo \"<br>AÑADIR\".$key;\n\t\t\t\t\t\t$fieldsarray[$key]->{\"fields_\".$orderidtmp[0]} = $item2->value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//print_r($fieldsarray);\n\n\t\t\t$propertyvar = \"fields_\".$orderidtmp[0] ;\n\t\t\t//echo \"<br>PROPERTY:: \".$propertyvar.\"<br>\";\n\n\n\t\t\t$fieldsarray = plgAdvancedsearchfieldsattachment::sortArrayofObjectByProperty( $fieldsarray, $propertyvar );\n\n\n\t\t\tif( count($orderidtmp) > 1) {\n\n\t\t\t\tif($orderidtmp[1] == \"DESC\"){\n\n\t\t\t\t\t$fieldsarray = array_reverse($fieldsarray, true);\n\n\t\t\t\t}\n\t\t\t\t}\n }\n\n\t\t$results = $fieldsarray;\n\n JRequest::setVar(\"option\", \"com_content\");\n\n\n\t\treturn $results;\n\t}",
"public function search()\n\t\t{\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\tif ($this->request->data) {\n\t\t\t\t\t$q = $this->request->data['Article']['query'];\n\t\t\t\t\t$conditions = array(\n\t\t\t\t\t\t'Article.published' => 1,\n\t\t\t\t\t\t\"OR\" => array(\n\t\t\t\t\t\t\"Article.title LIKE\" => \"%$q%\",\n\t\t\t\t\t\t\"Article.body LIKE\" => \"%$q%\"\n\t\t\t\t\t\t));\n\t\t\t\t\t$result = $this->Article->find('all', array('conditions'=>$conditions));\n\t\t\t\t\tif (!empty($result)){\n\t\t\t\t\t\t$this->set('articles', $result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->Session->setFlash(__('Unable to find the article.'));\n\t\t\t\t\t\t$this->redirect(array('controller' => 'articles', 'action' => 'index'));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash(__('Failed to search for the article.'));\n\t\t\t\t\t$this->redirect(array('controller' => 'articles', 'action' => 'index'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash(__('Failed to search for the article.'));\n\t\t\t\t\t$this->redirect(array('controller' => 'articles', 'action' => 'index'));\n\t\t\t}\n\t\t}",
"function getAllArticles()\n {\n $result = $this->db->runSelectQuery(\"gcArticles\", array(\"id\", \"articleTitle\"));\n \n if (!$result)\n {\n $this->msgCenter->addError(\"Could not query articles. Please try again later.\");\n return false;\n }\n return $result;\n }",
"public function searchArticle() {\n\n $expression = \"//div[contains(concat(' ',normalize-space(@class),' '),' view-news-listing ')]//div[contains(concat(' ',normalize-space(@class),' '),' attachment-before ')]//li [contains(concat(' ',normalize-space(@class),' '),' views-row-1 ')]//h2[contains(concat(' ',normalize-space(@class),' '),' news-title')]/a\";\n $searchText = $this->getSession()->getPage()->find('xpath',$expression);\n $search = $searchText->getText();\n\n return array(\n new When (\"I fill in \\\"edit-keys\\\" with \\\"$search\\\"\"),\n new When (\"I press \\\"edit-submit-news-listing\\\"\")\n );\n }",
"function getArticles() {\n\n global $db, $drupalDbTblBody, $drupalDbTblNode, $drupalDbTblAlias;\n\n $results = [];\n\n $sql = 'SELECT ';\n $sql .= $drupalDbTblNode . '.nid, ';\n $sql .= $drupalDbTblNode . '.title, ';\n\t$sql .= $drupalDbTblNode . '.created, ';\n $sql .= $drupalDbTblAlias . '.alias, ';\n $sql .= $drupalDbTblBody . '.body_value as body ';\n \n $sql .= 'FROM ' . $drupalDbTblBody . ' ';\n $sql .= 'INNER JOIN ' . $drupalDbTblNode . ' ON ' . $drupalDbTblBody . '.entity_id = ' . $drupalDbTblNode . '.nid ';\n $sql .= 'INNER JOIN ' . $drupalDbTblAlias . ' ON ' . $drupalDbTblAlias . '.source = CONCAT(\"node/\", ' . $drupalDbTblNode . '.nid)';\n\n\t$sql .= 'ORDER BY ' . $drupalDbTblNode . '.created';\n\t\n $stmt = $db->prepare($sql);\n\n $stmt->execute();\n\n while ($result = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $results[$result['nid']] = $result;\n }\n\n return $results;\n}",
"private function searchArticles($demand){\n\t\t$term = $demand->getSearchterm();\n\t\t\n\t\t// 1. exact match: redirect\n\t\tif (strlen($term) > 3) {\n\t\t\t$article = $this->articleRepository->findOneByTitle($term);\n\t\t\tif ($article){\n\t\t\t\t// redirect\n\t\t\t\t$this->redirect('show', 'article', NULL, array(article => $article->getUid()));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// 2. no results: fuzzy search\n\t\t$articles = $this->articleRepository->search($demand);\n\t\t// bug in typo3 4.5.4 and 4.6.0: because of lazy loading, we need to fake access to the objects for correct count\n\t\tforeach($articles as $article){}\n\t\t\n\t\tif ($articles->count() < 5){\n\t\t\t// 3. no results: authors,schools and tags\n\t\t\t$authorArticles = $this->articleRepository->findByAuthorSearch($term,'','');\n\t\t\t$schools = $this->schoolRepository->search($term);\n\t\t\tif ($schools->count() > 0) {\n\t\t\t\t$schoolArticles = $this->articleRepository->findBySchools($schools);\n\t\t\t}\n\t\t\t\n\t\t\t// 4. if almost nothing is found until here search with like\n\t\t\t$schoolArticleEntries = (isset($schoolArticles)) ? $schoolArticles->count() : 0; // $schoolArticles is only set if schools found\n\t\t\tif ( $authorArticles->count() < 5 && $schoolArticleEntries == 0 && strlen($term) > 3 ){\n\t\t\t\t$articles2 = $this->articleRepository->searchLike($demand);\n\t\t\t\t$articles = array_unique(array_merge($articles->toArray(), $articles2->toArray()));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array($articles, $authorArticles, $schoolArticles);\n\t}",
"abstract public function getContentSearcher();",
"public function onContentSearch(SearchEvent $event)\n\t{ \n\n\t\t(bool )$b_sqlite = App::db()->getDatabasePlatform()->getName() === 'sqlite';\n\n\t\t$params \t= App::module('friendlyit/search')->config('defaults');\n\t\t$limit \t\t= isset($params['limit_search_result']) ? $params['limit_search_result'] : self::PAGES_PER_PAGE;\n\t\t$markdown \t= isset($params['markdown_enabled']) ? $params['markdown_enabled'] : true ;\n\t\t\n\t\t$parameters = $event->getParameters();\n\t\t\n\t\t$text \t\t= $parameters[0];\n\t\t$phrase \t= $parameters[1];\n\t\t$ordering\t= $parameters[2];\n\t\t$areas \t= $parameters[3]; \n\t\t\n\t\t$searchText = $text;\n\n\t\tif (is_array($areas) && !array_intersect($areas, array_keys($this->onContentSearchAreasL())))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$text = trim($text);\n\t\tif ($text === '')\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$text = EXSearchHelper::strip_data(trim($text));\n\t\t$text = stripslashes($text); \n\t\t$text = htmlspecialchars($text); \n\n\t\t$matches = array();\n\t\tswitch ($phrase)\n\t\t{\n\t\t\tcase 'exact':\n\t\t\t\t$text = str_replace('\"', \"\", json_encode($text));\n\t\t\t\t$text =App::db()->quote($text);\n\t\t\t\t$text = str_replace(\"'\", \"\", $text);\n\t\t\t\t$text =App::db()->quote('%' . $text . '%', false);\n\t\t\t\t$wheres2 = array();\n\t\t\t\t$wheres2[] = 'a.title LIKE '.$text;\n\t\t\t\t$wheres2[] = 'a.data LIKE '. $text;\n\t\t\t\t$where = '(' . implode(') OR (', $wheres2) . ')';\n\t\t\t\tbreak;\n\n\t\t\tcase 'all':\n\t\t\tcase 'any':\n\t\t\tdefault:\n\t\t\t\t$words = explode(' ', $text);\n\t\t\t\t$wheres = array();\n\t\t\t\tforeach ($words as $word)\n\t\t\t\t{\n\t\t\t\t\t$word2 = json_encode(str_split($word), JSON_UNESCAPED_UNICODE);\n\t\t\t\t\t$word = App::db()->quote('%' . $word . '%', false);\n\t\t\t\t\t$word2 = App::db()->quote('%' . $word2 . '%', false);\n\t\t\t\t\t$wheres2 = array();\n\t\t\t\t\t$wheres2[] = ($b_sqlite) ? 'php_nocase(a.title) LIKE php_nocase(' . $word . ')' : 'LOWER(a.title) LIKE LOWER(' . $word . ')';\n\t\t\t\t\t$wheres2[] = ($b_sqlite) ? 'php_nocase(a.data) LIKE php_nocase(' . $word . ')' : 'LOWER(a.data) LIKE LOWER(' . $word . ')';\n\t\t\t\t\t$wheres2[] = 'a.title LIKE ' . $word2 . '';\n\t\t\t\t\t$wheres2[] = 'a.data LIKE ' . $word2 . '';\n\t\t\t\t\t$wheres[] = implode(' OR ', $wheres2);\n\t\t\t\t}\n\n\t\t\t\t$where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')';\n\t\t\t\tbreak;\n\t\t}\n\t\n\t\t\n\t\tswitch ($ordering)\n\t\t{\n\t\t\tcase 'oldest':\n\t\t\t\t$order = 'a.id, ASC';\n\t\t\t\tbreak;\n\n\t\t\tcase 'popular':\n\t\t\t\t//$order = \"'a.hits DESC'\";\n\t\t\t\t//break;\n\n\t\t\tcase 'alpha':\n\t\t\t\t$order = 'a.title, ASC';\n\t\t\t\tbreak;\n\n\t\t\tcase 'category':\n\t\t\t\t$order = 'a.title, ASC';\n\t\t\t\tbreak;\n\n\t\t\tcase 'newest':\n\t\t\tdefault:\n\t\t\t\t$order = 'a.id, DESC';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$rows = array();\n\n\t\tif ($b_sqlite){\n\t\t\t$mbString = extension_loaded('mbstring');\n\t\t\t$db \t\t\t= App::db()->getDatabase();\n\n\t\t\ttry{\n\t\t\t$pdo = new PDO('sqlite:' . $db, null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]); //pagekit.db\n\t\t\t}catch(PDOException $pe){\n\t\t\t\techo $pe->getMessage();\n\t\t\t} \n\t\t\t\n\t\t\t$prefix \t\t\t\t\t= App::db()->getPrefix();\n\t\t\t$db_name_system_widget \t\t= $prefix.'system_widget'; \n\t\t\t$db_name_system_node \t\t= $prefix.'system_node'; \n\n\t\t\t$mbString ? $pdo->sqliteCreateFunction('php_nocase', function($x) { return mb_strtolower($x); }) :\n\t\t\t$pdo->sqliteCreateFunction('php_nocase', function($x) { return strtolower($x); });\n\n\t\t\t$orders = explode(\",\", $order);\n\t\t\t$orderBy ='';\n\t\t\tif ($orders) {\n\t\t\t\t$orderBy = $orders[0] . $orders[1] ;\n\t\t\t}\t\n\n\t\t\t$user = App::user()->roles;\n\t\t\t$values = implode('|', (array)$user);\n\t\t\t$strf_a = \"OR ((',' || a.roles || ',') LIKE '%,$values,%')\";\n\t\t\t$strf_c = \"OR ((',' || c.roles || ',') LIKE '%,$values,%')\";\n\t\t\t$strf_0 = \"(a.nodes IS NULL) OR (',' || a.nodes || ',') LIKE '%,' || c.id || ',%'\";\n\n\t\t\t$query = $pdo->query( 'SELECT \ta.id AS widget_id, a.title AS widget_title, a.data, c.id AS node_id, c.title AS node_title, c.link\n\t\t\t\t\t\t\t\t\tFROM '. $db_name_system_widget .' a \n\t\t\t\t\t\t\t\t\tINNER JOIN '. $db_name_system_node .' c\n\n\t\t\t\t\t\t\t\t\tON ((c.type LIKE \"page\" OR c.type LIKE \"blog\") AND a.type LIKE (\"system/text\") AND '.$strf_0.' )\n\t\t\t\t\t\t\t\t\tWHERE c.status = '. self::STATUS_PUBLISHED.' AND a.status = '. self::STATUS_PUBLISHED.' AND ('. $where .')\n\t\t\t\t\t\t\t\t\tAND ((a.roles IS NULL) '.$strf_a.') \n\t\t\t\t\t\t\t\t\tAND ((c.roles IS NULL) '.$strf_c.')\n\t\t\t\t\t\t\t\t\tGROUP BY a.title, a.data, a.id, c.id\n\t\t\t\t\t\t\t\t\tORDER BY ' . $orderBy .'\n\t\t\t\t\t\t\t\t\tLIMIT 0 ,' . $limit . '\n\t\t\t\t\t\t\t\t\t');\n\n\t\t\t$rows = $query->fetchall(\\PDO::FETCH_ASSOC);\n\t\t\t}\n\n\t\telse{\n\n\t\t\t$strf_0 = \"(a.nodes IS NULL) OR (',' || a.nodes || ',') LIKE '%,' || c.id || ',%'\";\n\t\t\t\n\t\t\t$query = App::db()->createQueryBuilder()\n\t\t\t\t->select( 'a.id AS widget_id, a.title AS widget_title, a.data, c.id AS node_id, c.title AS node_title, c.link')\n\t\t\t\t->from('@system_widget a')\n\t\t\t\t->join('@system_node c', '((c.type LIKE \"page\" OR c.type LIKE \"blog\") AND a.type LIKE (\"system/text\") AND '.$strf_0.')', 'INNER')\n\t\t\t\t->where( 'c.status = '. self::STATUS_PUBLISHED.' AND a.status = '. self::STATUS_PUBLISHED.' AND ('. $where .')');\n\t\t\t\n\t\t\t//$query->where(function ($query) { return $query->where('a.nodes IS NULL')->whereInSet('a.nodes', 'c.id', false, 'OR');});\n\t\t /**\n\t\t\t* Creates and adds an \"order by\" to the query.\n\t\t\t*\n\t\t\t* @param string $sort\n\t\t\t* @param string $order\n\t\t\t* @return self\n\t\t\t*/\n\t\t\t$orders = explode(\",\", $order);\n\t\t\tif ($orders) {\n\t\t\t\t$query->orderBy($orders[0], $orders[1]);\n\t\t\t}\n\t\t\n\t\t\t$query->groupBy('a.title', 'a.data','a.id','c.id');\n\t\t\t$query->offset(0)->limit($limit);\n\t\t\t$query->where(function ($query) { return $query->where('a.roles IS NULL')->whereInSet('a.roles', App::user()->roles, false, 'OR');});\n\t\t\t$query->where(function ($query) { return $query->where('c.roles IS NULL')->whereInSet('c.roles', App::user()->roles, false, 'OR');});\n\t\t\t$rows = $query->get();\n\t\t}\n\t\t\n\t\t$list = null;\n\t\t$index = '0';\n\t\tif (!empty($rows))\n\t\t\t{\n\t\t\t\t$last_id = 0;\n\t\t\t\tforeach ($rows as $key => $item)\n\t\t\t\t{\n\n\t\t\t\t\t// NEED COMPACT RESULT\n\t\t\t\t\t// LOOP ON Widget ID\n\t\t\t\t\t// Compact ID Nodes\n\t\t\t\t\t// $page = $this->getPage($node->get('defaults.id', 0));\n\n\t\t\t\t\tif ($last_id === $item['widget_id']) continue;\n\n\t\t\t\t\t$list[$index]= new \\stdclass();\n\n\t\t\t\t\t$widget = Widget::find($item['widget_id']);\n\t\t\t\t\t//$node = Node::find($item['node_id']);\n\t\t\t\t\t//$page = Page::find($node->get('defaults.id', 0));\n\n\t\t\t\t\t// include support on/off title, but in Pagekit 1.0.13 NOT USE\n\t\t\t\t\t//$page = Page::find($item['page_id']);\n\t\t\t\t\t//($page->get('title')) ? $list[$index]->title = $item['title'] : $list[$index]->title = $index + 1;\n\t\t\t\t\t$list[$index]->title \t \t\t= $item['widget_title'];\n\t\t\t\t\t$list[$index]->metadesc \t\t= '';\n\t\t\t\t\t$list[$index]->metakey \t\t\t= '';\n\t\t\t\t\t$list[$index]->created\t\t\t= '';\n\n\t\t\t\t\t$list[$index]->text \t \t\t= App::content()->applyPlugins($widget->get('content'), ['widget' => $widget, 'markdown' => $widget->get('markdown')]);\n\t\t\t\t\t$list[$index]->section\t\t\t= __('Widget');\n\t\t\t\t\t$list[$index]->catslug \t\t\t= '';\n\t\t\t\t\t$list[$index]->browsernav \t\t= '';\n\t\t\t\t\t$list[$index]->href\t \t\t\t= App::url($item['link']);\n\t\t\t\t\t$last_id = $item['widget_id'];\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\t\t\t$rows = array();\n\t\t\t$rows[] = $list;\n\t\t\t}\n\t\t\n\t\t$results = array();\n\t\t\n\t\tif (count($rows))\n\t\t{\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\t$new_row = array();\n\n\t\t\t\tforeach ($row as $article)\n\t\t\t\t{\n\t\t\t\t\t//if (EXSearchHelper::checkNoHTML($article, $searchText, array('text', 'title', 'metadesc', 'metakey')))\n\t\t\t\t\tif (EXSearchHelper::checkNoHTML($article, $searchText, array('text', 'title')))\n\t\t\t\t\t{\n\t\t\t\t\t\t$new_row[] = $article;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$results = array_merge($results, (array) $new_row);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$event->setSearchData($results);\n\t\treturn array();\n\t}",
"public function searchArticles($search_term = '') {\n try {\n // Map request as query object. Search by title is currently disabled.\n // More info: https://www.mediawiki.org/wiki/API:Search\n $response = $this->client->get('', [\n 'query' => [\n 'action' => 'query',\n 'list' => 'search',\n 'utf8' => '',\n 'prop' => 'info',\n 'format' => 'json',\n 'srwhat' => 'text',\n 'srsearch' => $search_term,\n 'srlimit' => 20,\n 'sroffset' => 0,\n ],\n ]);\n $data = Json::decode($response->getBody());\n return $data;\n }\n catch (RequestException $e) {\n // Notify user about failed request.\n drupal_set_message(t('An error ocurred while attempting to fetch information from resource: \"%error\"', ['%error' => $e->getMessage()]), 'error');\n }\n }",
"function searchArticle($articleKeyword, $articleSearchType)\n {\n // check if the article keyword has a value\n if(trim($articleKeyword) == \"\")\n {\n // return and do not process anything\n return;\n }\n \n // determine the article search type\n if($articleSearchType == \"byTitle\")\n {\n // query all articles that has the same title\n $articlesQuery = mysql_query(\"SELECT article_id, title, account_id, date_submitted, date_modified, status FROM argus_articles WHERE title LIKE '%\".$articleKeyword.\"%'\") or die(mysql_error());\n }\n else\n {\n // query on the accounts based on the given author keyword\n $accountIdQuery = mysql_query(\"SELECT account_id FROM argus_accounts WHERE name LIKE '%\".$articleKeyword.\"%' AND position = 'CONTRIBUTOR'\") or die(mysql_error());\n \n if(mysql_num_rows($accountIdQuery) > 0)\n {\n // set the account id\n $accountId = mysql_result($accountIdQuery,0,\"account_id\");\n }\n \n // query all articles that has the author\n $articlesQuery = mysql_query(\"SELECT article_id, title, account_id, date_submitted, date_modified, status FROM argus_articles WHERE account_id = '\".$accountId.\"'\") or die(mysql_error());\n }\n \n // set the title of the page\n echo \"<h3>Search Result</h3>\";\n echo \"<div class='bg1' id='tablePanel'>\";\n \n // check if there are results\n if(mysql_num_rows($articlesQuery) == 0)\n {\n // notify the user that there are no search result\n echo \"<p><h3 align='center'>There are no search results</h3></p>\";\n }\n else\n {\n // else display the searches found in a table form\n echo \"<table width='100%'>\";\n echo \"<tr>\";\n echo \"<th align='center'>Title</th>\";\n echo \"<th>Author</th>\";\n echo \"<th>Date Submitted</th>\";\n echo \"<th>Date Modified</th>\";\n echo \"<th>Status</th>\";\n echo \"</tr>\";\n \n // display the searches\n $color = true;\n \n for($i=0; $i<mysql_num_rows($articlesQuery); $i++)\n {\n // display the table rows in an alternate color manner\n if($color == true)\n {\n echo \"<tr class='bg1'>\";\n $color = false;\n }\n else\n {\n echo \"<tr>\";\n $color = true;\n }\n \n // set the attributes to be displayed\n $articleId = mysql_result($articlesQuery,$i,\"article_id\");\n $title = $this -> limitTitle(mysql_result($articlesQuery,$i,\"title\"));\n $author = $this -> getAuthorName(mysql_result($articlesQuery,$i,\"account_id\"));\n $dateSubmitted = date(\"m/d/y\", mysql_result($articlesQuery,$i,\"date_submitted\"));\n $dateModified = $this -> getDateModified(mysql_result($articlesQuery,$i,\"date_modified\"));\n $status = mysql_result($articlesQuery,$i,\"status\");\n \n // display the attributes\n echo \"<td align='center'><a href='argusarticles.php?event=view&article=\".$articleId.\"'>\".$title.\"</a></td>\";\n echo \"<td>\".$author.\"</td>\";\n echo \"<td>\".$dateSubmitted.\"</td>\";\n echo \"<td>\".$dateModified.\"</td>\";\n echo \"<td>\".$status.\"</td>\";\n echo \"</tr>\";\n }\n \n echo \"</table>\";\n }\n \n echo \"</div>\";\n \n return;\n }",
"abstract public function findContent( Query $query, array $fieldFilters = array() );",
"function &search( &$queryText, $sortMode=time, $fetchPublished=false, $offset=0, $limit=10, $params = array(), &$SearchTotalCount )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $queryText = $db->escapeString( $queryText );\r\n\r\n // Build the ORDER BY\r\n $OrderBy = \"eZArticle_ArticleWordLink.Frequency DESC\";\r\n switch( $sortMode )\r\n {\r\n case \"alpha\" :\r\n {\r\n $OrderBy = \"eZArticle_Article.Name DESC\";\r\n }\r\n break;\r\n }\r\n\r\n if ( $fetchPublished == true )\r\n {\r\n $fetchText = \"\";\r\n }\r\n else\r\n {\r\n $fetchText = \"AND eZArticle_Article.IsPublished = '1'\";\r\n }\r\n\r\n $usePermission = true;\r\n\r\n $user =& eZUser::currentUser();\r\n\r\n // Build the permission\r\n $loggedInSQL = \"\";\r\n $groupSQL = \"\";\r\n if ( $user )\r\n {\r\n $groups =& $user->groups( false );\r\n\r\n foreach ( $groups as $group )\r\n {\r\n $groupSQL .= \" ( Permission.GroupID='$group' AND CategoryPermission.GroupID='$group' ) OR\r\n ( Permission.GroupID='$group' AND CategoryPermission.GroupID='-1' ) OR\r\n ( Permission.GroupID='-1' AND CategoryPermission.GroupID='$group' ) OR\r\n \";\r\n }\r\n $currentUserID = $user->id();\r\n $loggedInSQL = \"eZArticle_Article.AuthorID=$currentUserID OR\";\r\n\r\n if ( $user->hasRootAccess() )\r\n $usePermission = false;\r\n }\r\n\r\n $loggedInSQL = \"( ( ( $groupSQL Permission.GroupID='-1' AND CategoryPermission.GroupID='-1' ) AND Permission.ReadPermission='1' AND CategoryPermission.ReadPermission='1' ) ) AND\";\r\n\r\n if ( $usePermission )\r\n $permissionSQL = $loggedInSQL;\r\n else\r\n $permissionSQL = \"\";\r\n\r\n // stop word frequency\r\n $ini =& INIFile::globalINI();\r\n $StopWordFrequency = $ini->read_var( \"eZArticleMain\", \"StopWordFrequency\" );\r\n\r\n\r\n $query = new eZQuery( \"eZArticle_Word.Word\", $queryText );\r\n $query->setIsLiteral( true );\r\n $query->setStopWordColumn( \"eZArticle_Word.Frequency\" );\r\n $query->setStopWordPercent( $StopWordFrequency );\r\n $searchSQL = $query->buildQuery();\r\n\r\n $authorSQL = \"\";\r\n $dateSQL = \"\";\r\n $catSQL = \"\";\r\n $typeTables = \"\";\r\n $typeSQL = \"\";\r\n $sectionsSQL = \"\";\r\n $photoSQL = \"\";\r\n $photoTables = \"\";\r\n\r\n if ( isSet( $params[\"FromDate\"] ) )\r\n {\r\n $fromdate = $params[\"FromDate\"];\r\n if( is_a( $fromdate, \"eZDateTime\" ) )\r\n $fromdate = $fromdate->timeStamp();\r\n $dateSQL .= \"AND eZArticle_Article.Published >= '$fromdate'\";\r\n }\r\n if ( isSet( $params[\"ToDate\"] ) )\r\n {\r\n $todate = $params[\"ToDate\"];\r\n if( is_a( $todate, \"eZDateTime\" ) )\r\n $todate = $todate->timeStamp();\r\n $dateSQL .= \"AND eZArticle_Article.Published <= '$todate'\";\r\n }\r\n if ( isSet( $params[\"Categories\"] ) )\r\n {\r\n $cats = $params[\"Categories\"];\r\n $sql = \"\";\r\n $i = 0;\r\n foreach( $cats as $cat )\r\n {\r\n if ( $i > 0 )\r\n $sql .= \"OR \";\r\n $sql .= \"Category.ID = '$cat' \";\r\n ++$i;\r\n }\r\n if ( count( $cats ) > 0 )\r\n {\r\n $catSQL = \"AND ( $sql ) AND Category.ID=eZArticle_ArticleCategoryLink.CategoryID\r\n AND eZArticle_Article.ID=eZArticle_ArticleCategoryLink.ArticleID\";\r\n }\r\n }\r\n if ( isSet( $params[\"Type\"] ) )\r\n {\r\n $type = $params[\"Type\"];\r\n $typeSQL = \"AND eZArticle_Attribute.TypeID='$type'\r\n AND eZArticle_Attribute.ID=eZArticle_AttributeValue.AttributeID\r\n AND eZArticle_AttributeValue.ArticleID=eZArticle_Article.ID\";\r\n $typeTables = \"eZArticle_Attribute, eZArticle_AttributeValue, \";\r\n }\r\n if ( isSet( $params[\"AuthorID\"] ) )\r\n {\r\n $author = $params[\"AuthorID\"];\r\n $authorSQL = \"AND eZArticle_Article.ContentsWriterID='$author'\";\r\n }\r\n\tif ( isSet( $params[\"SectionsList\"] ) )\r\n\t{\r\n\t $sectionsList = $params[\"SectionsList\"];\r\n\t $sectionsArray = explode( \",\", $sectionsList );\r\n\t if ( is_numeric( $sectionsArray[0] ) )\r\n\t {\r\n\t\t$sectionsSQL .= \"AND ( Category.SectionID='$sectionsArray[0]'\";\r\n\t\tfor ( $i=1; $i<count( $sectionsArray ); $i++ )\r\n\t {\r\n\t\t $sectionsSQL .= \" OR Category.SectionID='$sectionsArray[$i]'\";\r\n\t\t}\r\n\t\t$sectionsSQL .= \" ) \";\r\n }\r\n }\r\n if ( isSet( $params[\"PhotographerID\"] ) )\r\n {\r\n $photo = $params[\"PhotographerID\"];\r\n $photoSQL = \"AND eZImageCatalogue_Image.PhotographerID='$photo'\r\n AND eZImageCatalogue_Image.ID=eZArticle_ArticleImageLink.ImageID\r\n AND eZArticle_Article.ID=eZArticle_ArticleImageLink.ArticleID\";\r\n $photoTables = \"eZArticle_ArticleImageLink, eZImageCatalogue_Image,\";\r\n }\r\n\r\n\r\n if ( isset($params[\"SearchExcludedArticles\"]) && $params[\"SearchExcludedArticles\"] == \"true\" )\r\n $excludeFromSearchSQL = \" \";\r\n else\r\n $excludeFromSearchSQL = \" AND Category.ExcludeFromSearch = '0' \";\r\n\r\n // special search for MySQL, mimic subselects ;)\r\n if ( $db->isA() == \"mysql\" )\r\n {\r\n $queryArray = explode( \" \", trim( $queryText ) );\r\n\r\n $db->query( \"CREATE TEMPORARY TABLE eZArticle_SearchTemp( ArticleID int )\" );\r\n\r\n $count = 1;\r\n foreach ( $queryArray as $queryWord )\r\n {\r\n $queryWord = trim( $queryWord );\r\n\r\n $searchSQL = \" ( eZArticle_Word.Word = '$queryWord' AND eZArticle_Word.Frequency < '$StopWordFrequency' ) \";\r\n\r\n $queryString = \"INSERT INTO eZArticle_SearchTemp ( ArticleID ) SELECT DISTINCT eZArticle_Article.ID AS ArticleID\r\n FROM eZArticle_Article,\r\n eZArticle_ArticleWordLink,\r\n eZArticle_Word,\r\n eZArticle_ArticleCategoryLink as Link,\r\n $typeTables\r\n $photoTables\r\n eZArticle_ArticleCategoryDefinition as Definition,\r\n eZArticle_ArticlePermission as Permission,\r\n eZArticle_Category AS Category,\r\n eZArticle_CategoryPermission as CategoryPermission\r\n\r\n WHERE\r\n $permissionSQL\r\n $searchSQL\r\n $dateSQL\r\n $catSQL\r\n $typeSQL\r\n $authorSQL\r\n $photoSQL\r\n\t\t $sectionsSQL\r\n AND\r\n ( eZArticle_Article.ID=eZArticle_ArticleWordLink.ArticleID\r\n AND Definition.ArticleID=eZArticle_Article.ID\r\n AND Definition.CategoryID=Category.ID\r\n $excludeFromSearchSQL\r\n AND eZArticle_ArticleWordLink.WordID=eZArticle_Word.ID\r\n AND Permission.ObjectID=eZArticle_Article.ID\r\n AND CategoryPermission.ObjectID=Definition.CategoryID\r\n $fetchText\r\n AND Link.ArticleID=eZArticle_Article.ID\r\n )\r\n ORDER BY $OrderBy\";\r\n\r\n $db->query( $queryString );\r\n\r\n // check if this is a stop word\r\n $queryString = \"SELECT Frequency FROM eZArticle_Word WHERE Word='$queryWord'\";\r\n\r\n $db->query_single( $WordFreq, $queryString, array( \"LIMIT\" => 1 ) );\r\n\r\n if ( $WordFreq[\"Frequency\"] <= $StopWordFrequency )\r\n $count += 1;\r\n }\r\n $count -= 1;\r\n\r\n $queryString = \"SELECT ArticleID, Count(*) AS Count FROM eZArticle_SearchTemp GROUP BY ArticleID HAVING Count>='$count'\";\r\n\r\n $db->array_query( $article_array, $queryString );\r\n\r\n// $db->array_query( $article_array, $queryString, array( \"Limit\" => $limit, \"Offset\" => $offset ) );\r\n\r\n $db->query( \"DROP TABLE eZArticle_SearchTemp\" );\r\n\r\n $SearchTotalCount = count( $article_array );\r\n if ( $limit >= 0 )\r\n $article_array =& array_slice( $article_array, $offset, $limit );\r\n }\r\n else\r\n {\r\n $queryString = \"SELECT DISTINCT eZArticle_Article.ID AS ArticleID, eZArticle_Article.Published, eZArticle_Article.Name, eZArticle_ArticleWordLink.Frequency\r\n FROM eZArticle_Article,\r\n eZArticle_ArticleWordLink,\r\n eZArticle_Word,\r\n eZArticle_ArticleCategoryLink,\r\n $catDefTable\r\n $catTable\r\n $typeTables\r\n $photoTables\r\n eZArticle_ArticlePermission\r\n WHERE\r\n $searchSQL\r\n $dateSQL\r\n $catSQL\r\n $typeSQL\r\n $authorSQL\r\n $photoSQL\r\n AND\r\n ( eZArticle_Article.ID=eZArticle_ArticleWordLink.ArticleID\r\n AND eZArticle_ArticleCategoryDefinition.ArticleID=eZArticle_Article.ID\r\n AND eZArticle_ArticleCategoryDefinition.CategoryID=eZArticle_Category.ID\r\n $excludeFromSearchSQL\r\n AND eZArticle_ArticleWordLink.WordID=eZArticle_Word.ID\r\n AND eZArticle_ArticlePermission.ObjectID=eZArticle_Article.ID\r\n $fetchText\r\n AND eZArticle_ArticleCategoryLink.ArticleID=eZArticle_Article.ID AND\r\n ( $loggedInSQL ($groupSQL eZArticle_ArticlePermission.GroupID='-1')\r\n AND eZArticle_ArticlePermission.ReadPermission='1'\r\n )\r\n )\r\n ORDER BY $OrderBy\";\r\n\r\n $db->array_query( $article_array, $queryString );\r\n\r\n $SearchTotalCount = count( $article_array );\r\n $article_array =& array_slice( $article_array, $offset, $limit );\r\n }\r\n\r\n for ( $i = 0; $i < count($article_array); $i++ )\r\n {\r\n $return_array[$i] = new eZArticle( $article_array[$i][$db->fieldName( \"ArticleID\" )], false );\r\n }\r\n\r\n return $return_array;\r\n }",
"private function searchNews() {\n\n $arrWhere = array(\n \"news_image LIKE ?\",\n \"news_intro LIKE ?\",\n \"news_text LIKE ?\",\n \"news_title LIKE ?\"\n );\n $arrParams = array(\n \"%\".$this->strSearchterm.\"%\",\n \"%\".$this->strSearchterm.\"%\",\n \"%\".$this->strSearchterm.\"%\",\n \"%\".$this->strSearchterm.\"%\"\n );\n\n $strWhere = \"( \".implode(\" OR \", $arrWhere).\" ) \";\n\n //Query bauen\n $strQuery = \"SELECT system_id\n FROM \"._dbprefix_.\"news,\n \"._dbprefix_.\"system\n WHERE \".$strWhere.\"\n AND system_id = news_id\n AND system_status = 1\";\n\n $arrNews = $this->objDB->getPArray($strQuery, $arrParams);\n\n\n if(count($arrNews) > 0) {\n\n foreach($arrNews as $arrOneNews) {\n\n $objNews = new class_module_news_news($arrOneNews[\"system_id\"]);\n $arrDetails = $this->getElementData($objNews);\n\n foreach($arrDetails as $arrOnePage) {\n\n //check, if the post is available on a page using the current language\n if(!isset($arrOnePage[\"news_detailspage\"]) || $arrOnePage[\"news_detailspage\"] == \"\" || !$objNews->rightView())\n continue;\n\n $objDetails = class_module_pages_page::getPageByName($arrOnePage[\"news_detailspage\"]);\n\n if($objDetails == null)\n continue;\n\n if(isset($this->arrHits[$objNews->getSystemid().$objDetails->getSystemid()])) {\n $objResult = $this->arrHits[$objNews->getSystemid().$objDetails->getSystemid()];\n $objResult->setIntHits($objResult->getIntHits() + 1);\n }\n else {\n\n //TODO: PV position\n\n $objResult = new class_search_result();\n $objResult->setStrResultId($objNews->getSystemid().$objDetails->getSystemid());\n $objResult->setStrSystemid($objNews->getSystemid());\n $objResult->setStrPagelink(getLinkPortal($arrOnePage[\"news_detailspage\"], \"\", \"_self\", $arrOnePage[\"news_detailspage\"], \"newsDetail\", \"&highlight=\".urlencode(html_entity_decode($this->strSearchterm, ENT_QUOTES, \"UTF-8\")), $objNews->getSystemid()));\n $objResult->setStrPagename($arrOnePage[\"news_detailspage\"]);\n $objResult->setStrDescription($objNews->getStrTitle());\n\n $this->arrHits[$objNews->getSystemid().$objDetails->getSystemid()] = $objResult;\n }\n }\n }\n }\n }",
"public function frontPageArticles() {\n\t\t\t$db = new DatabaseModule();\n\n\t\t\t$getArticles = $db->Handle->prepare('SELECT id FROM ms_articles ORDER BY articleDate DESC LIMIT 5');\n\t\t\t$getArticles->execute();\n\t\t\t$articles = $getArticles->fetchAll();\n\n\t\t\t$first = true;\n\n\t\t\tforeach($articles as $articleID) {\n\t\t\t\t$article = new Article($articleID['id']);\n\n\t\t\t\t$Link = \"blog/blog.php?do=read&article=\" . $article->ID;\n\n\t\t\t\tif($article->Comments < 10) {\n\t\t\t\t\t$cBox = \"<div class=\\\"cBox\\\"> <span style=\\\"position: relative; left: 3px;\\\">\". $article->Comments . \"</span> </div>\";\n\t\t\t\t} else {\n\t\t\t\t\t$cBox = \"<div class=\\\"cBox\\\"> <span>\". $article->Comments . \"</span> </div>\";\n\t\t\t\t}\n\n\t\t\t\tif($first) {\n\t\t\t\t\techo <<<FIRST\n\t\t\t\t\t\t<a class=\"latestArticle\" href=\"{$Link}\">\n\t\t\t\t\t\t\t<img src=\"Resources/Images/Covers/BlogPosts/{$article->Cover}.png\" alt=\"{$article->Title}\" title=\"{$article->Title}\" />\n\n\t\t\t\t\t\t\t{$cBox}\n\n\t\t\t\t\t\t\t<div class=\"headline\">\n\t\t\t\t\t\t\t\t{$article->Title}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\nFIRST;\n\n\t\t\t\t\t$first = false;\n\t\t\t\t} else {\n\t\t\t\t\techo <<<ARTICLE\n\t\t\t\t\t\t<a class=\"article\" href=\"{$Link}\">\n\t\t\t\t\t\t\t<img src=\"Resources/Images/Covers/BlogPosts/{$article->Cover}.png\" />\n\n\t\t\t\t\t\t\t{$cBox}\n\n\t\t\t\t\t\t\t<div class=\"headline\">{$article->Title}</div>\n\t\t\t\t\t\t</a>\nARTICLE;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function searchArticles($query) {\n\n global $db;\n\n $q = $db->query(\"\n SELECT articles.id as article_id,\n title,\n author_id,\n users.username as author_username,\n users.role as author_role,\n timestamp,\n body\n FROM articles, users\n WHERE articles.author_id = users.id\n AND title LIKE '%$query%'\n \");\n $q->execute();\n\n $r = $q->fetchAll(PDO::FETCH_ASSOC);\n return $r;\n\n}",
"public function searchArticle()\n {\n $article = new Article();\n\n $article_result = $article->search(Input::get('query'));\n\n $total_result = $article_result->total();\n\n return view('pages.search', compact('article_result', 'total_result'));\n }",
"function getSearchedArticles($search_query)\n {\n $query = $this->createQueryBuilder('a')\n ->where('a.title LIKE :title')\n ->setParameter('title', '%'.$search_query.'%');\n\n return $query->getQuery()->getArrayResult();\n }",
"function ting_search_pages_content_feed($query) {\n $entries = '';\n $max_results = 10;\n $result_count = 0;\n $cache_key = 'ting_search_content_feed_entries:' . md5(drupal_strtolower($query));\n $cache_data = cache_get($cache_key);\n\n if ($cache_data) {\n $result_count = $cache_data->data['result_count'];\n $entries = $cache_data->data['entries'];\n }\n else {\n $search_result = do_search($query, 'node');\n // do_search() calls pager_query() that populates this global.\n $result_count = (!empty($search_result)) ? $GLOBALS['pager_total_items'][0] : 0;\n\n foreach($search_result as $item) {\n $node = node_load($item->sid, NULL, TRUE);\n $author = user_load($node->uid);\n\n $entry = array(\n 'id' => url('node/' . $node->nid, array('absolute' => TRUE)),\n 'title' => $node->title,\n 'published' => gmdate('c', $node->created),\n 'updated' => gmdate('c', $node->changed),\n 'summary' => strip_tags($node->teaser),\n );\n $entry['alternate_link'] = $entry['id'];\n\n if (!empty($author->display_name)) {\n $entry['authors'][$author->uid]['name'] = $author->display_name;\n }\n else {\n $entry['authors'][$author->uid]['name'] = $author->name;\n }\n $entry['authors'][$author->uid]['uri'] = url('user/' . $author->uid, array('absolute' => TRUE));\n\n $entries .= theme('atom_entry', $entry);\n }\n }\n\n $feed = array(\n 'title' => t('“@title” content search results feed', array('@title' => $query)),\n 'alternate_link' => url('ting/search/' . $query, array('absolute' => TRUE)),\n 'entries' => $entries,\n );\n\n // If data was received from cache, set the feeds update time to the\n // cache creation time.\n if ($cache_data) {\n $feed['updated'] = gmdate('c', $cache_data->created);\n }\n\n if ($result_count > $max_results) {\n $feed['subtitle'] = t('First @max of @count items found.', array('@max' => $max_results, '@count' => $result_count));\n }\n elseif ($result_count > 0) {\n $feed['subtitle'] = format_plural($result_count, 'One item found', '@count items found.', array('@count' => $result_count));\n }\n else {\n $feed['subtitle'] = t('No items found.');\n }\n\n // Set the correct content type for Atom feeds.\n drupal_set_header('Content-Type: application/atom+xml; charset=utf-8');\n print theme('atom_feed', $feed);\n return;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
onDisplaySupplemental() Any additional CSS or JavaScript required by a pane. CSS should be included either via the tag or inline in a tag. JavaScript should be enclosed in a tag. | function onDisplaySupplemental($pane)
{
return '';
} | [
"private function augment_general_user_interface_javascript() {\n\t\t$new_options['use_sensor'] = array( 'type' => 'checkbox', 'default' > '1' , 'use_in_javascript' => true );\n\t\t$this->attach_to_slp( $new_options , array( 'page'=> 'slp_general','section' => 'user_interface', 'group' => 'javascript' ) );\n\t}",
"public function showJsLibraryHint()\n\t{\n\t\tif ($_POST || Input::get('act') != 'edit')\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Return if the user cannot access the layout module (see #6190)\n\t\tif (!$this->User->hasAccess('themes', 'modules') || !$this->User->hasAccess('layout', 'themes'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tSystem::loadLanguageFile('tl_layout');\n\t\tMessage::addInfo(sprintf($GLOBALS['TL_LANG']['tl_image_size']['picturefill'], $GLOBALS['TL_LANG']['tl_layout']['picturefill'][0]));\n\t}",
"function js_frontend_preview() {\n ?><script>\n window.<?php echo $this->slug; ?>_preview = function(args) {\n return '<section class=\"custom_header_shapes et_pb_fullwidth_header\">' +\n ' <div class=\"shapes\">' +\n ' <svg class=\"triangle triangle-first\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">' +\n ' <polygon points=\"0 0, 100 0, 40 100, 0 100\">' +\n ' </polygon>' +\n ' </svg>' +\n ' <svg class=\"triangle triangle-second\" viewBox=\"0 0 100 100\" xmlns=\"http://www.w3.org/2000/svg\">' +\n ' <polygon points=\"0 20, 100 100, 0 100\">' +\n ' </polygon>' +\n ' </svg>' +\n ' </div>' +\n ' <div class=\"et_pb_fullwidth_header_container\">' +\n ' </div>' +\n ' <div class=\"et_pb_fullwidth_header_overlay\"></div>' +\n ' <div class=\"et_pb_fullwidth_header_scroll\"></div>' +\n '</section>' \n\n }\n </script><?php\n }",
"public function shouldAttachAdditionalJavaScript();",
"function charity_is_hope_core_frontend_add_vars() {\n\t\t$vars = apply_filters( 'charity_is_hope_filter_localize_script', charity_is_hope_storage_empty('js_vars') ? array() : charity_is_hope_storage_get('js_vars'));\n\t\tif (!empty($vars)) wp_localize_script( 'charity-is-hope-core-init-script', 'CHARITY_IS_HOPE_STORAGE', $vars);\n\t\tif (!charity_is_hope_storage_empty('js_code')) {\n\t\t\t$holder = 'script';\n\t\t\t?><<?php charity_is_hope_show_layout($holder); ?>>\n\t\t\tjQuery(document).ready(function() {\n\t\t\t<?php charity_is_hope_show_layout(charity_is_hope_minify_js(charity_is_hope_storage_get('js_code'))); ?>\n\t\t\t});\n\t\t\t</<?php charity_is_hope_show_layout($holder); ?>><?php\n\t\t}\n\t}",
"private function set_demographics_code() {\n\t\t$this->js[] = \"ga('require', 'displayfeatures');\";\n\t}",
"public function add_legacy_preview_scripts() {\n\n\t\t// Bail if user can't customize anyway.\n\t\tif ( ! current_user_can( 'customize' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\twp_enqueue_script( 'customize-selective-refresh' );\n\n\t\t/**\n\t\t * Fires when plugins should enqueue their own scripts for the AMP Customizer preview.\n\t\t *\n\t\t * @since 0.4\n\t\t * @param WP_Customize_Manager $wp_customize Manager.\n\t\t */\n\t\tdo_action( 'amp_customizer_enqueue_preview_scripts', $this->wp_customize );\n\n\t\t$this->wp_customize->customize_preview_settings();\n\t\t$this->wp_customize->selective_refresh->export_preview_data();\n\n\t\twp_print_footer_scripts();\n\t}",
"function cp_display_preview_info_bar()\n {\n require_once(CP_BASE_DIR . '/modules/info_bar/style-preview-ajax.php');\n die();\n }",
"static function action_inject_custom_admin_js_header() {\n\n\t\t// Skip if this tool is site-disabled (when network-disabled, it should load with network defaults)\n\t\tif ( ! Clientside_Options::get_saved_option( 'enable-custom-cssjs-tool' ) && ! Clientside_Options::get_saved_network_option( 'disable-custom-cssjs-tool' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine this area's value\n\t\t// If this tool is network disabled, use the network defaults\n\t\tif ( Clientside_Options::get_saved_network_option( 'disable-custom-cssjs-tool' ) ) {\n\t\t\t$value = Clientside_Options::get_saved_network_default_option( 'custom-admin-js-header' );\n\t\t}\n\t\t// Use the regular site options\n\t\telse {\n\t\t\t$value = Clientside_Options::get_saved_option( 'custom-admin-js-header' );\n\t\t}\n\n\t\t// Only if custom JS is supplied\n\t\tif ( ! $value ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Output JS\n\t\techo '<script class=\"clientside-custom-js\">';\n\t\techo $value;\n\t\techo '</script>';\n\n\t}",
"public function show_shortcodes_section_footer_extra() {\n\t\t\t// This is a hook called after the section closing </div> to allow adding JS/CSS\n\t\t}",
"function displayAfterLoadTempl() \r\n\t{\r\n\t\t$this->xt->display_loaded(\"style_block\");\r\n\t\t$this->xt->display_loaded(\"iestyle_block\");\r\n\t}",
"function ag_head_elements() {\n\tif(get_option('ag_disable_rclick')) {\n\t\t?>\n <style type=\"text/css\">\n\t\t.ag_gallery_wrap *, .ag_galleria_slider_wrap *, #lcl_wrapper * {\n\t\t\t-webkit-touch-callout: none; \n\t\t\t-webkit-user-select: none;\n\t\t}\n\t\t</style>\n <?php\t\n\t}\n}",
"public function cp_display_preview_slide_in() {\n\t\t\trequire_once CP_BASE_DIR . '/modules/slide_in/style-preview-ajax.php';\n\t\t\tdie();\n\t\t}",
"function _style_premium_theme() {\n $this->_logger->entrance();\n\n if ( ! self::is_themes_page() ) {\n // Only include in the themes page.\n return;\n }\n\n if ( ! $this->has_paid_plan() ) {\n // Only include if has any paid plans.\n return;\n }\n\n $params = null;\n fs_require_once_template( '/js/jquery.content-change.php', $params );\n\n $params = array(\n 'slug' => $this->_slug,\n 'id' => $this->_module_id,\n );\n\n fs_require_template( '/js/style-premium-theme.php', $params );\n }",
"public function enableInfoWindow()\n {\n $js = sprintf('%s.enableInfoWindow();', $this->container);\n $this->javaScriptStack[] = $js;\n }",
"public function welcome_enhance() {\n\t\t\trequire_once( get_template_directory() . '/inc/admin/welcome-screen/component-enhance.php' );\n\t\t}",
"function meta_box_lessons_callback() {\n\t?>\n\t<div id=\"sfwd-lessons-app\"></div>\n\t<?php\n}",
"function tempera_customjs() {\n\t$temperas= tempera_get_theme_options();\n\tforeach ($temperas as $key => $value) { ${\"$key\"} = $value; }\n\techo '<script type=\"text/javascript\">';\n\techo 'var cryout_global_content_width = '.$tempera_sidewidth.';';\n\techo 'var cryout_toTop_offset = '.($tempera_sidewidth+$tempera_sidebar).';' ;\n\tif (is_rtl()) echo 'var cryout_toTop_offset = '.($tempera_sidewidth+$tempera_sidebar).';';\n\tif ($tempera_customjs != \"\") {\n\t\techo PHP_EOL.htmlspecialchars_decode($tempera_customjs, ENT_QUOTES);\n\t}\n\techo '</script>';\n}",
"public static function achilles_customize_preview() {\n\t wp_register_script( 'achilles-live-preview', get_template_directory_uri() . '/assets/js/live-preview.js', '', true );\n\t wp_enqueue_script( 'achilles-live-preview', get_template_directory_uri() . '/assets/js/live-preview.js', array( 'jquery', 'customize-preview' ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does the worker have at least one idle process? Part of the Daemon API Use from your daemon to determine if any of your daemon's worker processes are idle | public function is_idle() {
return $this->workers > count($this->running_calls);
} | [
"public function isIdle()\n {\n return $this->idleWorkers->count() > 0;\n }",
"public function isIdle(): bool;",
"public function isIdle()\n {\n return $this->idle;\n }",
"public function isWorkerMonitorRunning()\n {\n return $this->redis->exists(self::WORKER_MONITOR_HEARTBEAT_KEY);\n }",
"protected function isWorkerRunning()\n\t{\n\t\t$PID = $this->getLastRecordedPID();\n\n\t\tif ( ! $PID )\n\t\t\treturn false;\n\n\t\treturn str_contains(exec(\"ps -p $PID -opid=,cmd=\"), 'queue:work');\n\t}",
"private function isProcessAlive(): bool {\n\t\treturn $this->application->process->alive($this->pid);\n\t}",
"public function master_is_alive() : bool\n\t{\t\n\t\treturn $this->is_master or $this->this_process_is_alive( $this->master_pid );\n\t}",
"function check() {\n $current = $this->current;\n $current['time'] = time();\n $current['process'] = time() - $this->start;\n foreach ($this->limit as $key => $value) {\n if (isset($current[$key]) && $current[$key] > $value) {\n return FALSE;\n }\n }\n return !empty($this->workers);\n }",
"public function getIdleWorkerCount(): int;",
"public function isRunning()\n {\n return is_resource($this->process);\n }",
"function isIdle()\n {\n\t\tif (isset($_SESSION['__HTTP_SESSION_IDLE_TS']) && (($_SESSION['__HTTP_SESSION_IDLE_TS'] + $_SESSION['__HTTP_SESSION_IDLE']) < time())) {\n return true;\n } else {\n return false;\n }\n }",
"protected function isKilled()\n {\n // Worker check-in will fail if this worker has been killed.\n if (!$this->channel->checkInWorker($this->workerId)) {\n return true;\n } else {\n return false;\n }\n }",
"public function isAlive() { // same as subprocess.poll()\n\t\t$this->wait(0);\n\t\treturn $this->is_alive;\n\t}",
"private function findDisposableWorkers()\n {\n $disposableStatusses = array(ChildProcessContainer::STATUS_READY, ChildProcessContainer::STATUS_ALIVE);\n foreach ($this->family as &$child) {\n\n if (in_array($child->status, $disposableStatusses)) {\n if ($child->getAge() < 10) {\n //less than ten seconds old keep it alive a bit to let its do its job\n continue;\n }\n $child->bedTime();\n return true;\n }\n }\n return false;\n }",
"private function isRunning(){\n\t\tif($this->pid == null)\n\t\t\t$this->fail(\"Pid not defined\");\n\n return file_exists( \"/proc/$this->pid\" );\n\t}",
"protected function isIdleTimeOut(): bool\n {\n $idleTime = time() - $this->getLastTime();\n $maxIdleTime = $this->getPool()->getPoolConfig()->getMaxIdleTime();\n return $idleTime > $maxIdleTime;\n }",
"public function hasShutdownWorkers()\n {\n return $this->workers->hasShutdownWorkers() || $this->shutdownLock;\n }",
"public function isObsRunning(): bool\n {\n $res = shell_exec(\"tasklist /FI \\\"IMAGENAME eq obs64.exe\\\" 2>NUL | find /I /N \\\"obs64.exe\\\">NUL && if \\\"%ERRORLEVEL%\\\"==\\\"0\\\" echo running\");\n if (strcmp($res, \"\") !== 0) {\n return true;\n }\n return false;\n }",
"public function isRunningSchedulerWorker()\n {\n $pids = $this->redis->hKeys(self::$workerKey);\n $schedulerPid = $this->redis->get(self::$schedulerWorkerKey);\n\n if ($schedulerPid !== false && is_array($pids)) {\n if (in_array($schedulerPid, $pids)) {\n return true;\n }\n // Pid is outdated, remove it\n $this->unregisterSchedulerWorker();\n return false;\n }\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get Class Bll_Millionminds_Profile instance object | public static function getBllMillionmindsProfile()
{
if (self::$_bllMillionmindsProfile === null) {
require_once 'Bll/Millionminds/Profile.php';
self::$_bllMillionmindsProfile = new Bll_Millionminds_Profile();
}
return self::$_bllMillionmindsProfile;
} | [
"public function profile()\n {\n return new Profile;\n }",
"public function getProfile()\n {\n }",
"public function getProfile();",
"public static function init() {\n static $instance = false;\n\n if ( ! $instance ) {\n $instance = new WPUF_BP_Profile();\n }\n\n return $instance;\n }",
"public function getProfileClass(): string {\n $main_module = $this->xot->main_module;\n $class = 'Modules\\\\'.$main_module.'\\Models\\Profile';\n\n return $class;\n }",
"function getProfile() {\n\t\tif ( !$this->_Profile instanceof mofilmUserProfile ) {\n\t\t\t$this->_Profile = mofilmUserProfile::getUserActiveProfile($this->getID());\n\t\t\tif ( !$this->_Profile->getID() ) {\n\t\t\t\t$this->_Profile = mofilmUserProfile::getMostRecentUserProfile($this->getID());\n\t\t\t}\n\t\t}\n\t\treturn $this->_Profile;\n\t}",
"function retrieve_UserProfile_SW_OBJ($userProfileId)\r\n{\r\n connect();\r\n\t$query=\"SELECT U.UserProfileID, U.UserCategory, S.SocialWorkerProfileID,S.Title,S.FirstName, S.LastName,U.UsernameID, U.Password, U.UserEmail, S.Phone,S.HospitalAffiliation,S.EmailNotification\r\n FROM userprofile U JOIN socialworkerprofile S\r\n ON U.UserProfileID= S.UserProfileID\r\n WHERE U.UserCategory='Social Worker' AND U.UserProfileID=\\\"\".$userProfileId.\"\\\"\";\r\n \r\n $result = mysql_query($query) or die(mysql_error());\r\n \r\n if (mysql_num_rows($result) <1)\r\n {\r\n mysql_close();\r\n return false;\r\n }\r\n \r\n $result_row = mysql_fetch_assoc($result); \r\n $user = new UserProfile($result_row['UserCategory'], $result_row['UserProfileID'], $result_row['UsernameID'],$result_row['UserEmail'],\r\n $result_row['Password'],'null','null', 'null',\r\n 'null', 'null', $result_row['SocialWorkerProfileID'], $result_row['Title'],\r\n $result_row['FirstName'], $result_row['LastName'], $result_row['HospitalAffiliation'], $result_row['Phone'], \r\n $result_row['EmailNotification']);\r\n\t\r\n mysql_close();\r\n\treturn $user; \r\n\r\n}",
"public static function profile($profile) {\n\t\tif (!isset(self::$_instances[$profile])) {\n\t\t\tself::$_instances[$profile] = new static($profile);\n\t\t}\n\t\treturn self::$_instances[$profile];\n\t}",
"public function getProfile()\n {\n return $this->_profile;\n }",
"public function getProfile()\r\n\t{\r\n\t\treturn $this->profile;\r\n\t}",
"public function getProfileCached()\n\t{\n\t\t$cache = Application::getInstance()->getManagedCache();\n\n\t\t$cacheId = $this->getCacheId();\n\t\tif ($cache->read(static::PROFILE_INFO_CACHE_TTL, $cacheId))\n\t\t{\n\t\t\t$profile = $cache->get($cacheId);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$profile = $this->getProfile();\n\t\t\t$cache->set($cacheId, $profile);\n\t\t}\n\n\t\tif ($profile)\n\t\t{\n\t\t\t$authProvider = Service::getAuthAdapter(static::TYPE_CODE);\n\t\t\t$authProvider->setService($this->service);\n\t\t\t$profile['CLIENT_ID'] = $authProvider->getClientId();\n\t\t}\n\t\treturn $profile;\n\t}",
"function loadProfile() {\n $response = $this->client->get(\n sprintf(\"http://%s/v1/user/%s/profile\",\n SOCIAL_WS_HOSTNAME,\n urlencode($this->guid)));\n if(is_null($response) || $response[\"code\"] != 200) {\n return NULL;\n }\n\n $profile = json_decode($response[\"responseBody\"]);\n return $profile->profile;\n }",
"public static function getInstance($inID) {\n\t\t/**\n\t\t * Check for an existing instance\n\t\t */\n\t\tif ( isset(self::$_Instances[$inID]) ) {\n\t\t\treturn self::$_Instances[$inID];\n\t\t}\n\n\t\t/**\n\t\t * No instance, create one\n\t\t */\n\t\t$oObject = new mofilmUserProfile();\n\t\t$oObject->setID($inID);\n\t\tif ( $oObject->load() ) {\n\t\t\tself::$_Instances[$inID] = $oObject;\n\t\t\treturn $oObject;\n\t\t}\n\t\treturn $oObject;\n\t}",
"public static function initProfile () {\n if (!isset(self::$profile_object)){\n\n $profile_system = conf::getMainIni('profile_module');\n if (!isset($profile_system) || !moduleloader::isInstalledModule($profile_system)){\n self::$profile_object = new defaultProfile();\n return;\n } else {\n moduleloader::includeModule ($profile_system);\n $class = \"modules\\\\$profile_system\\\\module\";\n self::$profile_object = new $class();\n }\n }\n }",
"public function getProfileImage()\n {\n\n if (get_class($this) == 'Space') {\n return new ProfileImage($this->guid, 'default_space');\n }\n return new ProfileImage($this->guid);\n }",
"function retrieve_UserProfile_RMHApprover_OBJ($userProfileId)\r\n{\r\n connect();\r\n $query=\"SELECT U.UserProfileID, U.UserCategory,R.RMHStaffProfileID ,R.Title,R.FirstName, R.LastName,U.UsernameID, U.Password, U.UserEmail, R.Phone\r\n FROM userprofile U JOIN rmhstaffprofile R\r\n ON U.UserProfileID= R.UserProfileID\r\n WHERE U.UserCategory='RMH Staff Approver' AND U.UserProfileID=\\\"\".$userProfileId.\"\\\"\"; \r\n \r\n $result = mysql_query($query) or die(mysql_error());\r\n \r\n if (mysql_num_rows($result) <1)\r\n {\r\n mysql_close();\r\n return false;\r\n }\r\n $result_row = mysql_fetch_assoc($result); \r\n $user = new UserProfile($result_row['UserCategory'], $result_row['UserProfileID'], $result_row['UsernameID'],$result_row['UserEmail'],\r\n $result_row['Password'], $result_row['RMHStaffProfileID'],$result_row['Title'], $result_row['FirstName'],\r\n $result_row['LastName'], $result_row['Phone'],'null', 'null',\r\n 'null', 'null', 'null', 'null', 'null');\r\n\t\r\n mysql_close();\r\n\treturn $user; \r\n\r\n}",
"public function getProfileModel() {\n\t\t$class = ucfirst($this->type) . 'Model';\n\n\t\t$model = $class::getByKey($this->id);\n\t\tif (!$model) {\n\t\t\t$model = new $class();\n\t\t\t$model->setUserId($this->id);\n\t\t\t$model->save();\n\t\t}\n\n\t\treturn $model;\n\t}",
"public function getProfile()\n {\n return isset($this->profile) ? $this->profile : null;\n }",
"function getProfile( $profile_id ) {\n\n // update cache if required\n if ( $this->last_profile_id != $profile_id ) {\n $this->last_profile_object = new WPLA_AmazonProfile( $profile_id );\n $this->last_profile_id = $profile_id;\n }\n\n return $this->last_profile_object;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'deleteOidcDynamicClient' | public function deleteOidcDynamicClientRequest($id)
{
// verify the required parameter 'id' is set
if ($id === null || (is_array($id) && count($id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $id when calling deleteOidcDynamicClient'
);
}
$resourcePath = '/oauth2/register/{id}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// path params
if ($id !== null) {
$resourcePath = str_replace(
'{' . 'id' . '}',
ObjectSerializer::toPathValue($id),
$resourcePath
);
}
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
[]
);
}
// for model (json/xml)
if (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
foreach ($formParamValueItems as $formParamValueItem) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValueItem
];
}
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\Query::build($formParams);
}
}
// this endpoint requires Bearer authentication (access token)
if ($this->config->getAccessToken() !== null) {
$headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\Query::build($queryParams);
return new Request(
'DELETE',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function getOidcDynamicClientRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getOidcDynamicClient'\n );\n }\n\n $resourcePath = '/oauth2/register/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires Bearer authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function delete_client($params = array()) {\n $params['action'] = 'deleteclient';\n return self::send_request($params);\n }",
"public function deleted(ClientRequest $clientRequest)\n {\n //\n }",
"public function deleteClient(){\r\n\t $id = $this->getID();\r\n\t if (!$id) {echo 'error getting client ID'; return;}\r\n\t if ($state = $this->loginToSandBox()){\r\n\t\t\t$ch = $this->session;\r\n\t\t\t$data = array( CURLOPT_URL => SANDBOX_URL . $this->account_id . '/clients/' . $id . '?token=' . $this->token, \r\n\t\t\t\t\t\t CURLOPT_HEADER => 'Accept: application/json;',\r\n\t\t\t\t\t\t CURLOPT_TIMEOUT => 30,\r\n\t\t\t\t\t\t CURLOPT_RETURNTRANSFER => true,\r\n\t\t\t\t\t\t CURLOPT_CUSTOMREQUEST => \"DELETE\"\r\n\t\t\t);\r\n\r\n\t\t\theader('Content-Type: application/json');\r\n\t\t\techo $this->sendCurl($ch, $data);\r\n\t }else\r\n\t echo json_encode(array('message' => 'Error operation'));\r\n\t}",
"protected function deleteOAuth2ClientRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling deleteOAuth2Client'\n );\n }\n\n $resourcePath = '/clients/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getDeleteRequest()\n\t{\n\t\t$url = $this->url();\n\t\t\n\t\t$url->getQuery()->setParameter('code', 204);\n\t\t\n\t\treturn new Api\\Request\\Create((string) $url);\n\t}",
"public function deleteCenWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->cenId)) {\n $query['CenId'] = $request->cenId;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'DeleteCen',\n 'version' => '2017-09-12',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return DeleteCenResponse::fromMap($this->callApi($params, $req, $runtime));\n }",
"protected function restCategoriesIdClientsDeleteRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling restCategoriesIdClientsDelete'\n );\n }\n\n $resourcePath = '/rest/categories/{id}/clients';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteAction(){\n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity())\n\t\t{\n\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t$id = $this->_request->getParam('objid');\n\t\t$messages['message'] = ''; $messages['msgtype'] = '';\n\t\t$messages['flagtype'] = '';\n\t\t$actionflag = 3;\n\t\tif($id)\n\t\t{\n\t\t\t$clientsModel = new Timemanagement_Model_Clients();\n\t\t\t$checkProjects = $clientsModel->checkProjectClients($id);\n\t\t\tif($checkProjects == 0){\n\t\t\t\t$data = array('is_active'=>0,'modified'=>gmdate(\"Y-m-d H:i:s\"));\n\t\t\t\t$data['modified_by'] = $loginUserId;\n\t\t\t\t$where = array('id=?'=>$id);\n\t\t\t\t$id = $clientsModel->saveOrUpdateClientsData($data, $where);\n\t\t\t\tif($id == 'update')\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'Client deleted successfully.';\n\t\t\t\t\t$messages['msgtype'] = 'success';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'Client cannot be deleted.';\n\t\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$messages['message'] = 'Client is in use. You cannot delete the client';\n\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$messages['message'] = 'Client cannot be deleted.';$messages['msgtype'] = 'error';\n\t\t}\n\t\t$this->_helper->json($messages);\n\n\t}",
"protected function deleteLicenseKeyRequest($id, $licensekeyname, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling deleteLicenseKey'\n );\n }\n // verify the required parameter 'licensekeyname' is set\n if ($licensekeyname === null || (is_array($licensekeyname) && count($licensekeyname) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $licensekeyname when calling deleteLicenseKey'\n );\n }\n\n $resourcePath = '/api/v2/accounts/{id}/licensekey/{licensekeyname}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n // path params\n if ($licensekeyname !== null) {\n $resourcePath = str_replace(\n '{' . 'licensekeyname' . '}',\n ObjectSerializer::toPathValue($licensekeyname),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function deleteCompanyRequest($id, $x_avalara_client = 'Swagger UI; 20.9.0; Custom; 1.0')\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling deleteCompany'\n );\n }\n\n $resourcePath = '/api/v2/companies/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_avalara_client !== null) {\n $headerParams['X-Avalara-Client'] = ObjectSerializer::toHeaderValue($x_avalara_client);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function deleteOAuthClientRequest($client_id, $x_sds_auth_token = null)\n {\n // verify the required parameter 'client_id' is set\n if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $client_id when calling deleteOAuthClient'\n );\n }\n\n $resourcePath = '/v4/system/config/oauth/clients/{client_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_sds_auth_token !== null) {\n $headerParams['X-Sds-Auth-Token'] = ObjectSerializer::toHeaderValue($x_sds_auth_token);\n }\n\n // path params\n if ($client_id !== null) {\n $resourcePath = str_replace(\n '{' . 'client_id' . '}',\n ObjectSerializer::toPathValue($client_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=UTF-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=UTF-8'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function asDeleteRequest()\n {\n $url = $this->asUrl();\n\n return parent::request('DELETE', $url, [], $this->fqb_access_token, $this->fqb_etag);\n }",
"protected function deleteClientRequest($client_id)\n {\n // verify the required parameter 'client_id' is set\n if ($client_id === null || (is_array($client_id) && count($client_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $client_id when calling deleteClient'\n );\n }\n\n $resourcePath = '/v1/clients/{clientId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($client_id !== null) {\n $resourcePath = str_replace(\n '{' . 'clientId' . '}',\n ObjectSerializer::toPathValue($client_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // // this endpoint requires Bearer token\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function m_DeleteClient()\n\t{\n\t\tglobal $attributes,$_CONF;\n\t\t$smarty = $this->smarty;\n\n\t\t$rsResult = $this->dbHandler->m_ClientAction($attributes['clientid'], 'delete');\n\t\tif($rsResult)\n\t\t{\n\t\t\tif(isset($attributes['txtSearch']))\n\t\t\t{\n\t\t\t\theader(\"Location:\".SITE_URL.\"user/adminindex.php?action=searchclient&txtSearch=\".$attributes['txtSearch'].\"&msg=RECORD_DELETE\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\theader(\"Location:\".SITE_URL.\"user/adminindex.php?action=clientlist&msg=RECORD_DELETE\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t}",
"public function invoicesDeleteRequest($id, $x_apideck_consumer_id = null, $x_apideck_app_id = null, $x_apideck_service_id = null, $raw = false)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling invoicesDelete'\n );\n }\n\n $resourcePath = '/accounting/invoices/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($raw !== null) {\n if('form' === 'form' && is_array($raw)) {\n foreach($raw as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['raw'] = $raw;\n }\n }\n\n // header params\n if ($x_apideck_consumer_id !== null) {\n $headerParams['x-apideck-consumer-id'] = ObjectSerializer::toHeaderValue($x_apideck_consumer_id);\n }\n // header params\n if ($x_apideck_app_id !== null) {\n $headerParams['x-apideck-app-id'] = ObjectSerializer::toHeaderValue($x_apideck_app_id);\n }\n // header params\n if ($x_apideck_service_id !== null) {\n $headerParams['x-apideck-service-id'] = ObjectSerializer::toHeaderValue($x_apideck_service_id);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = $this->config->getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'DELETE',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function httpDelete($request)\n\t\t{\t\n\t\t\t$deleteRequest = $this->httpRequest('receive', 'DELETE', $request, '');\n\t\t\treturn $deleteRequest;\n\t\t}",
"function oa4mpDeleteClient($adminClient, $oidcClient) {\n $ret = false;\n\n $http = new HttpSocket();\n\n $request = $this->oa4mpInitializeRequest($adminClient);\n $request['method'] = 'DELETE';\n\n $client_id = $oidcClient['Oa4mpClientCoOidcClient']['oa4mp_identifier'];\n $request['uri']['query'] = array('client_id' => $client_id);\n\n $this->log(\"Request URI is \" . print_r($request['uri'], true));\n $this->log(\"Request method is \" . print_r($request['method'], true));\n $this->log(\"Request body is \" . print_r(null, true));\n\n $response = $http->request($request);\n\n $this->log(\"Response is \" . print_r($response, true));\n\n if($response->code == 204) {\n $ret = true;\n }\n\n return $ret;\n }",
"function sendDELETE(){\n //builds the string with the parameters to send\n $content = '';\n foreach($this->params as $k=>$val)\n $content .= '&'.$k.'='.rawurlencode($val);\n $content .= '&src=sdk-php-1.0';\n $content = substr($content, 1, strlen($content));//removes the first &\n $context = stream_context_create(array('http'=>array('method' =>'DELETE', 'ignore_errors' => 1)));\n $r = @file_get_contents($this->url.'?'.$content, false, $context);\n if($r !== false)\n $response = array('http-response' => $http_response_header, 'api-response' => $r);\n else $response = array('http-response' => $http_response_header);\n return $response;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create instance of BarCodeBuilder, specify codetext and symbology in the constructor | public static function run($dataDir=null){
$symbology=new Symbology();
$builder = new BarCodeBuilder("$ 123:50", $symbology->Codabar);
# Set the codabar start symbol to A
$codabarSymbol=new CodabarSymbol();
$builder->setCodabarStartSymbol($codabarSymbol->A);
# Set the codabar stop symbol to D
$builder->setCodabarStopSymbol($codabarSymbol->D);
# Save the image to disk in PNG format
$builder->save($dataDir . "barcode.out.png");
# Print message
print "Barcode image generated successfully.".PHP_EOL;
} | [
"private function _getCode(){\n $code = null;\n //try{\n $text = $this->text;\n $textColor = new CINColor($this->foregroundColor);\n $backgroudColor = new CINColor($this->backgroundColor);\n $fontPath = isset($this->font) ? $this->font : $this->_getDefaultFont();\n\n $font = new CINFontFile($fontPath, (is_int($this->fontSize)) ? $this->fontSize : 18);\n\n $codeClass = \"\\\\CodeItNow\\\\BarcodeBundle\\\\Generator\\\\\".$this->barcodeType;\n $code = new $codeClass();\n if($this->scale){\n $code->setScale($this->scale); // Resolution\n }\n if($this->thickness){\n $code->setThickness($this->thickness); // Thickness\n }\n if($this->label !== FALSE){\n $code->setLabel($this->label);\n }\n if($this->noLengthLimit){\n $code->setNoLengthLimit($this->noLengthLimit);\n }\n if($this->allowsUnknownIdentifier){\n $code->setAllowsUnknownIdentifier($this->allowsUnknownIdentifier);\n }\n $code->setForegroundColor($textColor); // Color of bars\n $code->setBackgroundColor($backgroudColor); // Color of spaces\n $code->setFont($font); // Font (or 0)\n $code->parse($text); // Text\n //} catch (\\Exception $ex) {\n \n //}\n return $code;\n }",
"private function _getCode()\n {\n $code = null;\n //try{\n $text = $this->text;\n $textColor = new CINColor($this->foregroundColor);\n $backgroudColor = new CINColor($this->backgroundColor);\n $fontPath = isset($this->font) ? $this->font : $this->_getFontPath();\n\n $font = new CINFontFile($fontPath, (is_int($this->fontSize)) ? $this->fontSize : 10);\n\n $codeClass = \"\\\\zxf\\\\qrcode\\\\Generator\\\\\" . $this->barcodeType;\n $code = new $codeClass();\n if ($this->scale) {\n $code->setScale($this->scale); // Resolution\n }\n if ($this->thickness) {\n $code->setThickness($this->thickness); // Thickness\n }\n if ($this->label !== false) {\n $code->setLabel($this->label);\n }\n if ($this->noLengthLimit) {\n $code->setNoLengthLimit($this->noLengthLimit);\n }\n if ($this->allowsUnknownIdentifier) {\n $code->setAllowsUnknownIdentifier($this->allowsUnknownIdentifier);\n }\n $code->setForegroundColor($textColor); // Color of bars\n $code->setBackgroundColor($backgroudColor); // Color of spaces\n $code->setFont($font); // Font (or 0)\n $code->parse($text); // Text\n //} catch (\\Exception $ex) {\n\n //}\n return $code;\n }",
"public function __construct()\n {\n\n /* [b] bold tag */\n $builder = new CodeDefinitionBuilder('b', '<strong>{param}</strong>');\n array_push($this->definitions, $builder->build());\n\n /* [i] italics tag */\n $builder = new CodeDefinitionBuilder('i', '<em>{param}</em>');\n array_push($this->definitions, $builder->build());\n\n /* [u] underline tag */\n $builder = new CodeDefinitionBuilder('u', '<u>{param}</u>');\n array_push($this->definitions, $builder->build());\n\n /* [center] center tag */\n $builder = new CodeDefinitionBuilder(\"center\", '<div style=\"text-align:center\">{param}</div>');\n array_push($this->definitions, $builder->build());\n\n /* [left] left tag */\n $builder = new CodeDefinitionBuilder(\"left\", '<div style=\"text-align:left\">{param}</div>');\n array_push($this->definitions, $builder->build());\n\n /* [right] right tag */\n $builder = new CodeDefinitionBuilder(\"right\", '<div style=\"text-align:right\">{param}</div>');\n array_push($this->definitions, $builder->build());\n\n /* [s] s tag */\n $builder = new CodeDefinitionBuilder(\"s\", '<span style=\"text-decoration:line-through;\">{param}</span>');\n array_push($this->definitions, $builder->build());\n\n /* [br] br tag */\n $builder = new CodeDefinitionBuilder(\"br\", '<br/>{param}');\n array_push($this->definitions, $builder->build());\n\n /* [quote] quote tag */\n $builder = new CodeDefinitionBuilder(\"quote\", '<blockquote>{param}</blockquote>');\n array_push($this->definitions, $builder->build());\n\n /* [code] code tag */\n $builder = new CodeDefinitionBuilder(\"code\", '<pre><code>{param}</code></pre>');\n array_push($this->definitions, $builder->build());\n\n /* [table] table tag */\n $builder = new CodeDefinitionBuilder(\"table\", '<table class=\"table-bordered\">{param}</table>');\n array_push($this->definitions, $builder->build());\n\n /* [tr] tr tag */\n $builder = new CodeDefinitionBuilder(\"tr\", '<tr>{param}</tr>');\n array_push($this->definitions, $builder->build());\n\n /* [td] td tag */\n $builder = new CodeDefinitionBuilder(\"td\", '<td>{param}</td>');\n array_push($this->definitions, $builder->build());\n\n /* [list] list tag */\n $builder = new CodeDefinitionBuilder(\"list\", '<ul>{param}</ul>');\n array_push($this->definitions, $builder->build());\n\n /* [ol] ol tag */\n $builder = new CodeDefinitionBuilder(\"ol\", '<ol>{param}</ol>');\n array_push($this->definitions, $builder->build());\n\n /* [li] li tag */\n $builder = new CodeDefinitionBuilder(\"*\", '<li>{param}</li>');\n array_push($this->definitions, $builder->build());\n\n $urlValidator = new \\JBBCode\\validators\\UrlValidator();\n\n /* [url] link tag */\n $builder = new CodeDefinitionBuilder('url', '<a href=\"{param}\">{param}</a>');\n $builder->setParseContent(false)->setBodyValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [url=http://example.com] link tag */\n $builder = new CodeDefinitionBuilder('url', '<a href=\"{option}\">{param}</a>');\n $builder->setUseOption(true)->setParseContent(true)->setOptionValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [img] image tag */\n $builder = new CodeDefinitionBuilder('img', '<img src=\"{param}\" />');\n $builder->setUseOption(false)->setParseContent(false)->setBodyValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [img=alt text] image tag */\n $builder = new CodeDefinitionBuilder('img', '<img src=\"{param}\" alt=\"{option}\" />');\n $builder->setUseOption(true)->setParseContent(false)->setBodyValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [color] color tag */\n $builder = new CodeDefinitionBuilder('color', '<span style=\"color: {option}\">{param}</span>');\n $builder->setUseOption(true)->setOptionValidator(new \\JBBCode\\validators\\CssColorValidator());\n array_push($this->definitions, $builder->build());\n\n /* [size] size tag */\n $builder = new CodeDefinitionBuilder('size', '<span style=\"font-size: {option}%\">{param}</span>');\n $builder->setUseOption(true)->setOptionValidator(new \\JBBCode\\validators\\CssColorValidator());\n array_push($this->definitions, $builder->build());\n\n /* [size] size tag */\n $builder = new CodeDefinitionBuilder('font', '<span style=\"font-family: {option}\">{param}</span>');\n $builder->setUseOption(true)->setOptionValidator(new \\JBBCode\\validators\\CssColorValidator());\n array_push($this->definitions, $builder->build());\n }",
"protected function _tag_open_BARCODE($param)\n {\n if (!isset($param['type'])) {\n $param['type'] = 'C39';\n }\n if (!isset($param['value'])) {\n $param['value'] = 0;\n }\n if (!isset($param['label'])) {\n $param['label'] = 'label';\n }\n if (!isset($param['style']['color'])) {\n $param['style']['color'] = '#000000';\n }\n\n $param['type'] = strtoupper($param['type']);\n if (!isset($param['dimension'])) {\n $param['dimension'] = '1D';\n }\n\n $this->parsingCss->save();\n $this->parsingCss->analyse('barcode', $param);\n $this->parsingCss->setPosition();\n $this->parsingCss->fontSet();\n\n $x = $this->pdf->GetX();\n $y = $this->pdf->GetY();\n $w = $this->parsingCss->value['width'];\n if (!$w) {\n $w = $this->cssConverter->convertToMM('50mm');\n }\n $h = $this->parsingCss->value['height'];\n if (!$h) {\n $h = $this->cssConverter->convertToMM('10mm');\n }\n $txt = ($param['label'] !== 'none' ? $this->parsingCss->value['font-size'] : false);\n $c = $this->parsingCss->value['color'];\n $infos = $this->pdf->myBarcode($param['value'], $param['type'], $x, $y, $w, $h, $txt, $c, $param['dimension']);\n\n $this->_maxX = max($this->_maxX, $x+$infos[0]);\n $this->_maxY = max($this->_maxY, $y+$infos[1]);\n $this->_maxH = max($this->_maxH, $infos[1]);\n $this->_maxE++;\n\n $this->pdf->SetXY($x+$infos[0], $y);\n\n $this->parsingCss->load();\n $this->parsingCss->fontSet();\n\n return true;\n }",
"public function barcodes(){\n /* echo \"<br>\";\n echo DNS2D::getBarcodeSVG('4445645656', 'DATAMATRIX');\n echo \"<br>\";\n echo $barcode = DNS1D::getBarcodeHTML('4445645656', 'C128');\n echo \"<br>\"; */\n }",
"function create_barcode($serial_number)\n\t{\n\t\t// side effect: includes the font file for barcodes\n\t\trequire_once('assets/barcode/class/BCGFontFile.php');\n\n\t\t// side effect: includes the color classes for barcodes\n\t\trequire_once('assets/barcode/class/BCGColor.php');\n\n\t\t// side effect: includes the drawing classes for barcodes\n\t\trequire_once('assets/barcode/class/BCGDrawing.php');\n\n\t\t// side effect: includes the barcode technology\n\t\trequire_once('assets/barcode/class/BCGcode39.barcode.php');\n\t\t\n\t\t// Loading Font\n\t\t$font = new BCGFontFile('assets/barcode/font/Arial.ttf', 18);\n\t\t// Don't forget to sanitize user inputs\n\t\t$text = $serial_number;\n\t\t// The arguments are R, G, B for color.\n\t\t$color_black = new BCGColor(0, 0, 0);\n\t\t$color_white = new BCGColor(255, 255, 255);\n\t\t$drawException = null;\n\t\ttry {\n\t\t\t$code = new BCGcode39();\n\t\t\t$code->setScale(2); // Resolution\n\t\t\t$code->setThickness(30); // Thickness\n\t\t\t$code->setForegroundColor($color_black); // Color of bars\n\t\t\t$code->setBackgroundColor($color_white); // Color of spaces\n\t\t\t$code->setFont($font); // Font (or 0)\n\t\t\t$code->parse($text); // Text\n $code->clearLabels();\n\t\t}\n\t\tcatch (Exception $exception) {\n\t\t\t$drawException = $exception;\n\t\t}\n\t\t/* Here is the list of the arguments\n\t\t1 - Filename (empty : display on screen)\n\t\t2 - Background color */\n\t\t$drawing = new BCGDrawing('', $color_white);\n\t\tif ($drawException) {\n\t\t\t$drawing->drawException($drawException);\n\t\t} else {\n\t\t\t$drawing->setBarcode($code);\n\t\t\t$drawing->draw();\n\t\t}\n\t\t// Header that says it is an image (remove it if you save the barcode to a file)\n\t\theader('Content-Type: image/png');\n\t\theader('Content-Disposition: inline; filename=\"barcode.png\"');\n\t\t// Draw (or save) the image into PNG format.\n\t\t$drawing->finish(BCGDrawing::IMG_FORMAT_PNG);\n\t}",
"public function generateBarCode()\n {\n if (empty($this->barcode_text)) {\n $str = 'x';\n $str .= 'c' . $this->id . uniqid();\n $this->barcode_text = $str;\n }\n return $this->barcode_text;\n }",
"private function createBarcode()\n {\n $barcodeOptions = [\n 'text' => $this->barcodeValue,\n 'factor' => '1',\n 'drawText' => $this->barcodeSettings->includeNumber($this->storeId),\n 'backgroundColor' => $this->barcodeSettings->getBackgroundColor($this->storeId),\n 'foreColor' => $this->barcodeSettings->getFontColor($this->storeId),\n ];\n\n $type = $this->barcodeSettings->getType($this->storeId);\n // @codingStandardsIgnoreLine\n $imageResource = ZendBarcode::draw($type, 'image', $barcodeOptions, []);\n // @codingStandardsIgnoreLine\n imagejpeg($imageResource, $this->fileName, 100);\n // @codingStandardsIgnoreLine\n imagedestroy($imageResource);\n }",
"public function render() {\n\t\t\tif ($this->image === null) {\n\t\t\t\tob_start();\n\n\t\t\t\t// Caches the data string\n\t\t\t\t$code = $this->data;\n\n\t\t\t\t// Computes the EAN-13 checksum digit\n\t\t\t\t$code .= static::checksum($code);\n\n\t\t\t\t// Creates the bar encoding using a binary string\n\t\t\t\t$bars = self::$patterns['end'][0];\n\t\t\t\tfor ($x = 0; $x < 6; $x++) {\n\t\t\t\t\t$bars .= self::$patterns['left'][$code[$x]];\n\t\t\t\t}\n\t\t\t\t$bars .= self::$patterns['center'][0];\n\t\t\t\tfor ($x = 6; $x < 12; $x++) {\n\t\t\t\t\t$bars .= self::$patterns['right'][$code[$x]];\n\t\t\t\t}\n\t\t\t\t$bars .= self::$patterns['end'][0];\n\n\t\t\t\t// Generates the barcode image\n\t\t\t\t$pixels = 2;\n\t\t\t\t$height = 100;\n\t\t\t\t$image = imagecreate($pixels * 95 + 30, $height + 30);\n\t\t\t\t$fg = imagecolorallocate($image, 0, 0, 0);\n\t\t\t\t$bg = imagecolorallocate($image, 255, 255, 255);\n\t\t\t\timagefilledrectangle($image, 0, 0, $pixels * 95 + 30, $height + 30, $bg);\n\t\t\t\t$length = strlen($bars);\n\t\t\t\tfor ($x = 0; $x < $length; $x++) {\n\t\t\t\t\t$sh = (($x < 10) || ($x >= 45 && $x < 50) || ($x >= 85)) ? 10 : 0;\n\t\t\t\t\t$color = ($bars[$x] == '1') ? $fg : $bg;\n\t\t\t\t\timagefilledrectangle($image, ($x * $pixels) + 15, 5, ($x + 1) * $pixels + 14, $height + 5 + $sh, $color);\n\t\t\t\t}\n\n\t\t\t\t// Adds the human readable label\n\t\t\t\timagestring($image, 4, 5, $height - 5, $code[0], $fg);\n\t\t\t\tfor ($x = 0; $x < 5; $x++) {\n\t\t\t\t\timagestring($image, 5, $pixels * (13 + $x * 6) + 15, $height + 5, $code[$x + 1], $fg);\n\t\t\t\t\timagestring($image, 5, $pixels * (53 + $x * 6) + 15, $height + 5, $code[$x + 6], $fg);\n\t\t\t\t}\n\t\t\t\timagestring($image, 4, $pixels * 95 + 17, $height - 5, $code[11], $fg);\n\n\t\t\t\t// Outputs image\n\t\t\t\timagepng($image);\n\t\t\t\timagedestroy($image);\n\n\t\t\t\t$this->image = ob_get_clean();\n\t\t\t}\n\t\t\treturn $this->image;\n\t\t}",
"public function Code39($xpos, $ypos, $code, $baseline=0.5, $height=5, $printText=false){\n\n $wide = $baseline;\n $narrow = $baseline / 3 ;\n $gap = $narrow;\n\n $barChar['0'] = 'nnnwwnwnn';\n $barChar['1'] = 'wnnwnnnnw';\n $barChar['2'] = 'nnwwnnnnw';\n $barChar['3'] = 'wnwwnnnnn';\n $barChar['4'] = 'nnnwwnnnw';\n $barChar['5'] = 'wnnwwnnnn';\n $barChar['6'] = 'nnwwwnnnn';\n $barChar['7'] = 'nnnwnnwnw';\n $barChar['8'] = 'wnnwnnwnn';\n $barChar['9'] = 'nnwwnnwnn';\n $barChar['A'] = 'wnnnnwnnw';\n $barChar['B'] = 'nnwnnwnnw';\n $barChar['C'] = 'wnwnnwnnn';\n $barChar['D'] = 'nnnnwwnnw';\n $barChar['E'] = 'wnnnwwnnn';\n $barChar['F'] = 'nnwnwwnnn';\n $barChar['G'] = 'nnnnnwwnw';\n $barChar['H'] = 'wnnnnwwnn';\n $barChar['I'] = 'nnwnnwwnn';\n $barChar['J'] = 'nnnnwwwnn';\n $barChar['K'] = 'wnnnnnnww';\n $barChar['L'] = 'nnwnnnnww';\n $barChar['M'] = 'wnwnnnnwn';\n $barChar['N'] = 'nnnnwnnww';\n $barChar['O'] = 'wnnnwnnwn';\n $barChar['P'] = 'nnwnwnnwn';\n $barChar['Q'] = 'nnnnnnwww';\n $barChar['R'] = 'wnnnnnwwn';\n $barChar['S'] = 'nnwnnnwwn';\n $barChar['T'] = 'nnnnwnwwn';\n $barChar['U'] = 'wwnnnnnnw';\n $barChar['V'] = 'nwwnnnnnw';\n $barChar['W'] = 'wwwnnnnnn';\n $barChar['X'] = 'nwnnwnnnw';\n $barChar['Y'] = 'wwnnwnnnn';\n $barChar['Z'] = 'nwwnwnnnn';\n $barChar['-'] = 'nwnnnnwnw';\n $barChar['.'] = 'wwnnnnwnn';\n $barChar[' '] = 'nwwnnnwnn';\n $barChar['*'] = 'nwnnwnwnn';\n $barChar['$'] = 'nwnwnwnnn';\n $barChar['/'] = 'nwnwnnnwn';\n $barChar['+'] = 'nwnnnwnwn';\n $barChar['%'] = 'nnnwnwnwn';\n\n $this->SetFont('Arial', '', 10);\n if($printText) $this->Text($xpos, $ypos + $height + 4, $code);\n $this->SetFillColor(0);\n\n $code = '*'.strtoupper($code).'*';\n for($i=0; $i<strlen($code); $i++){\n $char = $code{$i};\n if(!isset($barChar[$char])){\n $this->Error('Invalid character in barcode: '.$char);\n }\n $seq = $barChar[$char];\n for($bar=0; $bar<9; $bar++){\n if($seq{$bar} == 'n'){\n $lineWidth = $narrow;\n }else{\n $lineWidth = $wide;\n }\n if($bar % 2 == 0){\n $this->Rect($xpos, $ypos, $lineWidth, $height, 'F');\n }\n $xpos += $lineWidth;\n }\n $xpos += $gap;\n }\n }",
"protected function _prepareBarcode()\n {\n $barcodeTable = [];\n $height = ($this->_drawText) ? 1.1 : 1;\n\n // Start character (101)\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n\n $textTable = str_split($this->getText());\n $system = 0;\n\n if ($textTable[0] == 1) {\n $system = 1;\n }\n\n $checksum = $textTable[7];\n $parity = $this->_parities[$system][$checksum];\n\n for ($i = 1; $i < 7; $i++) {\n $bars = str_split($this->_codingMap[$parity[$i - 1]][$textTable[$i]]);\n foreach ($bars as $b) {\n $barcodeTable[] = [$b , $this->_barThinWidth , 0 , 1];\n }\n }\n\n // Stop character (10101)\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [0 , $this->_barThinWidth , 0 , $height];\n $barcodeTable[] = [1 , $this->_barThinWidth , 0 , $height];\n return $barcodeTable;\n }",
"public function testGenerateSingleBarcodes()\n {\n }",
"public function setCodeBarre($codeBarre) {\n $this->codeBarre = $codeBarre;\n return $this;\n }",
"public function ajax_barcode_gen(){\n\n\t$code = $this->input->post(\"code\");\n $receive = $this->action->read(\"patient_barcode\");\n $data = $receive[0];\n\n //Bar code generating Start here----------------\n $font = './private/fonts/arialbd.ttf';\n // - -\n\n $fontSize = 12; // GD1 in px ; GD2 in point\n $marge = 10; // between barcode and hri in pixel\n $x = $data->pos_x; // barcode center\n $y = $data->pos_y;; // barcode center\n $height = $data->code_height; // barcode height in 1D ; module size in 2D\n $width = $data->code_width; // barcode height in 1D ; not use in 2D\n //$width = 2; // barcode height in 1D ; not use in 2D\n $angle = 0; // rotation in degrees : nb : non horizontable barcode might not be usable because of pixelisation\n\n $code = $code; // barcode, of course ;)\n $type = $data->code_type;\n\n // -------------------------------------------------- //\n // USEFUL\n // -------------------------------------------------- //\n\n // -------------------------------------------------- //\n // ALLOCATE GD RESSOURCE\n // -------------------------------------------------- //\n $im = imagecreatetruecolor($data->img_width, $data->img_height);\n $black = ImageColorAllocate($im,0x00,0x00,0x00);\n $white = ImageColorAllocate($im,0xff,0xff,0xff);\n $red = ImageColorAllocate($im,0xff,0x00,0x00);\n $blue = ImageColorAllocate($im,0x00,0x00,0xff);\n imagefilledrectangle($im, 0, 0, $data->img_width, $data->img_height, $white);\n\n // -------------------------------------------------- //\n // BARCODE\n // -------------------------------------------------- //\n $data = Barcode::gd($im, $black, $x, $y, $angle, $type, array('code'=>$code), $width, $height);\n\n // -------------------------------------------------- //\n // HRI (Human readable Interpretation)\n // -------------------------------------------------- //\n if ( isset($font) ){\n $box = imagettfbbox($fontSize, 0, $font, $code);\n $len = $box[2] - $box[0];\n Barcode::rotate(-$len / 2, ($data['height'] / 2) + $fontSize + $marge, $angle, $xt, $yt);\n imagettftext($im, $fontSize, $angle, $x + $xt, $y + $yt, $black, $font, $code);\n }\n\n $url = './public/uploaded_barcode/'.$code.image_type_to_extension(IMAGETYPE_PNG);\n $success=imagepng($im,$url);\n\t if($success){\n\t \techo $url;\n\t }\n imagedestroy($im);\n // echo $code. image_type_to_extension(IMAGETYPE_PNG);\n // echo $random_num.image_type_to_extension(IMAGETYPE_PNG);\n // Bar code generating End here----------------\n}",
"protected function addBarcode()\n\t{\n\t\t$posX = 92;\n\t\t$posY = 43;\n\t\t$image = Zend_Pdf_Image::imageWithPath($this->barcode->getBarcodeImage());\n\t\t\t\n\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t$this->_getPdf()->pages[$i]->drawImage($image, $posX, $posY, $image->getPixelWidth() + $posX, $image->getPixelHeight() + $posY);\n\t\t}\n\t\t$this->setNumbersFont(7);\n\t\t\n\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t$this->_getPdf()->pages[$i]->drawText(str_pad($this->barcode->getBarcodeValue(), 39, \"*\", STR_PAD_LEFT), $posX, $posY, 'UTF-8');\n\t\t}\n\t}",
"public function encodeGenbarcode($code)\n {\n $encoding = \\preg_replace(\"#[|\\\\\\\\]#\", \"_\", $this->encoding());\n /* delete EAN-13 checksum */\n if (\\preg_match(\"#^ean$#i\", $encoding) && strlen($code) == 13) {\n $code = \\substr($code, 0, 12);\n }\n $code = \\preg_replace(\"#[|\\\\\\\\]#\", \"_\", $code);\n $cmd = $this->genbarcodeLocation() . \" \" . \\escapeshellarg($code) . \" \" . \\escapeshellarg($encoding) . \"\";\n\n $fp = \\popen($cmd, 'r');\n\n if (!$fp) {\n return false;\n }\n\n $ret = array(\n 'bars' => \\trim(\\fgets($fp, 1024)),\n 'text' => \\trim(\\fgets($fp, 1024)),\n 'encoding' => \\trim(\\fgets($fp, 1024)),\n );\n\n \\pclose($fp);\n\n if (!$ret['encoding'] || !$ret['bars'] || !$ret['text']) {\n return false;\n }\n\n return $ret;\n }",
"public function getBarCode()\n {\n return $this->bar_code;\n }",
"protected function getTCPDF2DBarcode() {\n\t\t\treturn new \\TCPDF2DBarcode($this->text, 'QRCODE,' . $this->errorCorrectionLevel);\n\t\t}",
"public static function loadStandardCodes()\n {\n // Add the standard definitions\n self::$bbcode->addCodeDefinitionSet(new DefaultCodeDefinitionSet());\n\n // Header tag\n $builder = new CodeDefinitionBuilder('header', '<h1>{param}</h1>');\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Strike tag\n $builder = new CodeDefinitionBuilder('s', '<del>{param}</del>');\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Spoiler tag\n $builder = new CodeDefinitionBuilder('spoiler', '<span class=\"spoiler\">{param}</span>');\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Box tag\n $builder = new CodeDefinitionBuilder('box', '<div class=\"spoiler-box-container\"><div class=\"spoiler-box-title\" onclick=\"Sakura.toggleClass(this.parentNode.children[1], \\'hidden\\');\">Click to open</div><div class=\"spoiler-box-content hidden\">{param}</div></div>');\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Box tag\n $builder = new CodeDefinitionBuilder('box', '<div class=\"spoiler-box-container\"><div class=\"spoiler-box-title\" onclick=\"Sakura.toggleClass(this.parentNode.children[1], \\'hidden\\');\">{option}</div><div class=\"spoiler-box-content hidden\">{param}</div></div>');\n $builder->setUseOption(true);\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Quote tag\n $builder = new CodeDefinitionBuilder('quote', '<blockquote><div class=\"quotee\">Quote</div><div class=\"quote\">{param}</div></blockquote>');\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Quote tag\n $builder = new CodeDefinitionBuilder('quote', '<blockquote><div class=\"quotee\">{option} wrote</div><div class=\"quote\">{param}</div></blockquote>');\n $builder->setUseOption(true);\n self::$bbcode->addCodeDefinition($builder->build());\n\n // Add special definitions (PHP files MUST have the same name as the definition class\n foreach (glob(ROOT . 'libraries/BBcodeDefinitions/*.php') as $ext) {\n // Include the class\n require_once $ext;\n \n // Clean the file path\n $ext = str_replace(ROOT . 'libraries/', '', $ext);\n $ext = str_replace('.php', '', $ext);\n $ext = str_replace('/', '\\\\', $ext);\n\n // Build the classname\n $className = __NAMESPACE__ . '\\\\' . $ext;\n\n // Add the BBcode definition\n self::$bbcode->addCodeDefinition(new $className);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all invoiced quotes. | public function getAllInvoiced()
{
/** @var Quote[] $quotes */
$quotes = $this->getORM()->find('Quote', "quote_status = 5 AND quote_delete = 0");
foreach ($quotes as $key => $quote)
{
$quotes[$key] = $this->getById($quote->id);
}
return $quotes;
} | [
"public function getAllQuotes() {\n return Quote::all();\n }",
"public function retrieveAllQuotes()\r\n {\r\n try {\r\n $url = '/quotes/get';\r\n $response = $this->callCrystal($url, $this->data);\r\n return $response;\r\n } catch (RequestException $e) {\r\n $response = $this->StatusCodeHandling($e);\r\n return $response;\r\n }\r\n }",
"public function getAllQuotes() {\n $stmt = $this->DB->prepare( 'SELECT * FROM quotations where flagged = 0 ORDER BY rating DESC, added DESC');\n $stmt->execute ();\n return $stmt->fetchAll ( PDO::FETCH_ASSOC );\n }",
"public function getAllQuotes ()\n {\n $quotes = array_values( $this->quotes );\n $quotes = \\r8\\ary\\flatten( $quotes );\n $quotes = \\array_merge( $quotes, array_keys($this->quotes) );\n $quotes = \\array_unique( $quotes );\n return \\array_values($quotes);\n }",
"public function getQuotes()\n {\n if (isset($this->bookings)) {\n $this->load('bookings');\n }\n return $this->bookings\n ->filter(function ($obj) {\n return $obj->status === 'saved';\n });\n }",
"public function quotes()\n\t{\n\t\techo json_encode($this->quotes->all_quotes());\n\t}",
"public function getRelatedQuotes ($invoices=false) {\n\n if ($invoices) {\n $invoiceCondition = \"type='invoice'\";\n } else {\n $invoiceCondition = \"type IS NULL OR type!='invoice'\";\n }\n\n /*\n Select all quotes which have a related record with the current record's id\n */\n $quotes = Yii::app()->db->createCommand ()\n ->select ('quotes.id')\n ->from ('x2_quotes as quotes, x2_relationships as relationships')\n ->where (\"(\".$invoiceCondition.\") AND \".\n \"((relationships.firstType='Quote' AND \".\n \"relationships.secondType=:recordType AND relationships.secondId=:recordId) OR \".\n \"(relationships.secondType='Quote' AND \".\n \"relationships.firstType=:recordType AND relationships.firstId=:recordId)) AND \".\n '((quotes.id=relationships.firstId AND relationships.firstType=\"Quote\") OR '.\n '(quotes.id=relationships.secondId AND relationships.secondType=\"Quote\"))',\n array (\n ':recordId' => $this->recordId,\n ':recordType' => $this->modelName\n ))\n ->queryAll ();\n\n // get models from ids\n $getId = function ($a) { return $a['id']; };\n $quotes = X2Model::model('Quote')->findAllByPk (array_map ($getId, $quotes));\n\n return $quotes;\n }",
"public function getApprovedQuotes() : array\n {\n return $this->repository->findBy([\n 'approved' => true,\n ]);\n }",
"public function getQuotesAsStore() {\n\n if ( is_null($this->quotes) ) return array(array('id'=>0, 'quote'=>$this->no_quotes_message));\n\n $return = array();\n \n foreach($this->quotes as $id=>$quote) array_push($return, array('id'=>$id, 'quote'=>$quote));\n\n return $return;\n\n }",
"protected function _getQuotes()\n {\n return $this->_doRequest();\n }",
"public static function getAll() {\n $sql = \"SELECT invoices.id AS invoice_id, invoices.*, cms_customer_data.*, tickets.*, cms_users.*, festival_events.* FROM invoices\n JOIN tickets ON invoices.id = tickets.invoice_id\n LEFT JOIN cms_customer_data ON invoices.user_id = cms_customer_data.user_id\n JOIN festival_events ON tickets.event_id = festival_events.id\n JOIN cms_users ON invoices.user_id = cms_users.id\";\n \n $ticketdata = App::get(\"db\")->query($sql);\n\n if (isset($ticketdata)) {\n $invoices = self::createInvoices($ticketdata);\n return $invoices;\n }\n return $invoices ?? [];\n\n }",
"protected function _getQuote()\n {\n return array(\n 'items' => $this->_getQuoteItems(), 'totalAmount' => $this->_quote->getGrandTotal(),\n );\n }",
"public function getInvoiceQuote();",
"public function getAllInvoices()\n {\n return $this->db->get('invoices')->result_array();\n }",
"protected function getQuote()\n {\n return [\n 'items' => $this->getQuoteItems(),\n 'totalAmount' => $this->quote->getGrandTotal()\n ];\n }",
"public function getInvoices()\r\n {\r\n return $this->appointment->where('has_invoice', true)->get();\r\n }",
"public function getQuotes($request)\n {\n if (!$this->_client) {\n $this->_logger->debug(get_class($this) . __(' Client Object is null'));\n return false;\n }\n\n if (!$this->_is_sand) {\n $request['clientId'] = $this->_clientId;\n }\n\n $response = $this->_client->getQuotes($request);\n\n //check for no ship days - public holidays - and retry with date +1 (up to +10) days before exiting\n $i = 0;\n while (is_soap_fault($response) && $response->faultstring == self::NO_SHIP_DATE && ++$i <= 10) {\n $readyDate = strtotime($request['anytime']['readyDate']);\n while (in_array(date('N', $readyDate), array(6, 7))) {\n $readyDate = strtotime('+1 day', $readyDate);\n }\n $request['anytime']['readyDate'] = date('Y-m-d', strtotime('+1 day', $readyDate));\n $response = $this->_client->getQuotes($request);\n }\n\n if (is_soap_fault($response)) {\n $this->_logger->debug($response->faultstring);\n return $response;\n }\n if (!isset($response->quotes->quote)) {\n $response->quotes->quote = array();\n } elseif (isset($response->quotes->quote) && !is_array($response->quotes->quote)) {\n $response->quotes->quote = array(0 => $response->quotes->quote);\n }\n\n $quotes = array();\n foreach ($response->quotes->quote as $quoteData) {\n $q = $this->_objectManager->create('Temando\\Temando\\Model\\Quote');\n $quotes[] = $q->loadResponse($quoteData);\n }\n return $quotes;\n }",
"public function getQuotations(): array\n {\n return $this->quotations;\n }",
"public function getQuotas()\n {\n return $this->quotas;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes by batches Archive IDs in the specified month, | protected function deleteArchiveIds(Date $date, $idArchivesToDelete)
{
$batches = array_chunk($idArchivesToDelete, 1000);
$numericTable = ArchiveTableCreator::getNumericTable($date);
$blobTable = ArchiveTableCreator::getBlobTable($date);
foreach ($batches as $idsToDelete) {
$this->model->deleteArchiveIds($numericTable, $blobTable, $idsToDelete);
}
} | [
"function batchDel($aIds) {\n \t\t$this->db->where_in('magainze_id', $aIds); \n\t\t$this->db->delete(MAGAINZE_ARTICLE);\n \t\t$this->db->where_in('id', $aIds); \n \t\treturn $this->db->delete(MAGAINZE_LIST); \n\t}",
"function exeDelete13thMonth($id) {\n $exeDelete13thMonth = $this->db->query(\"DELETE \n FROM 13month\n WHERE id = \".$this->db->escape($id).\" \"); \n \n $rsQuery['affRows'] = $this->db->affected_rows();\n return $rsQuery; \n }",
"public function deleteBatch($batch) {\n return $this->db_delete()\n ->condition('sqid', array_keys($this->get_items()))\n ->execute(); \n }",
"public function deleteById($accountManagersId);",
"function batchDelete() {\r\n $client = Zend_Gdata_AuthSub::getHttpClient($_POST['token']);\r\n $gdata = new Zend_Gdata_Gbase($client);\r\n \r\n $response = $gdata->post(buildBatchXML(), ITEMS_FEED_URI . '/batch');\r\n \r\n return $response;\r\n}",
"public static function delete_batch() {\n\t\twc_admin_record_tracks_event( 'delete_import_data_job_start', array( 'type' => static::$name ) );\n\n\t\t$batch_size = static::get_batch_size( 'delete' );\n\t\tstatic::delete( $batch_size );\n\n\t\tReportsCache::invalidate();\n\n\t\twc_admin_record_tracks_event( 'delete_import_data_job_complete', array( 'type' => static::$name ) );\n\t}",
"function deleteByObjectIds($ids) {\n cache_remove_by_pattern('object_assignments_*');\n return Assignments::delete(array('object_id IN (?)', $ids));\n }",
"public function delete($ids);",
"public function delete_batch()\n\t {\n\t\t \n\t\t \t$ids\t= ee()->input->post('delete');\n\t\t \n\t\t \t$delete_options\t= ee()->db->where_in('entry_id',$ids)->delete(ee()->shared->index_table);\n\t\t \t//$delete_idices\t\t= ee()->db->where_in('entry_id',$ids)->delete(ee()->shared->index_table);\n\t\t \n\t\t return TRUE;\n\t }",
"public function deleteByIds(array $ids) {}",
"public function batchDelete($ids)\n {\n $this->filterRepository->deleteByIds($ids);\n }",
"function delete_multi(DatastoreClient $datastore, array $keys)\n{\n // [START delete_multi]\n $datastore->deleteBatch($keys);\n // [END delete_multi]\n}",
"public function deleteAllByModule($module);",
"public function deleteMultiple(array $ids = []);",
"public function deleted(Batch $batch)\n {\n //\n }",
"public function delTask($line,$month,$year)\n\t{\n\t\t$reqDelTask = $this->db->prepare('DELETE FROM t_calender WHERE calLine = :calLine AND calMonth = :calMonth AND calYear = :calYear');\n\t\t$reqDelTask->execute(array(\n\t\t\t'calLine' => $line,\n\t\t\t'calMonth' => $month,\n\t\t\t'calYear' => $year\n\t\t\t));\n\t\t$reqDelTask->closeCursor();\n\t}",
"public function delete_result_pairings($year, $month) {\n $this->db->where('year', $year);\n $this->db->where('month', $month);\n $query = $this->db->get('results');\n if($query->num_rows() > 0) {\n $this->db->where('year', $year);\n $this->db->where('month', $month);\n $this->db->delete('results');\n $query = $this->db->query(\"SELECT MAX(id) AS id FROM results\");\n $row = $query->row();\n $max = $row->id;\n $max = $max + 1;\n $query = $this->db->query(\"ALTER TABLE results AUTO_INCREMENT = $max\");//ensures id continues from last, without gap\n }\n }",
"function release_delete_multiple(array $ids) {\n entity_delete_multiple('release', $ids);\n}",
"public function massDeleteAction() {\n $magazineIds = $this->getRequest()->getParam('magazine');\n if(!is_array($magazineIds)) {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('unideal_topads')->__('Please select magazines to delete.'));\n }\n else {\n try {\n foreach ($magazineIds as $magazineId) {\n $magazine = Mage::getModel('unideal_topads/magazine');\n $magazine->setId($magazineId)->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('unideal_topads')->__('Total of %d magazines were successfully deleted.', count($magazineIds)));\n }\n catch (Mage_Core_Exception $e){\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('unideal_topads')->__('There was an error deleting magazines.'));\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change products per row for upsells. | public static function upsell_display() {
// Get count
$count = get_theme_mod( 'ocean_woocommerce_upsells_count', '3' );
$count = $count ? $count : '3';
// Get columns
$columns = get_theme_mod( 'ocean_woocommerce_upsells_columns', '3' );
$columns = $columns ? $columns : '3';
// Alter upsell display
woocommerce_upsell_display( $count, $columns );
} | [
"public function upsellGridAction()\n {\n $this->_initProduct();\n $this->loadLayout();\n $this->getLayout()->getBlock('catalog.product.edit.tab.upsell')\n ->setProductsRelated($this->getRequest()->getPost('products_upsell', null));\n $this->renderLayout();\n }",
"function etheme_set_upsells_product_args($args) {\n\n $args['posts_per_page'] = Kirki::get_option( 'products_upsell_limit_et-desktop' );\n $args['columns'] = Kirki::get_option( 'products_upsell_per_view_et-desktop' );\n\n return $args;\n }",
"public function upsell_display() {\n\t\t\twoocommerce_upsell_display(\n\t\t\t\twpex_get_theme_mod( 'woo_upsells_count', 3 ),\n\t\t\t\twpex_get_theme_mod( 'woo_upsells_columns', 3 )\n\t\t\t);\n\t\t}",
"private function _upSellingProducts()\n {\n $productIds = [];\n\t\t\t\tif (!empty($this->checkoutSession->getLastAddedProductId())) {\n\t\t\t\t\t\t$product = $this->productRepository->getById($this->checkoutSession->getLastAddedProductId());\n\t\t\t\t\t\t$upSellProducts = $product->getUpSellProducts();\n\n\t\t\t\t\t\tforeach ($upSellProducts as $upSellProduct) {\n\t\t\t\t\t\t\t\t$productIds[] = $upSellProduct->getId();\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n if (empty($productIds)) {\n $this->_randomProducts();\n } else {\n $this->collection->addIdFilter($productIds);\n }\n }",
"function yog_wc_upsell_display( $args ) {\n \n if ( !yog_helper()->get_option( 'engines-product-sell', 'raw', true, 'options' ) ) return;\n \n $yog_limit = yog_helper()->get_option( 'engines-product-sell-limit', 'raw', 4, 'options' );\n $yog_columns = yog_helper()->get_option( 'engines-product-sell-column', 'raw', 4, 'options' );\n \n woocommerce_upsell_display( $yog_limit, $yog_columns );\n}",
"function poco_upsell_display() {\n $columns = apply_filters('poco_upsells_columns', 4);\n if (is_active_sidebar('sidebar-woocommerce-detail')) {\n $columns = 3;\n }\n woocommerce_upsell_display(-1, $columns);\n }",
"function new_loop_shop_per_page( $cols ) {\n // Return the number of products you wanna show per page.\n $cols = 100;\n return $cols;\n}",
"function new_loop_shop_per_page( $cols ) {\n // Return the number of products you wanna show per page.\n $cols = 18;\n return $cols;\n}",
"function new_loop_shop_per_page( $cols ) {\n // Return the number of products you wanna show per page.\n $cols = 9;\n return $cols;\n}",
"static function reset_products() {\n\t\tif(isset(self::$purchase_data)) self::$loop_prod_rows = self::$purchase_data['product_rows'];\n\t}",
"public function setPricePerItem($value);",
"function new_loop_shop_per_page( $cols ) {\n // Return the number of products you wanna show per page.\n $cols = 8;\n return $cols;\n}",
"public function productsgridAction()\n {\n $this->_initArticle();\n $this->loadLayout();\n $this->getLayout()->getBlock('article.edit.tab.product')\n ->setArticleProducts($this->getRequest()->getPost('article_products', null));\n $this->renderLayout();\n }",
"public function productsgridAction()\n {\n $this->_initAdministrativedocument();\n $this->loadLayout();\n $this->getLayout()->getBlock('administrativedocument.edit.tab.product')\n ->setAdministrativedocumentProducts($this->getRequest()->getPost('administrativedocument_products', null));\n $this->renderLayout();\n }",
"public function incrementAvailableProductsNumber()\n {\n $this->availableProductsNumber++;\n }",
"public function productsgridAction()\n {\n $this->_initTrainevent();\n $this->loadLayout();\n $this->getLayout()->getBlock('trainevent.edit.tab.product')\n ->setTraineventProducts($this->getRequest()->getPost('trainevent_products', null));\n $this->renderLayout();\n }",
"function new_loop_shop_per_page( $cols ) {\n // Return the number of products you wanna show per page.\n $cols = 12;\n return $cols;\n}",
"private function updateAvailabilityOnSale()\n {\n foreach($this->cart->content() as $item){\n $newAvailability = intval($item->model->availability - $item->qty);\n Product::where('id', $item->model->id)->update(['availability' => $newAvailability]);\n }\n }",
"function storefront_child_woocommerce_change_products_per_page() {\n\treturn 24;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retrieves a connection instance from the cluster using a key. | public function getConnectionByKey($key)
{
$hashablePart = Helpers::extractKeyTag($key);
$keyHash = $this->distributor->generateKey($hashablePart);
return $this->distributor->get($keyHash);
} | [
"public function getNodeConnectionByKey($key) {\n return $this->getNodeConnection($this->getDSNByKey($key));\n }",
"public function getConnectionConfig($key);",
"public static function getInstance(\n\t\t$key = null,\n\t\tCassandra $connection = null\n\t) {\n\t\t$className = get_called_class();\n\n\t\treturn new $className($key, $connection);\n\t}",
"public function getConnectionKey($key)\n {\n return get_class($this).'_'.$key;\n }",
"public function getRedisInstanceForKey($key)\n {\n $serverName = $this->getServerNameForKey($key);\n return $this->getRedisInstanceForServer($serverName);\n }",
"public static function getConnectionString($key)\n {\n Validate::isString($key, 'key');\n\n self::_init();\n $value = null;\n\n foreach (self::$_sources as $source) {\n $value = call_user_func_array($source, [$key]);\n\n if (!empty($value)) {\n break;\n }\n }\n\n return $value;\n }",
"function get_by_key() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_key_component\n\t\t\t\tWHERE kcp_id=?\";\n\t\t$this->db->query($sql, array($this->kcp_id));\n\t\treturn $query;\n\t}",
"public function getObjectFromPool($key) {\r\n\t\tif (!($key instanceof COSObjectKey)) return null;\r\n\t\r\n\t}",
"public function getCloud($key);",
"public function get($key)\n {\n return LibRedis::get($key);\n }",
"protected static function getRedis($key = NULL) {\n\t\tstatic $config = NULL;\n\t\tis_null($config) && $config = \\Snake\\Libs\\Base\\Config::load('Redis');\n\n\t\t$count = count($config->servers);\n\t\t$server_id = is_null($key) ? 0 : (hexdec(substr(md5($key), 0, 2)) % $count);\n\n\t\tif (!isset(self::$connections[$server_id])) {\n\t\t\t$host = $config->servers[$server_id]['host'];\n\t\t\t$port = $config->servers[$server_id]['port'];\n\t\t\tself::$connections[$server_id] = self::connect($host, $port);\n\t\t}\n\t\treturn self::$connections[$server_id];\n\t}",
"public function getClient($key = null);",
"function db_get_connection( $key = 'default' ){\r\n\t\tglobal $DATABASES;\r\n\r\n\t\t// check for key\r\n\t\tif( !isset( $DATABASES[ $key ] ) )\r\n\t\t\tthrow new Exception( 'Configuration Not Found For DB: '. $key, IMPROPERLYCONFIGURED );\r\n\r\n\t\t$db = $DATABASES[ $key ];\r\n\r\n\t\t// check if connection exists\r\n\t\tif( !isset( $db[ 'conn' ] ) ){\r\n\t\t\t// create pdo connection\r\n\t\t\ttry {\r\n\t\t\t\t$conn = new PDO( $db[ 'dsn' ], $db[ 'user' ], $db[ 'pass'] );\r\n\t\t\t\t$db[ 'conn' ] = $conn;\r\n\t\t\t}\r\n\t\t\tcatch( PDOException $e ) {\r\n\t\t\t\tthrow new Exception( 'Connection failed: ' . $e->getMessage(), CONNECTIONFAILURE );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// return connection\r\n\t\treturn $conn;\r\n\t}",
"final public static function getConnectionInfo($key = 'default') {\n if (empty(self::$databaseInfo)) {\n self::parseConnectionInfo();\n }\n\n if (!empty(self::$databaseInfo[$key])) {\n return self::$databaseInfo[$key];\n }\n }",
"final public static function getConnection($target = 'default', $key = NULL) {\n if (!isset($key)) {\n // By default, we want the active connection, set in setActiveConnection.\n $key = self::$activeKey;\n }\n // If the requested target does not exist, or if it is ignored, we fall back\n // to the default target. The target is typically either \"default\" or\n // \"slave\", indicating to use a slave SQL server if one is available. If\n // it's not available, then the default/master server is the correct server\n // to use.\n if (!empty(self::$ignoreTargets[$key][$target]) || !isset(self::$databaseInfo[$key][$target])) {\n $target = 'default';\n }\n\n if (!isset(self::$connections[$key][$target])) {\n // If necessary, a new connection is opened.\n self::$connections[$key][$target] = self::openConnection($key, $target);\n }\n return self::$connections[$key][$target];\n }",
"public function getDatasourceInstance($key) {\n return $this->datasourceService->getDataSourceInstanceByKey($key);\n }",
"public function get($key) {\n $result = $this->client->get($key);\n\n if ($result) {\n $result = unserialize($result);\n }\n\n return $result;\n }",
"public function getConnectionByKeyName($name)\n {\n if (count($this->_connections) == 1) {\n $connections = array_values($this->_connections);\n $connection = $connections[0];\n } else if ($this->_specifiedConnection->getConnection()) {\n $connection = $this->_specifiedConnection->getConnection();\n } else {\n $alias = $this->_keyDistributor->getConnectionByKeyName($name);\n $connection = $this->_connections[$alias];\n }\n\n return $connection;\n }",
"public function getConnectionKey()\n {\n return $this->_connectionKey;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends this mail with HTML content. | public function mailHTML($html_content) {
// Create a plain text fallback for the HTML content.
$plain_text_content = $this->getPlanTextFallback($html_content);
// Assemble the mail and send it.
$mail_message_sections = array(
array("text/plain; charset=UTF-8", $plain_text_content),
array("text/html; charset=UTF-8", $html_content),
);
$this->assembleMail($mail_message_sections);
} | [
"public function sendHTML() {\n \n $random_hash = md5(date('r', time())); \n \n $headers = 'From: ' . $this->_from;\n $headers .= \"\\r\\n\";\n $headers .= 'Content-Type: multipart/alternative; boundary=\"BlockSeparator-' . $random_hash . '\"';\n $msg = '--' . 'BlockSeparator-' . $random_hash;\n $msg .= \"\\r\\n\";\n $msg .= 'Content-Type: text/plain;';\n $msg .= \"\\r\\n\";\n $msg .= 'charset=\"iso-8859-1\"';\n $msg .= \"\\r\\n\";\n $msg .= 'Content-Transfer-Encoding: 7bit';\n $msg .= \"\\r\\n\\r\\n\";\n $msg .= iconv(\"UTF-8\", \"ISO-8859-1//TRANSLIT\", strip_tags($this->_message));\n $msg .= \"\\r\\n\";\n $msg .= '--' . 'BlockSeparator-' . $random_hash;\n $msg .= \"\\r\\n\";\n $msg .= 'Content-type: text/html;' . 'charset=\"iso-8859-1\"';\n $msg .= \"\\r\\n\";\n $msg .= 'Content-transfer-encoding: 7bit;';\n $msg .= \"\\r\\n\\r\\n\";\n $msg .= iconv(\"UTF-8\", \"ISO-8859-1//TRANSLIT\", $this->_message);\n $msg .= \"\\r\\n\";\n $msg .= '--' . 'BlockSeparator-' . $random_hash . '--';\n $sent = mail( $this->_to, $this->_subject, $msg, $headers );\n return $sent;\n }",
"function sendHtmlMail()\n {\n $this->headers.='MIME-Version: 1.0'.\"\\r\\n\";\n $this->headers.='Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n if(mail($this->to,$this->subject,$this->content,$this->headers)==FALSE)\n {\n $this->watchdog->logError(\"Sending of HTML Mail failed\",101,__FILE__);\n return false;\n }\n return true;\n }",
"private function htmlEmailPart(){\n\n $message = 'Content-type: text/html; charset=utf-8'.\"\\n\";\n\n return $message;\n }",
"function bodyHTML() {\n ob_start();\n $temp_layout = $this->controller->layout;\n $this->controller->layout = 'email'; // HTML wrapper for my html email in /app/views/layouts\n $this->controller->render($this->template . '_html');\n $mail_content = ob_get_clean();\n $this->controller->layout = $temp_layout; // Turn on layout wrapping again\n return $mail_content;\n }",
"public function html($message){\n $this->setHeader(\"Content-Type\", \"text/html\");\n $this->body = $message;\n $this->write();\n $this->close();\n }",
"function bodyHTML() {\r\n ob_start();\r\n $temp_layout = $this->controller->layout;\r\n $this->controller->layout = 'email'; // HTML wrapper for my html email in /app/views/layouts\r\n $this->controller->render($this->template . '_html'); \r\n $mail = ob_get_clean();\r\n $this->controller->layout = $temp_layout; // Turn on layout wrapping again\r\n return $mail;\r\n }",
"function jl_send_html_email($to, $from_name, $from_email, $subject, $htmltext )\n{\n $headers = '';\n $headers .= 'From: ' . $from_name. ' <' . $from_email . \">\\r\\n\";\n $headers .= \"MIME-Version: 1.0\\r\\n\";\n $headers .= \"Content-type: text/html; charset=utf-8\\r\\n\";\n $headers .= \"Content-Transfer-Encoding: base64\\r\\n\";\n\n $body = chunk_split(base64_encode($htmltext));\n\n // TODO: implement proper VERP stuff\n $additional_params = \"-f bounce@journalisted.com\";\n return mail($to, $subject, $body, $headers, $additional_params);\n}",
"public function previewHtmlMail()\n {\n // Check for missing attributes\n $this->checkForMissingAttributes();\n\n // Set up email body view\n $emailView = $this->setupStandaloneView();\n\n // Return the email body\n return $emailView->render();\n }",
"function bodyHTML() { \n //ob_start(); \n $temp_layout = $this->controller->layout; \n $this->controller->layout = 'email'; // HTML wrapper for my html email in /app/views/layouts \n\t $mail = $this->controller->render($this->template . '_html'); // \n \n\t //$mail = ob_get_clean(); \n $this->controller->layout = $temp_layout; // Turn on layout wrapping again \n \n return $mail; \n }",
"private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => 'opublisher@gmail.com',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => 'opublisher@gmail.com',\r\n 'fromName' => 'opublisher@gmail.com',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }",
"public function get_content_html() {\n\n\t\tif ( ! $this->object instanceof \\WC_PIP_Document ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tob_start();\n\n\t\t$this->object->output_template( array( 'action' => 'send_email' ) );\n\n\t\treturn ob_get_clean();\n\t}",
"function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $plainContent = false, $customheaders = false, $inlineImages = false) {\n\t\n\tif ($customheaders && is_array($customheaders) == false) {\n\t\techo \"htmlEmail($to, $from, $subject, ...) could not send mail: improper \\$customheaders passed:<BR>\";\n\t\tdieprintr($headers);\n\t}\n\n \n\t$subjectIsUnicode = (strpos($subject,\"&#\") !== false);\n\t$bodyIsUnicode = (strpos($htmlContent,\"&#\") !== false);\n $plainEncoding = \"\";\n\t\n\t// We generate plaintext content by default, but you can pass custom stuff\n\t$plainEncoding = '';\n\tif(!$plainContent) {\n\t\t$plainContent = Convert::xml2raw($htmlContent);\n\t\tif(isset($bodyIsUnicode) && $bodyIsUnicode) $plainEncoding = \"base64\";\n\t}\n\n\n\t// If the subject line contains extended characters, we must encode the \n\t$subject = Convert::xml2raw($subject);\n\tif(isset($subjectIsUnicode) && $subjectIsUnicode)\n\t\t$subject = \"=?UTF-8?B?\" . base64_encode($subject) . \"?=\";\n\n\n\t// Make the plain text part\n\t$headers[\"Content-Type\"] = \"text/plain; charset=\\\"utf-8\\\"\";\n\t$headers[\"Content-Transfer-Encoding\"] = $plainEncoding ? $plainEncoding : \"quoted-printable\";\n\n\t$plainPart = processHeaders($headers, ($plainEncoding == \"base64\") ? chunk_split(base64_encode($plainContent),60) : wordwrap($plainContent,120));\n\n\t// Make the HTML part\n\t$headers[\"Content-Type\"] = \"text/html; charset=\\\"utf-8\\\"\";\n \n\t\n\t// Add basic wrapper tags if the body tag hasn't been given\n\tif(stripos($htmlContent, '<body') === false) {\n\t\t$htmlContent =\n\t\t\t\"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.0 Transitional//EN\\\">\\n\" .\n\t\t\t\"<HTML><HEAD>\\n\" .\n\t\t\t\"<META http-equiv=Content-Type content=\\\"text/html; charset=utf-8\\\">\\n\" .\n\t\t\t\"<STYLE type=3Dtext/css></STYLE>\\n\\n\".\n\t\t\t\"</HEAD>\\n\" .\n\t\t\t\"<BODY bgColor=#ffffff>\\n\" .\n\t\t\t\t$htmlContent .\n\t\t\t\"\\n</BODY>\\n\" .\n\t\t\t\"</HTML>\";\n\t}\n\n\tif($inlineImages) {\n\t\t$htmlPart = wrapImagesInline($htmlContent);\n\t} else {\n\t\t$headers[\"Content-Transfer-Encoding\"] = \"quoted-printable\";\n\t\t$htmlPart = processHeaders($headers, wordwrap(QuotedPrintable_encode($htmlContent),120));\n\t}\n\t\n\tlist($messageBody, $messageHeaders) = encodeMultipart(array($plainPart,$htmlPart), \"multipart/alternative\");\n\n\t// Messages with attachments are handled differently\n\tif($attachedFiles && is_array($attachedFiles)) {\n\t\t\n\t\t// The first part is the message itself\n\t\t$fullMessage = processHeaders($messageHeaders, $messageBody);\n\t\t$messageParts = array($fullMessage);\n\n\t\t// Include any specified attachments as additional parts\n\t\tforeach($attachedFiles as $file) {\n\t\t\tif($file['tmp_name'] && $file['name']) {\n\t\t\t\t$messageParts[] = encodeFileForEmail($file['tmp_name'], $file['name']);\n\t\t\t} else {\n\t\t\t\t$messageParts[] = encodeFileForEmail($file);\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t// We further wrap all of this into another multipart block\n\t\tlist($fullBody, $headers) = encodeMultipart($messageParts, \"multipart/mixed\");\n\n\t// Messages without attachments do not require such treatment\n\t} else {\n\t\t$headers = $messageHeaders;\n\t\t$fullBody = $messageBody;\n\t}\n\n\t// Email headers\n\t$headers[\"From\"] \t\t= validEmailAddr($from);\n\n\t// Messages with the X-SilverStripeMessageID header can be tracked\n\tif(isset($customheaders[\"X-SilverStripeMessageID\"]) && defined('BOUNCE_EMAIL')) {\n\t\t$bounceAddress = BOUNCE_EMAIL;\n\t\t// Get the human name from the from address, if there is one\n\t\tif(ereg('^([^<>]+)<([^<>])> *$', $from, $parts))\n\t\t\t$bounceAddress = \"$parts[1]<$bounceAddress>\";\n\t} else {\n\t\t$bounceAddress = $from;\n\t}\n\t\n\t// $headers[\"Sender\"] \t\t= $from;\n\t$headers[\"X-Mailer\"]\t= X_MAILER;\n\tif (!isset($customheaders[\"X-Priority\"])) $headers[\"X-Priority\"]\t= 3;\n\t\n\t$headers = array_merge((array)$headers, (array)$customheaders);\n\n\t// the carbon copy header has to be 'Cc', not 'CC' or 'cc' -- ensure this.\n\tif (isset($headers['CC'])) { $headers['Cc'] = $headers['CC']; unset($headers['CC']); }\n\tif (isset($headers['cc'])) { $headers['Cc'] = $headers['cc']; unset($headers['cc']); }\n\t\n\t// the carbon copy header has to be 'Bcc', not 'BCC' or 'bcc' -- ensure this.\n\tif (isset($headers['BCC'])) {$headers['Bcc']=$headers['BCC']; unset($headers['BCC']); }\n\tif (isset($headers['bcc'])) {$headers['Bcc']=$headers['bcc']; unset($headers['bcc']); }\n\t\t\n\t\n\t// Send the email\n\t$headers = processHeaders($headers);\n\t$to = validEmailAddr($to);\n\t\n\t// Try it without the -f option if it fails\n\tif(!($result = @mail($to, $subject, $fullBody, $headers, \"-f$bounceAddress\"))) {\n\t\t$result = mail($to, $subject, $fullBody, $headers);\n\t}\n\t\n\treturn $result;\n}",
"public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }",
"private function saveHTML()\n\t{\n\t\t$this->encodeURLs();\n\t\t$this->cleanHTML();\n\n\t\treturn Db::getInstance()->update('expressmailing_email', array(\n\t\t\t'campaign_html' => pSQL($this->html_content, true)\n\t\t\t), 'campaign_id = '.pSQL($this->campaign_id)\n\t\t);\n\t}",
"public static function sendTestHTMLEmail(){\n $myQueue = new emailQueue();\n $myQueue->ToEmail = ciborium_configuration::$ciborium_testemailaddress;\n $myQueue->FromEmail = \"emailtest@cpaexambank.com\";\n $myQueue->CCList = \"\";\n $myQueue->BCCList = \"cpabccbin@gmail.com\";\n $myQueue->Subject = \"HTML Email Test\";\n $myQueue->Body = self::getEmailTemplateAsString(ciborium_configuration::$ciborium_emailtemplatepath.\"/\".enum_EmailTemplates::Test_HTML);\n $myQueue->Attachments = array();\n\n //string replacements in template\n $myQueue->Body = str_replace(\"~CURRENT_DATE~\", util_datetime::getDateNow(), $myQueue->Body);\n $myQueue->Body = str_replace(\"~CURRENT_DATETIME~\", util_datetime::getDateTimeNow(), $myQueue->Body);\n $myQueue->Body = str_replace(\"~BASE_URL~\", util_general::getBaseURL(), $myQueue->Body);\n\n return self::sendEmail($myQueue, __METHOD__, true, false);\n }",
"private function sendContent()\n {\n echo $this->content;\n }",
"public function mail()\n {\n $crud = new grocery_CRUD();\n $crud->set_table('mail');\n $output = $crud->render();\n\n $this->output($output);\n }",
"protected function sendEmail()\n {\n /** @var Email $mail */\n $mail = Email::create();\n $mail->setSubject('Partial form submissions of ' . DBDatetime::now()->Format(DBDatetime::ISO_DATETIME));\n foreach ($this->files as $file) {\n $mail->addAttachment($file);\n }\n $from = $this->config->SendMailFrom ?: 'site@' . Director::host();\n\n $mail->setFrom($from);\n foreach ($this->addresses as $address) {\n $mail->setTo($address);\n $mail->setBody('Please see attached CSV files');\n $mail->send();\n }\n }",
"private function sendEmail() {\r\n\t\trequire_once(t3lib_extMgm::extPath('mailform').\"lib/smtp/class.phpmailer.php\");\r\n\t\t$phpMailer = new PHPMailer();\r\n\t\t$phpMailer->CharSet = 'utf-8';\r\n\r\n\t\tif($this->SMTP_activated()) {\r\n\t\t\t$phpMailer->IsSMTP(); // telling the class to use SMTP\r\n\t\t\t$phpMailer->Host = $this->SMTP_getServer(); // SMTP server\r\n\t\t\t$phpMailer->SMTPAuth = true;\r\n\t\t\t$phpMailer->Username = $this->SMTP_getUser();\r\n\t\t\t$phpMailer->Password = $this->SMTP_getPassword();\r\n\t\t\t$phpMailer->From = $this->SMTP_getFromMail();\r\n\t\t\t$phpMailer->FromName = $this->SMTP_getFromName();\r\n\t\t\t$phpMailer->SMTPSecure = $this->SMTP_getSecure();\r\n\t\t\t$port = $this->SMTP_getPort();\r\n\t\t\tif(!empty($port)) {\r\n\t\t\t\t$phpMailer->Port\t= $this->SMTP_getPort();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$phpMailer->From = $this->SMTP_getFromMail();\r\n\t\t\t$phpMailer->FromName = $this->SMTP_getFromName();\r\n\t\t}\r\n\t\t\r\n\t\tforeach($this->attachments as $attachment) {\r\n\t\t\t$phpMailer->AddAttachment($attachment);\r\n\t\t}\r\n\t\t\r\n\t\t$phpMailer->IsHTML($this->htmlMail);\r\n\t\tif($this->htmlMail)\r\n\t\t\t$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\"; // optional, comment out and test\r\n\t\t\r\n\t\t$phpMailer->Subject = $this->subject;\r\n\t\t$phpMailer->Body = $this->content;\r\n\t\t\r\n\t\tforeach($this->receiver['emails'] as $mail) {\r\n\t\t\t$phpMailer->AddAddress($mail, $mail);\r\n\t\t}\r\n\r\n\t\t$phpMailer->send();\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default constructor. Creates a ServiceRepository to store the providers in, and then parses the application config file. | public function __construct()
{
$this->serviceRepository = new ServiceRepository();
$this->logger = Logger::getLogger();
$this->prepareApplication();
} | [
"private function init()\n {\n // return the configurations from the config file\n $this->configurations = $this->helper->getConfigurations();\n\n // return an instance of the corresponding Provider concrete according to the configuration\n $this->provider = $this->provider_factory->create($this->configurations);\n }",
"public function __construct()\n {\n $this->config = Yaml::parse(\n __BASE__ . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR\n . 'config.' . DependencyManager::get('Environment') . '.yaml'\n );\n }",
"public function __construct()\n {\n // create new container builder\n $this->container = new ContainerBuilder();\n\n // load dependency configuration from yml file\n $loader = new YamlFileLoader($this->container, new FileLocator(__DIR__ . '/../config'));\n $loader->load('services.yml');\n }",
"function __construct() {\n\n $path = dirname(dirname(__DIR__)).\"/config/\";\n\n $this->contenttypes = Yaml::parse($path.\"contenttypes.yml\");\n $this->configuration = Yaml::parse($path.\"config.yml\");\n $this->taxonomies = Yaml::parse($path.\"taxonomies.yml\");\n $this->widgets = Yaml::parse($path.\"widgets.yml\");\n\n }",
"public function __construct() {\n if ($configuredSearchPaths = Configuration::readParameter(\"search.paths\")) {\n $configuredPaths = explode(\";\", $configuredSearchPaths);\n foreach($configuredPaths as $configuredPath){\n $this->addSearchPath($configuredPath);\n }\n\n }\n }",
"protected function __construct() {\n $this->loadConfiguration();\n }",
"public function __construct(){\n \\acdhOeaw\\util\\RepoConfig::init($_SERVER[\"DOCUMENT_ROOT\"].'/modules/oeaw/config.ini');\n }",
"public function configure() {\n try {\n $this->container->loadFromFile($this->getConfigDir() .'/services.yml');\n } catch(NotFoundException $e) {}\n }",
"private function __construct()\n {\n if (!file_exists(self::CONFIG_LOCATION)) {\n // TODO: Better error handling\n echo 'settings.ini configuration file missing or damaged.';\n die();\n }\n $readConfig = [];\n if (file_exists(self::CONFIG_LOCATION)) {\n if ($readConfig = parse_ini_file(self::CONFIG_LOCATION)) {\n self::$config = $readConfig;\n }\n }\n }",
"public function __construct()\n\t{\n\t\t// Build path\n\t\t$home = getenv('HOME');\n\t\t$path = $home . DS . '.muse';\n\t\t$this->path = $path;\n\n\t\t$this->config = new Registry();\n\n\t\t// See if there's an existing file\n\t\tif (is_file($path))\n\t\t{\n\t\t\t$this->config->parse($path);\n\t\t}\n\t}",
"public function load() {\n $this->jsonConfigRepository = new JsonConfigRepository($this->configFile);\n $this->config = $this->jsonConfigRepository->read();\n $this->csvCoursesRepository = new CsvCoursesRepository($this->config);\n $apiConnector = new ApiConnector($this->config);\n $this->restContentMigrationsRepository = new RestContentMigrationsRepository($apiConnector);\n $this->restCoursesSearchRepository = new RestCoursesSearchRepository($apiConnector);\n }",
"private function __construct() {\r\n if(!$this->exists('config')) {\r\n $this->set('config', new Config());\r\n }\r\n }",
"public function __construct()\n {\n $this->config = config('vcs.github');\n }",
"private function loadServicesFile()\n {\n // Load file.\n $bag = new ContainerLessBag();\n $fileLoader = $this->getServiceBag()->getFileLoader();\n $filename = $this->generateConfigFilePath('service_providers.yml');\n $fileLoader->loadFileToBag($filename, 'service_providers', $bag);\n\n // Resolve parameters.\n $fileLoader->resolveParameters($bag, $this->getParameterBag());\n $services = array();\n\n // Instantiate services and load then to the container.\n foreach ($bag->values() as $name => $values) {\n // Multiple definitions for the same service, abort.\n if (array_key_exists($name, $services)) {\n throw ConfigurationException::multipleServiceDefinitionsException($name);\n }\n\n // Check if class is set (null counts as unset).\n if (!isset($values['class'])) {\n throw ConfigurationException::configurationAttributeNotFoundException($filename, $name, 'class');\n }\n $class = $values['class'];\n $service = $this->instantiateClass($class, isset($values['arguments']) ? $values['arguments'] : array());\n\n if (!($service instanceof ServiceProviderInterface)) {\n throw LogicException::mustImplementInterfaceException('ServiceProviderInterface', $class);\n }\n $services[$name] = $service;\n }\n\n // Register the services.\n foreach ($services as $service) {\n $this->registerService($service);\n }\n }",
"function __construct()\n {\n $this->conf = Config::get_config();\n }",
"public function __construct($configurationFile = null) {\n\n if(!empty($configurationFile)) {\n\t $this->load($configurationFile);\n } else {\n\t $this->load(rf_dir('config') .'/config.' . APPLICATION_ENV . '.php');\n }\n\n }",
"protected function __construct()\n {\n $this->_configs =\n Zend_Registry::isRegistered(self::CONFIG_SETTINGS) ?\n Zend_Registry::get(self::CONFIG_SETTINGS) :\n array();\n }",
"public function __construct()\n\t{\n\t\t$this->loadServices();\n\t}",
"public function __construct() {\n $this->stockServiceManagerConfig = new StockServiceManagerConfig($this);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saving the tags in the database | public function saveTags()
{
// Move all the spaces away
$nospace = str_replace(' ', '', $this->getTags());
$nolower = explode("#", $nospace);
$j = 0;
// Iterate loop to convert array
// elements into lowercase and
// overwriting the original array
foreach ($nolower as $element) {
$nolower[$j] = strtolower($element);
$j++;
}
foreach ($nolower as $element) {
//This looks if certain tags already exist or not
$conn = Db::getInstance();
$statement = $conn->prepare("select * from tags where text = :text");
$statement->bindValue(":text", $element);
$statement->execute();
$result = $statement->fetch();
if (!$result && !($element == "")) {
//This puts the new tags in the databank
$statement = $conn->prepare("INSERT INTO tags (text) VALUES (:tag);");
$statement->bindValue(":tag", $element);
$result = $statement->execute();
} else {
//Tag already exist
}
if (!($element == "")) {
//Get the tags id
$statement = $conn->prepare("select id from tags where text = :text");
$statement->bindValue(":text", $element);
$statement->execute();
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
//Save tags_id and post_id in the table post_tags
$tagId = $result[0]["id"];
$this->setId();
$postId = $this->getId();
$statement = $conn->prepare("INSERT into posts_tags (post_id, tag_id) VALUES (:postId, :tagId)");
$statement->bindValue(":postId", $postId);
$statement->bindValue(":tagId", $tagId);
$result = $statement->execute();
}
}
} | [
"protected function saveTags()\n {\n $this->checkConstants();\n $articleId = $this->id;\n $tags = $this->tags;\n if ( $this->isNewRecord )\n {\n if ( !empty( $tags ) )\n {\n $this->addTags( $articleId, $tags );\n }\n }\n else\n {\n if ( is_array( $tags ) &&( !empty( $tags ) ) )\n {\n /*\n we received array with the same or different values of tags -\n in any case that will be an array with numbers\n */\n if ( is_numeric( $tags[0] ) )\n {\n $this->changeTags( $articleId, $tags );\n }\n /*\n if $tags was filled with models and user has removed from form all tags\n we will receive empty array and $tags will be the same as after initialization\n */\n elseif( is_object( $tags[0] ) )\n {\n $this->deleteAllTags( $articleId );\n }\n }\n }\n }",
"public function save_tags(){\n\t\t//\tFIXME: no longer used but keeping for posterity at the moment.\n\t\tglobal $SLIQR_CONFIG;\n\t\t$s = Storage::singleton($SLIQR_CONFIG);\n\n\t\t// only persist tags if they've changed since load\n\t\tif((count($this->tags) != count($this->original_tags)) ||\n\t\t count(array_diff($this->tags, $this->original_tags))){\n\t\t\t// we just delete tags before re-adding them\n\t\t\t$tag_sql = \"DELETE FROM user_tag WHERE `user` = :userid\";\n\t\t\t$tag_params = array(\"userid\"=>$this->uid);\n\t\t\t$s->execute($tag_sql, $tag_params);\n\n\t\t\tif(count($this->tags)){\n\t\t\t\t// build up a single INSERT that covers all tags\n\t\t\t\t$tag_sql = \"INSERT INTO user_tag (`user`,`tag`) VALUES (:userid, :tag)\";\n\t\t\t\t$tag_params = array(\"userid\"=>$this->uid, \"tag\"=>$this->tags[0]);\n\t\t\t\tfor($i=1; $i<count($this->tags); $i++){\n\t\t\t\t\t$tag_sql .= \",(:userid, :tag{$i})\";\n\t\t\t\t\t$tag_params[\"tag{$i}\"] = $this->tags[$i];\n\t\t\t\t}\n\t\t\t\t$s->execute($tag_sql, $tag_params);\n\t\t\t}\n\n\t\t\t$this->original_tags = $this->tags;\n\t\t}\n\t}",
"function saveTags(&$blog) {\n\t\t\t$this->opendb();\n\t\t\t$sql = 'DELETE FROM TAGS WHERE BLOG_ID=:BLOG_ID';\n\t\t\t$stmt = $this->prepare($sql);\n\t\t$stmt->bindValue(':BLOG_ID', $blog['BLOG_ID'], SQLITE3_TEXT);\n\t\t$result = $stmt->execute();\t\n\n\t\t$tags = explode(',',$blog['TAGS']);\n\n\t\tforeach($tags as $tag) { \n\t\t\tif(trim($tag) != '') {\n\t\t\t\t$sql = 'INSERT INTO TAGS (BLOG_ID,TAG) VALUES (:BLOG_ID,:TAG)';\t\t\n\t\t\t\t$stmt = $this->prepare($sql);\n\t\t\t\t$stmt->bindValue(':BLOG_ID', $blog['BLOG_ID'], SQLITE3_TEXT);\n\t\t\t\t$stmt->bindValue(':TAG', $tag, SQLITE3_TEXT);\n\t\t\t\t$result = $stmt->execute();\t\t\t\t \t\n\t\t\t}\t\t\n\t\t}\n\t\t\t\n\t}",
"function save_tags($blog) {\n \t\t$this->opendb();\n \t\t$sql = 'DELETE FROM TAGS WHERE BLOG_ID=:BLOG_ID';\n \t\t$stmt = $this->prepare($sql);\n\t\t$stmt->bindValue(':BLOG_ID', $blog['BLOG_ID'], SQLITE3_TEXT);\n\t\t$result = $stmt->execute();\t\n\n\t\t$tags = explode(',',$blog['TAGS']);\n\n\t\tforeach($tags as $tag) { \n\t\t\tif(trim($tag) != '') {\n\t\t\t\t$sql = 'INSERT INTO TAGS (BLOG_ID,TAG) VALUES (:BLOG_ID,:TAG)';\t\t\n\t\t\t\t$stmt = $this->prepare($sql);\n\t\t\t\t$stmt->bindValue(':BLOG_ID', $blog['BLOG_ID'], SQLITE3_TEXT);\n\t\t\t\t$stmt->bindValue(':TAG', $tag, SQLITE3_TEXT);\n\t\t\t\t$result = $stmt->execute();\t\t\t\t \t\n\t\t\t}\t\t\n\t\t}\n \t\t$this->close();\t\n }",
"public function save() {\n\t\tparent::save();\n\t\tif ($this->_domains) {\n\t\t\t$this->_domains->save();\n\t\t\tforeach ($this->_domains as $domain) {\n\t\t\t\t$map = new Study_TagDomainMap();\n\t\t\t\t$map->tag_id = $this->getId();\n\t\t\t\t$map->domain_id = $domain->getId();\n\t\t\t\t$map->save();\n\t\t\t}\n\t\t}\n\t}",
"public function saving($tag)\n {\n parent::saving($tag);\n\n Log::Debug(\"Saving tag\", ['tag' => $tag->id]);\n }",
"public function save() {\n if (!sizeof($this->blocks)) {\n return false;\n }\n\n // tag saving\n $this->db->StartTransaction();\n if ($this->tagId == 0) {\n $query = \"INSERT INTO [|PREFIX|]dynamic_content_tags\";\n $query .= \" (name, createdate, ownerid)\";\n $query .= \" VALUES\";\n $query .= \" ('\" . $this->db->Quote(trim($this->name)) . \"', '\" . intval($this->createdDate) . \"', '\" . intval($this->ownerId) . \"')\";\n\n $result = $this->db->Query($query);\n if (!$result) {\n $this->db->RollBackTransaction();\n return false;\n }\n $this->tagId = $this->db->LastId('[|PREFIX|]dynamic_content_tags');\n } else {\n $query = \"UPDATE [|PREFIX|]dynamic_content_tags SET \";\n $query .= \" name='\" . $this->db->Quote(trim($this->name)). \"', \";\n $query .= \" createdate='\" . intval($this->createdDate) . \"' \";\n $query .= \" WHERE tagid=\" . $this->tagId;\n $result = $this->db->Query($query);\n if (!$result) {\n $this->db->RollBackTransaction();\n return false;\n }\n }\n\n // list tag saving\n if (is_array($this->lists) && sizeof($this->lists)) {\n $query = \"DELETE FROM [|PREFIX|]list_tags WHERE tagid=\" . $this->tagId;\n $result = $this->db->Query($query);\n if (!$result) {\n $this->db->RollBackTransaction();\n return false;\n }\n\n foreach ($this->lists as $eachList) {\n $query = \"INSERT INTO [|PREFIX|]list_tags\";\n $query .= \" (tagid, listid)\";\n $query .= \" VALUES\";\n $query .= \" ('\" . intval($this->tagId) . \"', '\" . intval($eachList) . \"')\";\n $result = $this->db->Query($query);\n if (!$result) {\n $this->db->RollBackTransaction();\n return false;\n }\n }\n }\n\n // block saving\n foreach ($this->blocks as $eachBlock) {\n $eachBlock->setTagId($this->tagId);\n if(!$eachBlock->save()) {\n $this->db->RollBackTransaction();\n return false;\n }\n }\n\n $this->db->CommitTransaction();\n return $this->tagId;\n }",
"public function save_tag_list($tags)\n\t{\n\t\t$tags = explode(',', $tags);\n\n\t\t$tag_ids = $this->_get_tags_ids_array();\n\n\t\tforeach($tags as $tag)\n\t\t{\n\t\t\t// New tag ? Add it !\n\t\t\tif( FALSE == preg_match( '/^\\d*$/' , $tag))\n\t\t\t{\n\t\t\t\tif (strlen($tag) > self::$_MAX_TAG_LENGTH)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$id_tag = $this->save($tag);\n\n\t\t\t\tif ( in_array($id_tag, $tag_ids))\n\t\t\t\t\t$tag_ids = array_diff($tag_ids, array($id_tag));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Keep existing tags : Remove them from $tag_ids array;\n\t\t\t\tif ( in_array($tag, $tag_ids))\n\t\t\t\t\t$tag_ids = array_diff($tag_ids, array($tag));\n\t\t\t}\n\t\t}\n\n\t\t// Delete remaining ids : they are not in saved list anymore\n\t\tif ( ! empty($tag_ids))\n\t\t{\n\t\t\t$this->{$this->db_group}->where_in('id_tag', $tag_ids);\n\t\t\t$this->{$this->db_group}->delete($this->get_table());\n\t\t}\n\t}",
"public function saveTags($add = false)\n {\n $model_name = $this->owner->formName();\n $relationship_table = $this->tagsRelationTable();\n\n $own_column = $this->tagsOwnColumn();\n\n $this->tagType = $this->tagType ? $this->tagType : $model_name;\n if(isset($_POST[$model_name]['tags'])) {\n if($_POST[$model_name]['tags']) {\n $existing_ids = ['0'];\n foreach(explode(',',$_POST[$model_name]['tags']) as $tag_value) {\n $tag = Tag::find()->where('status<>\"deleted\" AND name=:name AND type=:type', [':name' => $tag_value, ':type' => $this->tagType])->one();\n if(!isset($tag->id)) {\n $tag = new Tag;\n $tag->type = $this->tagType;\n $tag->name = $tag_value;\n $tag->save(); \n }\n $existingRelation = (new Query())\n ->from($relationship_table)\n ->where(\"{$own_column} = :own_id AND Tag_id = :tag_id AND status='active'\", [\":own_id\"=>$this->owner->id, \":tag_id\"=>$tag->id])\n ->one();\n if($existingRelation) {\n $existing_ids[] = $existingRelation['id'];\n } else {\n \\Yii::$app->db->createCommand()->insert($relationship_table, [\n 'Tag_id' => $tag->id,\n $own_column => $this->owner->id,\n 'update_by' => Yii::$app->getUser()->id,\n 'create_by' => Yii::$app->getUser()->id,\n 'update_time' => new Expression('NOW()'),\n 'create_time' => new Expression('NOW()'),\n ])->execute();\n $insertedRelation = (new Query())\n ->from($relationship_table)\n ->where(\"{$own_column} = :own_id AND Tag_id = :tag_id AND status='active'\", [\":own_id\"=>$this->owner->id, \":tag_id\"=>$tag->id])\n ->orderBy(\"id DESC\")\n ->one();\n $existing_ids[] = $insertedRelation['id'];\n }\n }\n if(!$add)\n \\Yii::$app->db->createCommand()->update($relationship_table, ['status' => \"deleted\", 'update_time' => new Expression('NOW()'), 'update_by' => Yii::$app->getUser()->id], \"{$own_column} = \" . $this->owner->id . \" AND id NOT IN (\" .implode(',', $existing_ids).\")\")->execute();\n } elseif(!$add) {\n \\Yii::$app->db->createCommand()->update($relationship_table, ['status' => \"deleted\", 'update_time' => new Expression('NOW()'), 'update_by' => Yii::$app->getUser()->id], \"{$own_column} = \" . $this->owner->id)->execute();\n }\n }\n }",
"private function saveTags($tags, $id){\n $this->db->delete(\n 'content_tags',\n 'idContent = ?'\n )->execute([$id]);\n \n $this->db->insert(\n 'content_tags',\n ['idContent', 'tag', 'slug']\n );\n \n if(isset($tags) && !is_null($tags)){\n $tagsArr = explode(\",\", $tags);\n \n foreach($tagsArr as $tag){\n $tag = trim($tag);\n $this->db->execute([\n $id,\n $tag,\n $this->valid->slugify($tag)\n ]);\n }\n }\n }",
"public function save()\n {\n if (!$this->getArticleId()) {\n return false;\n }\n $oTagSet = $this->get();\n foreach ($oTagSet as $oTag) {\n $oTag->addUnderscores();\n }\n $sTags = oxDb::getInstance()->escapeString($oTagSet);\n $oDb = oxDb::getDb();\n\n $sTable = getLangTableName('oxartextends', $this->getLanguage());\n $sLangSuffix = oxRegistry::getLang()->getLanguageTag($this->getLanguage());\n\n $sQ = \"insert into {$sTable} (oxid, oxtags$sLangSuffix) value (\" . $oDb->quote($this->getArticleId()) . \", '{$sTags}')\n on duplicate key update oxtags$sLangSuffix = '{$sTags}'\";\n\n if ($oDb->execute($sQ)) {\n $this->executeDependencyEvent();\n\n return true;\n }\n\n return false;\n }",
"function musicEditSave() {\n\t\t$this->save();\n\t\ttry { \n\t\t\t//$this->setTags($this->getTags(). \" \".$this->getArtistID().\" \". $this->getTrackName());\n\t\t\t//momusicTag::getInstance(momusicTags::getInstance($this->getID())->getTagID())->setName($this->getTags())->save();;\n\t\t} catch ( Exception $e) {\n\t\t\tsystemLog::message($e);\n\t\t}\t\n\t}",
"public function save(Tag $tag) : Tag;",
"public function saveTags($qid,$tag)\n \t\t{\n \t\t\t$data=array('qid'=>$qid,'tags'=>$tag);\n \t\t\treturn $this->db->insert('forum_tags',$data);\n \t\t}",
"function saveTextTags($tid): void \n{\n global $tbpref;\n runsql(\n \"DELETE FROM \" . $tbpref . \"texttags WHERE TtTxID =\" . $tid, \n ''\n );\n if (!isset($_REQUEST['TextTags']) \n || !is_array($_REQUEST['TextTags']) \n || !isset($_REQUEST['TextTags']['TagList']) \n || !is_array($_REQUEST['TextTags']['TagList'])\n ) {\n return;\n }\n $cnt = count($_REQUEST['TextTags']['TagList']);\n get_texttags(1);\n\n for ($i = 0; $i < $cnt; $i++) {\n $tag = $_REQUEST['TextTags']['TagList'][$i];\n if (!in_array($tag, $_SESSION['TEXTTAGS'])) {\n runsql(\n \"INSERT INTO {$tbpref}tags2 (T2Text) \n VALUES(\" . convert_string_to_sqlsyntax($tag) . \")\", \n \"\"\n );\n }\n runsql(\n \"INSERT INTO {$tbpref}texttags (TtTxID, TtT2ID) \n SELECT $tid, T2ID \n FROM {$tbpref}tags2 \n WHERE T2Text = \" . convert_string_to_sqlsyntax($tag), \n \"\"\n );\n }\n // refresh tags cache\n get_texttags(1);\n}",
"function saveWordTags($wid) \n{\n global $tbpref;\n runsql(\"DELETE from \" . $tbpref . \"wordtags WHERE WtWoID =\" . $wid, '');\n if (!isset($_REQUEST['TermTags']) \n || !is_array($_REQUEST['TermTags']) \n || !isset($_REQUEST['TermTags']['TagList']) \n || !is_array($_REQUEST['TermTags']['TagList'])\n ) {\n return;\n }\n $cnt = count($_REQUEST['TermTags']['TagList']);\n getWordTags(1);\n\n for ($i = 0; $i < $cnt; $i++) {\n $tag = $_REQUEST['TermTags']['TagList'][$i];\n if(!in_array($tag, $_SESSION['TAGS'])) {\n runsql(\n \"INSERT INTO {$tbpref}tags (TgText) \n VALUES(\" . convert_string_to_sqlsyntax($tag) . \")\", \n \"\"\n );\n }\n runsql(\n \"INSERT INTO {$tbpref}wordtags (WtWoID, WtTgID) \n SELECT $wid, TgID \n FROM {$tbpref}tags \n WHERE TgText = \" . convert_string_to_sqlsyntax($tag), \n \"\"\n );\n }\n // refresh tags cache\n get_tags(1);\n}",
"public function saved($tag)\n {\n parent::saved($tag);\n\n Log::Debug(\"Saved tag\", ['tag' => $tag->id]);\n }",
"public function saveAction() {\n $customerSession = Mage::getSingleton('customer/session');\n if (!$customerSession->authenticate($this)) {\n return;\n }\n $tagName = (string) $this->getRequest()->getQuery('productTagName');\n $productId = (int) $this->getRequest()->getParam('product');\n\n if (strlen($tagName) && $productId) {\n $session = Mage::getSingleton('catalog/session');\n $product = Mage::getModel('catalog/product')\n ->load($productId);\n if (!$product->getId()) {\n $session->addError($this->__('Unable to save tag(s).'));\n } else {\n try {\n $customerId = $customerSession->getCustomerId();\n $storeId = Mage::app()->getStore()->getId();\n\n $tagModel = Mage::getModel('tag/tag');\n /** Check customer group * */\n if (Mage::getStoreConfig(Sourcefuse_Automoderate_Model_Automoderate::XML_ENABLE_TAG_AUTO_APPROVE)) {\n $checkTagCustomerGroup = Mage::helper('automoderate')->checkTagCustomerGroup();\n }\n $tagStatus = isset($checkTagCustomerGroup) ? $tagModel->getApprovedStatus() : $tagModel->getPendingStatus();\n\n // added tag relation statuses\n $counter = array(\n Mage_Tag_Model_Tag::ADD_STATUS_NEW => array(),\n Mage_Tag_Model_Tag::ADD_STATUS_EXIST => array(),\n Mage_Tag_Model_Tag::ADD_STATUS_SUCCESS => array(),\n Mage_Tag_Model_Tag::ADD_STATUS_REJECTED => array()\n );\n $tagNamesArr = $this->_cleanTags($this->_extractTags($tagName));\n foreach ($tagNamesArr as $tagName) {\n // unset previously added tag data\n $tagModel->unsetData()\n ->loadByName($tagName);\n\n if (!$tagModel->getId()) {\n $tagModel->setName($tagName)\n ->setFirstCustomerId($customerId)\n ->setFirstStoreId($storeId)\n ->setStatus($tagStatus)\n ->save();\n }\n $relationStatus = $tagModel->saveRelation($productId, $customerId, $storeId);\n $counter[$relationStatus][] = $tagName;\n }\n $this->_fillMessageBox($counter);\n } catch (Exception $e) {\n Mage::logException($e);\n $session->addError($this->__('Unable to save tag(s).'));\n }\n }\n }\n $this->_redirectReferer();\n }",
"public function saveToDb()\n\t{\n\t\t$this->saveQuestionSequence();\n\t\t$this->saveNewlyCheckedQuestion();\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display the classes for the task div. | function cs_task_class( $class = '', $task_id = null ) {
echo 'class="' . esc_attr( join( ' ', cs_get_task_class( $class, $task_id ) ) ) . '"';
} | [
"function devshop_render_tasks($tasks = NULL, $class = '', $actions = array(), $float = 'left'){\n global $user;\n\n if (is_null($tasks)){\n // Tasks\n $tasks = hosting_get_tasks(null, null, 10);\n }\n\n // Get active or queued\n $tasks_count = 0;\n foreach ($tasks as $task){\n if ($task->task_status == HOSTING_TASK_QUEUED || $task->task_status == HOSTING_TASK_PROCESSING){\n $tasks_count++;\n }\n }\n\n $task_class = '';\n if ($tasks_count > 0) {\n $task_class = 'active-task fa-spin';\n }\n\n $items = array();\n $text = '<i class=\"fa fa-list-alt\"></i> '. t('Task Logs');\n\n // If for an environment, change the link.\n if (!empty($actions)) {\n\n $environment_node = node_load($tasks[0]->rid);\n $environment = $environment_node->environment;\n\n $url = \"node/{$environment->project_nid}/logs/{$environment->name}\";\n }\n else {\n $url = 'hosting/tasks';\n }\n\n $task_items = array();\n $task_items[] = l($text, $url, array(\n 'html' => TRUE,\n 'attributes' => array(\n 'class' => array(\n 'list-group-item',\n ),\n ),\n ));\n\n $task_types = hosting_available_tasks();\n\n if (!empty($tasks)) {\n\n foreach ($tasks as $task) {\n\n switch ($task->task_status){\n case HOSTING_TASK_SUCCESS:\n $icon = 'check text-success';\n $item_class = 'list-group-item-success';\n break;\n\n case HOSTING_TASK_ERROR;\n $icon = 'exclamation-circle text-danger';\n $item_class = 'list-group-item-danger';\n break;\n case HOSTING_TASK_WARNING:\n $icon = 'warning text-warning';\n $item_class = 'list-group-item-warning';\n break;\n\n case HOSTING_TASK_PROCESSING;\n case HOSTING_TASK_QUEUED;\n $icon = 'cog fa-spin text-info';\n $item_class = 'list-group-item-info';\n break;\n }\n\n $task_node = node_load($task->rid);\n\n // If environment tasks...\n if (!empty($actions)) {\n $task->title = $task_types[$task_node->type][$task->task_type]['title'];\n }\n\n $text = '<i class=\"fa fa-' . $icon . '\"></i> ';\n $text .= $task->title;\n $datetime = date('c', $task->changed);\n $text .= ' <time class=\"timeago task-ago btn-block\" datetime=\"' . $datetime . '\">' . format_interval(REQUEST_TIME - $task->changed) .' '. t('ago') . '</time>';\n\n $id = isset($task_node->environment)? \"task-{$task_node->environment->project_name}-{$task_node->environment->name}\": \"task-\";\n $task_items[] = l($text, 'node/' . $task->nid, array(\n 'html' => TRUE,\n 'attributes' => array(\n 'class' => array('list-group-item ' . $item_class),\n 'id' => $id,\n ),\n ));\n }\n }\n else {\n $task_items[] = t('No Active Tasks');\n }\n\n $items[] = array(\n 'class' => array('tasks'),\n 'data' => '<div class=\"list-group\">' . implode(\"\\n\", $task_items) . '</div>',\n );\n\n if (!empty($actions)) {\n\n array_unshift($items, array(\n 'class' => array('divider'),\n ));\n\n // Add \"Environment Settings\" link\n if (node_access('update', $environment_node)) {\n array_unshift($items, l('<i class=\"fa fa-sliders\"></i> ' . t('Environment Settings'), \"node/{$environment->site}/edit\", array('html' => TRUE)));\n }\n\n $action_items = array();\n foreach ($actions as $link) {\n $action_items[] = l($link['title'], $link['href'], array(\n 'attributes' => array(\n 'class' => array('list-group-item'),\n ),\n 'query' => array(\n 'token' => drupal_get_token($user->uid),\n ),\n ));\n }\n\n $items[] = array(\n 'class' => array('actions'),\n 'data' => '<div class=\"list-group\">' . implode(\"\\n\", $action_items) . '</div>',\n );\n }\n\n $tasks = theme('item_list', array(\n 'items' => $items,\n 'attributes' => array(\n 'class' => array(\n 'devshop-tasks dropdown-menu dropdown-menu-' . $float,\n )\n ),\n 'role' => 'menu',\n )\n );\n\n if ($tasks_count == 0) {\n $tasks_count = '';\n }\n\n $logs = t('Task Logs');\n return <<<HTML\n <div class=\"task-list btn-group\">\n <button type=\"button\" class=\"btn btn-link task-list-button dropdown-toggle $class\" data-toggle=\"dropdown\" title=\"$logs\">\n <span class=\"count\">$tasks_count</span>\n <i class=\"fa fa-gear $task_class\"></i>\n </button>\n $tasks\n </div>\nHTML;\n\n}",
"function task_show_tasks()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$row = array();\n\t\t$content = \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// List tasks (pointless comment)\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'task_manager', 'order' => 'task_safemode, task_next_run' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\twhile ( $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$row['task_minute'] = $row['task_minute'] != '-1' ? $row['task_minute'] : '-';\n\t\t\t$row['task_hour'] = $row['task_hour'] != '-1' ? $row['task_hour'] : '-';\n\t\t\t$row['task_month_day'] = $row['task_month_day'] != '-1' ? $row['task_month_day'] : '-';\n\t\t\t$row['task_week_day'] = $row['task_week_day'] != '-1' ? $row['task_week_day'] : '-';\n\t\t\t\n\t\t\tif ( time() > $row['task_next_run'] )\n\t\t\t{\n\t\t\t\t$row['_image'] = 'task_run_now.gif';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row['_image'] = 'task_run.gif';\n\t\t\t}\n\t\t\t\n\t\t\t$row['_next_run'] = gmdate( 'j M Y - G:i', $row['task_next_run'] );\n\t\t\t\n\t\t\t$row['_class'] = $row['task_enabled'] != 1 ? \" style='color:gray'\" : '';\n\t\t\t$row['_title'] = $row['task_enabled'] != 1 ? \" (Disabled)\" : '';\n\t\t\t$row['_next_run'] = $row['task_enabled'] != 1 ? \"<span style='color:gray'><s>{$row['_next_run']}</s></span>\" : $row['_next_run'];\n\t\t\t\n\t\t\t$content .= $this->html->task_manager_row( $row );\n\t\t}\n\t\t\n\t\t//-------------------------------\n\t\t// Print it\n\t\t//-------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->html->task_manager_wrapper( $content, gmdate( 'jS F Y - h:i A' ) );\n\t\t$this->ipsclass->admin->output();\n\t}",
"public function displayClasses() {\r\n\t\t$html = '';\r\n\t\tforeach($this->classes as $class) {\r\n\t\t\t$html .= \"<div class=\\\"classWrapper\\\">\" . $this->formatItem($class, 'class'); //Wrap the class in a div\r\n\t\t\t$methods = $class->getMethods();\r\n\t\t\tusort($methods, array($this, 'sort'));\r\n\t\t\t$html .= \"<div class=\\\"methods\\\">\" . PHP_EOL; //Wrap all the methods in a div to show/hide\r\n\t\t\tforeach($methods as $method) {\r\n\t\t\t\t$html .= $this->formatItem($method, 'method');\r\n\t\t\t}\r\n\t\t\t$html .= \"</div></div>\" . PHP_EOL;\r\n\t\t}\r\n\t\treturn $html;\r\n\t}",
"public function listTaskClasses(): array;",
"public function viewTasks(){\n\t\t$db = new Database();\n\t\t$db->connect();\n\t\t$result = $db->query('SELECT * FROM task_log WHERE user_id =\"'.$_SESSION['user_id'].'\"');\n\t\t$tasks = mysqli_fetch_all($result['result']);\n\t\techo '<div class=\"panel panel-default\">\n\t\t<table class=\"table table-hover\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Task ID</th>\n\t\t\t\t\t<th>Description</th>\n\t\t\t\t\t<th>Resource Type</th>\n\t\t\t\t\t<th>Date</th>\n\t\t\t\t\t<th>Duration</th>\n\t\t\t\t\t<th>Size</th>\n\t\t\t\t\t<th>Status</th>\n\t\t\t\t</tr>\n\t\t\t</thead>';\n\t\tforeach($tasks as $task){\n\t\t\techo '<tr>\n\t\t\t\t<td>'.$task[0].'</td>\n\t\t\t\t<td>'.$task[6].'</td>\n\t\t\t\t<td>'.$task[2].'</td>\n\t\t\t\t<td>'.$task[3].'</td>\n\t\t\t\t<td>'.$task[4].'</td>\n\t\t\t\t<td>'.$task[7].'</td>\n\t\t\t\t<td>'.$task[5].'</td>\n\t\t\t</tr>';\n\t\t}\n\t\techo '</table></div>';\n\t}",
"public function viewClass() {\r\n Auth::checkAuthentication();\r\n $teacherID = Session::get('user_id');\r\n $isTeacher = AccountModel::isTeacher(Session::get('user_role'));\r\n $classID = Request::get('classID');\r\n if (isset($teacherID) && isset($isTeacher) && isset($classID)) {\r\n if ($isTeacher) {\r\n if (ClassModel::isClassTaughtByTeacher($classID, $teacherID)) {\r\n $allStudentsInClassProgress = ClassModel::getAllStudentsInClassProgress($classID);\r\n $className = ClassModel::getClassName($classID, $teacherID);\r\n $allStudentsInClassProgress[\"className\"] = $className;\r\n $this->View->render('class/viewClass', $allStudentsInClassProgress);\r\n } else {\r\n Redirect::to(\"error/index\");\r\n }\r\n } else {\r\n Redirect::to(\"error/index\");\r\n }\r\n } else {\r\n Redirect::to(\"error/index\");\r\n }\r\n }",
"public static function showProgress($activeClass) {\n\t ?>\t \n\t \n\t<div class=\"row\">\n\t\n\t\t <center>\n <h3 class=\"shadowX widthX\"><i class=\"fa fa-info-circle\" style=\"font-size:0.8em\"></i> Status </h3>\n\t\t\t<br>\n\t\t\t\n\t\t\t<div class=\"row items-list\">\n\t\t\t\n\t\t\t <!-- Shop icon -->\n\t\t\t <div class=\"icon-item <?php echo ($activeClass == 'Shop' ? 'myactive' : 'myinactive'); ?> \"> <!-- assign css class by function argument {$activeClass} -->\n\t\t\t <i class=\"fa fa-gift\" style=\"font-size:24px;\"></i>\n\t\t\t\t\t<p><?=Html::a( \"Shop\", [\"/shop-liqpay/index\",] , $options = [\"title\" => \"Shop\",] ); ?></p>\n\t\t </div>\n\t\t\t\t\n\t\t\t\t<!-- A line -->\n\t\t\t\t<div class=\"icon-item\">\n\t\t\t\t <span class=\"line2\"> </span>\n\t\t\t </div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t <!-- Cart icon -->\n\t\t\t <div class=\"icon-item <?php echo ($activeClass == 'Cart' ? 'myactive' : 'myinactive'); ?> \"> <!-- assign css class by function argument {$activeClass} -->\n\t\t\t <i class=\"fa fa-shopping-cart\" style=\"font-size:24px;\"></i>\n\t\t\t\t <p><?=Html::a( \"Cart\", [\"/shop-liqpay/cart\",] , $options = [\"title\" => \"Cart\",] ); ?></p>\n\t\t </div>\n\t\t\t\t\n\t\t\t\t<!-- A line -->\n\t\t\t\t<div class=\"icon-item\">\n\t\t\t\t <span class=\"line2\"> </span>\n\t\t\t </div>\n\t\t\t\t\n <!-- Order icon -->\t\t\t\t\n\t\t\t\t<div class=\"icon-item <?php echo ($activeClass == 'Order' ? 'myactive' : 'myinactive'); ?> \"> <!-- assign css class by function argument {$activeClass} -->\t\n\t\t\t\t <i class=\"fa fa-tablet\" style=\"font-size:24px;\"></i>\n\t\t\t\t\t<p>Order</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<!-- A line -->\n\t\t\t\t<div class=\"icon-item\">\t\n\t\t\t\t <span class=\"line2\"> </span>\n\t\t\t\t</div>\n\t\t\t\t\n <!-- Payment icon -->\t\t\t\t\n\t\t\t\t<div class=\"icon-item <?php echo ($activeClass == 'Payment' ? 'myactive' : 'myinactive'); ?> \"> <!-- assign css class by function argument {$activeClass} -->\t\n\t\t\t\t <i class=\"fa fa-money\" style=\"font-size:24px;\"></i>\n\t\t\t\t\t<p>Payment</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<!-- A line -->\n\t\t\t\t<div class=\"icon-item\">\t\n\t\t\t\t <span class=\"line2\"> </span>\n\t\t\t\t</div>\n\t\t\t\t\n <div class=\"icon-item <?php echo ($activeClass == 'Complete' ? 'myactive' : 'myinactive'); ?> \"> <!-- assign css class by function argument {$activeClass} -->\t\t\t\t\n\t\t\t\t <i class=\"fa fa-check\" style=\"font-size:24px;\"></i>\n\t\t\t\t\t<p>Complete</p>\n\t\t\t </div>\n\t\t\t\n\t\t\n\t\t </div>\n\t\t\t\n\t\t\t\n\t <!--<hr>-->\n\t </center>\n\t</div>\t\n\t\n\t<?php\n\t }",
"function display_progress() {\n $steps = $this->workflow->get_steps();\n $current = $this->get_current_step();\n $last = $this->workflow->get_last_completed_step();\n $state = $last === null ? 1 : 0;\n $first = true;\n\n echo '<ul class=\"workflow_progress clearfix\">';\n foreach ($steps as $name => $display) {\n $link = false;\n switch ($state) {\n case 0:\n // the last-completed step and before\n $class = 'workflow_step workflow_step_completed';\n $link = true;\n if ($name === $last) {\n $state = 1;\n }\n break;\n case 1:\n // the next step to be completed\n $state = 2;\n $link = true;\n $class = 'workflow_step';\n break;\n default:\n // not-yet reachable steps\n $class = 'workflow_step workflow_step_incomplete';\n }\n if ($name === $current) {\n $class .= ' workflow_step_current';\n $link = false;\n }\n echo \"<li class=\\\"$class\\\">\";\n if ($first) {\n $first = false;\n } else {\n echo '<span class=\"accesshide\"><span class=\"arrowtext\">/ </span></span><span class=\"arrow sep\">►</span></span> ';\n }\n if ($link) {\n $target = $this->get_new_page(array('_wfid' => $this->workflow->id,\n '_step' => $name));\n echo \"<a href=\\\"{$target->url}\\\">\";\n }\n echo htmlspecialchars($display);\n if ($link) {\n echo '</a>';\n }\n echo '</li> ';\n }\n echo '</ul>';\n }",
"protected function _listTasks() {\n\t\t$this->out('Available tasks:');\n\t\tforeach ($this->taskNames as $loadedTask) {\n\t\t\t$this->out('\t- ' . $loadedTask);\n\t\t}\n\t}",
"public function printTask()\n {\n $result = \"\";\n if($this->taskList)\n {\n $result = \"\\nTask-List: \\\"\" . $this->getName() . \"\\\" Status: \" . $this->getStatusText() . \"\\n\";\n foreach ($this->taskList as $task)\n {\n $result .= $task->printTask();\n }\n }\n return $result;\n }",
"function add_entry_class($classes){\n\t\t\tglobal $wpdb;\n\t\t\tglobal $post;\n\t\t\tglobal $comment;\n\t\t\t$postID = $post->ID;\n\t\t\t$leaveanote_posts = $wpdb->prefix.\"leaveanote_posts\";\n\t\t\t$onoff = $wpdb->get_results(\"SELECT on_off FROM $leaveanote_posts WHERE post_ID=$postID\");\n\t\t\t$onoffItem = $onoff[0];\n\t\t\t$onoff = $onoffItem->on_off;\n\t\t\tif ($onoff == 'on'){\n\t\t\t\t$id = $comment->comment_ID;\n \t\t\t\t$maintable = $wpdb->prefix.\"leaveanote\";\n \t\t\t\t$left = $wpdb->get_results(\"SELECT leftPos FROM $maintable WHERE commentID=$id\");\n \t\t\t\t$top = $wpdb->get_results(\"SELECT topPos FROM $maintable WHERE commentID=$id\");\n \t\t\t\t$l = $left[0];\n \t\t\t\t$lpos = $l->leftPos;\n \t\t\t\t$t = $top[0];\n \t\t\t\t$tpos = $t->topPos;\n \t\t\t\techo 'style=\"position:absolute; top:'.$tpos.'; left:'.$lpos.';';\n\t\t\t\t$value = get_option('leaveanote_showhide');\n\t\t\t\tif ($value == 'show') {\n\t\t\t\t\techo ' display:block;';\n\t\t\t\t} elseif ($value == 'hide') {\n\t\t\t\t\techo ' display:none;';\n\t\t\t\t}\n \t\t\t\techo '\" ';\n\t\t\t\tarray_push($classes, \"post-its\");\n\t\t\t\treturn $classes;\n\t\t\t} else {\n\t\t\t\treturn $classes;\n\t\t\t}\n\t\t}",
"public function getTaskClassName();",
"public function showCreatedClasses()\n {\n foreach ($this->products['data'] as $k => $v) {\n $v->render();\n }\n }",
"public function displayTask()\n\t{\n\t\t$filters = array(\n\t\t\t'search' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.search',\n\t\t\t\t'search',\n\t\t\t\t''\n\t\t\t),\n\t\t\t'sort' => Request::getstate(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sort',\n\t\t\t\t'filter_order',\n\t\t\t\t'name'\n\t\t\t),\n\t\t\t'sort_Dir' => Request::getstate(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sortdir',\n\t\t\t\t'filter_order_Dir',\n\t\t\t\t'ASC'\n\t\t\t)\n\t\t);\n\n\t\t// instantiate mailing list object\n\t\t$lists = Mailinglist::all()\n\t\t\t->whereEquals('deleted', 0);\n\n\t\tif ($filters['search'])\n\t\t{\n\t\t\t$filters['search'] = strtolower((string)$filters['search']);\n\t\t\t$lists->whereLike('name', $filters['search']);\n\t\t}\n\n\t\t$rows = $lists\n\t\t\t->ordered($filters['sort'], $filters['sort_Dir'])\n\t\t\t->paginated('limitstart', 'limit')\n\t\t\t->rows();\n\n\t\t// diplay list of mailing lists\n\t\t$this->view\n\t\t\t->setLayout('display')\n\t\t\t->set('lists', $rows)\n\t\t\t->set('filters', $filters)\n\t\t\t->display();\n\t}",
"public function css_classes_content() {\n return implode( ' ', [\n 'c-factcheck',\n ] );\n }",
"function waiting_template()\n {\n $this->output( '<span id=\"qa-waiting-template\" class=\"qa-waiting fa fa-spinner fa-spin\"></span>' );\n }",
"public function _tiles_wrap_classes() {\n\n\t\t$settings = $this->get_settings();\n\t\t$classes = array( 'jet-smart-tiles-wrap' );\n\n\t\tif ( 'yes' === $settings['excerpt_on_hover'] ) {\n\t\t\t$classes[] = 'jet-hide-excerpt';\n\t\t}\n\n\t\tif ( 'yes' === $settings['carousel_enabled'] ) {\n\t\t\t$classes[] = 'jet-smart-tiles-carousel';\n\t\t}\n\n\t\tif ( 'yes' === $settings['carousel_enabled'] && 'yes' === $settings['show_arrows_on_hover'] ) {\n\t\t\t$classes[] = 'jet-arrows-on-hover';\n\t\t}\n\n\t\techo implode( ' ', $classes );\n\t}",
"public function classes()\n\t{\n\t\t$this->checkAdminLoginSession();\n\t\t$data['page'] = '123';\n\t\t$data['live_class_arr']=$this->AM->liveClassList();\t\t\n\t\t$this->load->view($this->_admin_classes,$data);\n\t}",
"function divClass($tab,$str,$class){\n \t\t\teco($tab++,\"<div class=\\\"\".$class.\"\\\">\\n\");\n\t\t\t\teco($tab,$str);\n \t\t\teco(--$tab,\"</div>\\n\");\t\t\t\n\t\t }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Builds and returns an instance of the class. | public function build()
{
$constructorArgs = $this->resolveConstructorParameters();
$built = new $this->className(...$constructorArgs);
foreach ((array)$this->afterBuildMethods as $afterBuildMethod) {
$built->{$afterBuildMethod}();
}
return $built;
} | [
"abstract protected function buildClass();",
"public static function create()\r\n\t{\r\n\t\treturn new Builder;\r\n\t}",
"public function construct(): object\n {\n return $this->reflected->newInstanceArgs(func_get_args());\n }",
"public static function build() {\n\t\t$proxy = ITSEC_Modules::get_setting( 'global', 'proxy' );\n\n\t\treturn self::build_for_type( $proxy );\n\t}",
"public function build()\n {\n return new UnitConverter($this->registry, $this->calculator);\n }",
"abstract protected function _build();",
"public function buildClass() {\n\n foreach ($this->_optionsFrom($this->_reflect) as $options) {\n\n $this->_map->add(\n $this->_makeItemFromOptions($options)\n );\n\n }\n\n }",
"public function build()\n {\n if (null === $this->eventDispatcher) {\n $this->eventDispatcher = new EventDispatcher();\n }\n\n $this->eventDispatcher->addListener(StartEvent::NAME, new DynamoStartListener());\n $this->eventDispatcher->addListener(MethodEvent::NAME, new DynamoMethodListener());\n\n if (null === $this->cacheDir) {\n $this->cacheDir = sys_get_temp_dir() . '/retrofit';\n }\n\n if (null === $this->serviceResolver) {\n $this->serviceResolver = new ServiceResolver();\n }\n\n if (null === $this->generator) {\n $this->generator = Generator::builder()\n ->setNamespacePrefix(Retrofit::NAMESPACE_PREFIX)\n ->setCacheDir($this->cacheDir . '/retrofit')\n ->setEventDispatcher($this->eventDispatcher)\n ->build();\n }\n\n return new Retrofit($this->serviceResolver, $this->generator);\n }",
"public function build()\n {\n $cm = $this->builder->getClassMetadata();\n\n $cm->mapEmbedded($this->mapping);\n\n return $this->builder;\n }",
"public static function build()\n {\n $printer_manager = \"\\\\App\\\\PrinterManager\\\\\" . ucfirst(self::serverOS()) . 'PrinterManager';\n return new $printer_manager;\n }",
"public function create()\n {\n $classNamespace = $this->getEntityNamespace();\n $state = new $classNamespace();\n\n return $state;\n }",
"public static function make() : self\n {\n return new static(new PreloaderCompiler, new PreloaderLister, new Opcache);\n }",
"public function buildClass($name);",
"public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }",
"public function builder()\n {\n return new Builder;\n }",
"public function build()\n {\n $soapClientFactory = new SoapClientFactory();\n $soapClient = $soapClientFactory->factory($this->wsdl, $this->soapOptions);\n\n $client = new Client($soapClient, $this->username, $this->password, $this->token);\n\n if ($this->log) {\n $logPlugin = new LogPlugin($this->log);\n $client->getEventDispatcher()->addSubscriber($logPlugin);\n }\n\n return $client;\n }",
"public static function make();",
"public function make()\n {\n $fullyQualifedClassName = __NAMESPACE__ . '\\\\' . $this->domainObjectClass;\n\n return new $fullyQualifedClassName;\n }",
"public function build()\n {\n $soapClientFactory = new SoapClientFactory();\n $soapClient = $soapClientFactory->factory($this->wsdl, $this->soapOptions, $this->environment);\n\n $client = new Client($soapClient, $this->username, $this->password, $this->token);\n\n if ($this->log) {\n $logPlugin = new LogPlugin($this->log);\n $client->getEventDispatcher()->addSubscriber($logPlugin);\n }\n\n return $client;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create request for operation 'checkoutsByCheckoutIdGet' | protected function checkoutsByCheckoutIdGetRequest($checkout_id, $accept, $content_type)
{
// verify the required parameter 'checkout_id' is set
if ($checkout_id === null || (is_array($checkout_id) && count($checkout_id) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $checkout_id when calling checkoutsByCheckoutIdGet'
);
}
// verify the required parameter 'accept' is set
if ($accept === null || (is_array($accept) && count($accept) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $accept when calling checkoutsByCheckoutIdGet'
);
}
// verify the required parameter 'content_type' is set
if ($content_type === null || (is_array($content_type) && count($content_type) === 0)) {
throw new \InvalidArgumentException(
'Missing the required parameter $content_type when calling checkoutsByCheckoutIdGet'
);
}
$resourcePath = '/checkouts/{checkoutId}';
$formParams = [];
$queryParams = [];
$headerParams = [];
$httpBody = '';
$multipart = false;
// header params
if ($accept !== null) {
$headerParams['Accept'] = ObjectSerializer::toHeaderValue($accept);
}
// header params
if ($content_type !== null) {
$headerParams['Content-Type'] = ObjectSerializer::toHeaderValue($content_type);
}
// path params
if ($checkout_id !== null) {
$resourcePath = str_replace(
'{' . 'checkoutId' . '}',
ObjectSerializer::toPathValue($checkout_id),
$resourcePath
);
}
// body params
$_tempBody = null;
if ($multipart) {
$headers = $this->headerSelector->selectHeadersForMultipart(
['application/json']
);
} else {
$headers = $this->headerSelector->selectHeaders(
['application/json'],
['application/json']
);
}
// for model (json/xml)
if (isset($_tempBody)) {
// $_tempBody is the method argument, if present
$httpBody = $_tempBody;
// \stdClass has no __toString(), so we should encode it manually
if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($httpBody);
}
} elseif (count($formParams) > 0) {
if ($multipart) {
$multipartContents = [];
foreach ($formParams as $formParamName => $formParamValue) {
$multipartContents[] = [
'name' => $formParamName,
'contents' => $formParamValue
];
}
// for HTTP post (form)
$httpBody = new MultipartStream($multipartContents);
} elseif ($headers['Content-Type'] === 'application/json') {
$httpBody = \GuzzleHttp\json_encode($formParams);
} else {
// for HTTP post (form)
$httpBody = \GuzzleHttp\Psr7\build_query($formParams);
}
}
$defaultHeaders = [];
if ($this->config->getUserAgent()) {
$defaultHeaders['User-Agent'] = $this->config->getUserAgent();
}
$headers = array_merge(
$defaultHeaders,
$headerParams,
$headers
);
$query = \GuzzleHttp\Psr7\build_query($queryParams);
return new Request(
'GET',
$this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
$headers,
$httpBody
);
} | [
"public function getCheckout($checkoutId)\n {\n return $this->makeRequest('get', \"checkouts/{$checkoutId}\");\n }",
"protected function postInitiateCheckoutCollectionRequest($checkout = null)\n {\n\n $resourcePath = '/checkouts/init';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($checkout)) {\n $_tempBody = $checkout;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/csv', 'text/html'],\n ['application/ld+json', 'application/json', 'text/csv', 'text/html']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function orderGetChargeableSumsRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling orderGetChargeableSums'\n );\n }\n\n $resourcePath = '/Order/{id}/getChargeableSums';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('token');\n if ($apiKey !== null) {\n $queryParams['token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function get(array $data=[]){\n $this->type='GET';\n \n if(isset($data['client_oid'])) {\n $this->path='/orders/client:'.$data['client_oid'];\n }\n \n if(isset($data['id'])) {\n $this->path='/orders/'.$data['id'];\n }\n \n $this->data=$data;\n return $this->exec();\n }",
"public function getReadyOrders(Request $request){\n // check params \n if(!$this->requiredParams($request, ['key'])){\n return response()->json(['status' => 'error' , 'message' => 'missing params' ] , 400);\n }\n\n $key = $this->checkParam($request->key);\n if ($key !== self::KEY) {\n return response()->json(['status' => 'error' , 'message' => 'invalid request' ] , 400);\n }\n\n $orders = Order::with('bills.shop')->with('status')->where('order_status_id',3)->get();\n \n\n return response()->json(['status' => 'success' , 'message' => 'OK', 'data' => $orders] , 200); \n }",
"public function getOrderInvoicesDetailsRequest($id, string $contentType = self::contentTypes['getOrderInvoicesDetails'][0])\n {\n\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getOrderInvoicesDetails'\n );\n }\n\n\n $resourcePath = '/order/checkout-forms/{id}/invoices';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/vnd.allegro.public.v1+json', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function restAccountsOrderSummariesOrdersAddressIdGetRequest($address_id)\n {\n // verify the required parameter 'address_id' is set\n if ($address_id === null || (is_array($address_id) && count($address_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $address_id when calling restAccountsOrderSummariesOrdersAddressIdGet'\n );\n }\n\n $resourcePath = '/rest/accounts/order_summaries/orders/{addressId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($address_id !== null) {\n $resourcePath = str_replace(\n '{' . 'addressId' . '}',\n ObjectSerializer::toPathValue($address_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function quoteCartItemRepositoryV1GetListGet_0Request()\n {\n\n $resourcePath = '/V1/carts/mine/items';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function build(): ListPayoutsRequest\n {\n return CoreHelper::clone($this->instance);\n }",
"private function _convertGetOrder($request) {\n \n $parameters = array();\n $parameters['Action'] = 'GetOrder';\n if ($request->isSetSellerId()) {\n $parameters['SellerId'] = $request->getSellerId();\n }\n if ($request->isSetAmazonOrderId()) {\n $amazonOrderIdgetOrderRequest = $request->getAmazonOrderId();\n foreach ($amazonOrderIdgetOrderRequest->getId() as $idamazonOrderIdIndex => $idamazonOrderId) {\n $parameters['AmazonOrderId' . '.' . 'Id' . '.' . ($idamazonOrderIdIndex + 1)] = $idamazonOrderId;\n }\n }\n\n return $parameters;\n }",
"public function retrieveInvoicesAction()\n {\n $invoiceId = $this->container->get('request')->get('id'); \n $baseUrl = $this->setGetContract->subUrlsInvoices.\"/$invoiceId\";\n $customerUrl= $baseUrl.\"?customer=$this->customerId\";\n $this->url = (isset($this->customerId)) ? $baseUrl : $customerUrl;\n $this->currentSubUrl = 'subUrlsInvoices';\n $this->datas = array();\n \n return $this->prepareRequest(); \n }",
"protected function getOmsOrderByIdRequest($oms_order_id)\n {\n // verify the required parameter 'oms_order_id' is set\n if ($oms_order_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $oms_order_id when calling getOmsOrderById'\n );\n }\n\n $resourcePath = '/beta/omsOrder/{omsOrderId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($oms_order_id !== null) {\n $resourcePath = str_replace(\n '{' . 'omsOrderId' . '}',\n ObjectSerializer::toPathValue($oms_order_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getAllOrderCompany(Request $request) \n {\n $input = $request->all();\n $searchBy = [];\n\n if($request->has('search') && $request->input('search')){\n\n $searchValues = explode(';', $request->input('search'));\n \n foreach ($searchValues as $val) {\n $tmp = explode(':', $val);\n \n if(count($tmp) > 1){\n $searchBy[$tmp[0]] = $tmp[1];\n }\n }\n }\n\n $orders = $this->orderRepository->getAllOrders($input['company_id'],$searchBy);\n if ($orders) {\n return $this->sendResponse($orders->toArray(), 'Orders retrieved successfully');\n }else{\n return $this->sendError('Data not found');\n }\n }",
"protected function paymentGetByIdRequest($id, $select = null, $filter = null, $expand = null, $custom = null)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling paymentGetById'\n );\n }\n\n $resourcePath = '/Payment/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($select !== null) {\n $queryParams['$select'] = ObjectSerializer::toQueryValue($select);\n }\n // query params\n if ($filter !== null) {\n $queryParams['$filter'] = ObjectSerializer::toQueryValue($filter);\n }\n // query params\n if ($expand !== null) {\n $queryParams['$expand'] = ObjectSerializer::toQueryValue($expand);\n }\n // query params\n if ($custom !== null) {\n $queryParams['$custom'] = ObjectSerializer::toQueryValue($custom);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function loadByCheckoutId($checkoutId)\n {\n return $this->load($checkoutId, 'klarna_checkout_id');\n }",
"protected function getCouponItemRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $id when calling getCouponItem');\n }\n\n $resourcePath = '/store/coupons/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace('{' . 'id' . '}', ObjectSerializer::toPathValue($id), $resourcePath);\n }\n\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n return new Request(\n 'GET',\n $url,\n $headers,\n $httpBody\n );\n }",
"protected function getShopAccountRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling getShopAccount'\n );\n }\n\n $resourcePath = '/shop_accounts/{id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function getShoppingCartCheckoutViaPayment() {\n \t$shoppingCartIdentification = new ShoppingCartIdentificationType(null, null, null);\n \t$buyShoppingCart = new BuyShoppingCartType();\n \t$directLabelInfo = new DirectLabelInfoType();\n \t$partnerBackLinks = new PartnerBackLinksType();\n\n \t$response = $this->_requestBuilder->getShoppingCartCheckoutViaPayment();\n \tvar_dump($response);\n }",
"protected function pOSTDeliveryCheckoutsDeliveryCheckoutIdRequest($delivery_checkout_id, $body = null, $authorization = null)\n {\n // verify the required parameter 'delivery_checkout_id' is set\n if ($delivery_checkout_id === null || (is_array($delivery_checkout_id) && count($delivery_checkout_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $delivery_checkout_id when calling pOSTDeliveryCheckoutsDeliveryCheckoutId'\n );\n }\n\n $resourcePath = '/delivery-checkouts/{deliveryCheckoutId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($authorization !== null) {\n $headerParams['Authorization'] = ObjectSerializer::toHeaderValue($authorization);\n }\n\n // path params\n if ($delivery_checkout_id !== null) {\n $resourcePath = str_replace(\n '{' . 'deliveryCheckoutId' . '}',\n ObjectSerializer::toPathValue($delivery_checkout_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test if getting acf image with integer as $name value throw expected exception | function test_get_acf_image_field_throwing_exception_when_name_is_integer() {
$plugin = acf_helper();
$this->expectException( \InvalidArgumentException::class );
$this->expectExceptionMessage( 'It looks like $name parameter is not a type of string but "integer".' );
$plugin['acf-helper/content']->get_acf_image_field( 1, 'Foo' );
} | [
"public function testGetInvalidImageByImageId() {\n\t\t//grab a profile id that exceeds the maxiumum allowable image profile id\n\t\t$image = Image::getImageByImageId($this->getPDO(), FlekTest::INVALID_KEY);\n\t\t$this->assertNull($image);\n\t}",
"function test_get_acf_file_field_throwing_exception_when_name_is_integer() {\n\n\t\t$plugin = acf_helper();\n\n\t\t$this->expectException( \\InvalidArgumentException::class );\n\t\t$this->expectExceptionMessage( 'It looks like $name parameter is not a type of string but \"integer\".' );\n\n\t\t$plugin['acf-helper/content']->get_acf_file_field( 1, 'Foo' );\n\t}",
"public function testImageValue() : void {\n\t\t$this->assertEquals('kc_image', PostType::Image->value);\n\t}",
"public function testGetInvalidImageByImagePath() {\n\t\t//grab an image by searching for content that does not exist\n\t\t$image = Image::getImageByImagePath($this->getPDO(), \"this image is not found\");\n\t\t$this->assertCount(0, $image);\n\t}",
"public function testS5contentHasImage()\n {\n $imageLabel = 'someText';\n $imageUrl = NULL;\n $expected = 0;\n $actual = contentHasImage($imageLabel, $imageUrl);\n $this->assertEquals($expected, $actual);\n }",
"public function testFcontentHasImage()\n {\n $imageLabel = ['lemon', 'apple'];\n $imageUrl = [];\n $expected = 0;\n $actual = contentHasImage($imageLabel, $imageUrl);\n $this->assertEquals($expected, $actual);\n }",
"function test_get_acf_url_field_throwing_exception_when_name_is_integer() {\n\n\t\t$plugin = acf_helper();\n\n\t\t$this->expectException( \\InvalidArgumentException::class );\n\t\t$this->expectExceptionMessage( 'It looks like $name parameter is not a type of string but \"integer\".' );\n\n\t\t$plugin['acf-helper/basic']->get_acf_url_field( 1, 'Foo' );\n\t}",
"public function testGetImage() {\n\n $image = $this->client->getObject(static::DCX_IMAGE_ID);\n\n $this->assertTrue($image instanceof Image);\n $this->assertSame(static::DCX_IMAGE_ID, $image->data()['id']);\n $this->assertSame('fotolia_160447209.jpg', $image->data()['filename']);\n $this->assertSame(TRUE, $image->data()['status']);\n }",
"public function testS4contentHasImage()\n {\n $imageLabel = '';\n $imageUrl = '';\n $expected = 0;\n $actual = contentHasImage($imageLabel, $imageUrl);\n $this->assertEquals($expected, $actual);\n }",
"public function identifyImageType(): int {}",
"public function testGetInvalidEventImageByEventImageImageId(): void {\n\n\t\t// grab a event image id that exceeds the maximum allowable event image id\n\t\t$eventImage = EventImage::getEventImageByEventImageImageId($this->getPDO(), OurVibeTest::INVALID_KEY);\n\t\t$this->assertCount(0,$eventImage);\n\t}",
"public function getImageIdByName($name = '') {\r\n\t\t$sql = \"SELECT id FROM `{$this->__tablename__}` WHERE name = ? LIMIT 1\";\r\n\t\t$sqlArr = array($name);\r\n\t\t\r\n\t\t$result = $this->db->getRow($sql, $sqlArr);\r\n\t\t\r\n\t\treturn empty($result['id']) ? false : (int)$result['id'];\r\n\t}",
"public function testImageCandidateFactoryWithInvalidDescriptor()\n {\n ImageCandidateFactory::createImageCandidateFromFileAndDescriptor('image.jpg', '124abc');\n }",
"function getImageProperty($name){}",
"public function testThrowsExceptionWhenTryingToGenerateImageIdentifierBasedOnAnEmptyLocalImage() {\n $path = __DIR__ . '/_files/emptyImage.png';\n $this->client->getImageIdentifier($path);\n }",
"public function testGetImageByImageFileName() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"image\");\n\n\t\t//Create a new Image and insert it into mySQL\n\t\t$image = new Image(null, $this->company->getCompanyId(), $this->VALID_IMAGEFILETYPE, $this->VALID_IMAGEFILENAME);\n\n\t\t$image->insert($this->getPDO());\n\n\t\t//Grab the data from mySQL and enforce the fields that match our expectations\n\t\t$results = Image::getImageByImageFileName($this->getPDO(), $this->company->getCompanyId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"image\"));\n\t\t$this->assertContainsOnlyInstancesOf(\"Edu\\\\Cnm\\\\CrumbTrail\\\\Image\", $results);\n\n\t\t//grab the results from the array and validate it\n\t\t$pdoImage = $results;\n\t}",
"public function check_image_exists($image_id);",
"function test_get_acf_file_field_throwing_exception_when_label_is_integer() {\n\n\t\t$plugin = acf_helper();\n\n\t\t$this->expectException( \\InvalidArgumentException::class );\n\t\t$this->expectExceptionMessage( 'It looks like $label parameter is not a type of string but \"integer\".' );\n\n\t\t$plugin['acf-helper/content']->get_acf_file_field( 'bar', 1 );\n\t}",
"public function testMimageShouldBeIncluded()\n {\n $imageLabel = 4;\n $imageUrl = [];\n $this->expectException(TypeError::class);\n $actual = imageShouldBeIncluded($imageLabel, $imageUrl);\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refuses a manager request | public function refuse(Resource $manager, $reason)
{
$this->emailRefusal($manager, $reason);
$this->delete($manager->id);
} | [
"private function doManagerLink() {\n\t\tif (VCDUtils::hasPermissionToChange($this->itemObj)) {\n\t\t\t$this->assign('isOwner', true);\n\t\t}\n\t}",
"protected function resetAvailableManagers()\n {\n $this->managerStatus[self::FLAG_AVAILABLE] = $this->managerList;\n $this->managerStatus[self::FLAG_UNAVAILABLE] = array();\n }",
"public function manager()\n {\n }",
"function maybe_disable_link_manager()\n {\n }",
"public function editManager()\n {\n $user = auth()->user();\n\n $property = Property::where('id', $this->request->property_id)->whereHas('information', function ($query) {\n $query->where('user_id', auth()->user()->id);\n })->firstOrFail();\n\n if ($property->verify_status != \"verified\") {\n return sendResponse(\"Please verify your property first.\", true, 200);\n }\n\n $manager = User::where('email', $this->request->manager_email)->whereHas('roles', function ($query) {\n $query->where('id', 1);\n })->first();\n\n if (!$manager) {\n return sendResponse(\"Please enter a valid manager email. There is no manager with this email.\", true, 200);\n }\n\n $propertyInfo = PropertyMoreInformation::where('property_id', $property->id)->firstOrFail();\n\n $alreadyManager = User::with([\n 'roles' => function ($query) {\n $query->where('id', 1);\n },\n ])->whereHas('roles', function ($query) {\n $query->where('id', 1);\n })->where('id', $propertyInfo->manager_id)->first();\n\n if ($manager->email == $alreadyManager->email) {\n return sendResponse($manager->name . ' Is Already A Manager', true, 200);\n }\n\n $propertyInfo->manager_id = $manager->id;\n $propertyInfo->isApprovedManager = 0;\n\n $propertyInfo->save();\n\n $managerRequest = ManagerRequest::where('user_id', $user->id)->where('property_id', $property->id)->first();\n\n if (is_null($managerRequest)) {\n $managerRequest = new ManagerRequest();\n }\n\n $managerRequest->property_id = $property->id;\n $managerRequest->user_id = $user->id;\n $managerRequest->manager_id = $manager->id;\n\n $managerRequest->request_type = $this->updateRequestType;\n $managerRequest->isCompleted = 0;\n\n $managerRequest->save();\n\n $user->sendManagerRequestNotificationsToAdmin($user, $this->updateRequestType, $property);\n\n return sendResponse($manager->name . ' Has Been Requested To Be New Manager.');\n }",
"public function giveManager(){\n $this->giveRole(self::ROLE_MANAGER);\n }",
"function managerAction() {\r\r\n switch($_REQUEST[$this->_request]) {\r\r\n case \"list\":\r\r\n $list = $this->_listFunction;\r\r\n $this->$list();\r\r\n break;\r\r\n \r\r\n case \"edit\":\r\r\n if(isset($_REQUEST[\"PHPWS_MAN_ITEMS\"]) &&\r\r\n\t is_array($_REQUEST[\"PHPWS_MAN_ITEMS\"]) &&\r\r\n\t sizeof($_REQUEST[\"PHPWS_MAN_ITEMS\"]) > 0) {\r\r\n\t$edit = $this->_editFunction;\r\r\n\t$this->$edit($_REQUEST[\"PHPWS_MAN_ITEMS\"]);\r\r\n } else {\r\r\n\t$list = $this->_listFunction;\r\r\n\t$this->$list();\r\r\n }\r\r\n break;\r\r\n\r\r\n case \"view\":\r\r\n if(isset($_REQUEST[\"PHPWS_MAN_ITEMS\"]) && \r\r\n\t is_array($_REQUEST[\"PHPWS_MAN_ITEMS\"]) &&\r\r\n\t sizeof($_REQUEST[\"PHPWS_MAN_ITEMS\"]) > 0) {\r\r\n\t$view = $this->_viewFunction;\r\r\n\t$this->$view($_REQUEST[\"PHPWS_MAN_ITEMS\"]);\r\r\n } else {\r\r\n\t$list = $this->_listFunction;\r\r\n\t$this->$list();\r\r\n\t}\r\r\n break;\r\r\n \r\r\n case \"hide\":\r\r\n $this->_doMassUpdate(\"hidden\", 1);\r\r\n $this->_updateFatcat(FALSE);\r\r\n $list = $this->_listFunction;\r\r\n $this->$list();\r\r\n break;\r\r\n \r\r\n case \"show\":\r\r\n $this->_doMassUpdate(\"hidden\", 0);\r\r\n $this->_updateFatcat(TRUE);\r\r\n $list = $this->_listFunction;\r\r\n $this->$list();\r\r\n break;\r\r\n\t\r\r\n case \"approve\":\r\r\n $this->_doMassUpdate(\"approved\", 1);\r\r\n $this->_updateFatcat(TRUE);\r\r\n $list = $this->_listFunction;\r\r\n $this->$list();\r\r\n break;\r\r\n \r\r\n case \"delete\":\r\r\n if(is_array($_REQUEST[\"PHPWS_MAN_ITEMS\"]) && sizeof($_REQUEST[\"PHPWS_MAN_ITEMS\"]) > 0) {\r\r\n\t$delete = $this->_deleteFunction;\r\r\n\t$this->$delete($_REQUEST[\"PHPWS_MAN_ITEMS\"]);\r\r\n } else {\r\r\n\t$list = $this->_listFunction;\r\r\n\t$this->$list();\r\r\n }\r\r\n break;\r\r\n }\r\r\n }",
"private function checkManager(): void\n {\n if ($this->manager === null || $this->manager->isOpen()) {\n return;\n }\n\n $this->repository = null;\n $manager = $this->registry->getManagerForClass($this->entityClass) ?? $this->registry->getManager();\n\n if (! $manager instanceof EntityManager) {\n throw new RuntimeException(sprintf('Registry returned %s.', get_class($manager)));\n }\n\n $this->manager = $manager;\n\n if ($this->manager->isOpen()) {\n return;\n }\n\n foreach ($this->registry->getManagers() as $name => $object) {\n if ($object === $this->manager) {\n $manager = $this->registry->resetManager($name);\n\n if (! $manager instanceof EntityManager) {\n throw new RuntimeException(sprintf('Registry returned %s.', get_class($manager)));\n }\n\n $this->manager = $manager;\n\n break;\n }\n }\n }",
"public function onManagerStop()\n {\n }",
"public function logManagerAction()\n {\n $this->modx->logManagerAction('remove_resource', $this->resource->get('class_key'), $this->resource->get('id'));\n }",
"public function manageAllRequests() { \n $param = isset($_GET['param']) ? $_GET['param'] : NULL;\n $id = isset($_GET['id']) ? $_GET['id'] : NULL;\n try {\n if (empty($param)) {\n $this->listAll();\n } elseif ($param == 'add') { \n $this->add();\n } elseif ($param == 'edit') {\n $this->edit($id);\n } elseif ($param == 'delete') {\n $this->delete($id);\n } else {\n throw new Exception(\"Invalid arguments\");\n }\n } catch (Exception $e) {\n echo 'Error Message: ' . $e->getMessage();\n }\n }",
"function cancel() {\n $model = $this->getModel('Request', 'Easysdi_shopModel');\n $id = JFactory::getApplication()->getUserState('com_easysdi_shop.edit.request.id');\n $model->checkin($id);\n $this->setRedirect(JRoute::_('index.php?option=com_easysdi_shop&view=requests', false));\n }",
"function request_moderation() {\n\tglobal $mybb, $db;\n\n\tif($mybb->settings['expmanager_usenotifications']) {\n\t\tif(isset($mybb->input['userid'])) {\n\t\t\t// Create a notification for moderators!\n\t\t\t$db->insert_query('expmodrequests', array('uid' => (int)$mybb->input['userid']));\n\t\t}\n\t}\n}",
"public function setDefaultRequest() {\n }",
"private function markRequestAsRevised(): void\n {\n $this->requestIsRevised = true;\n }",
"public function fireManagerAssignedEvent()\n {\n $this->fireModelEvent('managerAssigned', false);\n }",
"public function handle_override_changeset_lock_request() {}",
"public function forbidOperation();",
"public function handlerNeedsRequest(): bool;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to break ties according to Rule A8.1 under the RRS It will also detect if ties still exist and flag them accordingly parameters: array $class_data Array of class_data objects array $ties An Array of indices that identify rows that are tied. Returns array An array of class_data objects Modifies: [n]>tie_fixed boolean false if tie(s) remain(s) string If tie has been broken under this rule [n]>position Inserts the new position for elements and sorts the array accordingly. | function a8_1($class_data, $ties){
// First get the race results for each tied boat
foreach ($ties as $t) {
$positions[] = $class_data[$t]->position;
$temp = $class_data[$t]->race_results;
foreach ($temp as $race) {
if($race->discarded == 0){
$races[$t][] = intval($race->points);
}
}
// Using sort because we want to lose the array keys. Otherwise two equal sets of data could be considered inequal
sort($races[$t]);
}
asort($positions);
asort($races);
$boat_ids_by_rank = array_keys($races);
// $this->ci->firephp->log($boat_ids_by_rank, 'Boat IDs by rank');
for($i = 0; $i < sizeof($ties); $i++){
$boat_id = $boat_ids_by_rank[$i];
// $this->ci->firephp->log('Comparing ' . $class_data[$boat_id]->name);
$other_boats = $boat_ids_by_rank;
unset($other_boats[$i]);
$class_data[$boat_id]->position = $positions[$i];
$tie_flag = false;
foreach($other_boats as $ob){
if($races[$boat_id] === $races[$ob]){
// $this->ci->firephp->log('Tied with ' . $class_data[$ob]->name);
$tie_flag = true;
}
}
if($tie_flag){
$class_data[$boat_id]->tie_fixed = false;
}else{
$class_data[$boat_id]->tie_fixed = 'Tie breaker under rule A8.1';
}
}
// Sort the class_data based on the new positions
usort($class_data, 'cmp_position');
return $class_data;
} | [
"function getTies($date, $place, $step)\r\n\t{\n\t\t$place = addslashes($place);\n\r\n\t\t$utd = new utdate();\n\t\t$utd->setFrDate($date);\r\n\t\t// Firt select the ties of the day\r\n\t\t$eventId = utvars::getEventId();\r\n\t\t$fields = array('tie_id', 'tie_schedule', 'team_id',\r\n\t\t 'team_name', 'asso_logo', 't2t_scoreW', 'team_stamp');\r\n\t\t$tables = array('teams', 't2t', 'ties', 'draws', 'rounds',\r\n\t\t 'assocs', 'a2t');\r\n\t\t$where = \"t2t_teamId = team_id\".\r\n\t\" AND t2t_tieId = tie_id\".\r\n\t\" AND tie_roundId = rund_id\".\r\n\t\" AND rund_drawId = draw_id\".\r\n\t\" AND draw_eventId = $eventId\".\r\n\t\" AND asso_id = a2t_assoId\".\r\n\t\" AND a2t_teamId = team_id\";\r\n\t\tif ($date != -1)\r\n\t\t$where .= \" AND date(tie_schedule) ='\". $utd->getIsoDate() .\"'\";\r\n\t\tif ($place != -1)\r\n\t\t$where .= \" AND tie_place='$place'\";\r\n\t\tif ($step != -1)\r\n\t\t$where .= \" AND tie_step='$step'\";\r\n\t\tif ($date == '')\r\n\t\t$where .= \" OR tie_schedule is null\";\r\n\t\t$order = \"tie_schedule, tie_id, t2t_posTie\";\r\n\t\t$res = $this->_select($tables, $fields, $where, $order);\r\n\t\tif (!$res->numRows())\r\n\t\t{\r\n\t $infos['errMsg'] = \"msgNoTies\";\r\n\t return $infos;\r\n\t\t}\r\n\r\n\t\t$ties = array();\r\n\t\t$tieId=-1;\r\n\t\twhile ($tmp = $res->fetchRow(DB_FETCHMODE_ASSOC))\r\n\t\t{\r\n\t $tmp['asso_logo'] = utimg::getPathFlag($tmp['asso_logo']);\r\n\t if($tieId != $tmp['tie_id'])\r\n\t {\r\n\t \tif($tieId != -1)\r\n\t \t$ties[] = $tie;\r\n\t \t$tie = $tmp;\r\n\t \t$tie['team_name'] .= \"(\".$tmp['team_stamp'].\")\";\r\n\t \t$tie['team_id2'] = -1;\r\n\t \t$tie['team_name2'] = '';\r\n\t \t$tie['team_stamp2'] = '';\n\t \t$tie['asso_logo2'] = '';\r\n\t \t$tie['t2t_scoreW2'] = 0;\r\n\t \t$tieId = $tmp['tie_id'];\r\n\t }\r\n\t else\r\n\t {\r\n\t \t$tie['team_id2'] = $tmp['team_id'];\r\n\t \t$tie['team_name2'] = $tmp['team_name']. \"(\".\r\n\t \t$tmp['team_stamp'].\")\";\r\n\t \t$tie['team_stamp2'] = $tmp['team_stamp'];\n\t \t$tie['asso_logo2'] = $tmp['asso_logo'];\r\n\t \t$tie['t2t_scoreW2'] = $tmp['t2t_scoreW'];\r\n\t }\r\n\t\t}\r\n\t\t$ties[] = $tie;\r\n\t\treturn $ties;\r\n\t}",
"function getDateTies()\r\n\t{\r\n\t\t$date = new utdate();\r\n\t\t// Firt select the ties of the day\r\n\t\t$eventId = utvars::getEventId();\r\n\r\n\t\t$fields = array('tie_schedule');\r\n\t\t$tables = array('ties', 'draws', 'rounds');\r\n\t\t$where = \"tie_roundId = rund_id\".\r\n\t\" AND rund_drawId = draw_id\".\r\n\t\" AND tie_schedule != ''\".\r\n\t\" AND tie_isBye = 0\".\r\n\t\" AND draw_eventId = $eventId\";\r\n\t\t$order = \"tie_schedule\";\r\n\t\t$res = $this->_select($tables, $fields, $where, $order);\r\n\r\n\t\tif (!$res->numRows())\r\n\t\t{\r\n\t $infos['errMsg'] = \"msgNoDate\";\r\n\t return $infos;\r\n\t\t}\r\n\n\t\t$utd = new utdate();\r\n\t\twhile ($tmp = $res->fetchRow(DB_FETCHMODE_ORDERED))\r\n\t\t{\n\t\t\t$utd->setIsoDateTime($tmp[0]);\n\t\t\t$date = $utd->getDate();\r\n\t\t\t$dates[$date] = $date;\r\n\t\t}\r\n\t\t$dates[-1] = '-----';\r\n\t\treturn $dates;\r\n\t}",
"function breakingRecords($scores)\n{\n $size = count($scores);\n $min = $scores[0];\n $max = $scores[0];\n $index = 1;\n $min_r = 0;\n $max_r = 0;\n $board = [];\n // base case\n $board[0]['game'] = 0;\n $board[0]['score'] = $scores[0];\n $board[0]['max'] = $max;\n $board[0]['min'] = $min;\n while ($index < $size) {\n $min = min($min, $scores[$index]);\n $max = max($max, $scores[$index]);\n $board[$index]['game'] = $index;\n $board[$index]['score'] = $scores[$index];\n $board[$index]['max'] = $max;\n $board[$index]['min'] = $min;\n if ($min < $board[$index - 1]['min']) {\n $min_r++;\n }\n if ($max > $board[$index - 1]['max']) {\n $max_r++;\n }\n $index++;\n }\n\n return [$max_r, $min_r];\n}",
"function breakingRecords($score) {\n \n//the counter for broken records\n $posCount = 0;\n $negCount = 0;\n\t\n//Initialise the first record \n $posRec = $score[0];\n $negRec = $score[0];\n \n for ($i = 0; $i < sizeof($score); $i++) {\n\n if ($score[$i] > $posRec) {\n $posCount++;\n $posRec = $score[$i];\n \n } elseif ($score[$i] < $negRec) {\n $negCount++;\n $negRec = $score[$i];\n }\n } echo $posCount . \" \" . $negCount;\n}",
"function _updateTie($infos)\r\n\t{\r\n\t\t$data = $infos;\r\n\t\tunset($infos['tie_catage']);\n\t\tif ($infos['tie_id'] == -1)\r\n\t\t{\r\n\t\t\t/* Create a tie */\r\n\t\t\tunset($infos['tie_id']);\r\n\t\t\t$res = $this->_insert('ties', $infos);\r\n\t\t\t$data['tie_id'] = $res;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/* Updating the tie */\r\n\t\t\t$where = \"tie_id =\".$infos['tie_id'];\r\n\t\t\t$res = $this->_update('ties', $infos, $where);\r\n\t\t}\r\n\t\t$res = $this->_matchForTie($data);\r\n\t\tif (isset($res['errMsg']))\r\n\t\treturn $err;\r\n\r\n\t\treturn true;\r\n\t}",
"public function breakTies(TieBreakingPairComparator $tieBreakingPairComparator) : PairList\n {\n $initial = [];\n $result = array_reduce(\n $this->values,\n function (array $carry, PairList $current) use ($tieBreakingPairComparator) {\n $currentValues = $current->toArray();\n usort($currentValues, $tieBreakingPairComparator);\n array_push($carry, ...$currentValues);\n return $carry;\n },\n $initial\n );\n $resultPairList = new PairList(...$result);\n return $resultPairList;\n }",
"protected function fixFinishStatusBasedOnLaps(array $sessions)\n {\n foreach ($sessions as $session)\n {\n // Is race result\n if ($session->getType() === Session::TYPE_RACE)\n {\n // Mark no finish status when participant has not completed atleast\n // 50% of total laps\n foreach ($session->getParticipants() as $participant)\n {\n // Has no laps\n if ($participant->getNumberOfCompletedLaps() === 0)\n {\n // Always set DNF\n $participant->setFinishStatus(Participant::FINISH_DNF);\n }\n // Finished normally and matches 50% rule\n elseif ($this->finish_status_none_50percent_rule AND\n $participant->getFinishStatus() === Participant::FINISH_NORMAL AND\n (! $participant->getNumberOfCompletedLaps() OR\n 50 > ($participant->getNumberOfCompletedLaps() /\n ($session->getLastedLaps() / 100))))\n {\n $participant->setFinishStatus(Participant::FINISH_NONE);\n }\n }\n }\n }\n }",
"function lesson_unseen_question_jump($lesson, $user, $pageid) {\n global $DB;\n\n // get the number of retakes\n if (!$retakes = $DB->count_records(\"lesson_grades\", array(\"lessonid\"=>$lesson->id, \"userid\"=>$user))) {\n $retakes = 0;\n }\n\n // get all the lesson_attempts aka what the user has seen\n if ($viewedpages = $DB->get_records(\"lesson_attempts\", array(\"lessonid\"=>$lesson->id, \"userid\"=>$user, \"retry\"=>$retakes), \"timeseen DESC\")) {\n foreach($viewedpages as $viewed) {\n $seenpages[] = $viewed->pageid;\n }\n } else {\n $seenpages = array();\n }\n\n // get the lesson pages\n $lessonpages = $lesson->load_all_pages();\n\n if ($pageid == LESSON_UNSEENBRANCHPAGE) { // this only happens when a student leaves in the middle of an unseen question within a branch series\n $pageid = $seenpages[0]; // just change the pageid to the last page viewed inside the branch table\n }\n\n // go up the pages till branch table\n while ($pageid != 0) { // this condition should never be satisfied... only happens if there are no branch tables above this page\n if ($lessonpages[$pageid]->qtype == LESSON_PAGE_BRANCHTABLE) {\n break;\n }\n $pageid = $lessonpages[$pageid]->prevpageid;\n }\n\n $pagesinbranch = $this->get_sub_pages_of($pageid, array(LESSON_PAGE_BRANCHTABLE, LESSON_PAGE_ENDOFBRANCH));\n\n // this foreach loop stores all the pages that are within the branch table but are not in the $seenpages array\n $unseen = array();\n foreach($pagesinbranch as $page) {\n if (!in_array($page->id, $seenpages)) {\n $unseen[] = $page->id;\n }\n }\n\n if(count($unseen) == 0) {\n if(isset($pagesinbranch)) {\n $temp = end($pagesinbranch);\n $nextpage = $temp->nextpageid; // they have seen all the pages in the branch, so go to EOB/next branch table/EOL\n } else {\n // there are no pages inside the branch, so return the next page\n $nextpage = $lessonpages[$pageid]->nextpageid;\n }\n if ($nextpage == 0) {\n return LESSON_EOL;\n } else {\n return $nextpage;\n }\n } else {\n return $unseen[rand(0, count($unseen)-1)]; // returns a random page id for the next page\n }\n}",
"public function filter_classes($row_classes, $table_id, $row_cells, $row_idx, $row_data) {\n\t if ( $this->odd_even === 'odd' ) {\n $row_classes = str_replace('even', 'odd', $row_classes);\n } else {\n $row_classes = str_replace('odd', 'even', $row_classes);\n }\n\n\t if ( '#rowspan#' != $row_data[ 0 ] ) {\n if ( $this->odd_even === 'odd' ) {\n $this->odd_even = 'even';\n } else {\n $this->odd_even = 'odd';\n }\n\t }\n\t \n\t return $row_classes;\n }",
"function _updateKo($tieId)\n\t{\n\t\t$db = $this->_db;\n\n\t\t// search the winner of the tie\n\t\t$fields = array('t2t_teamId', 'tie_posRound', 'rund_id');\n\t\t$tables = array('t2t', 'ties', 'rounds');\n\t\t$where = \"t2t_tieId=$tieId\".\n\t\" AND t2t_tieId=tie_id\".\n\t\" AND tie_roundId=rund_id\".\n\t\" AND (t2t_result=\".WBS_TIE_WIN.\n\t\" OR t2t_result=\".WBS_TIE_WINWO.\")\".\n\t\" AND rund_type=\".WBS_TEAM_KO;\n\t\t$res = $db->select($tables, $fields, $where);\n\t\tif (!$db->numRows($res)) return;\n\t\t$data = $res->fetch(PDO::FETCH_ASSOC);\n\n\t\t// Updating relation between pairs and match for winner\n\t\t// Pas de mise a jour si c'est la finale\n\t\tif (!$data['tie_posRound']) return;\n\n\t\t// Next tie\n\t\t$tiePosRound = intval(($data['tie_posRound']-1)/2);\n\t\t// Position of the team in the next tie\n\t\t$teamPosTie = ($data['tie_posRound']%2) ? WBS_TEAM_TOP:WBS_TEAM_BOTTOM;;\n\t\t$teamId = $data['t2t_teamId'];\n\t\t$roundId = $data['rund_id'];\n\n\t\t$fields = array('t2t_id', 'tie_id');\n\t\t$tables = array('t2t', 'ties');\n\t\t$where = \"t2t_tieId=tie_id\".\n\t\" AND tie_roundId = $roundId\".\n\t\" AND tie_posRound = $tiePosRound\".\n\t\" AND t2t_posTie=$teamPosTie\";\n\t\t$res = $db->select($tables, $fields, $where);\n\t\tif ($db->numRows($res))\n\t\t{\n\t\t\t$data = $res->fetch(PDO::FETCH_ASSOC);\n\t\t\t$fields = array();\n\t\t\t$fields['t2t_teamId'] = $teamId;\n\t\t\t$where = \"t2t_id = \".$data['t2t_id'];\n\t\t\t$res = $db->update('t2t', $fields, $where);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Search the tie Id\n\t\t\t$fields = array('tie_id');\n\t\t\t$tables = array('ties');\n\t\t\t$where = \"tie_roundId = $roundId\".\n\t \" AND tie_posRound = $tiePosRound\";\n\t\t\t$res = $db->select($tables, $fields, $where);\n\t\t\t$data = $res->fetch(PDO::FETCH_ASSOC);\n\t\t\t$fields = array();\n\t\t\t$fields['t2t_teamId'] = $teamId;\n\t\t\t$fields['t2t_tieId'] = $data['tie_id'];\n\t\t\t$fields['t2t_posTie'] =$teamPosTie;\n\t\t\t$fields['t2t_result'] = WBS_TIE_NOTPLAY;\n\n\t\t\t$res = $db->insert('t2t', $fields);\n\t\t}\n\t\treturn;\n\t}",
"protected function rankByLastRace(Array $ranks, FullRegatta $reg, $races, $race_index = null) {\n\n $numRanks = count($ranks);\n if ($numRanks < 2)\n return $ranks;\n\n if ($race_index === null)\n $race_index = count($races);\n $race_index--;\n if ($race_index < 0) {\n // Let's go alphabetical\n foreach ($ranks as $rank)\n $rank->explanation = \"Alphabetical\";\n usort($ranks, \"Rank::compareTeam\");\n return $ranks;\n }\n\n // Get the last race scores. If combined scoring, remove other\n // races with the same number.\n $scoreList = array();\n $lastRace = $races[$race_index];\n foreach ($ranks as $rank) {\n $finish = $reg->getFinish($lastRace, $rank->team);\n $scoreList[] = $finish->score;\n $rank->explanation = sprintf(\"According to last race (%s)\", $lastRace);\n }\n array_multisort($scoreList, $ranks);\n\n // Check for more ties\n $ranksCopy = $ranks;\n $numTeams = count($ranks);\n $i = 0;\n $originalSpot = 0;\n while ($i < $numTeams) {\n\n $thisScore = $scoreList[$i];\n $tiedRanks = array();\n $tiedRanks[] = $ranksCopy[$i];\n $i++;\n while ($i < $numTeams) {\n $nextScore = $scoreList[$i];\n if ($nextScore != $thisScore)\n break;\n $tiedRanks[] = $ranksCopy[$i];\n\n // Update variables\n $thisScore = $nextScore;\n $i++;\n }\n\n // Resolve ties\n $tiedRanks = $this->rankByLastRace($tiedRanks, $reg, $races, $race_index);\n foreach ($tiedRanks as $rank)\n $ranks[$originalSpot++] = $rank;\n }\n return $ranks;\n }",
"public function detectWorstScore(array $scores)\n {\n $worstScore = Payone_Api_Enum_AddressCheckScore::GREEN;\n if (in_array(Payone_Api_Enum_AddressCheckScore::RED, $scores, true)) {\n $worstScore = Payone_Api_Enum_AddressCheckScore::RED;\n }\n elseif (in_array(Payone_Api_Enum_AddressCheckScore::YELLOW, $scores, true)) {\n $worstScore = Payone_Api_Enum_AddressCheckScore::YELLOW;\n }\n\n return $worstScore;\n }",
"public function tieBreaker($player_1_hand,$player_2_hand,$score_player_1,$score_player_2)\n {\n foreach ($player_1_hand as $key => $card){\n if($card > $player_2_hand[$key]){\n $win_array = [\n 'round_id' => $this->round_id,\n 'user_id' => Auth::user()->id,\n 'score_player_1' => $score_player_1,\n 'score_player_2' => $score_player_2,\n ];\n DB::table('wins')->insert([\n $win_array\n ]);\n return true;\n }\n }\n return false;\n }",
"public function setTieBreaker($tieBreaker) {}",
"public function rank(FullRegatta $reg, $races = null) {\n $divisions = array();\n foreach ($reg->getDivisions() as $div)\n $divisions[(string)$div] = $div;\n\n // 1. Create associative array of division => list of races,\n // depending on $races argument\n if ($races === null) {\n $races = array();\n foreach ($divisions as $id => $div)\n $races[$id] = $reg->getScoredRaces($div);\n }\n else {\n $race_nums = array();\n foreach ($races as $race)\n $race_nums[$race->number] = $race;\n\n $races = array();\n foreach ($divisions as $id => $div) {\n $races[$id] = array();\n foreach ($race_nums as $num => $race)\n $races[$id][] = $reg->getRace($div, $num);\n }\n }\n\n // 2. Track the division for each rank\n $ranks = array();\n foreach ($races as $id => $list) {\n foreach ($reg->getTeamTotals($list) as $rank) {\n $rank->division = $divisions[$id];\n $penalty = $reg->getDivisionPenalty($rank->team, $divisions[$id]);\n if ($penalty !== null) {\n $rank->score += $penalty->amount;\n }\n $ranks[] = $rank;\n }\n }\n\n // sort the ranks according to score\n usort($ranks, 'Rank::compareScore');\n\n // 3. Settle ties\n $newOrder = array();\n $numTeams = count($ranks);\n $i = 0;\n while ($i < $numTeams) {\n $tiedRanks = array();\n $tiedRanks[] = $ranks[$i];\n\n $aScore = $ranks[$i]->score;\n $i++;\n while ($i < $numTeams) {\n $nextScore = $ranks[$i]->score;\n if ($nextScore != $aScore)\n break;\n $tiedRanks[] = $ranks[$i];\n $i++;\n }\n\n // Head to head ties\n if (count($tiedRanks) > 1)\n $tiedRanks = $this->settleHeadToHead($tiedRanks, $reg, $races); // @TODO\n foreach ($tiedRanks as $rank)\n $newOrder[] = $rank;\n }\n\n // Add the last team, if necessary\n if (count($newOrder) < $numTeams)\n $newOrder[] = $tiedRanks[$numTeams - 1];\n\n // assign rank number successively\n foreach ($newOrder as $i => $rank)\n $rank->rank = ($i + 1);\n return $newOrder;\n }",
"public function setTieBreaker($tieBreaker){}",
"public function testNotEnoughScores() {\n $scores = array(\n 1 => array( 'date' => '2013/01/02', 'classification' => 'second',),\n 2 => array( 'date' => '2013/01/03', 'classification' => 'second',),\n 3 => array( 'date' => '2013/01/04', 'classification' => 'second',),\n 4 => array( 'date' => '2013/06/01', 'reassessment' => 'end_of_season',),\n 5 => array( 'date' => '2014/01/02', 'classification' => '',), # unclassified scores don't count\n 6 => array( 'date' => '2014/01/03', 'classification' => '',),\n 7 => array( 'date' => '2014/01/04', 'classification' => '',),\n 8 => array( 'date' => '2014/06/01', 'reassessment' => 'end_of_season',),\n );\n $results = $this->feedIt($scores);\n $expected = array(\n 3 => array( 'new_classification' => 'second' ),\n 4 => array( 'new_classification' => 'second' ),\n 8 => array( 'new_classification' => 'unclassified' ),\n );\n $this->assertEquals($expected, $results);\n }",
"private function replenishGapsFromWhites()\n\t{\n\t\t$maximal_blacks_number = $this->checkerboard->maximalBlacksNumber();\n\t\t$vacancies_number = $this->gaps_number - $maximal_blacks_number;\n\t\t$whites_indexes = $this->checkerboard->whitesIndexes();\n\t\t\n\t\twhile ($vacancies_number-- > 0)\n\t\t{\n\t\t\t$white_index = static::drawAndRemoveFromArray($whites_indexes);\n\t\t\tarray_push($this->gaps_indexes, $white_index);\n\t\t}\n\t}",
"private function findSeats(int $sought)\n {\n if ($sought > $this->cols or $this->sold_out) {\n return null;\n }\n\n // Traverse each row, stage to rear.\n // Record blocks of unreserved consecutive seats.\n $candidates = array();\n for ($row = 1; $row <= $this->rows; $row++) {\n $seats_to_reserve = array();\n for ($col = 1; $col <= $this->cols; $col++) {\n $seat = array($row,$col);\n // Do not take someone else's seat\n if ($this->reserved($seat)) {\n $seats_to_reserve = array();\n } else {\n $seats_to_reserve[] = $seat;\n }\n // Have we found enough seats?\n if (count($seats_to_reserve) == $sought)\n {\n // Measure how far from stage center\n $taxi_left = $this->getTaxi($seats_to_reserve[0]);\n end($seats_to_reserve);\n $r_idx = key($seats_to_reserve);\n reset($seats_to_reserve);\n $taxi_right = $this->getTaxi($seats_to_reserve[$r_idx]);\n $taxi_dist = $taxi_right >= $taxi_left ? $taxi_right : $taxi_left;\n // Record these seats for later\n if (!array_key_exists($taxi_dist, $candidates)) {\n $candidates[$taxi_dist] = $seats_to_reserve;\n }\n // Make count($seats_to_reserve) != sought\n array_shift($seats_to_reserve);\n }\n }\n }\n\n // Take the best group of seats (if any) and reserve them.\n if ($candidates) {\n $reservation_list = $candidates[min(array_keys($candidates))];\n foreach ($reservation_list as $res) {\n // NB: if the SeatingChart object is presisted to a database,\n // these reservations must be inside a transaction\n $this->individual($res);\n }\n end($reservation_list);\n $r_idx = key($reservation_list);\n reset($reservation_list);\n return array($reservation_list[0],$reservation_list[$r_idx]);\n } else {\n return null;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.