query
stringlengths 10
8.11k
| document
stringlengths 17
398k
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
Method to set the value of field werer_cd | public function setWererCd($werer_cd)
{
$this->werer_cd = $werer_cd;
return $this;
} | [
"function set_value() {\n //\n //Get the record for the water wreading\n $record = $this->wreading->driver;\n //\n //Get the subfields of this field\n $subfields = $record->fields[$this->name]->subfields;\n //\n //Let p be the primary key field name\n $p = $subfields->primary->name;\n //\n //Set the primary key field property\n if (isset($record->values->$p)) {\n $this->primarykey = $record->values->$p;\n }\n //\n //Let o be the output field\n $o = $subfields->output->name;\n //\n //Set the value component of teh foreign kety as the output subfeld\n if (isset($record->values->$o)) {\n //\n //Set teh value of this field\n $this->value = $record->values->$o;\n }\n }",
"public function getCdFornecedor()\n {\n return $this->cd_fornecedor;\n }",
"public function setErc($erc) {\n\t\t$this->erc = intval($erc);\n\t}",
"public function setCdFornecedor($cd_fornecedor)\n {\n $this->cd_fornecedor = $cd_fornecedor;\n\n return $this;\n }",
"public function testSetCodeChantier() {\n\n $obj = new BonTravPrev();\n\n $obj->setCodeChantier(\"codeChantier\");\n $this->assertEquals(\"codeChantier\", $obj->getCodeChantier());\n }",
"function setERCId($ercId) {\n\t\treturn $this->setData('ercId', $ercId);\n\t}",
"public function testSetCodeChantier() {\n\n $obj = new DevisCommercialEntetes();\n\n $obj->setCodeChantier(\"codeChantier\");\n $this->assertEquals(\"codeChantier\", $obj->getCodeChantier());\n }",
"public function testSetCodeChantierRempl() {\n\n $obj = new AbsEmpRemplacants();\n\n $obj->setCodeChantierRempl(\"codeChantierRempl\");\n $this->assertEquals(\"codeChantierRempl\", $obj->getCodeChantierRempl());\n }",
"public function setWhseCd($whse_cd)\n {\n $this->whse_cd = $whse_cd;\n\n return $this;\n }",
"private function _setDexterity($val) {\n\t\t$this->dexterity = $val;\n\t}",
"public function setDNID($value);",
"public function testSetCodeChantier() {\n\n $obj = new Tarifs();\n\n $obj->setCodeChantier(\"codeChantier\");\n $this->assertEquals(\"codeChantier\", $obj->getCodeChantier());\n }",
"public function testSetCodeChantier() {\n\n $obj = new FichesControlesEntetes();\n\n $obj->setCodeChantier(\"codeChantier\");\n $this->assertEquals(\"codeChantier\", $obj->getCodeChantier());\n }",
"function setDW($dw) { \n $this->dw = $dw; \n return $this; \n }",
"public function testSetCodeChantier() {\n\n $obj = new ChantiersFrequencesControlesQualite();\n\n $obj->setCodeChantier(\"codeChantier\");\n $this->assertEquals(\"codeChantier\", $obj->getCodeChantier());\n }",
"public function getChoferId()\n {\n return $this->chofer_id;\n }",
"public function setWard($ward)\n {\n $this->ward = $ward;\n }",
"function setVoucher( &$value )\r\n {\r\n if ( get_class ( $value ) )\r\n {\r\n $this->VoucherID = $value->id();\r\n }\r\n else if ( is_numeric ( $value ) )\r\n {\r\n $this->VoucherID = $value;\r\n }\r\n }",
"public function testSetCodeChantier() {\n\n $obj = new BonsTravauxInterventions();\n\n $obj->setCodeChantier(\"codeChantier\");\n $this->assertEquals(\"codeChantier\", $obj->getCodeChantier());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the value of field module_state | public function getModuleState()
{
return $this->module_state;
} | [
"function getState() {\n return $this->getFieldValue('state');\n }",
"public function GetModuleColorEditState()\n {\n $aModuleStateCodeColorList = array('ne' => 'EB3335', 'na' => 'FAA11C', 'ea' => '78C043');\n $sModuleState = $this->GetModuleEditState();\n\n return $aModuleStateCodeColorList[$sModuleState];\n }",
"public function getState()\n {\n return $this->fv_state;\n }",
"public function get_state() {\n return $this->curr_state;\n }",
"public function state()\n {\n return $this->_state;\n }",
"public function getState()\n {\n return $this->state->name;\n }",
"public function getState (){\n $this->debug->log(\"getState()\");\n $res = $this->getBinaryState();\n\n if ($res == \"1\")\n return \"on\";\n else\n return \"off\";\n }",
"function getState() {\n return $this->getParam(STATE);\n }",
"public function getState()\n {\n return $this->data['ik_payment_state'];\n }",
"public function getState();",
"public function getGroupState(){\n return($this->groupState);\n }",
"public function getPaymentState () {\n\t$data = $this->paymentState;\n\t return $data;\n}",
"public function getstate() {\n /**\n * Returning the resource Model for 'state'\n */\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'state' );\n }",
"public function getPBXState()\n {\n return $this->getKey('PBXState');\n }",
"public static function getVersionState() : string{\n\t\treturn FW_Version::$_state;\n\t}",
"public function getModuleStatus()\n {\n return $this->configProvider->getModuleStatus();\n }",
"public function getImageState() \n {\n return $this->_fields['ImageState']['FieldValue'];\n }",
"public function getUserState(){\n return($this->userState);\n }",
"public function getCmState()\n {\n return $this->cm_state;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a form to delete a departamento entity. | private function createDeleteForm(Departamento $departamento)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('departamento_delete', array('id' => $departamento->getDepId())))
->setMethod('DELETE')
->getForm()
;
} | [
"private function createDeleteForm(Departamento $departamento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('departamento_delete', array('id' => $departamento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(AvDepartamento $avDepartamento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('avdepartamento_delete', array('id' => $avDepartamento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm( OrdenDePago $ordenDePago ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->set( $this->generateUrl( 'orden_de_pago_delete', array( 'id' => $ordenDePago->getId() ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->getForm();\n\t}",
"private function createDeleteForm(Equipamento $equipamento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cadastro_equipamento_delete', array('id' => $equipamento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(DatParteDesvio $datParteDesvio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('partedesvio_delete', array('id' => $datParteDesvio->getIdparte())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Dependente $dependente)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dependente_delete', array('id' => $dependente->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('addepartamentos_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm(DetallePedido $detallePedido)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detallepedido_delete', array('id' => $detallePedido->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Pedido $pedido)\r\n {\r\n \r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('pedido_delete', array('id' => $pedido->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(DatPeriodos $datPeriodo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('datperiodos_delete', array('id' => $datPeriodo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(OrdenDeTrabajo $ordenDeTrabajo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('ordendetrabajo_delete', ['id' => $ordenDeTrabajo->getId()]))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Comunicado $comunicado)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('comunicado_delete', array('id' => $comunicado->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(TbTipoAtendimento $tbTipoAtendimento)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipoatendimento_delete', array('id' => $tbTipoAtendimento->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(TipoEquipo $tipoEquipo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('tipoequipo_delete', array('id' => $tipoEquipo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Cartaporte $cartaporte)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cartaporte_delete', array('id' => $cartaporte->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('box_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(CfgTipoVehiculo $cfgTipoVehiculo)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('cfgtipovehiculo_delete', array('id' => $cfgTipoVehiculo->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(MapDepartment $mapDepartment) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('mapdepartment_delete', array('id' => $mapDepartment->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ metodo per visualizzare la pagina di creazione watchlist | static function crea(){
if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');
else{
session_start();
$_SESSION['location']='/Watchlist/crea';
$serie=FPersistentManager::AllSeries(null);
$view = new VWatchlist();
$view->crea($_SESSION['utente'],$serie);
}
} | [
"public function listAction()\n {\n $this->_buildShell->writeShellBuildUrls();\n }",
"public function watch()\r\n {\r\n }",
"public function addwatchAction()\n {\n $type = ucfirst($this->_getParam('type'));\n $id = $this->_getParam('id');\n $user = $this->_getParam('userid');\n if (!$user) {\n $user = za()->getUser();\n }\n\n $this->notificationService->createWatch($user, $id, $type); \n }",
"function watchfolders() {\r\n $this->name=\"watchfolders\";\r\n $this->title=\"<#LANG_MODULE_WATCHFOLDERS#>\";\r\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\r\n $this->checkInstalled();\r\n}",
"public function display_watch_list()\n {\n $animes = DB::select(\"SELECT * FROM watchlist \n JOIN animes ON animes.id = anime_id\n WHERE user_id = ?\",[Auth::user()->id]);\n\n return view('/watchlist', [\"animes\" => $animes]);\n }",
"public function index()\n {\n $this->setDefaultData();\n $this->paginate = [\n 'contain' => ['RegisteredUsers', 'Listings'],\n 'conditions' => ['RegisteredUsers.username'\n => $this->Auth->user()['username']]\n ];\n $watchingLists = $this->paginate($this->WatchingLists);\n\n $this->set(compact('watchingLists'));\n $this->set('_serialize', ['watchingLists']);\n }",
"function addWatchList()\n {\n $this->doNotRenderHeader = 1;\n $filmId = $_POST['filmId'];\n $userId = $_POST['userId'];\n $sql = \"insert into \" . DEFAULT_SCHEMA . \".activity (film_id,user_id,name,created_at,updated_at) VALUES (\" . $filmId . \",\" . $userId . \",'watchlist',now() ,now());\";\n $result = $this->Profile->executeCommand($sql);\n\n if ($result) {\n $newActivity = $this->Profile->custom('select id as activity_id from activity where name = \"watchlist\" and user_id = ' . $userId . ' and film_id = ' . $filmId . ';');\n echo $newActivity[0]['Activity']['activity_id'];\n } else {\n echo '-1';\n }\n }",
"public function listAction()\n {\n try {\n\n $pageNumber = $this->getParam($this->navigationParamName, null);\n\n // Get key that define what type of chronicles to display\n $key = $this->getParam(\"pageKey\", self::PAGE_KEY_ANY_GROUPS);\n\n // Get 100 last chronicles from cache\n switch ($key) {\n case self::PAGE_KEY_ANY_GROUPS :\n $chronicles = ChronicleSvc::getInstance()->getLastChronicles(100);\n break;\n case self::PAGE_KEY_BLOGGERS :\n $chronicles = ChronicleSvc::getInstance()->getLastChronicles(100, GroupTypes::BLOGGER);\n break;\n case self::PAGE_KEY_BOOKSTORES :\n $chronicles = ChronicleSvc::getInstance()->getLastChronicles(100, GroupTypes::BOOK_STORE);\n break;\n }\n\n // Add all chronicle actions common items to model view\n $this->addCommonItemsToModelView();\n\n // Add chronicles list action common items to model view\n $this->addCommonListItemsToModelView($key, $chronicles, $pageNumber, null, null, null);\n } catch (\\Exception $e) {\n Trace::addItem(sprintf(\"Une erreur s'est produite dans \\\"%s->%s\\\", TRACE : %s\\\"\", get_class(), __FUNCTION__, $e->getTraceAsString()));\n $this->forward(\"error\", \"error\", \"default\");\n }\n }",
"public function generateList()\t{\n\t\t\t// generate svn status cache\n\t\t$this->svn->getFileStatus($this->path, TRUE);\n\t\tparent::generateList();\n\t}",
"public function watchtopiccommentAction()\n {\n //filter ステータス\n $srhStatus = (int)$this->_request->getPost('srhStatus');\n //filter キーword\n $srhKeyword = $this->_request->getPost('srhKeyword', '');\n\n //show type [0-search|1-ID別コンテンツ一覧|2-監視対象別のコンテンツ一覧|3-監視担当者別のコンテンツ一覧]\n $showType = (int)$this->_request->getPost('showType');\n $typeId = $this->_request->getPost('typeId');\n\n $this->view->srhStatus = $srhStatus;\n $this->view->srhKeyword = $srhKeyword;\n $this->view->showType = $showType;\n $this->view->typeId = $typeId;\n $this->view->title = 'みんなの時間割 - コンテンツ監視[掲示板のタイトル]|OPENSOCIAL APPS ADMIN|CF';\n $this->render();\n }",
"public function watchlist(){\n if(array_key_exists('recentviews', $_COOKIE)) {\n $cookie = $_COOKIE['recentviews'];\n $cookie = unserialize($cookie);\n } else {\n $cookie = array();\n }\n\n\n $title = 'Личный кабинет';\n $meta_key = 'Личный кабинет';\n $meta_desc = 'Личный кабинет';\n\n $products = Product::whereIn('id', $cookie)->get();\n //recent view\n\n $user = Auth::user();\n return view(\"profile.index.watchlist\", compact('title','meta_key','meta_desc', 'user', 'products'));\n }",
"protected function updateWatchlist() {\n\t\t# Apply watchlist checkbox value (may be NULL)\n\t\tif ( $this->watchThis === true ) {\n\t\t\t$this->user->addWatch( $this->page );\n\t\t} elseif ( $this->watchThis === false ) {\n\t\t\t$this->user->removeWatch( $this->page );\n\t\t}\n\t}",
"public function testWatchImageList()\n {\n\n }",
"function _list($filter){\n global $conf;\n global $lang;\n echo '<hr /><br />';\n echo '<form action=\"\" method=\"post\"><div class=\"no\">';\n echo '<input type=\"hidden\" name=\"filter\" value=\"'.hsc($filter).'\" />';\n formSecurityToken();\n\n $recents = getRecents(0,$this->max_lines);\n echo '<ul>';\n\n $cnt = 0;\n foreach($recents as $recent){\n if($filter){\n if(strpos(rawWiki($recent['id']),$filter) === false) continue;\n }\n\n $cnt++;\n $date = dformat($recent['date']);\n\n echo ($recent['type']===DOKU_CHANGE_TYPE_MINOR_EDIT) ? '<li class=\"minor\">' : '<li>';\n echo '<div class=\"li\">';\n echo '<input type=\"checkbox\" name=\"revert[]\" value=\"'.hsc($recent['id']).'\" checked=\"checked\" id=\"revert__'.$cnt.'\" />';\n echo ' <label for=\"revert__'.$cnt.'\">'.$date.'</label> ';\n\n echo '<a href=\"'.wl($recent['id'],\"do=diff\").'\">';\n $p = array();\n $p['src'] = DOKU_BASE.'lib/images/diff.png';\n $p['width'] = 15;\n $p['height'] = 11;\n $p['title'] = $lang['diff'];\n $p['alt'] = $lang['diff'];\n $att = buildAttributes($p);\n echo \"<img $att />\";\n echo '</a> ';\n\n echo '<a href=\"'.wl($recent['id'],\"do=revisions\").'\">';\n $p = array();\n $p['src'] = DOKU_BASE.'lib/images/history.png';\n $p['width'] = 12;\n $p['height'] = 14;\n $p['title'] = $lang['btn_revs'];\n $p['alt'] = $lang['btn_revs'];\n $att = buildAttributes($p);\n echo \"<img $att />\";\n echo '</a> ';\n\n echo html_wikilink(':'.$recent['id'],(useHeading('navigation'))?null:$recent['id']);\n echo ' – '.htmlspecialchars($recent['sum']);\n\n echo ' <span class=\"user\">';\n echo $recent['user'].' '.$recent['ip'];\n echo '</span>';\n\n echo '</div>';\n echo '</li>';\n\n @set_time_limit(10);\n flush();\n }\n echo '</ul>';\n\n echo '<p>';\n echo '<input type=\"submit\" class=\"button\" value=\"'.$this->getLang('revert').'\" /> ';\n printf($this->getLang('note2'),hsc($filter));\n echo '</p>';\n\n echo '</div></form>';\n }",
"public function lister()\r\n {\r\n }",
"public function testWatchProjectList()\n {\n\n }",
"protected function setupList()\n {\n if($this->hasAddOperation)\n {\n if(User::getPermission($this->permissionPrefix . \"_can_add\") || $this->forceAddOperation)\n {\n $this->toolbar->addLinkButton(\"New\",$this->name . \"/add\");\n }\n }\n\n if(User::getPermission($this->permissionPrefix.\"_can_export\"))\n {\n $exportButton = new MenuButton(\"Export\");\n $exportButton->addMenuItem(\"PDF\", \"#\",\"wyf.openWindow('\".$this->urlPath.\"/export/pdf')\");\n $exportButton->addMenuItem(\"Data\", \"#\",\"wyf.openWindow('\".$this->urlPath.\"/export/csv')\");\n $exportButton->addMenuItem(\"Template\", \"#\",\"wyf.openWindow('\".$this->urlPath.\"/export/csv/template')\");\n $exportButton->addMenuItem(\"HTML\", \"#\",\"wyf.openWindow('\".$this->urlPath.\"/export/html')\");\n $exportButton->addMenuItem(\"Excel\", \"#\",\"wyf.openWindow('\".$this->urlPath.\"/export/xls')\");\n $this->toolbar->add($exportButton);//addLinkButton(\"Export\",$this->urlPath.\"/export\");\n }\n\n if(User::getPermission($this->permissionPrefix.\"_can_import\"))\n {\n $this->toolbar->addLinkButton(\"Import\",$this->urlPath.\"/import\");\n }\n \n $this->toolbar->addLinkButton(\"Search\",\"#\")->linkAttributes=\"onclick=\\\"wyf.tapi.showSearchArea('{$this->table->name}')\\\"\";\n \n if($this->hasEditOperation)\n {\n if(User::getPermission($this->permissionPrefix.\"_can_edit\") || $this->forceEditOperation)\n {\n $this->table->addOperation(\"edit\",\"Edit\");\n }\n }\n \n if($this->hasDeleteOperation)\n {\n if(User::getPermission($this->permissionPrefix.\"_can_delete\") || $this->forceDeleteOperation)\n {\n $this->table->addOperation(\"delete\",\"Delete\",\"javascript:wyf.confirmRedirect('Are you sure you want to delete','{$this->urlPath}/%path%/%key%')\");\n }\n }\n\n if(User::getPermission($this->permissionPrefix.\"_can_view\"))\n {\n $this->table->addOperation(\"view\",\"View\");\n }\n \n if(User::getPermission($this->permissionPrefix.\"_can_audit\"))\n {\n $this->table->addOperation(\"audit\",\"History\");\n } \n \n if(User::getPermission($this->permissionPrefix.\"_can_view_notes\"))\n {\n $this->table->addOperation(\"notes\",\"Notes\");\n } \n }",
"public function getWatchList() {\n\n return $this->mWatchList;\n }",
"public function listAction()\n {\n $this->container->get('theme_installer')->synchronize();\n\n parent::listAction();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets as includeListContents Specify true to return the full user defined list contents in the response's UserDefinedList containers. A value of false means only a summary of the user defined list will be returned. The default value is false. | public function getIncludeListContents()
{
return $this->includeListContents;
} | [
"public function getUserDefinedList()\n {\n return $this->userDefinedList;\n }",
"public function setList($var)\n {\n GPBUtil::checkBool($var);\n $this->list = $var;\n\n return $this;\n }",
"public function setIncludeTableList($var)\n {\n GPBUtil::checkBool($var);\n $this->include_table_list = $var;\n\n return $this;\n }",
"public function renderList()\n {\n return $this->renderAdminPage('Light_Kit_Admin_UserData/kit/zeroadmin/generated/luda_resource_has_tag_list', [], PageConfUpdator::create()->updateWidget(\"body.light_realist\", [\n 'vars' => [\n 'request_declaration_id' => 'Light_Kit_Admin_UserData:generated/luda_resource_has_tag',\n ],\n ]));\n }",
"public function isListable() {\n\t\treturn false;\n\t}",
"public function getUserLists();",
"public function get_user_list($list){\n if(get_instance()->ecl('Instance')->mod('lists', 'if_user_has_list', [get_instance()->ecl('Instance')->user(),$list,'email'])){\n return true;\n } else {\n return false;\n }\n }",
"public function getUserListResult()\n {\n return $this->readOneof(16);\n }",
"public function isListable() {\n\t\treturn $this->listable;\n\t}",
"public function Admin_Action_CustomFieldUsedByList() {\n $listIDs = $this->_getPOSTRequest ( 'listid', null );\n if (is_array ( $listIDs )) {\n $output = GetJSON ( $this->_getCustomFieldUsedByList ( $listIDs ) );\n echo $output;\n }\n }",
"public function getUserList()\n {\n return $this->user_list;\n }",
"public function isList()\n {\n return $this->object === 'list';\n }",
"function isList() {\n\t\treturn true;\n\t}",
"public function isListable() : bool\n {\n return false;\n }",
"public function isRenderList();",
"public function lists(User $user)\n {\n if ($this->isGranted($user, 'user-lists')) {\n return true;\n }\n\n return false;\n }",
"public function setIncludeListColumnAnnotationsRpc($var)\n {\n GPBUtil::checkBool($var);\n $this->include_list_column_annotations_rpc = $var;\n\n return $this;\n }",
"public function hasUserListings()\n\t{\n\t\treturn FALSE;\n\t}",
"public function hasUserListings()\n {\n return true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get chunk data by file pointer to upload session. | protected function _od_getChunkData($fp)
{
static $chunkSize = null;
if ($chunkSize === null) {
$mem = elFinder::getIniBytes('memory_limit');
if ($mem < 1) {
$mem = 10485760; // 10 MiB
} else {
$mem -= memory_get_usage() - 1061548;
$mem = min($mem, 10485760);
}
if ($mem > 327680) {
$chunkSize = floor($mem / 327680) * 327680;
} else {
$chunkSize = $mem;
}
}
if ($chunkSize < 8192) {
return false;
}
$contents = '';
while (!feof($fp) && strlen($contents) < $chunkSize) {
$contents .= fread($fp, 8192);
}
return $contents;
} | [
"function getFileChunk() {\n $request = $this->_controler->request;\n\n if ($request->exist('item_id')) {\n $item_id = $request->get('item_id');\n $item_factory = $this->_getItemFactory();\n $item = $item_factory->getItemFromDb($item_id);\n if ($item !== null) {\n $itemType = $item_factory->getItemTypeForItem($item);\n if($itemType == PLUGIN_DOCMAN_ITEM_TYPE_FILE || $itemType == PLUGIN_DOCMAN_ITEM_TYPE_EMBEDDEDFILE) {\n if ($request->exist('version_number')) {\n $version_factory = $this->_getVersionFactory();\n $version = $version_factory->getSpecificVersion($item, $request->get('version_number'));\n } else {\n $version = $item->getCurrentVersion();\n }\n if ($version) {\n if (file_exists($version->getPath())) {\n if ($request->exist('chunk_offset') && $request->exist('chunk_size')) {\n $contents = file_get_contents($version->getPath(),NULL, NULL, $request->get('chunk_offset'), $request->get('chunk_size'));\n $this->_controler->_viewParams['action_result'] = base64_encode($contents);\n }\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_version_not_exist'));\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_not_a_file'));\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_filenotfound'));\n }\n } else {\n $this->_controler->feedback->log('error', $GLOBALS['Language']->getText('plugin_docman', 'error_item_id_missing'));\n }\n }",
"public function getChunk()\n {\n return $this->init()->doGetChunk();\n }",
"function get_chunk($file,$start,$end){\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $file);\ncurl_setopt($ch, CURLOPT_RANGE, $start.'-'.$end);\ncurl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_WRITEFUNCTION, 'chunk');\n$result = curl_exec($ch);\ncurl_close($ch);\n}",
"public function getUploadChunks(): Iterator\n {\n return UploadingFileChunk::findByFile($this->id);\n }",
"function common_readfile_chunked($file, $retbytes=true) {\n\t\treturn v_file::readfile_chunked($file, $retbytes);\n\t}",
"public function getCurrentChunk()\n {\n return $this->current_chunk;\n }",
"public function chunkStorage()\n {\n return $this->chunkStorage;\n }",
"public function getChunk()\n {\n $this->bootIfNotBooted();\n\n return $this->chunk;\n }",
"public function getCurrentChunk()\n\t{\n\t\treturn $this->getChunk($this->index * $this->size);\n\t}",
"private function readChunked()\n {\n $readLength = 0;\n $chunksize = null;\n $extension = null;\n $body = '';\n sscanf($this->inputStream->readLine(1024), \"%x%s\\r\", $chunksize, $extension);\n while (0 < $chunksize) {\n $data = $this->inputStream->read($chunksize + 2);\n $body .= rtrim($data);\n $readLength += $chunksize;\n sscanf($this->inputStream->readLine(1024), \"%x\\r\", $chunksize);\n }\n\n $this->headers->put('Content-Length', $readLength);\n $this->headers->remove('Transfer-Encoding');\n return $body;\n }",
"public function get_chunks($type) {\n\t\t\tif ($this->_chunks[$type] === null)\n\t\t\t\treturn null;\n\t\n\t\t\t$chunks = array ();\n\t\n\t\t\tforeach ($this->_chunks[$type] as $chunk) {\n\t\t\t\tif ($chunk['size'] > 0) {\n\t\t\t\t\tfseek($this->_fp, $chunk['offset'], SEEK_SET);\n\t\t\t\t\t$chunks[] = fread($this->_fp, $chunk['size']);\n\t\t\t\t} else {\n\t\t\t\t\t$chunks[] = '';\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn $chunks;\n\t\t}",
"private function readChunk() {\n\t\t// Handle content length\n\t\tif ($this->contentLength > 0) {\n\t\t\t// End of buffer\n\t\t\tif ($this->contentIndex >= $this->contentLength) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\n\t\t\t// Calculate chunk size to read\n\t\t\t$size = $this->contentLength - $this->contentIndex;\n\t\t\t$size = $size < $this->bufferSize ? $size : $this->bufferSize;\n\t\t\t$data = $this->fread($size);\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Handle chunked transfer encoding\n\t\tif ($this->transferEncoding === \"chunked\") {\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$line = $this->readLine($this->bufferSize);\n\n\t\t\t\t// Curl can produce empty response if first chunk length is 0\n\t\t\t\tif ($line === '') {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t\tif (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) {\n\t\t\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Invalid chunk length: \" . $line);\n\t\t\t\t} else {\n\t\t\t\t\t$this->chunkLength = hexdec($matches[1]);\n\t\t\t\t\t$this->chunkedContentLength += $this->chunkLength;\n\n\t\t\t\t\t// Chunk with zero length indicates the end\n\t\t\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t\t\t$this->contentLength = $this->chunkedContentLength;\n\t\t\t\t\t\t$this->readLine();\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$data = $this->fread(min($this->chunkLength, $this->bufferSize));\n\t\t\t$this->chunkLength -= strlen($data);\n\n\t\t\tif ($this->chunkLength === 0) {\n\t\t\t\t$this->readLine(); // Trailing CRLF\n\t\t\t}\n\n\t\t\t// Debug chunk size\n\t\t\tif ($this->client->getLogLevel() >= 3) {\n\t\t\t\t$this->client->log(\"- Chunk size: \" . strlen($data));\n\t\t\t}\n\n\t\t\treturn $data;\n\t\t}\n\n\t\treturn \"\";\n\t}",
"public function getChunk($chunkName)\n {\n $out = null;\n if (empty($chunkName)) {\n // nop\n } elseif ($this->isChunkProcessor('DLTemplate')) {\n $out = app('DLTemplate')->getChunk($chunkName);\n } elseif (isset ($this->chunkCache[$chunkName])) {\n $out = $this->chunkCache[$chunkName];\n } elseif (stripos($chunkName, '@FILE') === 0) {\n $out = $this->chunkCache[$chunkName] = $this->atBindFileContent($chunkName);\n } else {\n $out = app('DLTemplate')->getBaseChunk($chunkName);\n }\n return $out;\n }",
"private function uploadChunk($params = array())\n {\n $httpMethod = 'PUT';\n $urlBase = 'https://api-content.dropbox.com/1/chunked_upload';\n $urlParams = '';\n\n if ($params['uploadId'] != null && $params['offset'] != 0) {\n $urlParams = '?upload_id=' . $params['uploadId'] . '&offset=' . $params['offset'];\n }\n\n $requestHeaders = array('Authorization: ' . $this->getAccessToken(), 'Content-Type: application');\n $requestContent = $params['chunkOfFile'];\n $params = array('httpMethod' => $httpMethod, 'urlBase' => $urlBase . $urlParams, 'headers' => $requestHeaders,\n 'content' => $requestContent);\n\n $response = $this->sendRequest($params);\n\n if (!$response->isOk()) {\n throw new UploadFailedException($response->getStatusCode(), $response->getReasonPhrase(\n ), $response->getContent());\n } else {\n $content = json_decode($response->getContent(), true);\n $uploadId = $content['upload_id'];\n $offset = $content['offset'];\n\n return array('uploadId' => $uploadId, 'offset' => $offset);\n }\n }",
"public function getDataChunkForPush()\n\t{\n\t\tglobal $app_config;\n\t\tif (!empty($app_config['entity_to_table']['push_to_sugarcrm'])) {\n\t\t\t$table_name = $app_config['entity_to_table']['push_to_sugarcrm'];\n\t\t\t\n\t\t\ttry {\n\t\t\t\t$max = (int)$app_config['push_to_sugarcrm_chunk_size'] + 1; // query for limit + 1 to check if\n\t\t\t\t// still there are more records (next chunk)\n\t\t\t\t$sql = \"SELECT TOP $max * FROM {$table_name} where SugarCRMID IS NULL OR SugarCRMID = ''\";\n\t\t\t\t$sth = $this->db->prepare($sql);\n\t\t\t\t//$sth->bindValue(':max', $max, PDO::PARAM_INT);\n\t\t\t\t$sth->execute();\n\t\t\t\t$result = $sth->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\t$record_count = count($result);\n\t\t\t\tif ($record_count == $max) {\n\t\t\t\t\t$next_offset = 0;\n\t\t\t\t\t//remove last record from array as its additional record only fetched for pagination\n\t\t\t\t\tarray_pop($result);\n\t\t\t\t\t$record_count = $record_count - 1;\n\t\t\t\t} else {\n\t\t\t\t\t$next_offset = -1;\n\t\t\t\t}\n\t\t\t\t$data = array();\n\t\t\t\t$data['next_offset'] = $next_offset;\n\t\t\t\t$data['record_count'] = $record_count;\n\t\t\t\t$data['records'] = $result;\n\t\t\t\treturn $data;\n\t\t\t} catch (PDOException $e) {\n\t\t\t\tself::$logger->error($e->getMessage());\n\t\t\t\tself::$logger->error($e->getTraceAsString());\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function stream_read ($count) {return fread($this->stream, $data);}",
"private function pack_chunk() {\n\t\t$Err = new ChunkUploadError;\n\n\t\t$index = $chunk = $chunk_path = null;\n\t\textract($this->chunk_data);\n\n\t\t# truncate or append\n\t\t$fhn = @fopen($tempname, ($index === 0 ? 'wb' : 'ab'));\n\t\tif (false === $fhn) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tself::$logger->error(\n\t\t\t\t\"Chupload: cannot open temp file: '$tempname'.\");\n\t\t\treturn $Err::EDIO_WRITE_FAIL;\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}\n\t\tif (!flock($fhn, LOCK_EX | LOCK_NB)) {\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\tself::$logger->error(\n\t\t\t\t\"Chupload: temporary file busy: '$tempname'.\");\n\t\t\treturn $Err::EDIO_BUSY;\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}\n\t\t# write to temp blob\n\t\tfwrite($fhn, $chunk);\n\t\t# append index\n\t\tif ($index < $max_chunk && $max_chunk >= 1)\n\t\t\tfwrite($fhn, pack('v', $index));\n\t\tfclose($fhn);\n\t\t# remove chunk\n\t\t$this->unlink($chunk_path);\n\n\t\treturn 0;\n\t}",
"function transfer_chunk( $fp ) {\n\t\t$state_data = $state_data = $this->migration_state_manager->set_post_data();\n\t\t$this->migration_state_manager->set_post_data();\n\n\t\tif ( in_array( $state_data['intent'], array( 'savefile', 'find_replace', 'import' ) ) || 'backup' == $state_data['stage'] ) {\n\n\t\t\tif ( 'find_replace' === $state_data['stage'] ) {\n\t\t\t\t$this->process_chunk( $this->query_buffer );\n\t\t\t} else {\n\t\t\t\t$this->filesystem->close( $fp );\n\t\t\t}\n\n\t\t\t$result = array(\n\t\t\t\t'current_row' => $this->row_tracker,\n\t\t\t\t'primary_keys' => serialize( $this->primary_keys ),\n\t\t\t);\n\n\t\t\tif ( $state_data['intent'] == 'savefile' && $state_data['last_table'] == '1' ) {\n\t\t\t\t$result['dump_filename'] = $state_data['dump_filename'];\n\t\t\t\t$result['dump_path'] = $state_data['dump_path'];\n\t\t\t}\n\n\t\t\t$result = $this->http->end_ajax( json_encode( $result ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ( $state_data['intent'] == 'pull' ) {\n\t\t\t$result = $this->http->end_ajax( $this->row_tracker . ',' . serialize( $this->primary_keys ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\t$chunk_gzipped = '0';\n\t\tif ( isset( $state_data['gzip'] ) && $state_data['gzip'] == '1' && Util::gzip() ) {\n\t\t\t$this->current_chunk = gzcompress( $this->current_chunk );\n\t\t\t$chunk_gzipped = '1';\n\t\t}\n\n\t\t$data = array(\n\t\t\t'action' => 'wpmdb_process_chunk',\n\t\t\t'remote_state_id' => $state_data['remote_state_id'],\n\t\t\t'table' => $state_data['table'],\n\t\t\t'chunk_gzipped' => $chunk_gzipped,\n\t\t\t'chunk' => $this->current_chunk,\n\t\t\t// NEEDS TO BE the last element in this array because of adding it back into the array in ajax_process_chunk()\n\t\t);\n\n\t\t$data['sig'] = $this->http_helper->create_signature( $data, $state_data['key'] );\n\n\t\t$ajax_url = $this->util->ajax_url();\n\t\t$response = $this->remote_post->post( $ajax_url, $data, __FUNCTION__ );\n\n\t\tob_start();\n\t\t$this->util->display_errors();\n\t\t$maybe_errors = trim( ob_get_clean() );\n\n\t\tif ( false === empty( $maybe_errors ) ) {\n\t\t\t$maybe_errors = array( 'wpmdb_error' => 1, 'body' => $maybe_errors );\n\t\t\t$result = $this->http->end_ajax( json_encode( $maybe_errors ) );\n\n\t\t\treturn $result;\n\t\t}\n\n\t\tif ( '1' !== $response ) {\n\t\t\t$decoded_response = json_decode( $response, 1 );\n\t\t\tif ( $decoded_response && isset( $decoded_response['wpmdb_error'] ) && isset( $decoded_response['body'] ) ) {\n\t\t\t\t// $response is already json_encoded wpmdb_error object\n\t\t\t\t$this->error_log->log_error( 'transfer_chunk received error response: ' . $decoded_response['body'] );\n\n\t\t\t\treturn $this->http->end_ajax( $response );\n\t\t\t}\n\t\t\t$return = array( 'wpmdb_error' => 1, 'body' => $response );\n\n\t\t\treturn $this->http->end_ajax( json_encode( $return ) );\n\t\t}\n\n\t\t$result = $this->http->end_ajax( json_encode(\n\t\t\tarray(\n\t\t\t\t'current_row' => $this->row_tracker,\n\t\t\t\t'primary_keys' => serialize( $this->primary_keys ),\n\t\t\t)\n\t\t) );\n\n\t\treturn $result;\n\t}",
"public function getFileData()\n {\n return $this->fileData;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get columns configs to specified page for grid or detail view | public function genColumns($page)
{
$columns = array();
switch ($page) {
case 'index':
$columns = array(
array(
'name' => 'id',
'htmlOptions' => array('class' => 'span1 center', ),
),
array(
'name' => 'menu_id',
'value' => function ($data) {
/** @var $data Menu */
return $data->getValue('menu', 'label');
},
'filter' => \CHtml::listData(MenuList::getItems(true, true, array('id', 'label', )), 'id', 'label'),
),
'label',
array(
'name' => 'parent_id',
'value' => function ($data) {
/** @var $data Menu */
return $data->getValue('parent', 'label');
},
'filter' => \CHtml::listData(Menu::getItems(true, true, array('id', 'label', )), 'id', 'label'),
),
array(
'name' => 'type_id',
'value' => function ($data) {
/** @var $data Menu */
return $data->getValue('type', 'label');
},
'filter' => \CHtml::listData(MenuType::getItems(true, true, array('id', 'label', )), 'id', 'label'),
),
array(
'class' => 'back\components\CheckColumn',
'header' => 'Опубликовано',
'name' => 'published',
),
array(
'name' => 'position',
'htmlOptions' => array('class' => 'span1 center', ),
),
array(
'class' => 'bootstrap.widgets.TbButtonColumn',
),
);
break;
case 'view':
$columns = array(
'id',
array(
'name' => 'menu_id',
'value' => $this->getValue('menu', 'label'),
),
'label',
array(
'name' => 'parent_id',
'value' => $this->getValue('parent', 'label'),
),
array(
'name' => 'type_id',
'value' => $this->getValue('type', 'label'),
),
'related_id',
'link',
array(
'name' => 'published',
'value' => self::getBooleanText($this->published),
),
'position',
);
break;
default:
break;
}
return $columns;
} | [
"public static function getAllColumns($page)\n {\n $columns = array(\n \"list_issues\" => array(\n \"pri_rank\" => array(\n \"title\" => ev_gettext(\"Priority\")\n ),\n \"iss_id\" => array(\n \"title\" => ev_gettext(\"Issue ID\")\n ),\n \"usr_full_name\" => array(\n \"title\" => ev_gettext(\"Reporter\")\n ),\n \"iss_created_date\" => array(\n \"title\" => ev_gettext(\"Created Date\")\n ),\n \"iss_grp_id\" => array(\n \"title\" => ev_gettext(\"Group\")\n ),\n \"assigned\" => array(\n \"title\" => ev_gettext(\"Assigned\")\n ),\n \"time_spent\" => array(\n \"title\" => ev_gettext(\"Time Spent\")\n ),\n \"iss_percent_complete\" => array(\n \"title\" => ev_gettext(\"% Complete\"),\n \"default_role\" => 9\n ),\n \"iss_dev_time\" => array(\n \"title\" => ev_gettext(\"Est Dev Time\"),\n \"default_role\" => 9\n ),\n \"prc_title\" => array(\n \"title\" => ev_gettext(\"Category\")\n ),\n \"pre_title\" => array(\n \"title\" => ev_gettext(\"Release\")\n ),\n \"iss_customer_id\" => array(\n \"title\" => ev_gettext(\"Customer\")\n ),\n \"support_level\" => array(\n \"title\" => ev_gettext(\"Support Level\")\n ),\n \"sta_rank\" => array(\n \"title\" => ev_gettext(\"Status\")\n ),\n \"sta_change_date\" => array(\n \"title\" => ev_gettext(\"Status Change Date\")\n ),\n \"last_action_date\" => array(\n \"title\" => ev_gettext(\"Last Action Date\")\n ),\n \"custom_fields\" => array(\n \"title\" => ev_gettext(\"Custom Fields\")\n ),\n \"iss_summary\" => array(\n \"title\" => ev_gettext(\"Summary\"),\n \"align\" => \"left\",\n \"width\" => '30%'\n ),\n \"iss_expected_resolution_date\" => array(\n \"title\" => ev_gettext(\"Expected Resolution Date\")\n )\n )\n );\n return $columns[$page];\n }",
"public function genColumns($page)\n\t{\n\t\t$columns = array();\n\t\tswitch ($page) {\n\t\t\tcase 'index':\n\t\t\t\t$columns = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'id',\n\t\t\t\t\t\t'htmlOptions' => array('class' => 'span1 center', ),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'category',\n\t\t\t\t\t\t'value' => function ($data) {\n\t\t\t\t\t\t\t/** @var Message $data */\n\t\t\t\t\t\t\treturn $data->getValue('source', 'category');\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'htmlOptions' => array('class' => 'span2 center', ),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'message',\n\t\t\t\t\t\t'value' => function ($data) {\n\t\t\t\t\t\t\t/** @var Message $data */\n\t\t\t\t\t\t\treturn $data->getValue('source', 'message');\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\t'translation',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'language',\n\t\t\t\t\t\t'filter' => Lang::getLanguages('label', 'locale'),\n\t\t\t\t\t\t'htmlOptions' => array('class' => 'span2 center', ),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'class' => 'bootstrap.widgets.TbButtonColumn',\n\t\t\t\t\t\t'updateButtonUrl' => function ($data) {\n\t\t\t\t\t\t\t/** @var Message $data */\n\t\t\t\t\t\t\treturn \\CHtml::normalizeUrl(array('update', 'id' => $data->getAdminPrimaryKey()));\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'viewButtonUrl' => function ($data) {\n\t\t\t\t\t\t\t/** @var Message $data */\n\t\t\t\t\t\t\treturn \\CHtml::normalizeUrl(array('view', 'id' => $data->getAdminPrimaryKey()));\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'deleteButtonUrl' => function ($data) {\n\t\t\t\t\t\t\t/** @var Message $data */\n\t\t\t\t\t\t\treturn \\CHtml::normalizeUrl(array('delete', 'id' => $data->getAdminPrimaryKey()));\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'view':\n\t\t\t\t$columns = array(\n\t\t\t\t\t'id',\n\t\t\t\t\t'language',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label' => 'Категория',\n\t\t\t\t\t\t'value' => $this->getValue('source', 'category'),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'label' => 'Оригинал',\n\t\t\t\t\t\t'value' => $this->getValue('source', 'message'),\n\t\t\t\t\t),\n\t\t\t\t\t'translation',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $columns;\n\t}",
"public function columns()\n {\n $sql = \"SELECT \n `uspsc`.`id`, \n `uspsc`.`row_id`, \n `uspsc`.`size`, \n `dct`.`column_type`, \n `uspsc`.`offset`\n\t\t\t\tFROM \n\t\t\t\t `user_site_page_structure_column` `uspsc` \n\t\t\t\tINNER JOIN \n\t\t\t\t `user_site_page_structure_row` `uspsr` ON \n\t\t\t\t `uspsc`.`row_id` = `uspsr`.`id` AND \n\t\t\t\t `uspsr`.`site_id` = :site_id AND \n\t\t\t\t `uspsr`.`page_id` = :page_id \n INNER JOIN \n `designer_column_type` `dct` ON \n `uspsc`.`column_type_id` = `dct`.`id` \n\t\t\t\tWHERE \n\t\t\t\t `uspsc`.`site_id` = :site_id AND \n\t\t\t\t `uspsc`.`page_id` = :page_id \n\t\t\t\tORDER BY \n\t\t\t\t `uspsr`.`sort_order` ASC, \n\t\t\t\t `uspsc`.`sort_order` ASC\";\n $stmt = $this->_db->prepare($sql);\n $stmt->bindValue(':site_id', $this->site_id, PDO::PARAM_INT);\n $stmt->bindValue(':page_id', $this->page_id, PDO::PARAM_INT);\n $stmt->execute();\n\n $result = $stmt->fetchAll();\n\n $columns = array();\n\n foreach ($result as $column) {\n $columns[intval($column['row_id'])][] = array(\n 'id' => intval($column['id']),\n 'row_id' => intval($column['row_id']),\n 'width' => intval($column['size']),\n 'column_type' => $column['column_type'],\n 'offset' => intval($column['offset']),\n );\n }\n\n return $columns;\n }",
"public function getGridColumns();",
"function gssettings_settings_layout_columns( $columns, $screen ) {\n global $_gssettings_settings_pagehook;\n if ( $screen == $_gssettings_settings_pagehook ) {\n $columns[$_gssettings_settings_pagehook] = 1;\n }\n return $columns;\n }",
"protected function customizeColumnsConfig()\n {\n \n }",
"function showadmindata_add_page_columns( $columns ) {\n\t$new_columns = array();\n\n\tforeach ($columns as $key => $value) {\n\t\t$new_columns[ $key ] = $value;\n\t\tif ( $key == 'title' ) {\n\t\t\t$new_columns['page_template'] = \"Page Template\";\n\t\t\t$new_columns['menu_order'] = \"Order\";\n\t\t}\n\t}\n\n\treturn $new_columns;\n}",
"protected function _prepareColumns()\n {\n $this->addColumn(\n 'in_pages',\n [\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'name' => 'in_pages',\n 'inline_css' => 'checkbox entities',\n 'field_name' => 'in_pages',\n 'values' => $this->getSelectedPages(),\n 'align' => 'center',\n 'index' => 'page_id',\n 'use_index' => true\n ]\n );\n\n $this->addColumn(\n 'page_id',\n [\n 'header' => __('ID'),\n 'sortable' => true,\n 'index' => 'page_id',\n 'header_css_class' => 'col-id',\n 'column_css_class' => 'col-id'\n ]\n );\n\n $this->addColumn(\n 'chooser_identifier',\n [\n 'header' => __('Identifier'),\n 'name' => 'chooser_identifier',\n 'index' => 'identifier',\n 'header_css_class' => 'col-identifier',\n 'column_css_class' => 'col-identifier'\n ]\n );\n\n $this->addColumn(\n 'chooser_title',\n [\n 'header' => __('Title'),\n 'name' => 'chooser_title',\n 'index' => 'title',\n 'header_css_class' => 'col-title',\n 'column_css_class' => 'col-title'\n ]\n );\n\n return parent::_prepareColumns();\n }",
"function plugin_layout_columns($columns, $screen) {\r\n\t\tif ($screen == $this->page) {\r\n\t\t\t$columns[$this->page] = 2;\r\n\t\t}\r\n\t\treturn $columns;\r\n\t}",
"function excel_get_columns() {\n\t$t_columns = helper_get_columns_to_view( COLUMNS_TARGET_EXCEL_PAGE );\n\treturn $t_columns;\n}",
"public function getGridConfig();",
"function page_columns( $columns ) {\n\t\t\n\t\t$columns['custom_fields'] = __( 'Custom Fields', 'wp-quick-bulk-edit' );\n\t\treturn $columns;\n\n\t}",
"private function get_column_properties(){\n\t\t$sql_columns = $this->table_config[\"columns\"];\n\t\t$sql_columns =drk_subval_sort($sql_columns,\"order\",\"forward\"); // sort the columns by the sort order provided\n\t\tforeach($sql_columns as $col){\n\t\t\t$colname = $wpdb->escape($col[\"column_name\"]);\n\t\t\tif($col[\"is_open\"]){ // include only columns that are allowed to be made open\n\t\t\t\t$this->select_cols[] = $colname;\n\t\t\t\tif($col[\"is_search\"]){ // if a column can be searched then include in search columns\n\t\t\t\t\t$this->search_cols[$colname] = $colname;\n\t\t\t\t}\n\t\t\t\tif($col[\"filter_type\"]==\"multiple\"){ // if a column can be filtered then include in filter columns\n\t\t\t\t\t$this->filter_cols[\"multiple\"][$colname] = $colname;\n\t\t\t\t}\n\t\t\t\tif($col[\"filter_type\"]==\"single\"){ // if a column can be filtered then include in filter columns\n\t\t\t\t\t$this->filter_cols[\"single\"][$colname] = $colname;\n\t\t\t\t}\n\t\t\t\tif($col[\"filter_type\"]==\"search\"){ // if a column can be filtered then include in filter columns\n\t\t\t\t\t$this->filter_cols[\"single\"][$colname] = $colname;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function get_columns();",
"public function getVisibleColumns($gridId);",
"function on_screen_layout_columns($columns, $screen) {\n if ($screen == $this->pagehook) {\n $columns[$this->pagehook] = 2;\n }\n return $columns;\n }",
"public function getColumnConfig()\n {\n return $this->columnConfig;\n }",
"protected function buildColumnsConfig()\n {\n $this->columnsConfig = ullCmsContentBlockColumnConfigCollection::build($this->contentType, $this->defaultAccess, $this->requestAction);\n \n $this->customizeColumnsConfig();\n \n $this->handleRelationColumns();\n \n $this->customizeRelationColumns();\n \n $this->handleVersionableBehaviour();\n\n }",
"function populate_page_columns($column,$post_id){\n\n //featured image column\n if($column == 'page_featured_image'){\n //if this page has a featured image\n if(has_post_thumbnail($post_id)){\n $page_featured_image = get_the_post_thumbnail($post_id,'icon');\n echo $page_featured_image;\n }else{\n echo '—';\n }\n }\n\n //page template column\n if($column == 'page_template'){\n //get the current page template being used for the page \n $page_template_name = get_post_meta( $post_id, '_wp_page_template', true ); \n //get a listing of all of the page templates for our site\n $page_templates = get_page_templates();\n if(in_array($page_template_name,$page_templates)){\n //search through each template\n foreach($page_templates as $key => $value){\n //if the template matches our current template, we found it\n if($page_template_name == $value){\n echo $key . ''; \n }\n } \n }else{\n echo 'Default';\n } \n }\n\n //page content column\n if($column == 'page_content'){\n\n //get the page based on its post_id\n $page = get_post($post_id);\n if($page){\n //get the main content area\n $page_content = apply_filters('the_content', $page->post_content); \n echo $page_content;\n }\n }\n if($column == 'id'){\n echo $post_id;\n } \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Render data for upcoming events | public function upcomingAction() {
$this->view->events = $this->_events->getUpcomingEvents();
} | [
"function fwp_display_upcoming_events()\n {\n $events = fwp_get_future_events();\n\n $count = count($events);\n if ($count <= 1) {\n return 'Coming Soon.';\n }\n $i = 1;\n while ($i <= 4 && $i < $count) :\n $post = get_post($events[$i]['id']);\n $permalink = get_permalink($post->ID);\n // get event start date\n $start_date = fwp_get_start_date($post->ID);\n //get section html\n ob_start();\n ?>\n <a class=\"row p-0 m-0\" href=\"<?= $permalink ?>\">\n <div id=\"<?= $post->post_title ?>\" class=\"col-sm-12 p-0\" style=\"border-left:2px solid black;\">\n <h5 style=\"margin:0 0 0 0;color:black;\"><?= $start_date ?></h5>\n <h4 style=\"margin:0 0 5px 0;\"><?= $post->post_title ?></h4>\n </div>\n </a>\n<?php\n $i++;\n endwhile;\n $output = ob_get_contents();\n ob_end_clean();\n\n /* Restore original Post Data */\n wp_reset_postdata();\n return $output;\n }",
"public function render_events() {\n\t\t$output = '';\n\t\t$events = $this->group_events_by_date( $this->get_cached_events() );\n\n\t\tif ( $events ) {\n\t\t\tob_start();\n\t\t\trequire_once( __DIR__ . '/template-events.php' );\n\t\t\t$output = ob_get_clean();\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function render_events() {\n\t\t$events = $this->get_all_events();\n\tif ( $events ) {\n\t\t\trequire_once( __DIR__ . '/template-events.php' );\n\t\t}\n\t}",
"function dmh_list_upcoming_events_for_a_venue( $post ) {\n\n\t$query_params = array(\n array(\n 'status' => 'publish',\n 'Datetime.DTT_EVT_start' => array(\n '>',\n date( current_time( 'mysql' ) ),\n 'Datetime.DTT_EVT_end' => array(\n '<',\n date( current_time( 'mysql' ) )\n )\n )\n ),\n\t\t'order_by' => 'Datetime.DTT_EVT_start',\n\t\t'order' => 'ASC'\n );\n\n $events = EEH_Venue_View::get_venue( $post->ID )->events( $query_params );\n\n\techo '<h2>Upcoming screenings:</h2><ul>';\n\n foreach ( $events as $event ) {\n\n\t\t$event_dt = $event->first_datetime();\n\n echo '<li>';\n echo '<a href=\"' . get_permalink( $event->get( 'EVT_ID' ) ) . '\">' . $event_dt->start_date( 'n/j/Y' ) . ' - ' . $event->get( 'EVT_name' ) . '</a>';\n echo '</li>';\n\n }\n\n echo '</ul>';\n\n}",
"public function upcomingEvents()\n {\n $user = $this->guard->user();\n $upcomingEvents = $this->events->fetchPublicUpcomingEvents($user);\n\n return view('web.events.upcoming', [\n 'events' => $upcomingEvents\n ]);\n }",
"public function drawEventInfo() {\n\t\tglobal $page;\n\t\t\n\t\t$show_places = false;\t// Set this to switch on/off showing remaining places.\n\t\t\n\t\t//print \"Dates : \".$this->start_date.\" to \".$this->end_date.\"<br>\\n\";\n\t\t$html = '<div id=\"event-info\">';\n\t\tif ($this->location) $html.='<p>Event location: <strong>'.$this->location.'</strong></p>';\n\t\tif ($this->prev_guid || $this->next_guid) {\n\t\t\t$html.='<p>Series: ';\n\t\t\tif ($this->prev_guid) $html.='<a href=\"'.$page->drawLinkByGUID($this->prev_guid).'\">Previous event</a> -> ';\n\t\t\t$html.=$this->title;\n\t\t\tif ($this->next_guid) $html.=' -> <a href=\"'.$page->drawLinkByGUID($this->next_guid).'\">Next event</a>';\n\t\t}\n\t\t\n\t\tif ($this->start_date && $this->end_date && $this->start_date!=$this->end_date) $html.='<p>Runs: From '.$this->start_date.' to '.$this->end_date.'</p>';\n\t\telse if ($this->start_date && $this->end_date && $this->start_date==$this->end_date) $html.='<p>Date: '.$this->start_date.'</p>';\n\t\t\n\t\tif ($this->start_time && $this->end_time && $this->start_time!=\"00:00\" && $this->end_time!=\"00:00\") $html.='<p>Event time: '.$this->start_time.' to '.$this->end_time.'</p>';\n\t\telse if ($this->start_time && $this->start_time!=\"00:00\") $html.='<p>Start time: '.$this->start_time.'</p>';\n\t\t\n\t\t// Do we need to think about tickets.\n\t\tif (!$this->invite) {\n\t\t\n\t\t\t$html .= '<p class=\"evt-price\">Ticket price: £'.number_format($this->price, 2).'</p>';\n\t\t\t\n\t\t\t// 1 calculate how many tickets spare\n\t\t\t$spare_tickets = $this->total_tickets - $this->booked;\n\t\t\t$pc_spare=0;\n\t\t\tif ($this->total_tickets) $pc_spare = floor(($spare_tickets/$this->total_tickets)*100);\n\t\t\t//print \"total tickets \".$this->total_tickets.\" booked \".$this->booked.\" spare \".$spare_tickets.\" pc spare \".$pc_spare.\"%<br>\\n\";\n\t\t\tif (!$pc_spare) {\n\t\t\t\tif ($show_places) {\n\t\t\t\t\t$ticket_html='There are no places left on this event';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$ticket_html='<a href=\"'.$page->drawLinkByGUID($this->id).'?register=1&id='.$_SESSION['member_id'].'\">Attend this event</a>';\n\t\t\t\tif ($pc_spare<10 && $show_places) $ticket_html.=' (There are limited places left for this event)';\n\t\t\t}\n\t\t\tif ($ticket_html) $html.='<p class=\"evt-tickets\">Tickets: '.$ticket_html.'</p>';\n\t\t}\n\t\t$html.='</div>';\n\t\treturn $html;\n\t}",
"function uom_events_past_page() {\n drupal_set_title(t('Past events'));\n\n\t$api = uom_events_api();\n\t$api->displayFull();\n\t\n $tag = variable_get('uom_events_tag', '');\n $past_event_caching_time = variable_get('uom_events_past_event_cache', 86400);\n\t$num_of_years = variable_get('uom_events_past_num_of_years', 1);\n\t$tag_array = _build_tag_array($tag);\n\t\n\t$data = array();\n\t\n if( \n \t\t($cache = cache_get('uom_events_past_events_data')) && \n \t\t($past_event_caching_time != 0)\n ) {\n $data = $cache->data;\n }\n else {\n $tag_events = array();\n\t\tforeach($tag_array as $single_tag) {\n\t\t\t$tmp_tag_events = $api->pastEventsByTag($single_tag, $num_of_years, TRUE);\n\t\t\tif(count($tmp_tag_events) > 0) {\n\t\t\t\tforeach($tmp_tag_events as $tmp_tag_event) {\n\t\t\t\t\tif(!_is_event_included($tmp_tag_event->id, $tag_events)) {\n\t\t\t\t\t\t$tag_events[] = $tmp_tag_event;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\n\t\tusort($tag_events, \"_my_event_compare_desc\");\n\t\t// Remove non public events\n //$tag_events = array_filter($tag_events, '_uom_events_filter_public_event_callback');\n cache_set('uom_events_past_events_data', $tag_events, 'cache', time() + $past_event_caching_time);\n\t\t$data = $tag_events;\n }\n \n\t$output = theme('uom_event_past_list', array('events' => $data));\n\treturn $output; \n}",
"function iahm_event_rss_render() {\n\tget_template_part( 'feed', 'event' );\n}",
"public function getAllEvents(){\r\n\t\t\techo '<div class=\"container-fluid\">\r\n\t\t\t\t\t\t<div class=\"row\">';\r\n\r\n\t\t\t$date_class = new date;\r\n\t\t\t$connect = $this->connect();\r\n\t\t\t$select_qry = \"SELECT * FROM tb_events ORDER BY dateTimeCreated DESC\";\r\n\t\t\tif ($result = mysqli_query($connect,$select_qry)){\r\n\t\t\t\twhile($row = mysqli_fetch_object($result)){\r\n\t\t\t\t\techo '<div class=\"col-sm-9\">\r\n\t\t\t\t\t\t\t<div class=\"panel panel-primary content-element\">\r\n\t\t\t\t\t\t\t\t <div class=\"panel-heading\">\r\n\t\t\t\t\t\t\t \t\t' .$row->events_title.''\r\n\t\t\t\t\t\t\t \t\t.'<span class=\"pull-right\">Date Posted: '.$date_class->dateFormat($row->dateTimeCreated).'</span>'.\r\n\t\t\t\t\t\t\t\t '</div>\r\n\t\t\t\t\t\t\t\t <div class=\"panel-body\">'\r\n\t\t\t\t\t\t\t\t \t.$row->events_value.\r\n\t\t\t\t\t\t\t\t '</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\techo '<div class=\"calendar-div\" style=\"\">';\r\n\t\t\t\t\t\t\techo '';\r\n\t\t\t\t\techo '</div>'; // end of col-sm-3 \r\n\t\t\t\techo \"</div>\"; // end of row\r\n\t\t\techo \"</div>\"; // end of container-fluid\r\n\r\n\t\t}",
"function show_event() {\r\r\n\t\t$items = $this->events_class->read_items($this->a_selected_date['d'], $this->a_selected_date['m'], $this->a_selected_date['y']);\r\r\n\t\t$head = $this->read_file('header');\r\r\n\t\t$head = str_replace('$date', date ('d M, Y',mktime(0,0,0,$this->a_selected_date['m'],$this->a_selected_date['d'],$this->a_selected_date['y'])), $head);\r\r\n\t\techo $head;\r\r\n\t\tif(is_array($items)){\r\r\n\t\t\tuasort($items,array('calendar','sort_by_time_start'));\r\r\n\t\t\tforeach($items as $k => $v) {\r\r\n\t\t\t\tif($v->title){\r\r\n\t\t\t\t\tif($v->is_time){\r\r\n\t\t\t\t\t\tif($this->a_template['time_format'])\r\r\n\t\t\t\t\t\t\t$time = ($v->time_start['h']>11?($v->time_start['h']-12).':'.$v->time_start['m'].\" pm\":$v->time_start['h'].':'.$v->time_start['m'].\" am\").' - '.($v->time_end['h']>11?($v->time_end['h']-12).':'.$v->time_end['m'].\" pm\":$v->time_end['h'].':'.$v->time_end['m'].\" am\");\r\r\n\t\t\t\t\t\telse $time = $v->time_start['h'].':'.$v->time_start['m'].' - '.$v->time_end['h'].':'.$v->time_end['m'];\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\telse $time = ' ';\r\r\n\t\t\t\t\t$c = $this->a_template['event_list_templ'];\r\r\n\t\t\t\t\t$c = str_replace('$num', ++$i, $c);\r\r\n\t\t\t\t\t$c = str_replace('$time', $time, $c);\r\r\n\t\t\t\t\t$c = str_replace('$date',date ('d M, Y',mktime(0,0,0,$this->a_selected_date['m'],$v->day,$this->a_selected_date['y'])), $c);\r\r\n\t\t\t\t\t$c = str_replace('$title', $v->title, $c);\r\r\n\t\t\t\t\techo str_replace('$body', $v->body, $c);\r\r\n\t\t\t\t}\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\techo $this->read_file('footer','_'.$this->s_calendar_index.'.html');\r\r\n\t}",
"public function get_upcoming() {\n\t\t$sql = \"SELECT DATE_FORMAT (datetime,'%M %e') as date, event FROM events\n\t\tWHERE datetime > now() limit 2\";\n\t\t$eh = $this->pdo->query($sql);\n\t\t$text = \"Upcoming Events: \\n-------------------\\n \";\n\t\t\tforeach ($eh as $ev ){\n\t\t\t\t$text .= $ev['date'] . \": \" . $ev['event'] . NL;\n\t\t\t}\n\t\t$text .= NL;\n\t\tfile_put_contents(FileDefs::next_dir . '/' . FileDefs::tease_calendar,$text);\n\t\t//echo $text . BRNL;\n\n\t\treturn true;\n\t}",
"private function html_events(&$a) {\n\t\tif('upcoming' != $a['selected_date']) {\n\t\t\t$a['num_events'] = 0;\n\t\t}\n\t\t$options['date_filter'] = $this->get_date_filter($a['date_filter'], $a['selected_date']);\n\t\t$options['cat_filter'] = $this->get_cat_filter($a['cat_filter'], $a['selected_cat']);\n\t\t$options['num_events'] = $a['num_events'];\n\t\t$order = 'date_desc' == $a['initial_order'] ? 'DESC' : 'ASC';\n\t\tif('1' !== $this->options->get('el_date_once_per_day')) {\n\t\t\t// normal sort\n\t\t\t$options['order'] = array('startdate '.$order, 'starttime ASC', 'enddate '.$order);\n\t\t}\n\t\telse {\n\t\t\t// sort according end_date before start time (required for option el_date_once_per_day)\n\t\t\t$options['order'] = array('startdate '.$order, 'enddate '.$order, 'starttime ASC');\n\t\t}\n\t\t$events = $this->events->get($options);\n\n\t\t// generate output\n\t\t$out = $this->html_feed_link($a, 'top');\n\t\t$out .= $this->html_filterbar($a);\n\t\t$out .= $this->html_feed_link($a, 'below_nav');\n\t\tif(empty($events)) {\n\t\t\t// no events found\n\t\t\t$out .= '<p>'.$this->options->get('el_no_event_text').'</p>';\n\t\t}\n\t\telse {\n\t\t\t// print available events\n\t\t\t$out .= '\n\t\t\t\t<ul class=\"event-list-view\">';\n\t\t\t$single_day_only = $this->is_single_day_only($events);\n\t\t\tforeach ($events as $event) {\n\t\t\t\t$out .= $this->html_event($event, $a, $single_day_only);\n\t\t\t}\n\t\t\t$out .= '</ul>';\n\t\t}\n\t\t$out .= $this->html_feed_link($a, 'bottom');\n\t\treturn $out;\n\t}",
"public function events()\n {\n $events = CalendarEvent::all();\n $result = array();\n $count=0;\n foreach($events as $ev)\n {\n $result[$count]['id']=$ev->id;\n $result[$count]['title']=$ev->name;\n $result[$count]['start']=$ev->init_at;\n $result[$count]['end']=$ev->end_at;\n $result[$count]['allDay']=$ev->all_day;\n $result[$count]['forceEventDuration']=true;\n $result[$count]['backgroundColor']=$ev->backgroundcolor;\n $count++;\n }\n echo json_encode($result);\n }",
"function print_upcoming_event ( $e, $date ) {\n global $display_link, $link_target, $SERVER_URL, $charset, $login,\n $display_tzid, $showTime, $showPopups, $eventinfo, $username,\n $hcalendar_output, $UPCOMING_DISPLAY_CAT_ICONS;\n\n $popupid = 'pop' . $e->getId () . '-' . $date;\n\n $private = $confidential = false;\n // Access: P=Public, R=Private, C=Confidential\n if ( $e->getAccess () == 'R' ) {\n // not a public event, so we will just display \"Private\"\n $private = true;\n }\n else if ( $e->getAccess () == 'C' ) {\n // not a public event, so we will just display \"Confidential\"\n $confidential = true;\n }\n\n if ( ! empty ( $SERVER_URL ) && ! $private && ! $confidential) {\n echo \"<div class=\\\"vevent\\\">\\n\";\n if ( $display_link ) {\n if ( $showPopups ) {\n $timestr = '';\n if ( $e->isAllDay () ) {\n $timestr = translate ( 'All day event' );\n } else if ( $e->getTime () >= 0 ) {\n $timestr = display_time ( $e->getDatetime () );\n if ( $e->getDuration () > 0 ) {\n $timestr .= ' - ' . display_time ( $e->getEndDateTime () );\n }\n }\n $eventinfo .= build_entry_popup ( 'eventinfo-' . $popupid, $username,\n $e->getDescription (), $timestr, site_extras_for_popup ( $e->getId () ),\n $e->getLocation (), $e->getName (), $e->getId () );\n }\n $link = \"<a class=\\\"entry\\\" id=\\\"$popupid\\\" title=\\\"\" .\n htmlspecialchars ( $e->getName () ) . '\" href=\"' .\n $SERVER_URL . 'view_entry.php?id=' .\n $e->getID () . \"&date=$date&user=\" . $e->getLogin ();\n if ( ! empty ( $link_target ) ) {\n $link .= \"\\\" target=\\\"$link_target\\\"\";\n }\n $link .= '>';\n if ( empty ( $UPCOMING_DISPLAY_CAT_ICONS ) ||\n $UPCOMING_DISPLAY_CAT_ICONS != 'N' ) {\n $catNum = abs ( $e->getCategory () );\n if ( $catNum > 0 ) {\n $catIcon = 'icons/cat-' . $catNum . '.gif';\n if ( file_exists ( $catIcon ) )\n echo $link .\n '<img src=\"' . $catIcon . '\" alt=\"category icon\" border=\"0\"/></a>';\n }\n }\n echo $link;\n }\n }\n if ( $private ) {\n echo '[' . translate ( 'Private' ) . ']';\n } else if ( $confidential ) {\n echo '[' . translate ( 'Confidential' ) . ']';\n } else {\n echo '<span class=\"summary\">' . htmlspecialchars ( $e->getName () ) . '</span>';\n }\n if ( $display_link && ! empty ( $SERVER_URL ) && ! $private ) {\n echo '</a>';\n }\n\n //added for hCalendar\n if ( $hcalendar_output ) {\n echo '<abbr class=\"dtstart\" title=\"'. export_ts_utc_date ($e->getDateTimeTS () )\n .'\">' . $e->getDateTime () . \"</abbr>\\n\";\n echo '<abbr class=\"dtend\" title=\"'. export_ts_utc_date ($e->getEndDateTimeTS () )\n . '\">' . $e->getEndDateTimeTS () . \"</abbr>\\n\";\n echo '<span class=\"description\">' . $e->getDescription () . \"</span>\\n\";\n if ( strlen ( $e->getLocation () ) > 0 )\n echo '<span class=\"location\">' . $e->getLocation () . \"</span>\\n\";\n $categories = get_categories_by_id ( $e->getId (), $username );\n $category = implode ( ', ', $categories);\n if ( strlen ( $category ) > 0 )\n echo '<span class=\"categories\">' . $category . \"</span>\\n\";\n if ( strlen ( $e->getUrl () ) > 0 )\n echo '<span class=\"url\">' . $e->getUrl () . \"</span>\\n\";\n $rrule = export_recurrence_ical( $e->getId () );\n if ( strlen ( $rrule ) > 6 )\n echo '<span class=\"rrule\">' . substr ( $rrule, 6 ) . \"</span>\\n\";\n }\n\n if ( $showTime ) { //show event time if requested (default=don't show)\n if ( $e->isAllDay () ) {\n echo ' (' . translate ( 'All day event' ) . \")\\n\";\n } else if ( $e->getTime () != -1 ) {\n echo ' (' . display_time ( $e->getDateTime (), $display_tzid ) . \")\\n\";\n }\n }\n\n echo \"</div>\\n\";\n\n }",
"public function upcoming()\n\t{\n\t\t$event = DB::table('events')->orderBy('date', 'asc')->where('date','>',NOW())->first();\n\t\treturn view('welcome')->with('event', $event);\n\t}",
"function csc_related_events_render($subtype, $conf, $panel_args, $context = NULL) {\n module_load_include('inc', 'csc_related', 'csc_related');\n\n //Get current node id\n $nodeid = csc_related_current_nid();\n //Future events\n $qry = \"SELECT fr.entity_id, UNIX_TIMESTAMP(ed.field_event_date_value) as stamp\n FROM field_data_field_related fr, node n, field_data_field_event_date ed\n WHERE fr.field_related_target_id=$nodeid\n AND fr.entity_id=n.nid\n AND ed.entity_type='node' AND ed.entity_id=fr.entity_id\n AND UNIX_TIMESTAMP() <= UNIX_TIMESTAMP(ed.field_event_date_value)\n AND n.status = 1\n AND fr.bundle='event'\n ORDER BY stamp ASC\n LIMIT 3\";\n\n $r = db_query($qry);\n $nids = array();\n foreach($r as $row) $nids[] = $row->entity_id;\n\n //Less than 3 events, search past events\n $count = sizeof($nids);\n if($count < 3){\n $limit = 3 - $count;\n $qry = \"SELECT fr.entity_id, UNIX_TIMESTAMP(ed.field_event_date_value) as stamp\n FROM field_data_field_related fr, node n, field_data_field_event_date ed\n WHERE fr.field_related_target_id=$nodeid\n AND fr.entity_id=n.nid\n AND ed.entity_type='node' AND ed.entity_id=fr.entity_id\n AND UNIX_TIMESTAMP() > UNIX_TIMESTAMP(ed.field_event_date_value)\n AND n.status = 1\n AND fr.bundle='event'\n ORDER BY stamp DESC\n LIMIT $limit\";\n\n $r = db_query($qry);\n foreach($r as $row) $nids[] = $row->entity_id;\n }\n \n if(sizeof($nids)){\n $output = '<div class=\"see-all\"><a href=\"'. url('events/' . csc_related_current_nid()) .'\">SEE ALL</a></div>';\n $class = 'csc-item-num-' . sizeof($nids);\n foreach($nids as $nid){\n $node = node_load($nid);\n $lng = $node->language;\n $output .= theme('csc_related_events_item', array('title' => $node->title,\n 'body' => isset($node->field_small_teaser[$lng][0]['value']) ? $node->field_small_teaser[$lng][0]['value']: '',\n 'nid' => $node->nid,\n 'location' => ($node->field_location) ? $node->field_location[$lng][0] : '',\n 'image' => ($node->field_featured_image) ? $node->field_featured_image[$lng][0]['uri'] : '',\n 'date' => isset($node->field_event_date[$lng][0]) ? $node->field_event_date[$lng][0] : '',\n 'class' => $class,\n ));\n }\n\n $block = new stdClass();\n $block->title = 'Events';\n $block->content = $output;\n\n return $block;\n }\n}",
"function ja_upcoming_events_none() {\n\n\tglobal $events_found;\n\n\tif ( $events_found ) {\n\t\treturn '<h4>More events will be scheduled soon!</h4>';\n\t} else {\n\t\treturn '<h4>There are currently no events scheduled, however check back soon!</h4>';\n\t}\n}",
"public function indexHistoric()\n {\n $events = Event::with('contact')->historic()->orderBy('start', 'desc')->paginate(15);\n\n return view('event.index', ['events' => $events, 'title' => 'Past Events', 'show_locations' => false]);\n }",
"function tec_get_upcoming_events($separator='<\\b\\r>') {\n\tglobal $events_table;\n\t$upcoming_events = get_recent_items($events_table, 3);\n\t$ul = '';\n\tif($upcoming_events != '') {\t\n\t\t$ul = '<ul id=\"tec_upcoming\">';\n\t\tforeach($upcoming_events as $event) {\n\t\t\t$ul .= '<li><a href=\"/event/' . $event->id . '\"><span class=\"event_date\">';\n\t\t\t$ul .= format_date($event->date,'M'. $separator . 'd' . $separator . 'Y');\n\t\t\t$ul .= '</span><span class=\"event_title\">';\n\t\t\t$ul .= $event->title;\n\t\t\t$ul .= '</span><p>';\n\t\t\t$ul .= $event->time;\n\t\t\t$ul .= ' @ ';\n\t\t\t$ul .= $event->location;\n\t\t\t$ul .= '</p></a></li>';\n\t\t}\n\t\t$ul .= '</ul>';\n\t}\t\n\treturn $ul;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Register the REST daemon route init | public function register_rest() {
// Get runner status
$route_args = array(
'methods' => 'GET',
'callback' => array( $this, 'status' ),
);
register_rest_route( 'cron-master/v1', '/status', $route_args );
// Set cron runner
$route_args = array(
'methods' => 'GET',
'callback' => array( $this, 'do_cron' ),
);
register_rest_route( 'cron-master/v1', '/cron', $route_args );
// Run daemon Process.
$route_args = array(
'methods' => 'GET',
'permission_callback' => array( $this, 'verify' ),
'callback' => array( $this, 'daemon' ),
);
register_rest_route( 'cron-master/v1', '/daemon', $route_args );
} | [
"public function rest_api_register_routes() {\n\t}",
"public function register_rest_routes()\n {\n }",
"public static function rest_api_init() {\n\t\tregister_rest_route( 'arnie/v1', '/bots/(?P<id>[\\d]+)', array(\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'POST', 'PUT' ),\n\t\t\t\t'callback' => array( __CLASS__, 'rest_handle' ),\n\t\t\t\t'args' => array(\n\t\t\t\t\t'state' => array(\n\t\t\t\t\t\t'description' => __( 'The session state for this conversation JSON in base64.', 'arniebot' ),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'message' => array(\n\t\t\t\t\t\t'description' => __( 'The message to the bot.', 'arniebot' ),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t) );\n\t}",
"public function _initRest(){\n $frontController = Zend_Controller_Front::getInstance();\n $restRoute = new Zend_Rest_Route($frontController, array(), array('api' => array('objects', 'status')));\n $frontController->getRouter()->addRoute('rest', $restRoute);\n $frontController->setRequest(new REST_Request);\n $frontController->setResponse(new REST_Response);\n $router = $frontController->getRouter();\n $config = new Zend_Config_Ini(APPLICATION_PATH . '/config/routes.ini', 'production');\n $router->addConfig($config, 'routes');\n }",
"public function hook_rest_server() {\n\t\tadd_action( 'rest_api_init', array( $this, 'register_routes' ) );\n\t}",
"public static function register_rest_routes() {\n\t\tforeach (static::$apis as $api) {\n\t\t\t$api->register_rest_route();\n\t\t}\n }",
"public function register_routes() {}",
"public function register_routes() {\n\t\tregister_rest_route('ajaxendpoint/v1', '/dummy-data/', array(\n\t\t\t'methods' => 'GET',\n\t\t\t'callback' => array( $this, 'get_dummy_data' ),\n\t\t\t'permission_callback' => '__return_true'\n\t\t\t)\n\t\t);\n\t}",
"public function register_rest_endpoint() {\n\t\tregister_rest_route(\n\t\t\t$this->get_app_name() . '/v' . wpcd_rest_version,\n\t\t\t'/command/(?P<id>\\d+)/(?P<name>.+)/(?P<status>.+)/(?P<cmdid>\\d+)/',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET' ),\n\t\t\t\t'callback' => array( $this, 'perform_command' ),\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\t}",
"public function register_route() {\n\t\t$namespace = 'utec/v1';\n\n\t\tregister_rest_route(\n\t\t\t$namespace,\n\t\t\t'get-users', \n\t\t\t[\n\t\t\t\t'methods' => 'POST',\n\t\t\t\t'callback' => [ $this, 'process_request' ],\n\t\t\t]\n\t\t);\n\t}",
"public function initializeRouter()\r\n {\r\n $this->route = trim($this->app->request->get('route') , '/');\r\n\r\n $this->route = $this->route ? explode('/' , $this->route) : false;\r\n\r\n $this->setScript();\r\n\r\n $this->establishRoutes();\r\n\r\n $this->setRouteKey();\r\n\r\n $this->setRouteController();\r\n\r\n $this->setControllerMethod();\r\n\r\n $this->setControllerArguments();\r\n\r\n }",
"private function initRouter()\r\n {\r\n try {\r\n $routing = Routing::getInstance();\r\n $routing->addRoutes($this->rest);\r\n $routing->setCors(\"*\", \"origin, content-type, accept, authorization\");\r\n $routing = $routing->processRoutingRequest($this->target);\r\n if (!$routing) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' 400 ERROR');\r\n header(\"Content-Type: application/json\");\r\n echo json_encode(array(\"errorCode\" => 'ROUTER_NOT_FOUND'));\r\n die();\r\n }\r\n } catch (Exception $e) {\r\n header($_SERVER['SERVER_PROTOCOL'] . ' 500 FATAL ERROR');\r\n die(json_encode($e->getMessage()));\r\n }\r\n }",
"protected function init_routes() \n\t{\n\t\t$this->routes[\"([^\\\\/]+)\"] = array(\n\t\t\t\"method\" => \"set_controller_action_parameters\",\n\t\t);\n\t}",
"protected function _initRestRoute() {\r\n\t\t// Configure the Hostname Route for the api subdomain\r\n\t\t$op = $this->getOptions();\r\n\t\t$hostnameRoute = new Zend_Controller_Router_Route_Hostname($op['api']['domain']);\r\n\t\t\r\n\t\t// Configure the REST Route to use the api module\r\n\t\t$front = Zend_Controller_Front::getInstance();\r\n\t\t$pathRoute = new Zend_Rest_Route($front, array('module' => 'api'));\r\n\t\t\r\n\t\t// Chain the REST and Hostname routes\r\n\t\t$chainedRoute = new Zend_Controller_Router_Route_Chain();\r\n\t\t$chainedRoute->chain($hostnameRoute)\r\n\t\t ->chain($pathRoute);\r\n\t\t\r\n\t\t// Add the route to the REST controller using a Hostname Router\r\n\t\t$front->getRouter()->addRoute('api', $chainedRoute);\r\n\t}",
"function __construct(){\n $this->routes = array();\n // Add default notfound route\n $this->add(\"notfound\",function(){\n echo \"404\";\n });\n }",
"public function register_routes()\n {\n register_rest_route($this->namespace, $this->rest_base, array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_menus'),\n )\n ));\n register_rest_route($this->namespace, $this->rest_base . '/(?P<slug>[a-zA-Z0-9_-]+)', array(\n array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array($this, 'get_menu'),\n )\n ));\n }",
"public function addRestRoutes()\n {\n }",
"public function rest_api_init() {\n\t\tglobal $wp_version;\n\n\t\t// REST API was included starting WordPress 4.4.\n\t\tif ( version_compare( $wp_version, 4.4, '<' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Init REST API routes.\n\t\tadd_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );\n\t}",
"public function __construct() {\n\t\tadd_action( 'rest_api_init', array( $this, 'register_rest_routes' ) );\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a script which makes a call only if the user answers yes to the given question | public function confirm(string $sQuestion, string $sYesScript, string $sNoScript): string; | [
"public function hasAnswer();",
"function confirmEntry($voice) {\n\t$confirm = ask(\"Is that correct?\", array(\"choices\" => \"yes,no\", \"voice\" => $voice));\n\treturn $confirm->value == \"yes\" ? true : false;\n}",
"public function yes()\n {\n $result = $this -> isSent() && $this -> request -> {$this->method}('yes');\n \n if ($result && $this -> autoFinish) {\n $this -> finish();\n }\n \n return $result;\n }",
"public function ask($question) {\n\t\t$this->write($question . ' (y/n) ');\n\t\t$response = strtolower(trim(fgets(STDIN)));\n\n\t\tif(!in_array($response, array('y','n','yes','no'))) {\n\t\t\t$this->writeLn('Invalid response');\n\t\t\treturn $this->ask($question);\n\t\t}\n\n\t\treturn in_array($response, array('y','yes'));\n\t}",
"public function askQuestion(Question $question);",
"public function hasAcceptedAnswer();",
"public static function ask(string $question);",
"public function askConfirmation($question, $default = true);",
"public function confirm()\n {\n $yes = strtolower( $this->listener->getInput() );\n return empty($yes) || substr($yes, 0, 1) === 'y' || $yes === 1;\n }",
"public function confirm($question, $yesScript, $noScript)\n {\n if(!$noScript)\n {\n return \"jaxon.confirm.overhang(\" . $question . \",function(){\" . $yesScript . \";})\";\n }\n else\n {\n return \"jaxon.confirm.overhang(\" . $question . \",function(){\" . $yesScript . \";},function(){\" . $noScript . \";})\";\n }\n }",
"protected function askYesNo($question)\n\t{\n\t\treturn $this->confirm($question) === 'y' ? true : false;\n\t}",
"function i_demand_a_response($prompt){\n do {\n $yn = \" [y|n]:\";\n if(function_exists(\"readline\")){\n $input = readline($prompt.$yn);\n readline_add_history(trim($input));\n } else {\n echo $prompt.$yn;\n $input = fgets(STDIN);\n }\n if(strtolower(substr($input,0,1))==\"y\"){\n return TRUE;\n } elseif(strtolower(substr($input,0,1))==\"n\"){\n return FALSE;\n }\n } while (TRUE);\n}",
"public function confirm($question, $yesScript, $noScript)\n {\n $title = $this->getConfirmTitle();\n if(!$noScript)\n {\n return \"jaxon.confirm.noty(\" . $question . \",function(){\" . $yesScript . \";})\";\n }\n else\n {\n return \"jaxon.confirm.noty(\" . $question . \",function(){\" . $yesScript . \";},function(){\" . $noScript . \";})\";\n }\n }",
"function displayInscriptReqd($id) \n{\n\tif ($id == 'Y' or $id == 'y') { \n\t\techo \"Yes\"; \n\t} else { \n\t\techo \"No\"; \n\t}\n}",
"public function chooseQuestion();",
"public function askCommand()\n {\n $a = Interact::ask('you name is: ', null, function ($val, &$err) {\n if (!preg_match('/^\\w{2,}$/', $val)) {\n $err = 'Your input must match /^\\w{2,}$/';\n\n return false;\n }\n\n return true;\n });\n\n $this->write('Your answer is: ' . $a);\n }",
"function ask($question, $valid_answers = false, $no_echo = false) {\n\n\toutput(\"$question:\");\n\n\t// disable echoing of what is typed\n\tif($no_echo) {\n\t\tsystem('stty -echo');\n\t}\n\n\tif(!isset($GLOBALS['StdinPointer'])) {\n\t\t$GLOBALS['StdinPointer'] = fopen(\"php://stdin\",\"r\");\n\t}\n\t$cmd_input = trim(fgets($GLOBALS['StdinPointer'], \"255\"));\n\n\t// re-enable echoing after typing\n\tif($no_echo) {\n\t\tsystem('stty echo');\n\t}\n\n\tif($valid_answers) {\n\t\t$answer_is_valid = false;\n\t\tforeach($valid_answers as $valid_answer) {\n\t\t\tif(preg_match(\"/^\".$valid_answer.\"$/\", $cmd_input)) {\n\t\t\t\t$answer_is_valid = true;\n\t\t\t}\n\t\t}\n\n\t\tif(!$answer_is_valid){\n\t\t\toutput(\"Invalid response! Try again!\");\n\t\t\t$cmd_input = ask($question, $valid_answers, $no_echo);\n\t\t}\n\t}\n\treturn $cmd_input;\n}",
"abstract public function confirm(string $question, bool $default = false);",
"function correctAnswer() {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Asserts that an attribute is of a given type. | public function assertAttributeInternalType($expected, $attributeName, $classOrObject) {
$this->callAssertMethod(__FUNCTION__, [
'expected' => $key,
]);
} | [
"public static function assertAttributeElementHasOnlyTypeAttribute(\n AttributeElement $sut\n ): void\n {\n self::assertFalse($sut->hasDefault());\n self::assertFalse($sut->hasFixed());\n self::assertFalse($sut->hasForm());\n self::assertFalse($sut->hasId());\n self::assertFalse($sut->hasName());\n self::assertFalse($sut->hasRef());\n self::assertTrue($sut->hasType());\n self::assertFalse($sut->hasUse());\n }",
"public static function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '') {}",
"public function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null) {\n $this->callAssertMethod(__FUNCTION__, [\n 'expected' => $key,\n ]);\n }",
"function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')\n{\n return call_user_func_array(\n 'PHPUnit_Framework_Assert::assertAttributeInstanceOf',\n func_get_args()\n );\n}",
"static function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertAttributeContainsOnly', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public static function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')\n {\n self::getTestCase()->assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType, $message);\n }",
"public function testCanRetrieveAttributeValue() : void\r\n {\r\n $this->assertEquals(\r\n 'text',\r\n $this->getFake()\r\n ->setAttribute('type', 'text')\r\n ->getAttributeValue('type')\r\n );\r\n }",
"public function getHasAttributeTypeRequired($type);",
"static function get_valid_attribute_type($type = false)\n {\n return UsabilityDynamics\\WPP\\Attributes::get_valid_attribute_type($type);\n }",
"public function testGetAttributeType()\n {\n $this->markTestIncomplete();\n }",
"public function assertAllowedType($element);",
"public function assertElementType(NodeElement $element, $type) {\n if ($element->getTagName() !== $type) {\n throw new ExpectationException(\"The element is not a '$type'' field.\", $this->getSession());\n }\n }",
"public function setAttributeType($type)\n\t{\n\t\t$this->type = $type;\n\t}",
"abstract protected function validateAttribute(AttributeMetadata $attribute);",
"function attType($att){ return lookupAttribute($att)->type(); }",
"abstract protected function validateAttribute($object, $attribute);",
"function assert_ast_type( $ast, $expected ) {\n $type = ast_node_type($ast);\n if( is_string( $expected ) ) {\n grokit_logic_assert( $type == $expected,\n 'Node Type Mismatch: Exptected ' . $expected . ', got '\n . $type . ' from ' . ast_node_source($ast) );\n }\n else if( is_array( $expected ) ) {\n grokit_logic_assert( in_array( $type, $expected ),\n 'Node Type Mismatch: Expected one of [' . implode(', ', $expected)\n . '] got ' . $type . ' from ' . ast_node_source($ast));\n }\n }",
"public function testGetExpectedAttribute()\n {\n // check one value\n $value = 'value';\n $attributes = array(\n 'attribute' => array($value),\n );\n $expected = 'attribute';\n $this->assertEquals($value, Attributes::getExpectedAttribute($attributes, $expected));\n\n // check multiple (allowed) values\n $value = 'value';\n $attributes = array(\n 'attribute' => array($value, 'value2', 'value3'),\n );\n $expected = 'attribute';\n $this->assertEquals($value, Attributes::getExpectedAttribute($attributes, $expected, true));\n }",
"function isAttr($attrName, $object)\n{\n Assert::assertNotNull($object, 'object ' . get_class($object) . ' is not empty');\n Assert::assertObjectHasAttribute($attrName, $object);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract disabled content features from input post. | private function get_disabled_content_features($core, &$content)
{
$set = [
H5PCore::DISPLAY_OPTION_FRAME => (bool)$this->request->getArgument('frame'),
H5PCore::DISPLAY_OPTION_DOWNLOAD => (bool)$this->request->getArgument('download'),
H5PCore::DISPLAY_OPTION_EMBED => (bool)$this->request->getArgument('embed'),
H5PCore::DISPLAY_OPTION_COPYRIGHT => (bool)$this->request->getArgument('copyright')
];
$content['disable'] = $core->getStorableDisplayOptions($set, $content['disable']);
} | [
"function get_post_features(){\n\t$fields = get_fields();\n\n\tif(!$fields) return;\n\n\tforeach ($fields as $key => $val) {\n\t\tif(preg_match('#^featured_article_\\d+#', $key) && $val )\n\t\t\t$features[] = $val;\n\t}\n\n\treturn $features;\n}",
"public function get_disabled_post_state()\n {\n }",
"function extract_posted_dynamic_fields($DB, $post, $disabled) {\n\t\t$dyn_fields = array();\n\t\twhile (list($key, $value) = each($post))\n\t\t{\n\t\t\t// if the field is enabled, check it\n\t\t\tif (!isset($disabled[$key]))\n\t\t\t{\n\t\t\t\tif (substr($key,0,11)=='info_field_')\n\t\t\t\t{\n\t\t\t\t\tlist ($field_id, $val_index) = explode ('_', substr($key,11));\n\t\t\t\t\tif (is_numeric($field_id) && is_numeric($val_index))\n\t\t\t\t\t$dyn_fields[$field_id][$val_index] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $dyn_fields;\n\t}",
"function get_all_post_type_features($post_type = 'post', $excluded_features = array()){\n\t#see https://knowthecode.io/labs/custom-post-type-basics#configure-features\n\t$raw_features = get_all_post_type_supports($post_type);\n\n\tif(!$excluded_features){return array_keys($raw_features);}\n\n\t$included_features = array();\n\tforeach($raw_features as $key => $value){\n\t\tif(!in_array($key, $excluded_features)){\n\t\t\t$included_features[]=$key;\n\t\t}\n\t}\n\treturn $included_features;\n}",
"private function get_disabled_data() {\r\n\t\tglobal $post;\r\n\r\n\t\tif ( rocket_get_constant( 'WP_ROCKET_IS_TESTING', false ) ) {\r\n\t\t\t$this->disabled_data = null;\r\n\t\t}\r\n\r\n\t\tif ( isset( $this->disabled_data ) ) {\r\n\t\t\treturn $this->disabled_data;\r\n\t\t}\r\n\r\n\t\tif ( 'publish' !== $post->post_status ) {\r\n\t\t\t$this->disabled_data['not_published'] = 1;\r\n\t\t}\r\n\r\n\t\tif ( ! $this->options->get( 'async_css', 0 ) ) {\r\n\t\t\t$this->disabled_data['option_disabled'] = 1;\r\n\t\t}\r\n\r\n\t\tif ( get_post_meta( $post->ID, '_rocket_exclude_async_css', true ) ) {\r\n\t\t\t$this->disabled_data['option_excluded'] = 1;\r\n\t\t}\r\n\r\n\t\treturn $this->disabled_data;\r\n\t}",
"private function getExcludedPost() : array\n {\n return (array) get_field( 'custom_exclude_post' , 'options' );\n }",
"function get_all_post_type_features( $post_type = 'post', $exclude_features = array() ) {\n\t$configured_features = get_all_post_type_supports( $post_type );\n\n\tif ( ! $exclude_features ) {\n\t\treturn array_keys( $configured_features );\n\t}\n\n\t$features = array();\n\n\tforeach ( $configured_features as $feature => $value ) {\n\t\tif ( in_array( $feature, $exclude_features, true ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$features[] = $feature;\n\t}\n\n\treturn $features;\n\n}",
"function cfct_build_disable($the_excerpt) {\n\tremove_filter('the_content', 'cfct_build_the_content');\n\t// remove_filter('get_the_excerpt', 'cfct_build_disable', 1);\n\tadd_filter('get_the_excerpt', 'cfct_build_enable', 99999);\n\treturn $the_excerpt;\n}",
"public function get_disabled_post_state() {\n\t\t\treturn '<span class=\"dashicons dashicons-hidden\"></span> ' . _x( 'Disabled', 'post status', 'acf' );\n\t\t}",
"protected function filter_enabled_features($enabled_features)\n {\n }",
"function %DOMAIN_NAME%_disable_block_editor_by_post($enabled, $post) {\n if ( !GWP_BLOCK_EDITOR ) return false;\n\n if ( in_array($post->post_type, ['product']) ) {\n $enabled = false;\n }\n return $enabled;\n}",
"function acf_allow_unfiltered_html() { }",
"private static function get_enabled_features()\n {\n }",
"private function migrateExclusions() {\n\t\t$excludedPosts = aioseo()->options->sitemap->news->advancedSettings->excludePosts;\n\t\t$toExclude = aioseo()->db\n\t\t\t->start( 'postmeta as pm' )\n\t\t\t->select( 'pm.post_id' )\n\t\t\t->whereRaw( \"`pm`.`meta_key` = '_seopress_news_disabled'\" )\n\t\t\t->whereRaw( \"`pm`.`meta_value` = 'yes'\" )\n\t\t\t->run()\n\t\t\t->result();\n\n\t\tif ( count( $toExclude ) ) {\n\t\t\tforeach ( $toExclude as $record ) {\n\t\t\t\t$post = aioseo()->helpers->getPost( $record->post_id );\n\t\t\t\tif ( ! is_object( $post ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$excludedPost = new \\stdClass();\n\t\t\t\t$excludedPost->value = $post->ID;\n\t\t\t\t$excludedPost->type = $post->post_type;\n\t\t\t\t$excludedPost->label = $post->post_title;\n\t\t\t\t$excludedPost->link = get_permalink( $post->ID );\n\n\t\t\t\tarray_push( $excludedPosts, wp_json_encode( $excludedPost ) );\n\t\t\t}\n\t\t\taioseo()->options->sitemap->news->advancedSettings->enable = true;\n\t\t}\n\t\taioseo()->options->sitemap->news->advancedSettings->excludePosts = $excludedPosts;\n\t}",
"public function modify_post_supports()\n {\n remove_post_type_support(self::SLUG, 'custom-fields');\n }",
"function acf_allow_unfiltered_html()\n{\n}",
"public function filter_metabox_disabled($post_types)\n {\n }",
"private function migrateDisabledPosts() {\n\t\tif ( empty( $this->oldOptions['aiosp_ex_pages'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$deprecatedOptions = aioseo()->internalOptions->internal->deprecatedOptions;\n\t\tif ( ! in_array( 'excludePosts', $deprecatedOptions, true ) ) {\n\t\t\tarray_push( $deprecatedOptions, 'excludePosts' );\n\t\t\taioseo()->internalOptions->internal->deprecatedOptions = $deprecatedOptions;\n\t\t}\n\n\t\t$excludedPosts = aioseo()->options->deprecated->searchAppearance->advanced->excludePosts;\n\t\t$pages = explode( ',', $this->oldOptions['aiosp_ex_pages'] );\n\t\tif ( count( $pages ) ) {\n\t\t\tforeach ( $pages as $page ) {\n\t\t\t\t$page = trim( $page );\n\t\t\t\t$id = intval( $page );\n\t\t\t\tif ( ! $id ) {\n\t\t\t\t\t$post = get_page_by_path( $page, OBJECT, aioseo()->helpers->getPublicPostTypes( true ) );\n\t\t\t\t\tif ( $post && is_object( $post ) ) {\n\t\t\t\t\t\t$id = $post->ID;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( $id ) {\n\t\t\t\t\t$post = get_post( $id );\n\t\t\t\t\tif ( ! is_object( $post ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$excludedPost = new \\stdClass();\n\t\t\t\t\t$excludedPost->value = $id;\n\t\t\t\t\t$excludedPost->type = $post->post_type;\n\t\t\t\t\t$excludedPost->label = $post->post_title;\n\t\t\t\t\t$excludedPost->link = get_permalink( $id );\n\n\t\t\t\t\tarray_push( $excludedPosts, wp_json_encode( $excludedPost ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\taioseo()->options->deprecated->searchAppearance->advanced->excludePosts = $excludedPosts;\n\t}",
"function tinymce_content_edit_disable( $args ) \n\t\t{\n\t\t\tglobal $post;\n\t\t\tif ( $this->is_page_locked_for_current_user() && $this->is_page_content_locked($post->ID) ) {\n \t\t$args['readonly'] = 1;\n \t}\n \treturn $args;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Default Constructor. Determines whether or not the mcrypt extension should be used. $mode could be: CRYPT_DES_MODE_ECB CRYPT_DES_MODE_CBC CRYPT_DES_MODE_CTR CRYPT_DES_MODE_CFB CRYPT_DES_MODE_OFB CRYPT_DES_MODE_3CBC If not explicitly set, CRYPT_DES_MODE_CBC will be used. | public function __construct($mode = CRYPT_DES_MODE_ECB)
{
switch ($mode) {
// In case of CRYPT_DES_MODE_3CBC, we init as CRYPT_DES_MODE_CBC
// and additional flag us internally as 3CBC
case CRYPT_DES_MODE_3CBC:
parent::Crypt_Base(CRYPT_MODE_CBC);
$this->mode_3cbc = true;
// This three $des'es will do the 3CBC work (if $key > 64bits)
$this->des = array(
new Crypt_DES(CRYPT_MODE_CBC),
new Crypt_DES(CRYPT_MODE_CBC),
new Crypt_DES(CRYPT_MODE_CBC),
);
// we're going to be doing the padding, ourselves, so disable it in the Crypt_DES objects
$this->des[0]->disablePadding();
$this->des[1]->disablePadding();
$this->des[2]->disablePadding();
break;
// If not 3CBC, we init as usual
default:
parent::__construct($mode);
}
return $this;
} | [
"function Crypt_DES($mode = CRYPT_MODE_DES_CBC)\r\n {\r\n if ( !defined('CRYPT_DES_MODE') ) {\r\n switch (true) {\r\n case extension_loaded('mcrypt'):\r\n // i'd check to see if des was supported, by doing in_array('des', mcrypt_list_algorithms('')),\r\n // but since that can be changed after the object has been created, there doesn't seem to be\r\n // a lot of point...\r\n define('CRYPT_DES_MODE', CRYPT_DES_MODE_MCRYPT);\r\n break;\r\n default:\r\n define('CRYPT_DES_MODE', CRYPT_DES_MODE_INTERNAL);\r\n }\r\n }\r\n\r\n switch ( CRYPT_DES_MODE ) {\r\n case CRYPT_DES_MODE_MCRYPT:\r\n switch ($mode) {\r\n case CRYPT_DES_MODE_ECB:\r\n $this->mode = MCRYPT_MODE_ECB;\r\n break;\r\n case CRYPT_DES_MODE_CBC:\r\n default:\r\n $this->mode = MCRYPT_MODE_CBC;\r\n }\r\n\r\n break;\r\n default:\r\n switch ($mode) {\r\n case CRYPT_DES_MODE_ECB:\r\n case CRYPT_DES_MODE_CBC:\r\n $this->mode = $mode;\r\n break;\r\n default:\r\n $this->mode = CRYPT_DES_MODE_CBC;\r\n }\r\n }\r\n }",
"function Crypt_DES($mode = CRYPT_DES_MODE_CBC)\n {\n if ( !defined('CRYPT_DES_MODE') ) {\n switch (true) {\n case extension_loaded('mcrypt') && in_array('des', mcrypt_list_algorithms()):\n define('CRYPT_DES_MODE', CRYPT_DES_MODE_MCRYPT);\n break;\n default:\n define('CRYPT_DES_MODE', CRYPT_DES_MODE_INTERNAL);\n }\n }\n\n switch ( CRYPT_DES_MODE ) {\n case CRYPT_DES_MODE_MCRYPT:\n switch ($mode) {\n case CRYPT_DES_MODE_ECB:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_ECB;\n break;\n case CRYPT_DES_MODE_CTR:\n $this->mode = 'ctr';\n //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_DES_MODE_CTR;\n break;\n case CRYPT_DES_MODE_CFB:\n $this->mode = 'ncfb';\n $this->ecb = mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_ECB, '');\n break;\n case CRYPT_DES_MODE_OFB:\n $this->mode = MCRYPT_MODE_NOFB;\n break;\n case CRYPT_DES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_CBC;\n }\n $this->enmcrypt = mcrypt_module_open(MCRYPT_DES, '', $this->mode, '');\n $this->demcrypt = mcrypt_module_open(MCRYPT_DES, '', $this->mode, '');\n\n break;\n default:\n switch ($mode) {\n case CRYPT_DES_MODE_ECB:\n case CRYPT_DES_MODE_CBC:\n $this->paddable = true;\n $this->mode = $mode;\n break;\n case CRYPT_DES_MODE_CTR:\n case CRYPT_DES_MODE_CFB:\n case CRYPT_DES_MODE_OFB:\n $this->mode = $mode;\n break;\n default:\n $this->paddable = true;\n $this->mode = CRYPT_DES_MODE_CBC;\n }\n if (function_exists('create_function') && is_callable('create_function')) {\n $this->inline_crypt_setup();\n $this->use_inline_crypt = true;\n }\n }\n }",
"public function __construct($mode = CRYPT_RIJNDAEL_MODE_CBC)\n {\n parent::__construct($mode);\n }",
"function setMode($mode)\n {\n $this->_mcryptMode = $mode;\n }",
"function set_mode($mode) {\n\t\t$this->_mcrypt_mode = $mode;\n\t}",
"function set_mode($mode)\n\t{\n\t\t$this->_mcrypt_mode = $mode;\n\t}",
"function set_mode($mode)\n\t{\n\t\t$this->mcrypt_mode = $mode;\n\t}",
"public function set_mode($mode)\n {\n $this->_mcrypt_mode = $mode;\n return $this;\n }",
"function Crypt_AES($mode = CRYPT_AES_MODE_CBC)\n {\n if ( !defined('CRYPT_AES_MODE') ) {\n switch (true) {\n case extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()):\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_MCRYPT);\n break;\n default:\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL);\n }\n }\n\n switch ( CRYPT_AES_MODE ) {\n case CRYPT_AES_MODE_MCRYPT:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n // ctr doesn't have a constant associated with it even though it appears to be fairly widely\n // supported. in lieu of knowing just how widely supported it is, i've, for now, opted not to\n // include a compatibility layer. the layer has been implemented but, for now, is commented out.\n $this->mode = 'ctr';\n //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_AES_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = 'ncfb';\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = MCRYPT_MODE_NOFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_CBC;\n }\n\n break;\n default:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n $this->mode = CRYPT_RIJNDAEL_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_CFB;\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_OFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\n }\n }\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_INTERNAL) {\n parent::Crypt_Rijndael($this->mode);\n }\n }",
"function Crypt_AES($mode = CRYPT_AES_MODE_CBC)\n {\n if ( !defined('CRYPT_AES_MODE') ) {\n switch (true) {\n case extension_loaded('mcrypt') && in_array('rijndael-128', mcrypt_list_algorithms()):\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_MCRYPT);\n break;\n default:\n define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL);\n }\n }\n\n switch ( CRYPT_AES_MODE ) {\n case CRYPT_AES_MODE_MCRYPT:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n // ctr doesn't have a constant associated with it even though it appears to be fairly widely\n // supported. in lieu of knowing just how widely supported it is, i've, for now, opted not to\n // include a compatibility layer. the layer has been implemented but, for now, is commented out.\n $this->mode = 'ctr';\n //$this->mode = in_array('ctr', mcrypt_list_modes()) ? 'ctr' : CRYPT_AES_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = 'ncfb';\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = MCRYPT_MODE_NOFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = MCRYPT_MODE_CBC;\n }\n\n break;\n default:\n switch ($mode) {\n case CRYPT_AES_MODE_ECB:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_ECB;\n break;\n case CRYPT_AES_MODE_CTR:\n $this->mode = CRYPT_RIJNDAEL_MODE_CTR;\n break;\n case CRYPT_AES_MODE_CFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_CFB;\n break;\n case CRYPT_AES_MODE_OFB:\n $this->mode = CRYPT_RIJNDAEL_MODE_OFB;\n break;\n case CRYPT_AES_MODE_CBC:\n default:\n $this->paddable = true;\n $this->mode = CRYPT_RIJNDAEL_MODE_CBC;\n }\n }\n\n if (CRYPT_AES_MODE == CRYPT_AES_MODE_INTERNAL) {\n parent::Crypt_Rijndael($this->mode);\n }\n\n }",
"function _get_mode()\n\t{\n\t\tif ($this->_mcrypt_mode == '')\n\t\t{\n\t\t\t$this->_mcrypt_mode = MCRYPT_MODE_CBC;\n\t\t}\n\n\t\treturn $this->_mcrypt_mode;\n\t}",
"function __construct($mode) {\n\t\t\t$this->_mode = $mode;\n\t\t\t$this->setConfig();\n\t\t}",
"function __construct() {\n\t\t$this->_mcrypt_exists = (! function_exists ( 'mcrypt_encrypt' )) ? FALSE : TRUE;\n\t}",
"function __construct($mode) {\n $this->_mode = $mode;\n $this->setConfig();\n }",
"public function __construct($algo = MCRYPT_3DES, $mode = MCRYPT_MODE_CBC, $rand = MCRYPT_RAND) {\n\t\t$this->algo = $algo;\n\t\t$this->mode = $mode;\n\t\t$this->rand = $rand;\n\n\t\t$this->iv_size = mcrypt_get_iv_size($this->algo, $this->mode);\n\t}",
"protected function _get_mode()\n {\n if ($this->_mcrypt_mode === NULL)\n {\n return $this->_mcrypt_mode = MCRYPT_MODE_CBC;\n }\n\n return $this->_mcrypt_mode;\n }",
"function __construct($mode = null)\n\t{\n\t\t$this->_mode = $this->getMode($mode);\n\t\t$this->setEnv();\n\t}",
"function __construct($mode = null)\n {\n $this->_mode = $this->getMode($mode);\n $this->setEnvironment();\n }",
"function setEncryptionMode($mode)\n {\n $this->encryptionMode = $mode;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Condition: Flag is flagged. | function flag_rules_condition_flagged($flag, $entity, $account) {
return $flag->is_flagged($flag->get_content_id($entity), $account->uid);
} | [
"public function contextFlagConditionCheck() {\n if ($this->condition_used()) {\n $obj_page = menu_get_object();\n if (!empty($obj_page->nid)) {\n $flags = $this->getFlagsForType();\n $arr_flags = array();\n foreach ($flags as $flag) {\n $obj_flag = flag_get_flag($flag->name);\n $arr_flags[$flag->name] = $obj_flag->is_flagged($obj_page->nid);\n }\n foreach ($this->get_contexts() as $context) {\n $options = $this->fetch_from_context($context, 'options');\n $require_all = isset($options[$this->contextSettingName]) ? $options[$this->contextSettingName] : FALSE;\n $arr_trigger_flags = $this->fetch_from_context($context, 'values');\n if (!$require_all) {\n foreach ($arr_trigger_flags as $flag_name) {\n if (isset($arr_flags[$flag_name]) && $arr_flags[$flag_name]) {\n $this->condition_met($context);\n }\n }\n }\n else {\n $is_all_active = TRUE;\n foreach ($arr_trigger_flags as $delta => $flag_name) {\n if (!$arr_flags[$delta]) {\n $is_all_active = FALSE;\n }\n }\n if ($is_all_active) {\n $this->condition_met($context);\n }\n }\n }\n }\n }\n }",
"public function onCondition()\n {\n }",
"public function getCondition();",
"public function getCondition() {\n }",
"public function initialCondition();",
"public function FieldCondition() {\n }",
"function markWhenConditionUsed()\r\n\t{\r\n\t\t$this->whenCondition = true;\r\n\t}",
"public function checkCondition(): void;",
"public function hasFlag($name);",
"public function isFlagSet($flag) {}",
"public function getConditionString()\n {\n return 'true';\n }",
"public function canFlag()\n {\n return in_array('flag', $this->actions);\n }",
"public function flag()\n\t{\n\t\treturn $this->flag;\n\t}",
"public function isFlagDay(): bool;",
"public function testGetCondition()\r\n {\r\n Debug::instance()->setCondition( function() {return TRUE;} );\r\n $this->assertTrue( Debug::instance()->getCondition() );\r\n Debug::instance()->setCondition( function() {return FALSE;} );\r\n $this->assertFalse( Debug::instance()->getCondition() );\r\n }",
"abstract public function getFlagAction();",
"public static function event_has_been_flagged($id){\n\t\t$db = instance(':db');\n\t\t$sql = instance(':sel-sql');\n\t\t\n\t\t$query = $db->prepare($sql->getEventFlagCount);\n\t\t$query->execute(array('id' => $id));\n\t\t$query->setFetchMode(\\PDO::FETCH_OBJ);\n\t\t$result = $query->fetch();\n\t\tif ($result->flagCount >= 3) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"function getFlag()\n\t{\n\t\treturn $this->_flag;\n\t}",
"public function getFlag()\n {\n return $this->flag;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the [name_f] column value. | public function getNameF()
{
return $this->name_f;
} | [
"protected function get_column_parameter($name)\r\n\t{\r\n\t\tif(array_key_exists($name, $this->fields))\r\n\t\t\treturn $this->fields[$name];\r\n\t\t\r\n\t\treturn '';\r\n\t}",
"public function getRawColumnValue(string $name): mixed\n\t{\n\t\treturn $this->columns[Str::camelToSnake($name)];\n\t}",
"function getForeignValue($name)\r\n\t{\r\n\t\tif (isset($this->m_attribFVals[$name]))\r\n\t\t\treturn $this->m_attribFVals[$name];\r\n\t\telse\r\n\t\t\treturn $this->m_values[$name];\r\n\t}",
"public function getFieldValue($name) {\n return $this->__get($name);\n }",
"public function getFieldValue($name){\n foreach($this->_fields as $f){\n if($f->getName()==$name)return $f->getValue();\n }\n return NULL;\n }",
"public function udfName(){\n\t\t$data = $this->uri->segment(\"4\");\n\n\t\t$this->db->select(\"a.form_name, a.id\");\n\t\t$this->db->join(\"transaction_udf_column b\", \"b.id = a.id\", \"inner\");\n\t\t$this->db->where(\"b.tran_udf_col_id\", $data);\n\t\t$query = $this->db->get(\"transaction_file_maintenance a\");\n\t\treturn $query->row();\n\t}",
"public function column_name();",
"public function getValue($name);",
"function get_name_colname(){\n\t\treturn $this->name_colname;\n\t}",
"public static function frGetFieldValue($form, $name){\n\t\treturn $form->getValue($name);\n\t}",
"public function getValName()\n {\n return $this->valName;\n }",
"public function __get($name)\n\t{\n\t\treturn $this->getCellValue($name);\n\t}",
"public function getFldName ()\n {\n return $this->fld_name;\n }",
"public function get_column_value()\n {\n return $this->properties['options'][$this->get_value()];\n }",
"public function getNameColumn()\n {\n return $this->nameColumn;\n }",
"public function field($name)\n {\n return $this->fields->get($name);\n }",
"public function UserColumn( $name ) {\r\n $fname = $this->event->UserColumn( $name );\r\n if ($fname && array_key_exists( $fname, $this->columns )) return $this->columns[$fname];\r\n return null;\r\n }",
"function findValueByName($name)\n {\n $this->dao->select('s_value');\n $this->dao->from($this->getTableName());\n $this->dao->where('s_name', $name);\n $result = $this->dao->get();\n\n if( $result == false ) {\n return false;\n }\n\n if( $result->numRows() == 0 ) {\n return false;\n }\n\n $row = $result->row();\n return $row['s_value'];\n }",
"public function getValueColumn() {\n\t\treturn $this->caseInsensitive ? strtolower($this->valueColumn) : $this->valueColumn;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse an individual filter. | protected function parseFilter($filter)
{
$filter = explode('|', $filter);
if (count($filter) !== 3) {
throw new InvalidArgumentException(
'Malformed query string, filter format should be (filter[]=field|delimiter|value)'
);
}
$filter = array_combine(['field', 'delimiter', 'value'], $filter);
$filter['binding'] = str_replace('.', '_', $filter['field']) . '_' . $this->param++;
$filter['delimiter'] = strtolower($filter['delimiter']);
$filter['delimiter'] = html_entity_decode($filter['delimiter']);
if (! in_array($filter['delimiter'], [
'=', '!=', '<>', '<=', '>=', '<', '>', 'in', 'not in', 'like', 'not like'
])) {
throw new InvalidArgumentException(sprintf('(%s) is not an accepted delimiter', $filter['delimiter']));
}
return $filter;
} | [
"protected function parseFilters()\n {\n $namespace = '\\\\Slick\\\\ImageCache\\\\Filter\\\\';\n $count = 0;\n foreach($this->filters as $class => $filterOptions) {\n\n $className = \"{$namespace}{$class}\";\n if (isset($filterOptions['class'])) {\n $className = \"{$namespace}{$filterOptions['class']}\";\n unset($filterOptions['class']);\n }\n\n /** @var FilterInterface $filter */\n $filter = new $className($filterOptions);\n if ($count++ == 0) {\n $this->positiveFilter = $filter;\n } else {\n $this->negativeFilter = $filter;\n break;\n }\n }\n }",
"private function parseForFiltering() {\n $filters = array_key_exists(\"filter\", $_GET) ? json_decode($_GET['filter'],true) : NULL;\n // If $filters was set, go on and check each item of the array.\n if (isset($filters)) {\n foreach($filters as $filter) {\n // If \"property\" and \"value\" keys exist, go on.\n if(\n array_key_exists(\"property\", $filter ) &&\n array_key_exists(\"value\", $filter )\n ) {\n // check if property is not an empty string\n if($filter[\"property\"] != \"\") {\n // add filter property=>value to the $filterStore[]\n $this->filterStore[$filter[\"property\"]] = $filter[\"value\"];\n }\n }\n }\n }\n }",
"function mFILTER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$FILTER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:211:3: ( 'filter' ) \n // Tokenizer11.g:212:3: 'filter' \n {\n $this->matchString(\"filter\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function getFilterParser(): Filter\n {\n return new Filter;\n }",
"private static function parseFilter(&$text)\n {\n if (!$text || isset($text[0])) {\n return null;\n }\n\n return FilterFactory::makeFilter($text);\n }",
"protected function processFilter($filter)\n {\n $validOperators = '(!~|=~|==|!=|>|<|>=|<=|=@|!@)';\n\n // Clean Duplicate Whitespace\n $filter = preg_replace('/\\s\\s+/', ' ', trim($filter));\n\n // Escape Google Analytics reserved characters.\n $filter = str_replace(array(',', ';'), array('\\,', '\\;'), $filter);\n\n // Clean up operators\n $filter = preg_replace(\n '/(&&\\s*|\\|\\|s*|^)([a-z]+)(\\s*'.$validOperators.')/i',\n '$1ga:$2$3',\n $filter\n );\n\n // Clean invalid quote characters\n $filter = preg_replace('/[\\'\\\"]/i', '', $filter);\n\n //Clean up operators\n $filter = preg_replace(\n array('/\\s*&&\\s*/', '/\\s*\\|\\|\\s*/', '/\\s*'.$validOperators.'\\s*/'),\n array(';', ',', '$1'),\n $filter\n );\n\n if (strlen($filter) > 0) {\n return urlencode($filter);\n } else {\n return null;\n }\n }",
"public static function parseFilters()\n {\n $fq = array_map(function ($pair) {\n return \"{$pair[0]}:\\\"{$pair[1]}\\\"\";\n }, self::parseFacets());\n if (get_option('solr_search_items_only')) {\n $fq[] = \"resulttype:Item\";\n }\n return $fq;\n }",
"protected function parse($filterString)\n {\n $length = strlen($filterString);\n if ($length == 0 || preg_match('/[^\\w\\[\\],]+/', $filterString)) {\n return null;\n }\n\n $start = null;\n $current = [];\n $stack = [];\n $parent = [];\n $currentElement = null;\n\n for ($position = 0; $position < $length; $position++) {\n //Extracting field when encountering field separators\n if (in_array($filterString[$position], ['[', ']', ','])) {\n if ($start !== null) {\n $currentElement = substr($filterString, $start, $position - $start);\n $current[$currentElement] = 1;\n }\n $start = null;\n }\n switch ($filterString[$position]) {\n case '[':\n array_push($parent, $currentElement);\n // push current field in stack and initialize current\n array_push($stack, $current);\n $current = [];\n break;\n\n case ']':\n //cache current\n $temp = $current;\n //Initialize with previous\n $current = array_pop($stack);\n //Add from cache\n $current[array_pop($parent)] = $temp;\n break;\n\n //Do nothing on comma. On the next iteration field will be extracted\n case ',':\n break;\n\n default:\n //Move position if no field separators found\n if ($start === null) {\n $start = $position;\n }\n }\n }\n //Check for wrongly formatted filter\n if (!empty($stack)) {\n return null;\n }\n //Check if there's any field remaining that's not added to response\n if ($start !== null) {\n $currentElement = substr($filterString, $start, $position - $start);\n $current[$currentElement] = 1;\n }\n return $current;\n }",
"protected function scanFilter()\n {\n return $this->scanInput('/^:(\\w+)/', 'filter');\n }",
"private function _processFilter()\n {\n $filter = $this->_dataService->getHost()->getQueryStringItem(\n ODataConstants::HTTPQUERY_STRING_FILTER\n );\n\t\t\n if (!is_null($filter)) {\n $requestTargetKind = $this->_requestDescription->getTargetKind();\n if (!($requestTargetKind == RequestTargetKind::RESOURCE \n || $requestTargetKind == RequestTargetKind::COMPLEX_OBJECT \n || $this->_requestDescription->getRequestCountOption() == RequestCountOption::VALUE_ONLY)\n ) {\n ODataException::createBadRequestError(\n Messages::queryProcessorQueryFilterOptionNotApplicable()\n );\n }\n $resourceType = $this->_requestDescription->getTargetResourceType();\n// $resourceType = new \\ODataProducer\\Providers\\Metadata\\ResourceType(new \\ReflectionClass('Adro\\StudentEnrollmentBundle\\Entity\\Student'), null, null);\n try {\n \t$expressionProvider = $this->_dataService->getMetadataQueryProviderWrapper()->getExpressionProvider(); \n $internalFilterInfo = ExpressionParser2::parseExpression2(\n $filter, $resourceType, $expressionProvider\n );\n\t\t\t\t/* @var $internalFilterInfo \\ODataProducer\\UriProcessor\\QueryProcessor\\ExpressionParser\\InternalFilterInfo */\n\t\t\t\t\n//\t\t\t\techo '<pre>'; //print_r($internalFilterInfo);\n//\t\t\t\tprint_r($resourceType);\n//\t\t\t\t\n//\t\t\t\texit('');\n $this->_requestDescription->setInternalFilterInfo(\n $internalFilterInfo\n ); \n } catch (ODataException $odataException) {\n throw $odataException;\n }\n }\n }",
"protected static function _parseCombination($filter)\n {\n // Extract logical operator and filter arguments.\n $operator = substr($filter, 0, 1);\n $filter = substr($filter, 1);\n\n // Split $filter into individual subfilters. We cannot use split() for\n // this, because we do not know the complexiness of the\n // subfilter. Thus, we look trough the filter string and just recognize\n // ending filters at the first level. We record the index number of the\n // char and use that information later to split the string.\n $sub_index_pos = array();\n // Previous character looked at.\n $prev_char = '';\n // Denotes the current bracket level we are, >1 is too deep, 1 is ok, 0\n // is outside any subcomponent.\n $level = 0;\n for ($curpos = 0, $len = strlen($filter); $curpos < $len; $curpos++) {\n $cur_char = $filter{$curpos};\n\n // Rise/lower bracket level.\n if ($cur_char == '(' && $prev_char != '\\\\') {\n $level++;\n } elseif ($cur_char == ')' && $prev_char != '\\\\') {\n $level--;\n }\n\n if ($cur_char == '(' && $prev_char == ')' && $level == 1) {\n // Mark the position for splitting.\n array_push($sub_index_pos, $curpos);\n }\n $prev_char = $cur_char;\n }\n\n // Now perform the splits. To get the last part too, we need to add the\n // \"END\" index to the split array.\n array_push($sub_index_pos, strlen($filter));\n $subfilters = array();\n $oldpos = 0;\n foreach ($sub_index_pos as $s_pos) {\n $str_part = substr($filter, $oldpos, $s_pos - $oldpos);\n array_push($subfilters, $str_part);\n $oldpos = $s_pos;\n }\n\n if (count($subfilters) > 1) {\n // Several subfilters found.\n if ($operator == '!') {\n throw new Horde_Ldap_Exception('Invalid filter syntax: NOT operator detected but several arguments given');\n }\n } elseif (!count($subfilters)) {\n // This should not happen unless the user specified a wrong filter.\n throw new Horde_Ldap_Exception('Invalid filter syntax: got operator ' . $operator . ' but no argument');\n }\n\n // Now parse the subfilters into objects and combine them using the\n // operator.\n $subfilters_o = array();\n foreach ($subfilters as $s_s) {\n array_push($subfilters_o, self::parse($s_s));\n }\n if (count($subfilters_o) == 1) {\n $subfilters_o = $subfilters_o[0];\n }\n\n return self::combine($operator, $subfilters_o);\n }",
"protected static function __parseFilter(&$string) {\n\n $string = self::__cleanFilterString($string);\n\n // Check its not a regexp\n if(preg_match('/^regexp:/i', $string)) {\n $string = str_replace('regexp:', '', $string);\n return self::REGEXP;\n }\n\n // Look to see if its a shorthand date (year only), and convert to full date\n elseif(preg_match('/^(1|2)\\d{3}$/i', $string)) {\n $string = \"$string-01-01 to $string-12-31\";\n }\n\n elseif(preg_match('/^(earlier|later) than (.*)$/i', $string, $match)) {\n\n $string = $match[2];\n\n if(!self::__isValidDateString($string)) return self::ERROR;\n\n $time = strtotime($string);\n\n switch($match[1]){\n case 'later': $string = DateTimeObj::get('Y-m-d H:i:s', $time+1) . ' to 2038-01-01'; break;\n case 'earlier': $string = '1970-01-03 to ' . DateTimeObj::get('Y-m-d H:i:s', $time-1); break;\n }\n\n }\n\n // Look to see if its a shorthand date (year and month), and convert to full date\n elseif(preg_match('/^(1|2)\\d{3}[-\\/]\\d{1,2}$/i', $string)) {\n\n $start = \"$string-01\";\n\n if(!self::__isValidDateString($start)) return self::ERROR;\n\n $string = \"$start to $string-\" . date('t', strtotime($start));\n }\n\n // Match for a simple date (Y-m-d), check its ok using checkdate() and go no further\n elseif(!preg_match('/to/i', $string)) {\n\n if(!self::__isValidDateString($string)) return self::ERROR;\n\n $string = DateTimeObj::get('Y-m-d H:i:s', strtotime($string));\n return self::SIMPLE;\n\n }\n\n // Parse the full date range and return an array\n\n if(!$parts = preg_split('/to/', $string, 2, PREG_SPLIT_NO_EMPTY)) return self::ERROR;\n\n $parts = array_map(array('self', '__cleanFilterString'), $parts);\n\n list($start, $end) = $parts;\n\n if(!self::__isValidDateString($start) || !self::__isValidDateString($end)) return self::ERROR;\n\n $string = array('start' => $start, 'end' => $end);\n\n return self::RANGE;\n }",
"private function _processFilter()\n {\n $filter = $this->request->getQueryStringItem(ODataConstants::HTTPQUERY_STRING_FILTER);\n\n if (is_null($filter)) {\n return;\n }\n\n $kind = $this->request->getTargetKind();\n if (!($kind == TargetKind::RESOURCE\n || $kind == TargetKind::COMPLEX_OBJECT\n || $this->request->queryType == QueryType::COUNT)\n ) {\n throw ODataException::createBadRequestError(\n Messages::queryProcessorQueryFilterOptionNotApplicable()\n );\n }\n $resourceType = $this->request->getTargetResourceType();\n $expressionProvider = $this->service->getProvidersWrapper()->getExpressionProvider($this->request);\n $filterInfo = ExpressionParser2::parseExpression2($filter, $resourceType, $expressionProvider);\n $this->request->setFilterInfo($filterInfo);\n\n }",
"protected function parseConstraintFilter($filter, $value)\n {\n switch ($filter) {\n case 'valid':\n // Return TRUE for \"1\", \"true\", \"on\" and \"yes\";\n // return FALSE for \"0\", \"false\", \"off\", \"no\" and \"\";\n // Otherwise return NULL\n $isValidBool = filter_var($value, FILTER_VALIDATE_BOOLEAN,\n FILTER_NULL_ON_FAILURE);\n\n if ($isValidBool !== null) {\n $this->parsedFilterParams['constraint'][$filter] =\n $isValidBool;\n }\n\n break;\n\n case 'limit':\n case 'offset':\n $parsedInt = filter_var($value, FILTER_VALIDATE_INT);\n\n if ($parsedInt !== false && $parsedInt > 0) {\n $this->parsedFilterParams['constraint'][$filter] =\n $parsedInt;\n }\n\n break;\n }\n }",
"private function parseFilterOption(string $filter): string\r\n {\r\n $filter = trim($filter);\r\n\r\n if (strpos($filter, '[') !== false) {\r\n // holds filter option eg. \"<\", \">\", \"!\", \"like\" usw..\r\n $filter_option = substr($filter, strpos($filter, '['));\r\n // bare field name\r\n $field_name = $this->stripFilterOptions($filter);\r\n\r\n switch ($filter_option) {\r\n case '[>]':\r\n return \" `$field_name` > \";\r\n case '[<]':\r\n return \" `$field_name` < \";\r\n case '[>=]':\r\n return \" `$field_name` >= \";\r\n case '[<=]':\r\n return \" `$field_name` <= \";\r\n case '[!]':\r\n return \" `$field_name` != \";\r\n case '[like]':\r\n return \" `$field_name` LIKE \";\r\n case '[!like]':\r\n return \" `$field_name` NOT LIKE \";\r\n default:\r\n return \" `$field_name` = \";\r\n }\r\n }\r\n\r\n return \" `$filter` = \";\r\n }",
"protected function parseFilter($name, $config)\n\t{\n\t\t$className = $config['class'];\n\t\t$class = new \\ReflectionClass($className);\n\n\t\tif (isset($config['arguments'])) {\n\t\t\t$arguments = $this->replacePlaceholders($config['arguments']);\n\t\t}\n\t\telse {\n\t\t\t$arguments = [];\n\t\t}\n\n\t\t$filter = $class->newInstanceArgs($arguments);\n\n\t\tforeach ($config as $property => $value) {\n\t\t\tif ($property == 'class' || $property == 'arguments') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$setterName = 'set' . ucfirst($property);\n\t\t\t$setter = $class->getMethod($setterName);\n\t\t\t$setter->invoke($filter, $value);\n\t\t}\n\n\t\t$this->filters[$name] = $filter;\n\n\t\treturn $filter;\n\t}",
"function _parse_filter($filterline){\n if(preg_match('/^(.*?)([\\*=<>!~]{1,2})(.*)$/',$filterline,$matches)){\n $column = $this->_column(trim($matches[1]));\n\n $com = $matches[2];\n $aliasses = array('<>' => '!=', '=!' => '!=', '~!' => '!~',\n '==' => '=', '~=' => '~', '=~' => '~');\n\n if (isset($aliasses[$com])) {\n $com = $aliasses[$com];\n } elseif (!preg_match('/(!?[=~])|([<>]=?)|(\\*~)/', $com)) {\n msg('Failed to parse comparison \"'.hsc($com).'\"',-1);\n return false;\n }\n\n $val = trim($matches[3]);\n\n if(strpos($com, '~') !== false) {\n if ($com === '*~') {\n $val = '*' . $val . '*';\n $com = '~';\n }\n $val = str_replace('*','%',$val);\n if ($com == '!~'){\n $com = 'NOT LIKE';\n } else {\n $com = 'LIKE';\n }\n } else {\n // Clean if there are no asterisks I could kill\n $val = $this->_cleanData($val, $column['type']);\n }\n $val = sqlite_escape_string($val); //pre escape\n\n return array('key' => $column['key'],\n 'value' => $val,\n 'compare' => $com,\n 'colname' => $column['colname'],\n 'type' => $column['type']\n );\n }\n msg('Failed to parse filter \"'.hsc($filterline).'\"',-1);\n return false;\n }",
"public function evalFilter(array $filter);",
"public function setFilter($filter){}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns ids of enabled locations | public function getLocationsEnabledID($excludeNoShow = true, $parent = false)
{
$conditions = [
'enabled' => 'y'
];
$excludeNoShow and $conditions["show"] = "b";
$locations = $this->findBy(
$conditions,
['id' => 'ASC']
);
$ids = [];
foreach ($locations as $loc) {
if (($parent && $loc->getId() > $parent) || !$parent)
$ids[] = $loc->getId();
}
return $ids;
} | [
"public function getLocationIds(): array\n {\n return $this->locationIds;\n }",
"public function getEnabledLocations()\n {\n if (!$this->enabledLocations) {\n $repository = $this->container->get('doctrine')->getRepository('WebBundle:SettingLocation');\n $this->enabledLocations = $repository->getLocationsEnabledID() ?: [1, 3, 4];\n }\n\n return $this->enabledLocations;\n }",
"function get_location_ids() {\n $locationIds = array(\n 'anchor',\n 'capstone',\n 'cobblestone',\n 'fleetwood',\n 'greer',\n 'iva',\n 'linley',\n 'manna',\n 'mccormick',\n 'patewood',\n 'poinsett',\n 'theridge',\n 'riverfalls',\n 'simpsonville',\n 'southernoaks'\n );\n\n return $locationIds;\n}",
"private function getUserGrantedLocations()\n {\n return Auth::user()->userLocations()->pluck('id');\n }",
"function getLocationIds() {\n global $accessToken, $connectHost, $requestHeaders;\n $requestPath = $connectHost . '/v1/me/locations';\n $response = Unirest\\Request::get($requestPath, $requestHeaders);\n $locations = $response->body;\n $locationIds = array();\n\n foreach ($locations as $location) {\n $locationIds[] = $location->id;\n }\n\n return $locationIds;\n}",
"function getLocationIds() {\n\n global $accessToken, $connectHost, $requestHeaders;\n $requestPath = $connectHost . '/v1/me/locations';\n $response = Unirest\\Request::get($requestPath, $requestHeaders);\n $locations = $response->body;\n\n return($locations[0]->id);\n\n }",
"public function enabledIds(): array;",
"public function getAllEnabledStoreIds(): array;",
"public function getLocationIds(): ?array\n {\n return $this->locationIds;\n }",
"public function getLocations();",
"private static function getLocations() {\n\t\treturn self::get(\t'locations',\n\t\t\t\t\t\t\t\"SELECT location FROM data WHERE (state<>\" . STATE_DELETED . \")GROUP BY location ORDER BY location ASC;\",\n\t\t\t\t\t\t\ttrue );\n\t}",
"private function getStockLocationsIds(): array\n {\n global $db;\n\n //====================================================================//\n // Load to Cache\n if (!isset(self::$locationIds)) {\n self::$locationIds = array();\n //====================================================================//\n // Prepare SQL Query\n $sql = \"SELECT e.rowid, e.ref, e.lieu, e.description\";\n $sql .= \" FROM \".MAIN_DB_PREFIX.\"entrepot as e\";\n $sql .= \" WHERE e.entity IN (\".getEntity('stock').\")\";\n $sql .= \" AND e.statut = 1\";\n //====================================================================//\n // Execute Query\n $resSql = $db->query($sql);\n if (!$resSql) {\n return self::$locationIds;\n }\n //====================================================================//\n // Parse Results\n $index = 0;\n while ($index < $db->num_rows($resSql)) {\n $obj = $db->fetch_object($resSql);\n self::$locationIds[(string) $obj->ref] = (int) $obj->rowid;\n $index++;\n }\n }\n\n return self::$locationIds;\n }",
"public static function getLocations(): array\n {\n return static::$locations;\n }",
"public function getVisibleInSiteIds()\n {\n return array(self::VISIBILITY_IN_SEARCH, self::VISIBILITY_IN_CATALOG, self::VISIBILITY_BOTH);\n }",
"public function getIds()\n {\n return $this->restrictedCountryIds;\n }",
"function findAllLocations() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM locations;'));\r\n\r\n\t}",
"public function listLocations();",
"public function getLocations(): array\n {\n $arrLocations = array();\n $objLocations = ContaoEstateManager\\ProviderModel::findAll();\n\n if ($objLocations === null)\n {\n return $arrLocations;\n }\n\n while ($objLocations->next())\n {\n $arrLocations[ $objLocations->id ] = $objLocations->postleitzahl . ' ' . $objLocations->ort . ' (' . $objLocations->firma . ')';\n }\n\n return $arrLocations;\n }",
"function fnGetAllVisibleLocations()\n\t\t{\n\t\t\t$arrInventoryLocation = array();\n\n\t\t\t$sSQL = \"select * from pms_inventory_location where hide_location=0 order by location_name\";\n\t\t\t$this->query($sSQL);\n\t\t\tif($this->num_rows() > 0)\n\t\t\t{\n\t\t\t\twhile($this->next_record())\n\t\t\t\t{\n\t\t\t\t\t$arrInventoryLocation[] = $this->fetchrow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $arrInventoryLocation;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna o id do tipo categoria SISTEMA, via SQL | public static function retornaIdTipoCategoriaSistemaViaSQL()
{
// invocando o metodo que recupera o id do tipo categoria por nome
return self::retornaIdTipoCategoriaPorNomeViaSQL(TIPO_CATEGORIA_SISTEMA);
} | [
"public function retornaIdTipoCategoriaSistema()\n\t{\n\t\t// invocando o metodo que recupera o id do tipo categoria por nome\n\t\treturn $this->retornaIdTipoCategoriaPorNome(TIPO_CATEGORIA_SISTEMA);\n\t}",
"function nombre_categoria($idc,$idioma=\"es\"){\n return $this->bd->seleccion_unica(\"nombre_$idioma from categorias where idc=\".intval($idc));\n }",
"function getConvenioId_fromCategory($modelo_categoria){\n\t\t$convenioid= $this->GetField_sql(\"SELECT c.id FROM mdl_proy_convenios c\n\t\t\t\t\t\t\t\t\t\t\tWHERE c.categoryid={$modelo_categoria};\");\n\t\treturn $convenioid;\n\t}",
"public function retornaIdTipoCategoriaLinguagem()\n\t{\n\t\t// invocando o metodo que recupera o id do tipo categoria por nome\n\t\treturn $this->retornaIdTipoCategoriaPorNome(TIPO_CATEGORIA_LINGUAGEM);\n\t}",
"function getId_tipo_dossier()\n {\n if (!isset($this->iid_tipo_dossier) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_tipo_dossier;\n }",
"public function getIdCategoria()\r\n {\r\n return $this->id_categoria;\r\n }",
"function getId_tipo_activ()\n {\n if (!isset($this->iid_tipo_activ) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_tipo_activ;\n }",
"public function getIdCategoria()\n {\n return $this->idCategoria;\n }",
"function get_type_category_id($id_category=0){\n \techo $this->model->get_hospital_types_category_id($id_category);\n }",
"public function getId_categoria()\n {\n return $this->id_categoria;\n }",
"public function getIdcategoria()\n {\n return $this->idcategoria;\n }",
"public function getIdTipo()\n {\n return $this->id_tipo;\n }",
"public static function retornaIdCategoriaPerfilUsuarioSistemaViaSQL()\n\t{\n\t\t// recuperando o id do tipo categoria PERFIL\n\t\t$idTipoCategoriaPerfil = Basico_OPController_TipoCategoriaOPController::retornaIdTipoCategoriaPerfilViaSQL();\n\n\t\t// recuperando o id da categoria\n\t\t$idCategoriaPerfilUsuarioSistema = self::retornaIdCategoriaPorNomeCategoriaIdTipoCategoriaViaSQL(CATEGORIA_PERFIL_USUARIO_SISTEMA, $idTipoCategoriaPerfil, true);\n\n\t\t// verificando se a categoria foi recuperada com sucesso\n\t\tif ($idCategoriaPerfilUsuarioSistema) {\n\t\t\t// retornando o id da categoria\n\t\t\treturn $idCategoriaPerfilUsuarioSistema;\n\t\t} else \n\t\t\tthrow new Exception(MSG_ERRO_CATEGORIA_PERFIL_USUARIO_SISTEMA);\n\n\t\treturn null;\n\t}",
"public function ConsultarIdCategoria($cod_cat){\r\n $resultado = $this->bd->query(\"SELECT * FROM categoria WHERE codigoCategoria = '$cod_cat'\");\r\n return $resultado;\r\n }",
"public function idSpesaDefault()\n {\n $default = Expense::where('nome', 'Da Categorizzare')->first();\n if($default)\n {\n return $default->id;\n }\n return Expense::create(['nome' => 'Da Categorizzare'])->id;\n }",
"public function getIdTipo()\n {\n return $this->idTipo;\n }",
"function getId_tipo_enc()\n {\n if (!isset($this->iid_tipo_enc) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_tipo_enc;\n }",
"public function getCategoriaId()\r\n {\r\n return $this->categoria_id;\r\n }",
"public function getCategoria()\n {\n return $this->DS_CATEGORIA;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the database id of the detector. | public function setDbId($id)
{
$this->db_id = $id;
} | [
"public function setDatabaseId($var)\n {\n GPBUtil::checkString($var, True);\n $this->database_id = $var;\n\n return $this;\n }",
"function setID($id) {\r\n $this->id = $id;\r\n }",
"public function getDatabaseId()\n {\n return $this->database_id;\n }",
"public function setLink($dbId);",
"public function setDatabase($id, $database)\n {\n $database = (int) $database;\n\n if (! $this->hasResource($id)) {\n return $this->setResource($id, [\n 'database' => $database,\n ]);\n }\n\n $resource = & $this->resources[$id];\n if ($resource['resource'] instanceof RedisResource && $resource['initialized']) {\n $resource['resource']->select($database);\n }\n\n $resource['database'] = $database;\n\n return $this;\n }",
"public function setid ($id) {\n if (!preg_match(\"/^\\d{7}$/\",$id)) $this->debug_scalar(\"<BR>setid: Invalid IMDB ID '$id'!<BR>\");\n $this->imdbID = $id;\n $this->reset_vars();\n }",
"public function setID($id) {\n $this->ID = $id;\n }",
"public function setId($value) { $this->_id = $value; }",
"public function getDbId(): int\n {\n return $this->dbId;\n }",
"public function setImdbId($id)\n {\n $this->setId(self::IMDB_IDENTIFIER, $id);\n }",
"final public function db($db)\r\n\t{ //select db\r\n\r\n\t\t$this->db = $db;\r\n\t}",
"public function setConfigById($databaseId = 0) {\n \t$config = Config::getInstance();\n \t$configArray = $config->getDBConfig();\n \t$this->setConfig($configArray[$databaseId]);\n }",
"public function setDb($db);",
"public function setDatabase(string $name): void\n {\n $this->database = $name;\n }",
"public function setTeamId($iTeamDatabaseId)\n {\n $this->iTeamDatabaseId = $iTeamDatabaseId;\n }",
"public function setDbHostId($db_host_id = ''){\n\t\t$this->db_host_id = $db_host_id;\n\t}",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"public function setIdentifierValue($document, $id)\n {\n $this->reflFields[$this->identifier]->setValue($document, $id);\n }",
"public function setId($value) { $this->id = $value;}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the value of preferredInstall | public function getPreferredInstall()
{
return $this->preferredInstall;
} | [
"public function preferredInstall()\n {\n return $this->preferredInstall;\n }",
"public static function getInstallMode(): ?string\n {\n return self::getOption('installMode');\n }",
"public function get_installed_version();",
"public function getInstallMode(){\n if (!$this->GetOnlineState()) return null;\n $filter=array('InstallMode');\n return self::Call('Control','getInstallMode',null,$filter);;\n }",
"protected function getInstallProfile() {\n $config = $this->getConfigStorage()->read('core.extension');\n if (!empty($config['profile'])) {\n $install_profile = $config['profile'];\n }\n // @todo https://www.drupal.org/node/2831065 remove the BC layer.\n else {\n // If system_update_8300() has not yet run fallback to using settings.\n $install_profile = Settings::get('install_profile');\n }\n\n // Normalize an empty string to a NULL value.\n return empty($install_profile) ? NULL : $install_profile;\n }",
"public function getInstalledVersion() {}",
"function getInstallationSource();",
"public function getInstalledVersion()\n {\n return (string) Mage::getConfig()->getNode()->modules->Quickpay_Payment->version;\n }",
"function get_current_or_network_install() {\n return ( $this->_site instanceof FS_Site ) ?\n $this->_site :\n $this->get_network_install();\n }",
"private function getInstallFrom()\n\t{\n\t\tif ($this->installfrom === null)\n\t\t{\n\t\t\t$installfrom = base64_decode($this->app->input->getBase64('installfrom', ''));\n\n\t\t\t$field = new SimpleXMLElement('<field></field>');\n\n\t\t\tif ((new UrlRule)->test($field, $installfrom) && preg_match('/\\.xml\\s*$/', $installfrom))\n\t\t\t{\n\t\t\t\t$update = new Update;\n\t\t\t\t$update->loadFromXml($installfrom);\n\t\t\t\t$package_url = trim($update->get('downloadurl', false)->_data);\n\n\t\t\t\tif ($package_url)\n\t\t\t\t{\n\t\t\t\t\t$installfrom = $package_url;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->installfrom = $installfrom;\n\t\t}\n\n\t\treturn $this->installfrom;\n\t}",
"public function getInstallTarget()\n {\n return $this->installTarget;\n }",
"public function getInstallInfo()\n {\n return $this->installInfo;\n }",
"public function get_installed_version() {\n\t\t\tif ( function_exists( 'get_plugins' ) ) {\n\t\t\t\t$all_plugins = get_plugins();\n\t\t\t\tif ( array_key_exists( $this->get_plugin_file(), $all_plugins ) && array_key_exists( 'Version', $all_plugins[ $this->get_plugin_file() ] ) ) {\n\t\t\t\t\treturn $all_plugins[ $this->get_plugin_file() ]['Version'];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function getInstallation()\n {\n return $this->installation;\n }",
"public function getInstallerPref($name, $default = null)\n\t{\n\t\treturn isset($this->installer_data[$name]) ? $this->installer_data[$name] : $default;\n\t}",
"abstract function getInstallationPath();",
"public static function getNavigationOptionValueForInstall()\n {\n $value = '';\n $nav = new self();\n $nav->addPagesFromFilter(self::PUBLIC_NAVIGATION_MAIN_FILTER_NAME);\n if ($nav->count()) {\n $value = json_encode($nav->toArray());\n }\n return $value;\n }",
"public function getInstallationSource();",
"public function getApplications6d917118Installations()\n {\n return '';\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check whether to allow multiple categories selection | function snax_poll_multiple_categories_selection() {
$default = snax_get_legacy_category_multi_setting();
return 'standard' === apply_filters( 'snax_poll_category_multi', get_option( 'snax_poll_category_multi', $default ) );
} | [
"function snax_list_multiple_categories_selection() {\n\t$default = snax_get_legacy_category_multi_setting();\n\n\treturn 'standard' === apply_filters( 'snax_list_category_multi', get_option( 'snax_list_category_multi', $default ) );\n}",
"function snax_quiz_multiple_categories_selection() {\n\t$default = snax_get_legacy_category_multi_setting();\n\n\treturn 'standard' === apply_filters( 'snax_quiz_category_multi', get_option( 'snax_quiz_category_multi', $default ) );\n}",
"function snax_text_multiple_categories_selection() {\n\t$default = snax_get_legacy_category_multi_setting();\n\n\treturn 'standard' === apply_filters( 'snax_text_category_multi', get_option( 'snax_text_category_multi', $default ) );\n}",
"public function supportsCategories();",
"function snax_multiple_categories_selection( $default = '' ) {\n\t$show = apply_filters( 'snax_multiple_categories_selection', get_option( 'snax_category_multi', $default ) );\n\n\treturn 'on' === $show;\n}",
"function filter_category_selection($categories, $allowed_categories)\n {\n if(!is_array($allowed_categories)) return array();\n $filtered_categories = array();\n foreach($categories as $category)\n {\n if(in_array($category,$allowed_categories))\n {\n $filtered_categories[] = $category;\n }\n }\n return $filtered_categories;\n }",
"protected function checkCategoryIsNotSelected()\n {\n Yii::$app->request->setQueryParams([\n 'category_id'=>'',\n ]);\n $this->tester->assertCount(4, $this->prepareDataProvider()->models);\n }",
"public function categoriesAreRequested()\n {\n return (bool) Mage::getStoreConfig('bxSearch/autocomplete/category');\n }",
"function validate_group_category($array=NULL)\n\t{\n\t\tif($array==NULL)\n\t\t\t$array = $_POST['category'];\n\t\tif(count($array)==0)\n\t\t\treturn false;\n\t\telse\n\t\t{\n\t\t\t\n\t\t\tforeach($array as $arr)\n\t\t\t{\n\t\t\t\tif($this->category_exists($arr))\n\t\t\t\t\t$new_array[] = $arr;\n\t\t\t}\n\t\t}\n\t\tif(count($new_array)==0)\n\t\t{\n\t\t\te(lang('vdo_cat_err3'));\n\t\t\treturn false;\n\t\t}elseif(count($new_array)>ALLOWED_GROUP_CATEGORIES)\n\t\t{\n\t\t\te(sprintf(lang('vdo_cat_err2'),ALLOWED_GROUP_CATEGORIES));\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\treturn true;\n\t}",
"function validate_group_category($array=NULL)\r\n\t{\r\n\t\tif($array==NULL)\r\n\t\t\t$array = $_POST['category'];\r\n\t\tif(count($array)==0)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t{\r\n\t\t\t\r\n\t\t\tforeach($array as $arr)\r\n\t\t\t{\r\n\t\t\t\tif($this->category_exists($arr))\r\n\t\t\t\t\t$new_array[] = $arr;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count($new_array)==0)\r\n\t\t{\r\n\t\t\te(lang('vdo_cat_err3'));\r\n\t\t\treturn false;\r\n\t\t}elseif(count($new_array)>ALLOWED_GROUP_CATEGORIES)\r\n\t\t{\r\n\t\t\te(sprintf(lang('vdo_cat_err2'),ALLOWED_GROUP_CATEGORIES));\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn true;\r\n\t}",
"protected function itemAllowedInCats($data = array())\n\t{\n\t\t// Initialise variables.\n\t\t$user\t\t= JFactory::getUser();\n\n\t\t$cats = isset($data['cid']) ? $data['cid'] : array();\n\t\tif ( !empty($data['catid']) && !in_array($data['catid'], $cats) )\n\t\t{\n\t\t\t$cats[] = $data['catid'];\n\t\t}\n\n\t\t$allow = null;\n\t\tif (count($cats))\n\t\t{\n\t\t\t$allow = true;\n\t\t\tforeach ($cats as $currcatid)\n\t\t\t{\n\t\t\t\t// If the category has been passed in the data or URL check it.\n\t\t\t\t$cat_allowed = $user->authorise('core.create', 'com_content.category.' . $currcatid);\n\t\t\t\tif (!$cat_allowed)\n\t\t\t\t{\n\t\t\t\t\tJFactory::getApplication()->enqueueMessage(\"No access to add item to category with id \" . $currcatid, 'warning');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$allow &= $cat_allowed;\n\t\t\t}\n\t\t}\n\n\t\tif ($allow === null)\n\t\t{\n\t\t\t// no categories specified, revert to the component permissions.\n\t\t\t$allow\t= $user->authorise('core.create', 'com_flexicontent');\n\t\t}\n\n\t\treturn $allow;\n\t}",
"protected function isAttributeSetOrCategory() {\r\n return in_array($this->getAttributeRealCode($this->getAttribute()), ['attribute_set_id', 'category_ids']);\r\n }",
"function _passed_reject_categories() {\n\t\t$reject_categories = $this->_config->get_array( 'pgcache.reject.categories' );\n\t\tif ( !empty( $reject_categories ) ) {\n\t\t\tif ( $cats = get_the_category() ) {\n\t\t\t foreach( $cats as $cat ) {\n\t\t\t\t if ( in_array( $cat->slug, $reject_categories ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function hasCategories();",
"function HasMultipleSelection(){}",
"public function searchOptionCategories()\n {\n $this->_setRealtimeAction('Categories');\n return true;\n }",
"function validate_collection_category( $array = NULL ) {\n global $cbcollection;\n return $cbcollection->validate_collection_category( $array );\n}",
"function is_select_subcategory_items(){\n\t\tif($this->CI->config->item('subcategory_of_items')){\n\t\t\t$items = $this->get_cart();\n\t\t\tforeach ($items as $item )\n\t\t\t{\n\t\t\t\tif (isset($item['item_id']))\n\t\t\t\t{\n\t\t\t\t\tif ( $item['has_subcategory']==1) {\n\t\t\t\t\t\tif($item['custom1_subcategory']==\"\" || $item['custom1_subcategory']==null || $item['custom2_subcategory']==\"\" ||\n\t\t\t\t\t\t $item['custom2_subcategory']==null){\n\t\t\t\t\t\t\t return false;\n\t\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t}",
"public function hasCategoryList(){\n\t\treturn false;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create response for operation 'savePushConfiguration' | private function savePushConfigurationResponse(ResponseInterface $response, UriInterface $requestUri): mixed
{
$statusCode = $response->getStatusCode();
$responseBody = $response->getBody();
$responseHeaders = $response->getHeaders();
if ($statusCode < 200 || $statusCode > 299) {
throw new ApiException(
sprintf('[%d] API Error (%s)', $statusCode, $requestUri),
$statusCode,
$responseHeaders,
$responseBody
);
}
$responseResult = null;
if ($statusCode === 200) {
$responseResult = $this->deserialize($responseBody, '\Infobip\Model\WebRtcPushConfigurationResponse', $responseHeaders);
}
return $responseResult;
} | [
"public function settingsSave()\n {\n $config = app('itemconfig');\n $save = $config->save($this->request, app('admin_field_factory')->getEditFields());\n\n if (is_string($save)) {\n return response()->json([\n 'success' => false,\n 'errors' => $save,\n ]);\n } else {\n // override the config options so that we can get the latest\n app('admin_config_factory')->updateConfigOptions();\n\n return response()->json([\n 'success' => true,\n 'data' => $config->getDataModel(),\n 'actions' => app('admin_action_factory')->getActionsOptions(),\n ]);\n }\n }",
"public function saveConfig();",
"protected function save()\n {\n $this->configIsWriteable();\n\n $helper = new Lupin_Config_Helper_XmlArray();\n\n Frapi_Internal::deleteCached('configFile-' . $this->configName);\n\n return $helper->write(\n array(\n 'config' => $this->config,\n 'filename' => $this->configFile,\n 'topLevelName' => $this->configName,\n )\n );\n }",
"public function save_info_oauth_config() {\n $post = (object) $this->_post(null);\n $oauth_config = new \\Oauth_config;\n $ok = $oauth_config->save_oauth_config($post);\n if ($ok):\n $this->set_alert('Se guardo los cambios realizados de la URI exitosamente', 'success');\n else:\n $this->set_alert('No se pudo guardar la URI suministrada ', 'error');\n endif;\n return $this->render_json($ok);\n }",
"public function getConfigData()\n {\n $config = new \\stdClass();\n $config->workspaceId = $this->_hubHelper->getApiWorkspaceId();\n $config->nodeId = $this->_hubHelper->getApiNodeId();\n $config->token = $this->_hubHelper->getApiToken();\n $config->context = $this->_hubHelper->getContext();\n $store = new \\stdClass();\n $store->id = \"\".$this->_hubHelper->getStore()->getStoreId();\n $store->name = $this->_hubHelper->getStore()->getFrontendName();\n $store->country = $this->_hubHelper->getStoreDefaultCountry();\n $store->website = $this->_hubHelper->getStore()->getBaseUrl();\n $store->type = $this->_hubHelper->getContext();\n $contextInfo = new \\stdClass();\n $contextInfo->store = $store;\n $config->contextInfo = $contextInfo;\n\n return \"ch('config', \".json_encode($config).\");\";\n }",
"private function delete_push_config() {\n $helperDevice = Mage::helper('mobassistantconnector/deviceAndPushNotification');\n\n if ($this->registration_id && $this->app_connection_id) {\n $result = $helperDevice->deletePushSettingByRegAndCon(\n $this->registration_id,\n $this->app_connection_id\n );\n\n if ($result) {\n $result = array('success' => 'true');\n } else {\n $result = array('error' => $this->__('Could not delete data'));\n }\n } else {\n $result = array('error' => $this->__('Missing parameters'));\n }\n\n $helperDevice->deleteEmptyDevices();\n $helperDevice->deleteEmptyAccounts();\n\n return $result;\n }",
"public function executeSilentConfigurationUpdateAction() : ResponseInterface {}",
"public function store()\n\t{\n\t\t$command_name = Input::get(\"command_name\");\n\t\t$command_line = Input::get(\"command_line\");\n\t\t$uuid = UUID::v4();\n\n\t\tObject::create(array(\n\t\t\t\"uuid\" => $uuid,\n\t\t\t\"object_type\" => \"12\",\n\t\t\t\"first_name\" => $command_name,\n\t\t\t\"second_name\" => \"\",\n\t\t\t\"is_active\" => \"1\"\n\t\t));\n\n\t\tCommand::create(array(\n\t\t\t\"object_uuid\" => $uuid,\n\t\t\t\"command_line\" => $command_line\n\t\t));\n\n\t\t$this->writeConfig();\n\n\t\treturn Response::json(array(\"success\" => true));\n\t}",
"public function postApplications6d917118SimplePush()\n {\n return '{\n \"id\": \"22debd80-04ab-4213-ac6f-18d6c0c106fe\",\n \"name\": \"A Simplepush variant\",\n \"description\": \"And a description on the variant\",\n \"variantID\": \"13f663bc-6321-4fc0-b8e1-77429d6c180c\",\n \"secret\": \"ed92f308-67ae-4315-b7d7-57b0c206574d\",\n \"developer\": \"user\",\n \"production\": false,\n \"type\": \"simplePush\"\n}';\n }",
"public function create(array $values = array()) {\n // Add values that are specific to our WsConfig\n $values += array(\n 'wsconfig_id' => '',\n 'name' => '',\n 'is_new' => TRUE,\n 'title' => '',\n 'created' => '',\n 'changed' => '',\n 'data' => array(),\n );\n\n $wsconfig = parent::create($values);\n return $wsconfig;\n }",
"public function save()\n\t{\n\t\t$configurationClass = '<?php' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Lang/Object.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Collections/HashMap.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Model/Container/Plugin.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Model/Container/Entity.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'require_once \"TechDivision/Model/Configuration/Interfaces/Container.php\";' . PHP_EOL;\n\t\t$configurationClass .= 'class TechDivision_Model_Configuration_Generated' . PHP_EOL;\n\t\t$configurationClass .= '\textends TechDivision_Lang_Object' . PHP_EOL;\n\t\t$configurationClass .= '\timplements TechDivision_Model_Configuration_Interfaces_Container {' . PHP_EOL;\n\t\t$configurationClass .= '\tprotected $_entities = null;' . PHP_EOL;\n\t\t$configurationClass .= '\tprotected $_plugins = null;' . PHP_EOL;\n\t\t$configurationClass .= '\tprotected $_configDate = ' . $this->_configDate . ';' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function __construct() {}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function getConfigDate() {' . PHP_EOL;\n\t\t$configurationClass .= '\t\treturn $this->_configDate;' . PHP_EOL;\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function getPlugins() {' . PHP_EOL;\n\t\t$configurationClass .= '\t\treturn $this->_plugins;' . PHP_EOL;\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function getEntities() {' . PHP_EOL;\n\t\t$configurationClass .= '\t\treturn $this->_entities;' . PHP_EOL;\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '\tpublic function initialize($applicationName = null) {' . PHP_EOL;\n\t\t$configurationClass .= '\t\t$this->_plugins = new TechDivision_Collections_HashMap();' . PHP_EOL;\n\t\t// generated the code for all plugins\n\t\tforeach ($this->_plugins as $plugin) {\n\t\t\t$configurationClass .= ' \t$plugin = new TechDivision_Model_Container_Plugin();' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$plugin->setName(\"' . $plugin->getName() . '\");' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$plugin->setType(\"' . $plugin->getType() . '\");' . PHP_EOL;\n\t\t\t$configurationClass .= '\t\t$this->_plugins->add($plugin->getName(), $plugin);' . PHP_EOL;\n\t\t}\n\t\t$configurationClass .= '\t\t$this->_entities = new TechDivision_Collections_HashMap();' . PHP_EOL;\n\t\t// generated the code for all entitiy and session beans\n\t\tforeach ($this->_entities as $entity) {\n\t\t\t$configurationClass .= ' \t$cont = new TechDivision_Model_Container_Entity();' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$cont->setName(\"' . $entity->getName() . '\");' . PHP_EOL;\n\t\t\t$configurationClass .= ' \t$cont->setType(\"' . $entity->getType() . '\");' . PHP_EOL;\n\t\t\tforeach ($epb->getApplications() as $application) {\n\t\t\t\t$configurationClass .= ' \t$cont->addApplication(\"' . $application . '\");' . PHP_EOL;\n\t\t\t}\n\t\t\t$configurationClass .= '\t\t$this->_entities->add($cont->getName(), $cont);' . PHP_EOL;\n\t\t}\n\t\t// close the brackets and add the php delimiter\n\t\t$configurationClass .= '\t}' . PHP_EOL;\n\t\t$configurationClass .= '}' . PHP_EOL;\n\t\t$configurationClass .= '?>';\n\t\t// save the file\n\t\treturn file_put_contents(\n\t\t $this->_generatedConfigFile,\n\t\t $configurationClass\n\t\t);\n\t}",
"public function configToJSON()\n {\n return json_encode($this->conf());\n }",
"public function getConfigJson()\n {\n return $this->getConfig()->toJson();\n }",
"function postConfig(){\n\n\t\t$config_name = Input::get('config_name');\n\t\t$config_index = Input::get('config_idx');\n\n\t\t$config_content = Config::get($config_name);\n\n\t\treturn Response::json($config_content[$config_index]);\n\n\t}",
"public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}",
"private static function save_details_to_config()\n\t{\n\t\t\\Config::load('rack');\n\t\t\n\t\t\\Config::set('rack', \n\t\t\tarray(\n\t\t\t\t'auth-user' => static::$auth_user,\n\t\t\t\t'auth-key' => static::$auth_key,\n\t\t\t\t'api-url' => static::$api_url,\n\t\t\t\t'auth-token' => static::$auth_token,\n\t\t\t\t'storage-url' => static::$storage_url,\n\t\t\t\t'cdn-management' => static::$cdn_management,\n\t\t\t\t'last-saved' => \\Date::create_from_string(\\Date::forge()->format('%d/%m/%Y'), \"eu\")->get_timestamp(), // save the date as midnight\t\t\t\n\t\t\t)\n\t\t);\n\t\t\n\t\t\\Config::save('rack', 'rack');\n\t}",
"public function store(CreateSmallConfigAPIRequest $request)\n {\n $input = $request->all();\n\n $smallConfigs = $this->smallConfigRepository->create($input);\n\n return $this->sendResponse($smallConfigs->toArray(), 'Small Config saved successfully');\n }",
"public function createConfiguration()\n {\n $response = new Configuration();\n $response->setBaseUri('https://example.com/address-finder');\n $response->setStatusPath('/status');\n $response->setPropertyLookup($this->createPropertyLookUp());\n $response->setstreetLookup($this->createStreetLookUp());\n\n return $response;\n }",
"public function saveConfiguration()\n {\n // write the formatted config file to the path\n file_put_contents(self::$config_path, $this->app['utils']->JSONFormat(self::$config));\n $this->app['monolog']->addDebug('Save configuration to '.basename(self::$config_path));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add a new status log to the registrar plan. | public function add_new_log($data) {
global $DB, $USER;
$log = new \stdClass;
$log->regplanid = $this->id;
$log->status = empty($data->status) ? $this->status : $data->status;
$log->userid = empty($data->userid) ? $USER->id : $data->userid;
$log->modifiedtime = empty($data->modifiedtime) ? time() : $data->modifiedtime;
if (!empty($data->comment)) {
$log->comment = $data->comment;
} else if (!empty($data->commentseditor['text'])) {
$log->comment = $data->commentseditor['text'];
} else {
$log->comment = '';
}
if ($DB->insert_record('local_evtp_status', $log)) {
// Update the registrar plan record as well.
$regplan = $DB->get_record('local_evtp_regplan', array('id'=>$this->id), 'id, status, startdate, completiondate');
$regplan->status = $log->status;
if (empty($regplan->startdate)) {
$regplan->startdate = time();
}
if ($log->status == \local_evtp\utils::REGPLAN_COMPLIANT) {
$regplan->completiondate = time();
} else {
$regplan->completiondate = 0;
}
$DB->update_record('local_evtp_regplan', $regplan);
$this->_load_object($this->id);
return true;
}
return false;
} | [
"public function addStatus($status);",
"public function status_add($status) {\n $status = json_encode($status);\n $ch = $this->api_connect($this->url . 'status/add');\n $ch = $this->api_options($ch, \"POST\", $data);\n $result = curl_exec($ch);\n }",
"public function training_plan_status(\\local_evtp\\regplan $regplan) {\n\n // Sanity check. This should have been caught earlier but good to check here as well.\n if (!$regplan->is_valid()) {\n redirect(new moodle_url('/local/evtp/plansearch.php'), get_string('invalidplanid', 'local_evtp'));\n exit;\n }\n\n // Set some variables.\n $regplanid = $regplan->get_id();\n $planviewurl = new moodle_url('/local/evtp/planview.php', array('id'=>$regplanid));\n $planstatusurl = new moodle_url('/local/evtp/planstatus.php', array('id'=>$regplanid));\n\n $out = self::heading(get_string('trainingplanstatus', 'local_evtp'));\n\n // Set up a table of registrar plan information.\n $table = new html_table();\n $table->head = array();\n $table->align = array('left', 'left');\n $table->id = 'registrarplanstatus';\n $table->data = array();\n\n $table->data[] = array(get_string('trainingplan', 'local_evtp'),\n $regplan->get_name());\n\n $table->data[] = array(get_string('registrar', 'local_evtp'),\n fullname($regplan->get_registrar()));\n\n $table->data[] = array(get_string('me', 'local_evtp'),\n fullname($regplan->get_me()));\n\n $table->data[] = array(get_string('status', 'local_evtp'),\n $regplan->get_status());\n\n $out .= html_writer::table($table);\n\n $out .= html_writer::empty_tag('hr');\n\n // Form for adding a new status log.\n $planstatusform = new \\local_evtp\\forms\\planstatusform();\n\n $data = new \\stdClass;\n $data->id = $regplanid;\n $data->status = $regplan->get_status_value();\n $planstatusform->set_data($data);\n \n if ($planstatusform->is_cancelled()) {\n redirect($planviewurl);\n exit;\n }\n\n if ($data = $planstatusform->get_data()) {\n if ($regplan->add_new_log($data)) {\n redirect($planviewurl, get_string('addednewplanstatus', 'local_evtp'));\n exit;\n } else {\n $out .= self::notify_problem(get_string('erroraddingnewplanstatus', 'local_evtp'));\n }\n }\n\n ob_start();\n $planstatusform->display();\n $out .= ob_get_contents();\n ob_end_clean();\n \n $out .= html_writer::empty_tag('hr');\n\n // Table of current status log entries.\n $logs = $regplan->get_logs_list();\n \n if (!empty($logs)) {\n $table = new html_table();\n $table->head = array(get_string('statusdate', 'local_evtp'),\n get_string('status', 'local_evtp'),\n get_string('who', 'local_evtp'),\n get_string('comments', 'local_evtp'),\n '');\n $table->align = array('left', 'left', 'left', 'left', 'center');\n $table->id = 'registrarplanstatuslogs';\n $table->data = array();\n\n foreach ($logs as $log) {\n $row = new html_table_row();\n\n // Delete icon and link.\n $delete = html_writer::link(\n new moodle_url('/local/evtp/planstatus.php', array('id' => $regplanid,\n 'logid' => $log->id,\n 'action' => 'del')),\n self::pix_icon('t/delete',\n get_string('deleteitem', 'local_evtp'),\n 'moodle',\n array('class' => 'iconsmall'))\n );\n\n $actionlinks = $delete;\n $row->cells = array($log->modifiedtime,\n $log->status,\n $log->who,\n $log->comment,\n $actionlinks);\n $table->data[] = $row;\n }\n $out .= html_writer::table($table);\n }\n return $out;\n }",
"public function add_system_status_report() {\n\n\t\tinclude( wc_customer_order_csv_export()->get_plugin_path() . '/includes/admin/views/html-system-status-table.php' );\n\t}",
"protected function addToLog($log)\n {\n $this->logs[] = \"[\".date('d/m/Y H:i:s').\"] \".$log;\n }",
"private function addDeployStatus()\n {\n $this->add(\n array(\n 'name' => 'deployStatus',\n 'required' => false,\n 'validators' => array(\n array(\n 'name' => '\\Application\\Validator\\Callback',\n 'options' => array(\n 'callback' => function ($value) {\n if (!in_array($value, array('success', 'fail'))) {\n return \"Deploy status must be 'success' or 'fail'.\";\n }\n return true;\n }\n )\n )\n )\n )\n );\n }",
"public static function add()\r\n {\r\n $params = array(\r\n 'log_add' => $_POST\r\n );\r\n\r\n $settings = array(\r\n 'log_add' => array()\r\n );\r\n\r\n if ($_POST) {\r\n $validation = form::validation(array());\r\n\r\n if ($validation) {\r\n $add_log = api::query('log/add', $params['log_add'], $settings['log_add']);\r\n\r\n if (f::is_done($add_log)) {\r\n header('Location: /log');\r\n }\r\n }\r\n }\r\n\r\n view::load('log/form');\r\n }",
"public function addLog($log)\n {\n $this->log[] = $log;\n }",
"function add() {\n if(!$this->request->isApiCall() && !$this->request->isAsyncCall()) {\n $this->httpError(HTTP_ERR_BAD_REQUEST);\n } // if\n \n $this->wireframe->print_button = false;\n \n if($this->request->isSubmitted()) {\n $status_data = $this->request->post('status');\n \n $status_message = array_var($status_data, 'message');\n $status_message_parent = null;\n \n $status_message_parent_id = (integer) array_var($status_data, 'parent_id');\n if($status_message_parent_id) {\n $status_message_parent = StatusUpdates::findById($status_message_parent_id);\n } // if\n \n $this->active_status_update = new StatusUpdate();\n \n $this->active_status_update->setAttributes($status_data);\n $this->active_status_update->setCreatedById($this->logged_user->getId());\n $this->active_status_update->setCreatedByName($this->logged_user->getName());\n $this->active_status_update->setCreatedByEmail($this->logged_user->getEmail());\n \n $save = $this->active_status_update->save();\n if(!$save || is_error($save)) {\n if($this->request->isApiCall()) {\n $this->serveData($save);\n } else {\n $this->httpError(HTTP_ERR_OPERATION_FAILED);\n } // if\n } // if\n \n if($this->request->isApiCall()) {\n $this->serveData($this->active_status_update, 'message');\n } else {\n UserConfigOptions::setValue('status_update_last_visited', new DateTimeValue(), $this->logged_user);\n \n if(instance_of($status_message_parent, 'StatusUpdate')) {\n $this->smarty->assign('status_update', $status_message_parent);\n } else {\n $this->smarty->assign('status_update', $this->active_status_update);\n } // if\n \n print $this->smarty->fetch(get_template_path('_status_row', $this->controller_name, STATUS_MODULE));\n \n die();\n } // if\n } else {\n $this->httpError(HTTP_ERR_BAD_REQUEST);\n } // if\n }",
"public function addToTurnSummary($log)\n {\n array_push($this->battle_frame['turn_summary'], $log);\n }",
"public function addNewLogAction()\n {\n $id = $this->getRequest()->get('id');\n $object = $this->getDoctrine()->getRepository('Webit\\ForexCoreBundle\\Entity\\RealProfile')->find($id);\n\n $form = $this->createForm(new \\Webit\\UserLogBundle\\Form\\UserLogType());\n\n if ($this->getRequest()->getMethod() == 'POST') {\n $form = $form->bind($this->getRequest());\n if ($form->isValid()) {\n $dispacher = $this->container->get('event_dispatcher');\n $dispacher->dispatch('user.log', new GenericEvent(\"Log Added manually\", array('type' => 'log', 'user' => $object->getPortalUser(), 'body' => $form->get('body')->getData())));\n\n $this->addFlash('sonata_flash_success', 'New log has been added successfully');\n\n return new RedirectResponse($this->admin->generateObjectUrl('show', $object));\n }\n }\n\n\n return $this->render(\"WebitForexBoAreaBundle::UserAdmin/add_new_log.html.twig\", array('form' => $form->createView(), 'object' => $object, 'id' => $id));\n }",
"function add()\n\t{\n\t\t$companies = $this->company_model->get_many_by(array('active_status' => 1));\n\t\t\n\t\t$this->data = array(\n 'page_header' \t=> 'Add New Violation Level',\n 'notification' \t=> array(\"sound\"=>false),\n\t\t\t'companies'\t\t=> $companies\n );\n\t\t$this->load_view('forms/violation_level-add');\n\t}",
"public function addHistoryStatus(NostoOrderStatusInterface $status)\n {\n $this->historyStatuses[] = $status;\n }",
"public function addStatus(PersonStatus $newStatus)\n\t{\n\t\tif (!$this->hasStatus($newStatus))\n\t\t{\n\t\t\t$params[] = $this->sqlId;\n\t\t\t$params[] = $newStatus->toInt();\n\t\t\t$query = \"INSERT INTO \" . PersonStatus::TABLENAME . \" (id_person, status) VALUES ($1, $2);\";\n\t\t\t$result = Database::currentDB()->executeQuery($query, $params);\n\n\t\t\tif ($result)\n\t\t\t{\n\t\t\t\t$this->status[] = $newStatus;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tDatabases::currentDB()->showError(\"ligne n° \" . __LINE__ . \" Classe: \" . __CLASS__);\n\t\t\t}\n\t\t}\n\t}",
"public function addclaimstatus(){\n $response = $this->insertInToTable(CLAIM_STATUS, array(array('claim_status_name'=>$this->getData['addnewclaimstatus'], 'created_by'=>$this->Useconfig['user_id'], 'created_ip'=>commonfunction::loggedinIP())));\n return $response;\n }",
"public function addCertificationStatusLog(\\CertificationStatusLog $certStatusLog){\n $this->certificationStatusLog[] = $certStatusLog; \n $certStatusLog->setParentSite($this); \n }",
"function record_registration_track($data)\n\t{\n\t\t$ids = explode(',', $data['idlist']);\n\t\t# end the current registration status\n\t\t$result = $this->_query_reader->run('end_registration_status', array(\n\t\t\t'id_list'=>implode(\"','\", $ids), \n\t\t\t'user_id'=>$this->native_session->get('__user_id')\n\t\t));\n\t\t\n\t\t# add the suspended registration status\n\t\tif($result){\n\t\t\t$result = $this->_query_reader->run('add_registration_status', array(\n\t\t\t\t'id_list'=>implode(\"','\", $ids), \n\t\t\t\t'reason'=>htmlentities($data['reason'], ENT_QUOTES),\n\t\t\t\t'status'=>$data['status'],\n\t\t\t\t'end_date'=>(!empty($data['expiry_date'])? date('Y-m-d',strtotime(make_us_date($data['expiry_date']))): '0000-00-00'),\n\t\t\t\t'user_id'=>$this->native_session->get('__user_id')\n\t\t\t));\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"function register() {\n if($this->time < 0)\n $this->time = time();\n $sql = \"INSERT INTO event_log (`time`, data, type, description) VALUES (?, ?, ?, ?)\";\n $ps = db_prepareStatement($sql);\n $ps->bind_param('isss', $this->time, $this->data, $this->type, $this->description);\n $ps->execute();\n }",
"public function add_status($data)\n {\n $this->db->insert(LEADS_STATUSES_TABLE, $data);\n $insert_id = $this->db->insert_id();\n\n if ($insert_id) {\n logActivity('New Leads Status Added [StatusID: ' . $insert_id . ', Name: '.$data['name'].']');\n return $insert_id;\n }\n\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Open (unlock) a LUKS container. | public function openContainer($params, $context) {
global $xmlConfig;
// Validate the RPC caller context.
$this->validateMethodContext($context, array(
"role" => OMV_ROLE_ADMINISTRATOR
));
// Validate the parameters of the RPC service method.
$this->validateMethodParams($params, '{
"type":"object",
"properties":{
"devicefile":{'.$GLOBALS['OMV_JSONSCHEMA_DEVICEFILE'].'},
"passphrase":{"type":"string"}
}
}');
// Validate the container
$luks = new OMVLuksContainer($params['devicefile']);
if (is_null($luks) || !$luks->exists()) {
throw new OMVException(OMVErrorMsg::E_MISC_FAILURE,
sprintf(gettext("LUKS container on '%s' not found"),
$params['devicefile']));
}
// Check that the container is not already open, then use
// the supplied passphrase to unlock it if not
if (FALSE === $luks->isOpen()) {
if (FALSE === $luks->open($params['passphrase'])) {
throw new OMVException(OMVErrorMsg::E_MISC_FAILURE,
sprintf(gettext("Unable to unlock encrypted device: %s"),
$luks->getLastError()));
}
}
} | [
"public function unlock() {\n \n }",
"public function unlock()\n {\n }",
"function unlock_sqlite3_access() {\n\tglobal $DB;\n\n\tsem_release($DB['SEM_ID']);\n}",
"public function releaseLocks($url);",
"static public function containerLocked()\n {\n throw new Exception\\ContainerLocked(\"Cannot modify container when locked.\");\n }",
"public function release($lockName);",
"public function closeSlice() {\n\t\t$conn->query(\"UPDATE Slice SET isOpen = 0 WHERE sid = \" . $this->sid);\n\t}",
"public function unlockLab() {\n\t$this -> lock = 0;\n $rc = $this -> save ();\n\treturn $rc;\n }",
"function stopContainer($containerName){\n exec(\"sudo lxc-stop -n \".$containerName);\n}",
"public function open() {\n if (!$this->open) {\n foreach ($this->secrets as $secrets) {\n $secrets->open();\n }\n }\n $this->open= true;\n return $this;\n }",
"public function close() {\r\n\t\t@fclose($this->file);\r\n\t\tif(is_file($this->lockfile)) { unlink($this->lockfile); }\r\n\t}",
"abstract protected function releaseLock($name);",
"private function lock() {\n\t\tif(!file_exists(FILE_LOCKED)) {\n\t\t\tif(file_exists(FILE_UNLOCKED)) {\n\t\t\t\tunlink(FILE_UNLOCKED);\n\t\t\t}\n\t\t\t$file = fopen(FILE_LOCKED, 'w');\n\t\t\tfclose($file);\n\t\t}\n\t}",
"public function close()\r\n {\r\n if (! $this->isSelected()) {\r\n /** @see Zend_Di_Exception **/\r\n require_once 'Zend/Di/Exception.php';\r\n throw new Zend_Di_Exception('You need to open a container first.');\r\n }\r\n \r\n $container = $this->_containerName;\r\n $this->_containerName = null;\r\n \r\n return $this->getContainer($container);\r\n }",
"protected function openLock() {\r\n\t\t\t// for a certain period of time.\r\n\t\t\techo \"Lock open.\\n\";\r\n\t\t}",
"public function _destruct() {\n\t\t$this->unlock();\n\t}",
"public function releaseRead($path, $lock);",
"public function detachVolume($request);",
"public function actionUnlock()\n {\n UserOnline::unlock(Yii::$app->adminuser->id);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET /admin/autoselectpricing/versionfees/version/states get Pricing Version states view page | public function states($id)
{
$version = $this->pricingVersionFeeRepo->version($id);
if ($version) {
$states = $this->statesRepository->getStates();
return view('admin::auto_select_pricing.version-fees.version-fee.states', compact('states', 'version'));
} else {
Session::flash('error', 'Sorry, We could not find that record.');
return redirect()->route('admin.autoselect.pricing.fees.index');
}
} | [
"public function states($id)\n { \n $group = $this->pricingGroupFeeRepo->group($id);\n\n if ($group) {\n\n $states = $this->statesRepository->getStates();\n\n return view('admin::auto_select_pricing.version-fees.group-fee.states', compact('states', 'group'));\n\n } else {\n\n Session::flash('error', 'Sorry, We could not find that record.');\n \n return redirect()->route('admin.autoselect.pricing.fees.index');\n } \n }",
"public function getStateVitals() {\n }",
"public function statesPage() {\n return view('pages.states');\n }",
"public function index()\n\t{\n\t\t$state = Input::get('state');\n\t\t$site_name = Input::get('site_name');\n\n\t\t$filter_data = array('state' => $state,\n\t\t\t\t\t\t\t\t\t\t\t\t'site_name' => $site_name\n\t\t\t\t\t\t\t\t\t\t\t );\n\n\t $approvedsites = Approvedsite::filter($filter_data)->paginate(2);\n\n\t\t$states = $this->get_states();\n\n\t\treturn View::make('admin.approvedsites.index', compact('approvedsites','states'));\n\t}",
"public function GetStateVersion();",
"public function actionStatelist() {\n\n $shipping_card = new ShippingInfoForm();\n if (isset($_POST['ShippingInfoForm'])) {\n $shipping_card->attributes = $_POST['ShippingInfoForm'];\n }\n $stateList = $shipping_card->getStates();\n\n\n echo CHtml::tag('option', array('value' => ''), 'Select State', true);\n foreach ($stateList as $value => $name) {\n echo CHtml::tag('option', array('value' => $value), CHtml::encode($name), true);\n }\n }",
"public function actionIndex()\n {\n $searchModel = new ShippingLogisticsStateSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function get_versions()\n {\n $obj = new View();\n $queryobj = new Snowagent_model();\n $sql = \"SELECT version, COUNT(1) AS count\n FROM snowagent\n LEFT JOIN reportdata USING (serial_number)\n WHERE \".get_machine_group_filter('').\" \n GROUP BY version\n ORDER BY COUNT DESC\"; \n $obj->view('json', array('msg' => $queryobj->query($sql)));\n }",
"function print_filter_view_state() {\n\tglobal $t_select_modifier, $t_filter;\n\t?><!-- View Status -->\n\t\t<select name=\"<?php echo FILTER_PROPERTY_VIEW_STATE_ID;?>\">\n\t\t\t<?php\n\t\t\techo '<option value=\"' . META_FILTER_ANY . '\" ';\n\tcheck_selected( $t_filter[FILTER_PROPERTY_VIEW_STATE_ID], META_FILTER_ANY );\n\techo '>[' . lang_get( 'any' ) . ']</option>';\n\techo '<option value=\"' . VS_PUBLIC . '\" ';\n\tcheck_selected( $t_filter[FILTER_PROPERTY_VIEW_STATE_ID], VS_PUBLIC );\n\techo '>' . lang_get( 'public' ) . '</option>';\n\techo '<option value=\"' . VS_PRIVATE . '\" ';\n\tcheck_selected( $t_filter[FILTER_PROPERTY_VIEW_STATE_ID], VS_PRIVATE );\n\techo '>' . lang_get( 'private' ) . '</option>';\n\t?>\n\t\t</select>\n\t\t<?php\n}",
"public function getVersions () {\r\n\t$this->ensureLoggedIn();\r\n\r\n\treturn $this->request(array('req' => 'getversions'));\r\n\t}",
"public function getStatesList();",
"public function indexAction() {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('LooninsIncidentBundle:GdpVersions')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function showAccountOrderStates();",
"public function index()\n {\n if (! Gate::allows('payment_status_access')) {\n return abort(401);\n }\n\n\n $payment_statuses = PaymentStatus::all();\n\n return view('admin.payment_statuses.index', compact('payment_statuses'));\n }",
"public function getStates();",
"public function listNeededStates(): array;",
"public function actionStateholidays()\n\t{\n\t\t$models = DncHolidayState::model()->findAll(array(\n\t\t\t'condition' => 'status = 1',\n\t\t\t'order' => 'state, name ASC',\n\t\t));\n\t\t\n\t\t$this->render('stateHolidays', array(\n\t\t\t'models' => $models,\n\t\t));\n\t}",
"public function actionIndex()\n\t{\n\t\t$searchModel = new StateSearch();\n\t\t$dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t$states = ArrayHelper::getColumn(StoreState::findAll(['store_id' => Yii::$app->user->identity->store->id]), 'state_id');\n\t\t\n\t\treturn $this->render('index', [\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'states' => $states,\n\t\t]);\n\t}",
"public static function getStates()\n {\n\t\t if (is_null(self::$_states)) {\n self::$_states = array(\n self::STATE_OPEN => Mage::helper('sales')->__('Pending'),\n self::STATE_PAID => Mage::helper('sales')->__('Paid'),\n self::STATE_CANCELED => Mage::helper('sales')->__('Canceled'),\n );\n }\n\t\t \n\t\t// echo '<pre>';print_r( self::$_states);die;\n\t\t \n\t\t\t$invoiceStatus = Mage::getStoreConfig('editorder/opermission/edit_order_invoice_status'); \n\t\t\t$invoiceStatusArr = @unserialize($invoiceStatus);\t\t\n\t\t\tif($invoiceStatusArr) {\n\t\t\t\t$i = 4 ;\n\t\t\t\t foreach($invoiceStatusArr as $field) {\n\t\t\t\t \t \n\t\t\t\t\t$invoice_state = $field['feature'];\n\t\t\t\t\tself::$_states[$i] = $invoice_state ;\n\t\t\t\t\t//echo '<pre>';print_r( self::$_states);die;\n\t\t\t\t\t$i++ ;\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n \n return self::$_states;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This action returns a JSON response with a listing of screencasts based on the parameters posted to it. | public function screencasts_list() {
$start = microtime(true);
// Only allow this action to be viewed as JSON
$response = array('success' => false, 'result' => null, 'created' => null);
if(!$this->request->is('json')) {
return json_encode($response);
}
// Providing a comma separate list of tags will return only certain documents.
$tags = isset($this->request->data['tags']) ? explode(',', $this->request->data['tags']):false;
$conditions = array('published' => true);
foreach($tags as $tag) {
$conditions['$or'][] = array('tags' => trim($tag));
}
// Limit just in case. So things don't get out of hand one day.
$limit = isset($this->request->data['limit']) ?$this->request->data['limit']:25;
$page = $this->request->page ?: 1;
$order = array('created' => 'desc');
$total = SandboxScreencast::count(compact('conditions'));
$documents = SandboxScreencast::all(compact('conditions','order','limit','page'));
$page_number = (int)$page;
$total_pages = ((int)$limit > 0) ? ceil($total / $limit):0;
// Pagination info
$response['page'] = $page;
$response['total'] = $total;
$response['limit'] = $limit;
$response['total_pages'] = $total_pages;
// The links
if($total > 0) {
$response['success'] = true;
foreach($documents as $document) {
$response['result'][] = array('title' => $document->title, 'description' => $document->description, 'link' => $document->link);
}
}
// Stats
$response['created'] = time();
$response['took'] = microtime(true) - $start;
return json_encode($response);
} | [
"protected function listSurl()\n {\n return $this->getJson(route('surl.list'));\n }",
"public function publishlistAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $stories = $em->getRepository('PDSStoryBundle:Story')->publishRequest();\n\n\n return array('stories' => $stories);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $movieCasts = $em->getRepository('AppBundle:MovieCast')->findAll();\n\n return $this->render('admin/moviecast/index.html.twig', array(\n 'movieCasts' => $movieCasts,\n ));\n }",
"public function study()\r\n {\r\n Application::$app->checkSpotifyToken();\r\n\r\n // Lo-Fi Study Beats\r\n $curl = curl_init();\r\n curl_setopt_array($curl, array(\r\n CURLOPT_URL => 'https://api.spotify.com/v1/playlists/37i9dQZF1DX8Uebhn9wzrS/tracks?limits=10',\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_ENCODING => '',\r\n CURLOPT_MAXREDIRS => 10,\r\n CURLOPT_TIMEOUT => 0,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => 'GET',\r\n CURLOPT_HTTPHEADER => array(\r\n 'Accept: application/json',\r\n 'Content-Type: application/json',\r\n 'Authorization: Bearer ' . $_SESSION['access_token']\r\n ),\r\n ));\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n $decoded = json_decode($response, true);\r\n\r\n // Deep Focus Music\r\n $curl1 = curl_init();\r\n curl_setopt_array($curl1, array(\r\n CURLOPT_URL => 'https://api.spotify.com/v1/playlists/37i9dQZF1DWZeKCadgRdKQ/tracks?limits=10',\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_ENCODING => '',\r\n CURLOPT_MAXREDIRS => 10,\r\n CURLOPT_TIMEOUT => 0,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => 'GET',\r\n CURLOPT_HTTPHEADER => array(\r\n 'Accept: application/json',\r\n 'Content-Type: application/json',\r\n 'Authorization: Bearer ' . $_SESSION['access_token']\r\n ),\r\n ));\r\n $response = curl_exec($curl1);\r\n curl_close($curl1);\r\n $decoded1 = json_decode($response, true);\r\n\r\n // All Nighter Music\r\n $curl2 = curl_init();\r\n curl_setopt_array($curl2, array(\r\n CURLOPT_URL => 'https://api.spotify.com/v1/playlists/37i9dQZF1DX692WcMwL2yW/tracks?limits=10',\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_ENCODING => '',\r\n CURLOPT_MAXREDIRS => 10,\r\n CURLOPT_TIMEOUT => 0,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => 'GET',\r\n CURLOPT_HTTPHEADER => array(\r\n 'Accept: application/json',\r\n 'Content-Type: application/json',\r\n 'Authorization: Bearer ' . $_SESSION['access_token']\r\n ),\r\n ));\r\n $response = curl_exec($curl2);\r\n curl_close($curl2);\r\n $decoded2 = json_decode($response, true);\r\n\r\n // Brain Food Playlist\r\n $curl3 = curl_init();\r\n curl_setopt_array($curl3, array(\r\n CURLOPT_URL => 'https://api.spotify.com/v1/playlists/37i9dQZF1DWXLeA8Omikj7/tracks?limits=10',\r\n CURLOPT_RETURNTRANSFER => true,\r\n CURLOPT_ENCODING => '',\r\n CURLOPT_MAXREDIRS => 10,\r\n CURLOPT_TIMEOUT => 0,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\r\n CURLOPT_CUSTOMREQUEST => 'GET',\r\n CURLOPT_HTTPHEADER => array(\r\n 'Accept: application/json',\r\n 'Content-Type: application/json',\r\n 'Authorization: Bearer ' . $_SESSION['access_token']\r\n ),\r\n ));\r\n $response = curl_exec($curl3);\r\n curl_close($curl3);\r\n $decoded3 = json_decode($response, true);\r\n\r\n // Combine Playlist tracks to pass $params to /study-music view\r\n $params = array();\r\n $params[] = array('title' => 'Lofi Study Beats',\r\n 'about' => 'This playlist offers chill study beats to relax to.',\r\n 'playlistlink' => 'https://open.spotify.com/playlist/37i9dQZF1DX8Uebhn9wzrS?si=xVwyMszdSw2oa1m6rTQzvg',\r\n 'order' => '1',\r\n 'songs' => $decoded);\r\n $params[] = array('title' => 'Deep Focus Music',\r\n 'about' => 'This playlist offers music that allows you to deeply focus on your studies.',\r\n 'playlistlink' => 'https://open.spotify.com/playlist/37i9dQZF1DWZeKCadgRdKQ?si=K5aasHI8TEGdOtbWAVgLpA',\r\n 'order' => '2',\r\n 'songs' => $decoded1);\r\n $params[] = array('title' => 'All Nighter Music',\r\n 'about' => 'Up all night and need a little boost to keep you going? Stay focused with these electronic and trap beats!',\r\n 'playlistlink' => 'https://open.spotify.com/playlist/37i9dQZF1DX692WcMwL2yW?si=MAnLXtqUTB6WrfByN1X1FA',\r\n 'order' => '3',\r\n 'songs' => $decoded2);\r\n $params[] = array('title' => 'Brain Food',\r\n 'about' => 'Feed your brain with hypnotic electronic beats for studies and a relaxing time.',\r\n 'playlistlink' => 'https://open.spotify.com/playlist/37i9dQZF1DWXLeA8Omikj7?si=sRuJavKERWmrVsBljehY5g',\r\n 'order' => '4',\r\n 'songs' => $decoded3);\r\n\r\n return $this->render('pasthits', $params);\r\n }",
"public function getSchoolsListAction()\n {\n\t\t$params=$this->getRequest()->getParams();\n\t\t$keyword=$params[\"term\"];\n\t\t$result=\\Extended\\school_ref::getSchoolList($keyword);\n\t\t$data_arr=array();\n\t\t$i=0;\n\t\twhile($i<count($result))\n\t\t{\n\t\t\t$data_arr[]=array(\n\t\t\t\t\t'label'=>$result[$i]['title'],\n\t\t\t\t\t'value'=>$result[$i]['title'],\n\t\t\t\t\t'id'=>$result[$i]['id']\n\t\t\t\t\t);\n\t\t\t$i++;\n\t\t}\n\t\techo Zend_Json::encode($data_arr);\n\t\tdie;\n }",
"public function getSchoolsListAction()\n\t{\n\t\t$params=$this->getRequest()->getParams();\n\t\t$keyword=$params[\"term\"];\n\t\t$result=\\Extended\\school_ref::getSchoolList($keyword);\n\t\t$data_arr=array();\n\t\t$i=0;\n\t\twhile($i<count($result)){\n\t\t\t$data_arr[]=array(\n\t\t\t\t'label'=>$result[$i]['title'],\n\t\t\t\t'value'=>$result[$i]['title'],\n\t\t\t\t'id'=>$result[$i]['id']\n\t\t\t);\n\t\t\t$i++;\n\t\t}\n\t\techo Zend_Json::encode($data_arr);\n\t\tdie;\n\t}",
"public function index()\n\t{\n\t\t$reddits = Reddit::orderBy('name')->get();\n\n\t\treturn $this->respondWithCollection($reddits, new RedditTransformer());\n\t}",
"public function listAction()\n {\n $request=$this->getRequest();\n $requestUtil=$this->getRequestUtil();\n \n $pageRequestData=$requestUtil->getPageRequestDataFrom($request);\n $dataPage=$this->getSystemSecurityGroupManager()->findPageFrom($pageRequestData);\n \n return $requestUtil->defaultListJsonResponse($dataPage->getData(), $dataPage->getTotalRecords());\n }",
"public function actionRestList()\n {\n $this->doRestList();\n }",
"public function actionBrandReviewList()\n {\n $code = 1000;\n\n $sort = Yii::$app->request->get('sort', []);\n $model = new GoodsBrand;\n $orderBy = $sort ? ModelService::sortFields($model, $sort) : ModelService::sortFields($model);\n if ($orderBy === false) {\n return Json::encode([\n 'code' => $code,\n 'msg' => Yii::$app->params['errorCodes'][$code],\n ]);\n }\n\n $where = '1';\n\n $keyword = trim(Yii::$app->request->get('keyword', ''));\n if (!$keyword) {\n $reviewStatus = (int)Yii::$app->request->get('review_status', Yii::$app->params['value_all']);\n if ($reviewStatus != Yii::$app->params['value_all'] && !in_array($reviewStatus, array_keys(Yii::$app->params['reviewStatuses']))) {\n return Json::encode([\n 'code' => $code,\n 'msg' => Yii::$app->params['errorCodes'][$code],\n ]);\n }\n if ($reviewStatus != Yii::$app->params['value_all']) {\n $where .= \" and review_status = {$reviewStatus}\";\n }\n\n $startTime = trim(Yii::$app->request->get('start_time', ''));\n $endTime = trim(Yii::$app->request->get('end_time', ''));\n\n if (($startTime && !StringService::checkDate($startTime))\n || ($endTime && !StringService::checkDate($endTime))\n ) {\n return Json::encode([\n 'code' => $code,\n 'msg' => Yii::$app->params['errorCodes'][$code],\n ]);\n }\n\n $endTime && $endTime .= ' 23:59:59';\n\n if ($startTime) {\n $startTime = strtotime($startTime);\n $startTime && $where .= \" and create_time >= {$startTime}\";\n }\n if ($endTime) {\n $endTime = strtotime($endTime);\n $endTime && $where .= \" and create_time <= {$endTime}\";\n }\n } else {\n $where .= \" and supplier_name like '%{$keyword}%'\";\n $ids = GoodsBrand::findIdsByMobile($keyword);\n $ids && $where .= \" or id in(\" . implode(',', $ids) . \")\";\n }\n\n $page = (int)Yii::$app->request->get('page', 1);\n $size = (int)Yii::$app->request->get('size', GoodsBrand::PAGE_SIZE_DEFAULT);\n\n return Json::encode([\n 'code' => 200,\n 'msg' => 'OK',\n 'data' => [\n 'brand_review_list' => [\n 'total' => (int)GoodsBrand::find()->where($where)->asArray()->count(),\n 'details' => GoodsBrand::pagination($where, GoodsBrand::FIELDS_REVIEW_LIST, $page, $size, $orderBy)\n ]\n ],\n ]);\n }",
"public function listAction()\n {\n\n $alphabet = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9'));\n $alphabetMax = count($alphabet) - 1;\n $count = rand(1, 10);\n $json = array();\n for ($i = 0; $i < $count; $i++) {\n $object = new Ghost();\n $object->setId($i);\n\n $length = rand(1, 7);\n $name = '';\n for ($j = 0; $j < $length; $j++) {\n $name .= $alphabet[rand(0, $alphabetMax)];\n }\n $object->setName($name);\n\n $json[] = $object->jsonSerialize();\n }\n\n return new JsonResponse($json);\n }",
"public function index()\n {\n $limit = Request::get('limit') ?: 20;\n\n $offset = Request::get('offset') ?: 0;\n\n $sports = $this->repository->filterByUser(Auth::user()->id)->paginate($limit, $offset);\n\n $data = $this->fractal->collection($sports, new SportTransformer(), 'sports');\n\n return $this->respondWithSuccess($data);\n }",
"public function actionList()\n\t{\n\t\t$this->getScriptRegistrar()->registerScript(new Script('dream/dream-list.js'));\n\t\treturn $this->render('dream-list', [\n\t\t\t'canFilter' => true,\n\t\t\t'formAction' => '/search/list'\n\t\t]);\n\t}",
"public function GetCategoryShows() {\n $this->url = config('mangoapi.base_uri').'index.php/nand?scope='.config('mangoapi.clientscope').'&action='.config('mangoapi.categorydetailsandshows').$this->extraquery.'&key='.config('mangoapi.apikey').'&p_s=1&user_id='.config('mangoapi.user_id').'';\n if(!empty($this->url)) {\n $responses = $this->GetResponse(array('url' => $this->url));\n }\n return ($responses);\n }",
"function getAllSeries() {\n\n $service_url = \"/series.json\";\n if($series = $this->getJSON($service_url)){\n //$x = \"search-results\";\n //$episodes = $search->$x->result;\n return $series;\n } else return false;\n }",
"public function listAction()\n {\n return $this->response(\n 'ajax',\n array(\n 'galleries' => $this->getModel('galleries')->getList(),\n )\n );\n }",
"function action_list_Stories()\r\n {\r\n\t\t$data['stories'] = Model_PCP_Stories::getStories(array('status'=>'p'));\r\n $this->template->content = View::factory('pcp/stories',$data)->render();\r\n }",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public static function find_feeds() {\n\t\tif ( isset( $_POST['query'] ) ) {\n\t\t\t$query = sanitize_text_field( wp_unslash( $_POST['query'] ) );\n\n\t\t\t$response = Yarns_Microsub_Parser::search( $query );\n\t\t\t$response = static::validate_results( $response, 'search' );\n\n\t\t\tif ( $response['error'] ) {\n\t\t\t\techo wp_json_encode( $response );\n\t\t\t\twp_die();\n\t\t\t} else {\n\t\t\t\t$html = '<h3>Select a feed to follow:</h3>';\n\t\t\t\tforeach ( $response['content']['results'] as $result ) {\n\t\t\t\t\t$html .= '<label><input type=\"radio\" name=\"yarns-feed-picker\" value=\"' . $result['url'] . '\">' . $result['url'] . '</label>';\n\t\t\t\t}\n\t\t\t\t$html .= '<a class=\"button\" id =\"yarns-channel-preview-feed\">Preview</a>';\n\t\t\t\t$html .= '<a class=\"button\" id =\"yarns-channel-add-feed\">Subscribe</a>';\n\n\t\t\t\techo wp_json_encode(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'error' => false,\n\t\t\t\t\t\t'content' => $html,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\twp_die();\n\t\t\t}\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse license file and make an array with license data | public function parseLicenseFile() {
$licRecStorage = 0;
if (Storage::exists('/app/license.lic')) {
$licFile = File::get(storage_path('/app/license.lic'));
// $pubKey = File::get(Storage::disk('local')->get('public.txt'));
if (!empty($licFile)) {
$licRecStorage = 1;
} else {
$licRecStorage = 0;
}
} else {
$licRecStorage = 0;
}
return $licRecStorage;
} | [
"protected function parseLicenseFile()\n\t{\n\t\tif ($this->parsed)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->parsed = TRUE;\n\n\t\t// Reset the errors\n\t\tunset($this->errors['missing_license']);\n\t\tunset($this->errors['corrupt_license_file']);\n\n\t\t$license = json_decode(base64_decode($this->getRawLicense()), TRUE);\n\n\t\tif ( ! isset($license['data']))\n\t\t{\n\t\t\t$this->errors['corrupt_license_file'] = \"The license is missing its data.\";\n\t\t\treturn;\n\t\t}\n\n\t\t$this->signed_data = $license['data'];\n\t\t$this->data = json_decode($license['data'], TRUE);\n\n\t\tif (isset($license['signature']))\n\t\t{\n\t\t\t$this->signature = base64_decode($license['signature']);\n\t\t}\n\t}",
"static function ParseLicenses ($text) {\r\n $licenses = array();\r\n return $licenses;\r\n }",
"function parse_license_file( $licenses_file = null ) {\n\tif ( null !== $licenses_file ) {\n\t\tload_env_file( $licenses_file );\n\t} else {\n\t\techo \"\\nLicenses file not specified, licenses will be read from environment.\";\n\t}\n}",
"public function getLicenses(string $path): array;",
"protected static function parseAndCache()\n\t{\n\t\t$json = VANITY_VENDOR . '/skyzyx/spdx-licenses/spdx-licenses.json';\n\n\t\tif (file_exists($json))\n\t\t{\n\t\t\tself::$licenses = json_decode(file_get_contents($json), true);\n\t\t}\n\t}",
"function &getDataLicences()\n\t{\n\t\t$query = 'SELECT a.id AS value, a.name AS text' .\n\t\t\t\t\t' FROM #__oer_licenses AS a';\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$licencelist = $this->_db->loadObjectList();\n\t\t\treturn $licencelist;\n\t}",
"function getLicenseDetail(){\n\t\t/** getting License status **/\n\t\t$_state = modApiFunc(\"License\", \"checkLicense\");\n\t\t/** Getting License information array **/\n\t\t$licenseInfo = modApiFunc(\"License\",\"getLicenseInfo\", $_state);\n\t\t/** array containing license details **/\n\t\t$licenseDetailArray = array(\n\t\t\t\t'license' => $licenseInfo[\"license_key\"],\n\t\t\t\t'store_url' => $licenseInfo[\"current_url\"],\n\t\t\t\t'store_version' => PRODUCT_VERSION_NUMBER,\n\t\t);\n\t\treturn $licenseDetailArray;\n\t}",
"public function getLicense();",
"function DBgetLicense(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT fs.fk_license, cc.LINK_DEED as id, cc.NAME as name\n\t\t FROM \".$this->penelopeTabID.\" AS extab\n\t\t JOIN space ON extab.uuid = space.uuid\n\t\t JOIN file_summary AS fs ON space.source_id = fs.source_id\n\t\t JOIN w_lu_creative_commons AS cc ON fs.fk_license = cc.PK_LICENSE\n\t\t GROUP BY fs.source_id\n\t\t ORDER BY fs.fk_license DESC\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql); \n\t\t if($result){\n\t\t\t\t$output = $result[0];\n\t\t\t\tif(stristr($output[\"id\"], \"creativecommons\")){\n\t\t\t\t\t $output[\"name\"] = \"Creative Commons \".$output[\"name\"];\n\t\t\t\t}\n\t\t\t\tunset($output[\"fk_license\"]);\n\t\t\t\treturn $output;\n\t\t }\n\t\t else{\n\t\t\t\treturn array(\"id\" => \"http://creativecommons.org/licenses/by/3.0\",\n\t\t\t\t\t\t\t\t \"name\" => \"Creative Commons Attribution\"\n\t\t\t\t\t\t\t\t );\n\t\t }\n\t\t \n\t\t \n\t }",
"function acf_pro_get_license() { }",
"public static function get_license_from_url($url)\n {\n if (stripos($url, 'creativecommons.org') === false) {\n return [\n 'version' => null,\n 'commercial_use' => null,\n 'modification' => null,\n 'jurisdiction' => null,\n ];\n }\n\n $raw_extract = array_slice(\n explode('/', $url),\n 4, // remove http://creativecommons.org/\n 3\n );\n\n if (stripos($url, '/publicdomain/zero/')) {\n $version = 'cc0';\n } elseif (stripos($url, '/publicdomain/mark/')) {\n $version = 'pdmark';\n } elseif (stripos($url, '/4.0')) {\n $version = 'cc4';\n } else {\n $version = 'cc3';\n }\n\n return [\n 'version' => $version,\n 'commercial_use' => strpos($raw_extract[0], 'nc') ? 'no' : 'yes',\n 'modification' => self::get_modification_state($raw_extract[0]),\n 'jurisdiction' => !isset($raw_extract[2]) || strpos($raw_extract[2], '.') || $raw_extract[2] == '' ? 'international' : $raw_extract[2],\n ];\n }",
"private function get_license() {\n\t\treturn include self::ROOT . '/LICENSE.php';\n\t}",
"public function licensePath();",
"function license() {}",
"function getUserLicenseList() {\n\t\t$validLicense = array();\n\t\tif ( $this->getUserLicense() ) {\n\t\t\t$oResponse = $this->getResponse();\n\t\t\tforeach ( $oResponse as $value ) {\n\t\t\t\t$licenseID = $value->id;\n\t\t\t\tif ( strlen((string) $licenseID) > 0 ) {\n\t\t\t\t\t$oMofimMusicLicense = mofilmUserMusicLicense::getInstance((string)$licenseID);\n\t\t\t\t\tif ( !$oMofimMusicLicense instanceof mofilmUserMusicLicense || !$oMofimMusicLicense->getID() ) {\n\t\t\t\t\t\t$oTracks = $value->tracks;\n\t\t\t\t\t\t$trackName = array();\n\t\t\t\t\t\tforeach ( $oTracks as $inTrack ) {\n\t\t\t\t\t\t\t$trackName[] = $inTrack->name;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tracks = implode(\",\",$trackName);\n\t\t\t\t\t\t$oMofimMusicLicense = new mofilmUserMusicLicense();\n\t\t\t\t\t\t$oMofimMusicLicense->setLicenseID((string) $licenseID);\n\t\t\t\t\t\t$oMofimMusicLicense->setTrackName($tracks);\n\t\t\t\t\t\t$oMofimMusicLicense->setExpiryDate (\"2099-02-05 05:12:31\");\n\t\t\t\t\t\t$oMofimMusicLicense->setUserID((string) $this->getUserID());\n\t\t\t\t\t\t$oMofimMusicLicense->setStatus(0);\n\t\t\t\t\t\t$oMofimMusicLicense->setMusicSource(\"AudioSocket\");\n\t\t\t\t\t\t$oMofimMusicLicense->save();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$validLicense = mofilmUserMusicLicense::listOfObjectsByUserID($this->getUserID());\n\t\t\treturn $validLicense;\n\t\t} else {\n\t\t\t$validLicense = mofilmUserMusicLicense::listOfObjectsByUserID($this->getUserID());\n\t\t\tif ( count($validLicense) <=0 ) {\n\t\t\t\tthrow new mofilmException(\"UserID {$this->getUserID()} has no licenses\");\n\t\t\t} else {\n\t\t\t\treturn $validLicense;\n\t\t\t}\n\t\t}\n\t}",
"function license_agreement( $file = 'license.txt' ) {\n global $config;\n $openFile = @fopen( $file, 'r' );\n if ( $openFile ) {\n $content = @fread( $openFile, @filesize( $file ) );\n } else {\n return FALSE;\n }\n\n @fclose( $openFile );\n return $content;\n }",
"public function load()\n {\n \n //split into blocks and filter empty lines\n $items = array_filter(explode($this->vcardSeparator, file_get_contents($this->filename)), create_function('$a', 'return ($a);'));\n//Zend_Debug::dump($this->vcardSeparator);\n $this->items = array();\n\n foreach($items as $item) {\n $values = $this->parse($item);\n//Zend_Debug::dump($values);\n $item2 = array();\n foreach($values as $value) {\n//Zend_Debug::dump($value);\n switch ($value['name']) {\n case 'N':\n $item2['lastName'] = $value['value'][0];\n $item2['firstName'] = $value['value'][1];\n break;\n case 'EMAIL':\n $item2['email'] = $value['value'][0];\n break;\n default:\n \n }\n \n }\n if ($item2) $this->items[] = $item2;\n }\n \n }",
"public function get_all_license()\n {\n $sentence = new SentenceUtil();\n $sentence->fromCommand(\"/system/license/getall\");\n $this->talker->send($sentence);\n $rs = $this->talker->getResult();\n $i = 0;\n if ($i < $rs->size()) {\n return $rs->getResultArray();\n }\n }",
"public function GetSkusFile(){\n\n $file = $this->fileinput;\n\n $skus = array();\n\n $file_name = $file;\n\n if (file_exists($file_name)){\n\n $h_file=file($file_name);\n\n foreach ($h_file as $line){\n\n $a_skus = explode(';',$line);\n $skus[trim($a_skus[0])] = intval($a_skus[1]);\n }\n\n }\n\n return $skus;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Save more product industries | public function saveProductIndustries(){
$marketplaceproduct = MarketplaceProducts::find(Input::get('product_id'));
//first of all delete existing rows and create new one.
MarketplaceProductIndustries::whereRaw("product_id = ? ",array($marketplaceproduct->id))->delete();
foreach(Input::get('product_industries') as $acc){
$industry = new MarketplaceProductIndustries();
$industry->product_id = $marketplaceproduct->id;
$industry->industry_id = $acc;
$industry->save();
}
return Redirect::to('marketplaceproducts/info/'.$marketplaceproduct->id)->with('message', 'Your market listing has posted.');
} | [
"public function updateIndustriesAction()\n {\n\n $meroveusParams = [\n \"KEYWORDS\" => \"\",\n \"MODE\" => \"LABELSEARCH\",\n \"LABELS\" => [\n [\n \"NAME\" => \"\",\n \"DATACLASS\" => [\n \"KEY\" => \"industry\",\n ],\n ],\n ],\n ];\n\n // @todo handle deletions\n $industries = $this->companyService->queryMeroveusRoot($meroveusParams);\n\n $industriesAdded = 0;\n $numberOfMeroveusIndustries = 0;\n\n foreach ($industries as $industry) {\n $numberOfMeroveusIndustries++;\n try {\n $saved = (new MeroveusIndustry([\n 'externalId' => $industry['LABELID'],\n 'industry' => trim($industry['NAME'], 'Â '),\n ]))->save();\n\n $industriesAdded += $saved ? 1 : 0;\n } catch (\\Exception $e) {\n\n }\n }\n\n $savedIndustries = Generic::query(\"SELECT count(*) AS count FROM meroveusIndustry\")->first()->count;\n\n echo \"Added {$industriesAdded} new industries of {$numberOfMeroveusIndustries} from meroveus\" . PHP_EOL;\n echo \"There are {$savedIndustries} in the datahub\";\n }",
"public function productSave(Replicate\\Request\\ProductSave $req);",
"public function append_product()\n\t{\n\t\t$product_id = $this->input->post(\"product_id\");\n\t\t$vendor_id = $this->input->post(\"vendor_id\");\n\t\t$initial_stock = $this->input->post(\"stock\");\n\t\t$initial_price = $this->input->post(\"price\");\n\t\tif ($this->vendor->add_product($vendor_id, $product_id, $initial_stock, $initial_price)) \n\t\t{\n\t\t\t$this->products();\n\t\t}\t\n\t}",
"function saveInventoryProductDetails()\n\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering into function saveInventoryProductDetails().\");\n\t\tglobal $app_strings;\n\n\t\tif($this->mode == 'edit')\n\t\t{\n\t\t\t$inventarr = $this->getInventProInfo($this->id);\n\t\t\t\n//\t\t\t$update_productsql2 = \"update ec_products set num = num +\".$inventarr['quantity'].\" where productid =\".$inventarr['productid'];\n//\t\t\t$this->db->query($update_productsql2);\n\t\t\tdeleteInventoryProductDetails($this->id,'');\n\t\t}\n\n\t\t$tot_no_prod = $_REQUEST['totalProductCount'];\n\n\t\t$prod_seq=1;\n\t\tfor($i=1; $i<=$tot_no_prod; $i++)\n\t\t{\n\t\t\t$prod_id = $_REQUEST['hdnProductId'.$i];\n\t\t\t$qty = $_REQUEST['qty'.$i];\n\t\t\t$listprice = $_REQUEST['listPrice'.$i];\n\t\t\t$listprice = getConvertedPrice($listprice);//convert the listPrice into $\n\n\t\t\t$comment = addslashes($_REQUEST['comment'.$i]);\n\n\t\t\t//if the product is deleted then we should avoid saving the deleted products\n\t\t\tif($_REQUEST[\"deleted\".$i] == 1)\n\t\t\t\tcontinue;\n\t\t\t$query =\"insert into ec_inventoryproductrel(id, productid, sequence_no, quantity, listprice, comment) values($this->id, $prod_id , $prod_seq, $qty, $listprice, '$comment')\";\n\t\t\t$prod_seq++;\n\t\t\t$this->db->query($query);\n\t\t}\n\n\t\t//we should update the netprice (subtotal), taxtype, group discount, S&H charge, S&H taxes, adjustment and total\n\t\t//netprice, group discount, taxtype, S&H amount, adjustment and total to entity table\n\n\t\t$updatequery = \" update $this->table_name set \";\n\n\t\t$total = getConvertedPrice($_REQUEST['total']);//convert total to $\n\t\t$updatequery .= \" total='\".$total.\"'\";\n\t\t$updatequery .= \" where salesorderid=$this->id\"; \n\t\t$this->db->query($updatequery);\n\t\t$log->debug(\"Exit from function saveInventoryProductDetails().\");\n\t}",
"public function save(){\n $product = $this->bindFormValues($this->input->post());\n $this->product->save($product);\n\n $this->redirectTo('all');\n }",
"public function save(Product $product): void;",
"public function updateProduct()\n\t{\n\t}",
"public function save(){\r\n\t\tif (is_null($this->_id)){\r\n\t\t\tgetDb()->insert('product', [\r\n\t\t 'name' => $this->_name,\r\n\t\t 'price' => $this->_price,\r\n\t\t 'description' => $this->_description,\r\n\t\t 'picture' => $this->_picture,\r\n\t\t \t'isEdited' => $this->_isEdited\r\n\t\t ]);\r\n\t\t}else{\r\n\t\t\tgetDb()->update('product', [\r\n\t\t\t 'name' => $this->_name,\r\n\t\t\t 'price' => $this->_price,\r\n\t\t\t 'description' => $this->_description,\r\n\t\t\t 'picture' => $this->_picture,\r\n\t\t\t 'isEdited' => $this->_isEdited\r\n\t\t\t], ['id' => $this->_id]);\r\n\t\t}\r\n\r\n\t}",
"public static function save(): void\n {\n //* Initialiser le tableau des erreurs\n $errors = [];\n\n //* Créer le produit.\n $product = new Product();\n\n //* Récupérer et filtrer les données.\n $product->idProduct = filter_input(INPUT_POST, 'idProduct', FILTER_VALIDATE_INT) ?: null;\n $product->idCategory = filter_input(INPUT_POST, 'idCategory', FILTER_VALIDATE_INT) ?: null;\n $product->name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES) ?: null;\n $product->ref = filter_input(INPUT_POST, 'ref', FILTER_SANITIZE_STRING) ?: null;\n $product->price = filter_input(INPUT_POST, 'price', FILTER_VALIDATE_FLOAT) ?: null;\n\n //* Si données valides, persister le produit et rediriger vers la liste.\n if ($product->validate($errors)) {\n $product->persist();\n Router::redirect('/');\n }\n\n //* Sinon, retrouver toutes les catégories et rendre la vue editProduct.\n $categories = Category::findAllBy([], ['name' => 'ASC']);\n Router::render('editProduct.php', ['product' => $product, 'categories' => $categories, 'errors' => $errors]);\n }",
"public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }",
"private function addEnhedtoDB()\n {\n try {\n $product_id = (int)$this->getProduct();\n $lokale = (int)$this->getLokale();\n $svf = (int)$this->getSVF();\n $thp = (int)$this->getTHP();\n $antal = $this->getAntal();\n //Get the Product ID from the new Product and insert into a new variable.\n // prepare a sql script for inserting X Total of Units/Enheds for the new Product.\n //Looping sql insert script X times for each Unit/Enhed.\n for ($enhedNumber = 1; $enhedNumber <= $antal; $enhedNumber++) {\n $convertEnhedNumberToString = \"Unit_\" . (string)$enhedNumber;\n $url = 'http://localhost:8000/api/booking/products/units/create';\n $data = array(\n 'unit_number' => $convertEnhedNumberToString,\n 'products_id' => $product_id,\n 'location_room_id' => $lokale,\n 'product_location_type_svf_id' => $svf,\n 'product_location_type_thp_id' => $thp,\n );\n\n// use key 'http' even if you send the request to https://...\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/json \\r\\nAuthorization: \".$_SESSION['user']['token'],\n 'method' => 'POST',\n 'content' => json_encode($data)\n )\n );\n//send request to api and get result\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n $jsonData = json_decode($result, true);\n\n }\n\n } catch (Exception $e) {\n die(\"Error: \" . $e);\n }\n }",
"public function testUpdateProductUsingPOST()\n {\n }",
"public function testUpdateProduct()\n {\n }",
"public function saveDataExcelInProduct($insertProducts);",
"private function action_save()\r\n\t{\r\n\t\r\n\t\tDB::send_query('\r\n\t\tUPDATE purchase_comps SET\r\n\t\tproduct_id=\\'' . $this->f_product_id . '\\',\r\n\t\tunits=\\'' . $this->f_units . '\\',\r\n\t\tquantity_purchased=\\'' . $this->f_quantity_purchased . '\\',\r\n\t\tquantity_sellable=\\'' . $this->f_quantity_sellable . '\\',\r\n\t\texpiration_date=\\'' . $this->f_expiration_date . '\\',\r\n\t\tmin_price_per_unit=\\'' . $this->f_min_price_per_unit . '\\'\r\n\t\tWHERE id=\\'' . $this->f_id . '\\'\r\n\t\t');\r\n\t}",
"protected function saveProducts()\n {\n $this->translator = $this->translator->init($this->_parameters);\n $existingImages = [];\n $existingUpload = [];\n $entityLinkField = $this->getProductEntityLinkField();\n if (!empty($this->_parameters['import_source']) && $this->_parameters['import_source'] != 'file') {\n $this->_initSourceType($this->_parameters['import_source']);\n }\n $configurableData = [];\n\n $isPriceGlobal = $this->_catalogData->isPriceGlobal();\n $productLimit = null;\n $productsQty = null;\n while ($nextBunch = $this->_dataSourceModel->getNextBunch()) {\n $entityRowsIn = $entityRowsUp = [];\n $attributes = [];\n $this->websitesCache = $this->categoriesCache = $this->categoryProductPosition = [];\n $this->categoryProcessor->setRowCategoryPosition($this->categoryProductPosition);\n $mediaGallery = $uploadedImages = [];\n $tierPrices = [];\n $previousType = $prevAttributeSet = null;\n $existingImages = $this->getExistingImages($nextBunch);\n if ($this->sourceType && $this->_parameters['image_import_source']) {\n $nextBunch = $this->prepareImagesFromSource($nextBunch);\n }\n\n $prevData = [];\n foreach ($nextBunch as $rowNum => $rowData) {\n $time = explode(\" \", microtime());\n $startTime = $time[0] + $time[1];\n if (isset($rowData[self::COL_CATEGORY])) {\n $categoriesMapping = $this->categoriesMapping($rowData);\n $rowData[self::COL_CATEGORY] = $categoriesMapping[self::COL_CATEGORY];\n\n if (!empty($categoriesMapping[self::COL_CATEGORY . '_position'])) {\n $rowData[self::COL_CATEGORY . '_position'] =\n $categoriesMapping[self::COL_CATEGORY . '_position'];\n }\n }\n\n $rowData = $this->joinIdenticalyData($rowData);\n if (isset($rowData['_attribute_set']) && isset($rowData['attribute_set_code'])) {\n if (isset($rowData['update_attribute_set']) && ((int)($rowData['update_attribute_set']) > 0)) {\n $rowData['_attribute_set'] = $rowData['attribute_set_code'];\n } else {\n unset($rowData['attribute_set_code']);\n }\n }\n $oldSkus = $this->skuProcessor->getOldSkus();\n $sku = strtolower($this->getCorrectSkuAsPerLength($rowData));\n\n if (!isset($oldSkus[$sku])) {\n if (!isset($rowData['_attribute_set'])\n || (isset($rowData['_attribute_set']) && empty($rowData['_attribute_set']))\n ) {\n $collectSets = $this->_attrSetIdToName;\n reset($collectSets);\n $rowData['_attribute_set'] = current($collectSets);\n }\n }\n $createValuesAllowed = (bool)$this->scopeConfig->getValue(\n Import::CREATE_ATTRIBUTES_CONF_PATH,\n ScopeInterface::SCOPE_STORE\n );\n\n $storeIds = $this->getStoreIds();\n\n if (isset($this->_parameters['remove_related_product'])\n && $this->_parameters['remove_related_product'] == 1\n ) {\n $this->removeRelatedProducts($this->getCorrectSkuAsPerLength($rowData));\n }\n\n if (isset($this->_parameters['remove_crosssell_product'])\n && $this->_parameters['remove_crosssell_product'] == 1\n ) {\n $this->removeCrosssellProducts($this->getCorrectSkuAsPerLength($rowData));\n }\n\n if (isset($this->_parameters['remove_upsell_product'])\n && $this->_parameters['remove_upsell_product'] == 1\n ) {\n $this->removeUpsellProducts($this->getCorrectSkuAsPerLength($rowData));\n }\n\n $rowData = $this->checkAdditionalImages($rowData);\n $rowData = $this->customChangeData($rowData);\n if (!$this->validateRow($rowData, $rowNum) || !$this->validateRowByProductType($rowData, $rowNum)) {\n $this->addLogWriteln(\n __('product with sku: %1 is not valided', $this->getCorrectSkuAsPerLength($rowData)),\n $this->output,\n 'info'\n );\n $this->notValidedSku[] = strtolower($this->getCorrectSkuAsPerLength($rowData));\n unset($nextBunch[$rowNum]);\n continue;\n } else {\n $rowData = $this->prepareRowForDb($rowData);\n }\n $productType = isset($rowData[self::COL_TYPE]) ?\n strtolower($rowData[self::COL_TYPE]) :\n $this->skuProcessor->getNewSku($this->getCorrectSkuAsPerLength($rowData))['type_id'];\n // custom\n\n if ($productType) {\n $productTypeModel = $this->_productTypeModels[$productType];\n if ($createValuesAllowed) {\n $rowData = $this->createAttributeValues(\n $productTypeModel,\n $rowData\n );\n }\n }\n\n if (!isset($rowData[self::COL_ATTR_SET]) ||\n !isset($this->_attrSetNameToId[$rowData[self::COL_ATTR_SET]])) {\n $this->addRowError(ValidatorInterface::ERROR_INVALID_ATTR_SET, $rowNum);\n $this->addLogWriteln(\n __(\n 'product with sku: %1 is not valided. ' .\n 'Invalid value for Attribute Set column (set doesn\\'t exist?)',\n $this->getCorrectSkuAsPerLength($rowData)\n ),\n $this->output,\n 'info'\n );\n $this->notValidedSku[] = strtolower($this->getCorrectSkuAsPerLength($rowData));\n unset($nextBunch[$rowNum]);\n continue;\n }\n\n $urlKey = $this->getUrlKey($rowData);\n if (!empty($rowData[self::URL_KEY])) {\n // If url_key column and its value were in the CSV file\n $rowData[self::URL_KEY] = $urlKey;\n } elseif ($this->isNeedToChangeUrlKey($rowData)) {\n // If url_key column was empty or even not declared in the CSV file but by the rules it is need to\n // be setteed. In case when url_key is generating from name column we have to ensure that the bunch\n // of products will pass for the event with url_key column.\n $nextBunch[$rowNum][self::URL_KEY] = $rowData[self::URL_KEY] = $urlKey;\n } elseif (isset($rowData[self::URL_KEY]) || isset($rowData[self::COL_NAME])) {\n $rowData[self::URL_KEY] = $urlKey;\n }\n\n $this->urlKeys = [];\n $rowData = $this->applyCategoryLevelSeparator($rowData);\n\n $rowData = $this->adjustBundleTypeAttributes($rowData);\n\n if (empty($this->getCorrectSkuAsPerLength($rowData))) {\n $rowData = array_merge($prevData, $this->deleteEmpty($rowData));\n } else {\n $prevData = $rowData;\n }\n $sku = $this->getCorrectSkuAsPerLength($rowData);\n if ($this->onlyUpdate) {\n $collectionUpdate = $this->collectionFactory->create()->addFieldToFilter(\n self::COL_SKU,\n $this->getCorrectSkuAsPerLength($rowData)\n );\n if (!$collectionUpdate->getSize()) {\n $this->addLogWriteln(__('product with sku: %1 does not exist', $sku), $this->output, 'info');\n unset($nextBunch[$rowNum]);\n continue;\n }\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n unset($nextBunch[$rowNum]);\n $this->notValidedSku[] = strtolower($this->getCorrectSkuAsPerLength($rowData));\n\n continue;\n }\n\n if (isset($rowData['_attribute_set']) && isset($this->_attrSetNameToId[$rowData['_attribute_set']])) {\n $this->skuProcessor->setNewSkuData(\n $this->getCorrectSkuAsPerLength($rowData),\n 'attr_set_id',\n $this->_attrSetNameToId[$rowData['_attribute_set']]\n );\n }\n\n $this->prepareConfigurableVariation($rowData, $configurableData);\n $rowScope = $this->getRowScope($rowData);\n $rowSku = $this->getCorrectSkuAsPerLength($rowData);\n $checkSku = $rowSku;\n\n if (version_compare($this->productMetadata->getVersion(), '2.2.0', '>=')) {\n $checkSku = strtolower($rowSku);\n }\n if (!$rowSku) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n } elseif (self::SCOPE_STORE == $rowScope) {\n // set necessary data from SCOPE_DEFAULT row\n $rowData[self::COL_TYPE] = $this->skuProcessor->getNewSku($checkSku)['type_id'];\n $rowData['attribute_set_id'] = $this->skuProcessor->getNewSku($checkSku)['attr_set_id'];\n $rowData[self::COL_ATTR_SET] = $this->skuProcessor->getNewSku($checkSku)['attr_set_code'];\n }\n // Entity phase\n\n if (!isset($this->_oldSku[$checkSku])) {\n // new row\n if (!$productLimit || $productsQty < $productLimit) {\n if (isset($rowData['has_options'])) {\n $hasOptions = $rowData['has_options'];\n } else {\n $hasOptions = 0;\n }\n $entityRowsIn[$rowSku] = [\n 'attribute_set_id' => $this->skuProcessor->getNewSku($checkSku)['attr_set_id'],\n 'type_id' => $this->skuProcessor->getNewSku($checkSku)['type_id'],\n 'sku' => $rowSku,\n 'has_options' => $hasOptions,\n 'created_at' => $this->_localeDate->date()->format(DateTime::DATETIME_PHP_FORMAT),\n 'updated_at' => $this->_localeDate->date()->format(DateTime::DATETIME_PHP_FORMAT),\n ];\n $productsQty++;\n } else {\n $rowSku = null;\n // sign for child rows to be skipped\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n continue;\n }\n } else {\n $array = [\n 'updated_at' => $this->_localeDate->date()->format(DateTime::DATETIME_PHP_FORMAT),\n $entityLinkField => $this->_oldSku[$checkSku][$entityLinkField],\n ];\n $array['attribute_set_id'] = $this->skuProcessor->getNewSku($checkSku)['attr_set_id'];\n $array['type_id'] = $productType;\n // existing row\n $entityRowsUp[] = $array;\n }\n\n // Categories phase\n if (!array_key_exists($rowSku, $this->categoriesCache)) {\n $this->categoriesCache[$rowSku] = [];\n }\n\n $rowData['rowNum'] = $rowNum;\n $categoryIds = $this->getCategories($rowData);\n if (isset($rowData['category_ids'])) {\n $catIds = explode($this->getMultipleValueSeparator(), $rowData['category_ids']);\n $finalCatId = [];\n foreach ($catIds as $catId) {\n $catId = (int)$catId;\n $existingCat = $this->categoryProcessor->getCategoryById($catId);\n if (is_int($catId) && $catId > 0 && $existingCat && $existingCat->getId()) {\n $finalCatId[] = $catId;\n }\n }\n $categoryIds = array_merge($categoryIds, $finalCatId);\n }\n if (!empty($this->getCategoryProcessor()->getFailedCategories())) {\n foreach ($this->getCategoryProcessor()->getFailedCategories() as $field) {\n $this->addRowError('Category: ' . __($field['category']->getName() .\n ' Url: ' . $field['category']->getUrlKey() .\n ' ' . $field['exception']->getMessage()), $rowNum);\n }\n $this->addLogWriteln(\n __('product with sku: %1 is not valided', $this->getCorrectSkuAsPerLength($rowData)),\n $this->output,\n 'info'\n );\n $this->notValidedSku[] = strtolower($this->getCorrectSkuAsPerLength($rowData));\n unset($nextBunch[$rowNum]);\n continue;\n }\n foreach ($categoryIds as $id) {\n $this->categoriesCache[$rowSku][$id] = true;\n }\n\n $catIds = [];\n if ($this->isSkuExist($rowSku)) {\n if (!isset($this->_oldSku[strtolower($rowData[self::COL_SKU])]['entity_id'])) {\n $entityId = $this->_oldSku[strtolower($rowData[self::COL_SKU])]['row_id'];\n $this->skuProcessor->setNewSkuData($rowData[self::COL_SKU], 'entity_id', $entityId);\n } else {\n $entityId = $this->_oldSku[strtolower($rowData[self::COL_SKU])]['entity_id'];\n }\n $oldCategoryIds = $this->getCategoryLinks($entityId);\n\n if (!empty($categoryIds)\n && isset(\n $this->_parameters['remove_product_categories'],\n $this->_oldSku[strtolower($rowData[self::COL_SKU])]\n )\n && $this->_parameters['remove_product_categories'] > 0\n ) {\n foreach ($oldCategoryIds as $oldCategoryId) {\n if (!in_array($oldCategoryId['category_id'], $categoryIds, false)) {\n $this->categoriesCache[$rowSku][$oldCategoryId['category_id']] = false;\n }\n }\n }\n }\n\n if (!isset($this->categoryProductPosition[$rowSku])) {\n $this->categoryProductPosition[$rowSku] = [];\n }\n $this->categoryProductPosition[$rowSku] += $this->categoryProcessor->getRowCategoryPosition();\n\n if (isset($rowData[self::COL_CATEGORY]) && empty($rowData[self::COL_CATEGORY])) {\n foreach ($catIds as $categoryId) {\n $this->categoryLinkRepository->deleteByIds($categoryId, $rowData[self::COL_SKU]);\n $this->categoriesCache[$rowSku] = [];\n $this->categoryProductPosition[$rowSku] = [];\n }\n }\n\n unset($rowData['rowNum']);\n if (!array_key_exists($rowSku, $this->websitesCache)) {\n $this->websitesCache[$rowSku] = [];\n }\n\n // Product-to-Website phase\n if (!empty($rowData[self::COL_PRODUCT_WEBSITES])) {\n $websiteCodes = explode($this->getMultipleValueSeparator(), $rowData[self::COL_PRODUCT_WEBSITES]);\n foreach ($websiteCodes as $websiteCode) {\n $websiteId = $this->storeResolver->getWebsiteCodeToId($websiteCode);\n $this->websitesCache[$rowSku][$websiteId] = true;\n }\n }\n\n // Price rules\n $rowData = $this->applyPriceRules($rowData);\n $fixedName = __(\"Fixed\");\n $fixed = $fixedName;\n if (isset($rowData['_tier_price_value_type'])) {\n $fixed = $rowData['_tier_price_value_type'] == $fixedName;\n }\n // Tier prices phase\n if (!empty($rowData['_tier_price_website'])) {\n $tierPrices[$rowSku][] = [\n 'all_groups' => $rowData['_tier_price_customer_group'] == self::VALUE_ALL,\n 'customer_group_id' => $rowData['_tier_price_customer_group'] ==\n self::VALUE_ALL ? 0 : $rowData['_tier_price_customer_group'],\n 'qty' => $rowData['_tier_price_qty'],\n 'value' => ($fixed) ? $rowData['_tier_price_price'] : 0,\n 'website_id' => self::VALUE_ALL == $rowData['_tier_price_website'] || $isPriceGlobal\n ? 0\n : $this->storeResolver->getWebsiteCodeToId(\n $rowData['_tier_price_website']\n ),\n 'percentage_value' => (!$fixed) ? $rowData['_tier_price_price'] : 0,\n ];\n $tierPrices = array_merge($tierPrices, $this->getTierPrices($rowData, $rowSku));\n } else {\n $tierPrices += $this->getTierPrices($rowData, $rowSku);\n }\n if (!$this->validateRow($rowData, $rowNum)) {\n $this->addLogWriteln(__('product with sku: %1 is not valided', $sku), $this->output, 'info');\n unset($nextBunch[$rowNum]);\n continue;\n }\n // Media gallery phase\n $this->processMediaGalleryRows($rowData, $mediaGallery, $existingImages, $uploadedImages, $rowNum);\n $rowStore = (self::SCOPE_STORE == $rowScope)\n ? $this->storeResolver->getStoreCodeToId($rowData[self::COL_STORE])\n : 0;\n if (!$productType === null) {\n $previousType = $productType;\n }\n $prevAttributeSet = null;\n if (isset($rowData[self::COL_ATTR_SET])) {\n $prevAttributeSet = $rowData[self::COL_ATTR_SET];\n }\n if (self::SCOPE_NULL == $rowScope) {\n // for multiselect attributes only\n if (!$prevAttributeSet === null) {\n $rowData[self::COL_ATTR_SET] = $prevAttributeSet;\n }\n if ($productType === null && !$previousType === null) {\n $productType = $previousType;\n }\n if ($productType === null) {\n continue;\n }\n }\n if (!$productType) {\n $tempProduct = $this->skuProcessor->getNewSku($checkSku);\n if (isset($tempProduct['type_id'])) {\n $productType = $tempProduct['type_id'];\n }\n }\n if ($productType) {\n $productTypeModel = $this->_productTypeModels[$productType];\n\n if (!empty($rowData['tax_class_name'])) {\n $collectionTax = $this->collectionTaxFactory->create();\n $collectionTax->addFieldToFilter('class_type', ClassModel::TAX_CLASS_TYPE_PRODUCT);\n foreach ($collectionTax as $taxClass) {\n if (strtolower($rowData['tax_class_name']) == strtolower($taxClass->getClassName())) {\n $rowData['tax_class_name'] = $taxClass->getClassName();\n }\n }\n $rowData['tax_class_id'] =\n $this->taxClassProcessor->upsertTaxClass($rowData['tax_class_name'], $productTypeModel);\n }\n\n if ($this->getBehavior() == Import::BEHAVIOR_APPEND ||\n empty($this->getCorrectSkuAsPerLength($rowData))) {\n if (isset($this->_parameters['clear_attribute_value'])\n && $this->_parameters['clear_attribute_value'] == 0) {\n $rowData = $productTypeModel->clearEmptyData($rowData);\n }\n }\n\n if (isset($this->_parameters['clear_attribute_value'])\n && $this->_parameters['clear_attribute_value'] == 1\n ) {\n $rowData[self::COL_STORE] = null;\n }\n $rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(\n $rowData,\n !isset($this->_oldSku[$checkSku])\n );\n //google translation data\n if ($this->translator->isTranslatorSet()) {\n $translateAttributes = $this->_parameters['translate_attributes'] ?? [];\n $translateStore = (int)($this->_parameters['translate_store_ids'] ?? 0);\n }\n foreach ($rowData as $attrCode => $attrValue) {\n $attribute = $this->retrieveAttributeByCode($attrCode);\n $tempStore = $rowStore;\n if ('multiselect' != $attribute->getFrontendInput() && self::SCOPE_NULL == $rowScope) {\n // skip attribute processing for SCOPE_NULL rows\n continue;\n }\n $attrId = $attribute->getId();\n $backModel = $attribute->getBackendModel();\n $attrTable = $attribute->getBackend()->getTable();\n $storeIds = [0];\n\n if ('datetime' == $attribute->getBackendType() && strtotime($attrValue)) {\n $attrValue = $this->dateTime->gmDate(\n 'Y-m-d H:i:s',\n $this->_localeDate->date($attrValue)->getTimestamp()\n );\n }\n\n $defaultValue = $this->getDefaultAttrValue($attribute, $rowSku);\n $storeValue = $this->getDefaultAttrValue($attribute, $rowSku, $tempStore);\n /*\n * If storeValue exists and the default value is same as new value then remove it\n */\n if ($storeValue && $defaultValue === $attrValue && $tempStore > 0) {\n $this->_deleteStoreAttributeValue($attribute, $rowSku, $tempStore);\n }\n if ($this->translator->isTranslatorSet()) {\n if (!empty($translateAttributes)\n && !empty($translateStore)\n && !isset($attributes[$attrTable][$rowSku][$attrId][$translateStore])\n && in_array($attrCode, $translateAttributes, true)\n ) {\n $storeValue = $this->translator\n ->translateAttributeValue($attrValue, $attrCode, $translateStore);\n $attributes[$attrTable][$rowSku][$attrId][$translateStore] = $storeValue;\n } elseif (isset($translateStore) && $translateStore > 0) {\n $this->_deleteStoreAttributeValue($attribute, $rowSku, $translateStore);\n }\n }\n\n if ($defaultValue && ($defaultValue === $attrValue)) {\n continue;\n }\n\n if (self::SCOPE_STORE == $rowScope) {\n if (self::SCOPE_WEBSITE == $attribute->getIsGlobal()) {\n // check website defaults already set\n if (!isset($attributes[$attrTable][$rowSku][$attrId][$tempStore])) {\n $storeIds = $this->storeResolver->getStoreIdToWebsiteStoreIds($tempStore);\n }\n } elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {\n $storeIds = [$tempStore];\n }\n\n if (!isset($this->_oldSku[$checkSku])) {\n $storeIds[] = 0;\n }\n }\n $storeIds = array_unique($storeIds);\n sort($storeIds);\n\n foreach ($storeIds as $storeId) {\n $attributes[$attrTable][$rowSku][$attrId][$storeId] = $attrValue;\n }\n // restore 'backend_model' to avoid 'default' setting\n $attribute->setBackendModel($backModel);\n }\n\n $time = explode(\" \", microtime());\n $endTime = $time[0] + $time[1];\n $totalTime = $endTime - $startTime;\n $totalTime = round($totalTime, 5);\n $this->addLogWriteln(__('product with sku: %1 .... %2s', $sku, $totalTime), $this->output, 'info');\n }\n }\n\n if (method_exists($this, '_saveProductEntity')) {\n $this->_saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n );\n } else {\n $this->saveProductEntity(\n $entityRowsIn,\n $entityRowsUp\n );\n }\n\n $this->afterSaveNewEntities($entityRowsIn);\n $this->addLogWriteln(__('Imported: %1 rows', count($entityRowsIn)), $this->output, 'info');\n $this->addLogWriteln(__('Updated: %1 rows', count($entityRowsUp)), $this->output, 'info');\n $this->_saveProductWebsites(\n $this->websitesCache\n )->_saveProductCategories(\n $this->categoriesCache\n )->_saveProductTierPrices(\n $tierPrices\n )->_saveMediaGallery(\n $mediaGallery\n )->_saveProductAttributes(\n $attributes\n )->_saveProductCategoriesPosition(\n $this->categoryProductPosition\n );\n\n $this->_eventManager->dispatch(\n 'catalog_product_import_bunch_save_after',\n ['adapter' => $this, 'bunch' => $nextBunch]\n );\n }\n if (!empty($configurableData)) {\n $this->saveConfigurationVariations($configurableData, $existingImages);\n }\n\n return $this;\n }",
"function admin_updateFeatureProducts(){\n\t\t\t$this->render = false;\n\t\t\tif($this->data['featureProducts']){\n\t\t\t\n\t\t\t\t$this->Product->updateAll( array('Product.home_feature' => 0) );\n\t\t\t\t$this->Product->create();\n\t\t\t$data = $this->data['featureProducts'];\n\t\t\n\t\t\tforeach($data as $item){\n\t\t\t\t\t$a['id'] = $item; \n\t\t\t\t\t$a['home_feature'] = 1;\n\t\t\t\t\n\t\t\t\t\t$this->Product->save($a);\n\t\t\n\t\t\t\t\t$this->Product->create();\n\t\t\t\t}\n\t }else{\n\t\t\t\techo 'error';die;\n\t\t\t}\n\t\t\n\t\techo 'success';die;\n\t\t}",
"public function testUpdateSupplierProduct()\n {\n }",
"public function actionProductsCreate()\n {\n $data = json_decode(file_get_contents('php://input'), true);\n ProductShopifyAdminRestApiForm::createOrUpdateFromApiData($data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get controller for this group | public function getController()
{
return $this->group->getController();
} | [
"public function GetController()\n {\n return $this->controller;\n }",
"public function getController() {\n return $this->_controller;\n }",
"public function getController(): Controller\n {\n return $this->controller;\n }",
"public static function getController()\n {\n return self::$controller;\n }",
"public function getController(){\n return $this->controller;\n }",
"public function getController(): object\n {\n return $this->controller;\n }",
"public static function getController(){\n\t\tself::parseUrl();\n\t\t$index = (isset(self::$urlSegments[0]) && self::$urlSegments[0] == 'admin')? 1 : 0;\n\t\treturn self::getSegment($index);\n\t}",
"public static function getController()\n {\n return self::$instance;\n }",
"public function getIdController()\n {\n return $this->id_controller;\n }",
"public function getController()\n {\n return $this->controller\n ? $this->controller\n : $this->controller = CalendarEvent_Controller::create($this->owner);\n }",
"public function getIdController()\n {\n return $this->idController;\n }",
"public function getController()\n\t{\n\t\tif($this->_owner instanceof CController)\n\t\t\treturn $this->_owner;\n\t\telse\n\t\t\treturn Yii::app()->getController();\n\t}",
"public static function getController() {\n if (isset($_SESSION[self::CONTROLLER_KEY])) {\n return unserialize($_SESSION[self::CONTROLLER_KEY]);\n } else {\n return new Controller();\n }\n }",
"public function getController()\n\t{\n\t\tif (! $this->controller) {\n\t\t\t$class = $this->parseControllerCallback()[0];\n\n\t\t\t$this->controller = app()->make(ltrim($class, '\\\\'));\n\t\t}\n\n\t\treturn $this->controller;\n\t}",
"public function getCurrentController()\n {\n return $this->controller;\n }",
"public static function getController(){\n return str_replace('Controller', \"\", self::$controller);\n }",
"public function getControllerId()\n {\n return $this->controllerId;\n }",
"protected function getControllerGroup()\n {\n return str_replace(\n $this->getBundleNamespace().'\\\\Controller\\\\', '', substr(get_class($this), 0, -10)\n );\n }",
"public function getController() {\n if (!empty($this->path[0])) {\n // Check if there is a path\n $controller = $this->path[0];\n if (file_exists('controller/' . $controller . 'Controller.php')) {\n // Check if there is a controller\n $this->controller = $controller;\n }\n else {\n // We will set the default controller to be used\n $this->controller = $this->standardController;\n }\n }\n\n else {\n $this->controller = $this->standardController;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
testDateTime method Test generation of date/time select elements. | public function testDateTime() {
extract($this->dateRegex);
$result = $this->Form->dateTime('Contact.date', ['default' => true]);
$now = strtotime('now');
$expected = [
['select' => ['name' => 'Contact[date][year]']],
['option' => ['value' => '']],
'/option',
$yearsRegex,
['option' => ['value' => date('Y', $now), 'selected' => 'selected']],
date('Y', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][month]']],
['option' => ['value' => '']],
'/option',
$monthsRegex,
['option' => ['value' => date('m', $now), 'selected' => 'selected']],
date('F', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][day]']],
['option' => ['value' => '']],
'/option',
$daysRegex,
['option' => ['value' => date('d', $now), 'selected' => 'selected']],
date('j', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][hour]']],
['option' => ['value' => '']],
'/option',
$hoursRegex,
['option' => ['value' => date('H', $now), 'selected' => 'selected']],
date('G', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][minute]']],
['option' => ['value' => '']],
'/option',
$minutesRegex,
['option' => ['value' => date('i', $now), 'selected' => 'selected']],
date('i', $now),
'/option',
'*/select',
];
$this->assertHtml($expected, $result);
// Empty=>false implies Default=>true, as selecting the "first" dropdown value is useless
$result = $this->Form->dateTime('Contact.date', ['empty' => false]);
$now = strtotime('now');
$expected = [
['select' => ['name' => 'Contact[date][year]']],
$yearsRegex,
['option' => ['value' => date('Y', $now), 'selected' => 'selected']],
date('Y', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][month]']],
$monthsRegex,
['option' => ['value' => date('m', $now), 'selected' => 'selected']],
date('F', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][day]']],
$daysRegex,
['option' => ['value' => date('d', $now), 'selected' => 'selected']],
date('j', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][hour]']],
$hoursRegex,
['option' => ['value' => date('H', $now), 'selected' => 'selected']],
date('G', $now),
'/option',
'*/select',
['select' => ['name' => 'Contact[date][minute]']],
$minutesRegex,
['option' => ['value' => date('i', $now), 'selected' => 'selected']],
date('i', $now),
'/option',
'*/select',
];
$this->assertHtml($expected, $result);
} | [
"public function testDateTimeAllZeros() {\n\t\t$result = $this->Form->dateTime('Contact.date', [\n\t\t\t'timeFormat' => false,\n\t\t\t'empty' => ['day' => '-', 'month' => '-', 'year' => '-'],\n\t\t\t'value' => '0000-00-00',\n\t\t]);\n\n\t\t$this->assertMatchesRegularExpression('/<option value=\"\">-<\\/option>/', $result);\n\t\t$this->assertDoesNotMatchRegularExpression('/<option value=\"0\" selected=\"selected\">0<\\/option>/', $result);\n\t}",
"public function testControlDatetime() {\n\t\t$this->Form = $this->getMockBuilder('Cake\\View\\Helper\\FormHelper')\n\t\t\t->setMethods(['datetime'])\n\t\t\t->setConstructorArgs([new View()])\n\t\t\t->getMock();\n\n\t\t$array = [\n\t\t\t'type' => 'datetime',\n\t\t\t'timeFormat' => 24,\n\t\t\t'minYear' => 2008,\n\t\t\t'maxYear' => 2011,\n\t\t\t'interval' => 15,\n\t\t\t'options' => null,\n\t\t\t'id' => 'prueba',\n\t\t\t'required' => null,\n\t\t\t'templateVars' => [],\n\t\t];\n\t\t$version = Configure::version();\n\t\tif (version_compare($version, '4.3.0') >= 0) {\n\t\t\t$array += [\n\t\t\t\t'aria-required' => null,\n\t\t\t\t'aria-invalid' => null,\n\t\t\t\t'aria-describedby' => null,\n\t\t\t];\n\t\t}\n\n\t\t$this->Form->expects($this->once())->method('datetime')\n\t\t\t->with('prueba', $array)\n\t\t\t->will($this->returnValue('This is it!'));\n\t\t$result = $this->Form->control('prueba', [\n\t\t\t'type' => 'datetime', 'timeFormat' => 24, 'minYear' => 2008,\n\t\t\t'maxYear' => 2011, 'interval' => 15,\n\t\t]);\n\t\t$expected = [\n\t\t\t'div' => ['class' => 'input datetime'],\n\t\t\t'label' => ['for' => 'prueba'],\n\t\t\t'Prueba',\n\t\t\t'/label',\n\t\t\t'This is it!',\n\t\t\t'/div',\n\t\t];\n\t\t$this->assertHtml($expected, $result);\n\t}",
"public function testControlDatetimeRequired() {\n\t\t$result = $this->Form->control('birthday', [\n\t\t\t'type' => 'date',\n\t\t\t'required' => true,\n\t\t]);\n\t\t$this->assertStringContainsString(\n\t\t\t'<select name=\"birthday[year]\" required=\"required\"',\n\t\t\t$result,\n\t\t);\n\t}",
"function testDateDataType() {\n $data = array(\n 'id' => 1,\n 'datefield' => date('Y-m-d'),\n );\n $this->insertValues($data);\n $this->selectAndCheck($data);\n }",
"public function testRenderDateTime() {\n\n $obj = new TestDataTablesProvider($this->router, $this->translator, $this->buttonTwigExtension);\n\n $this->assertEquals(\"\", $obj->renderDateTime(null));\n $this->assertEquals(\"14/01/2019 18:15\", $obj->renderDateTime(new DateTime(\"2019-01-14 18:15:00\")));\n $this->assertEquals(\"14-01-2019 18h15\", $obj->renderDateTime(new DateTime(\"2019-01-14 18:15:00\"), \"d-m-Y H\\hi\"));\n }",
"public function testGetSetDateTime() {\n $fixture = \"2014-09-27 07:18:57\";\n \n $this->assertSame($this->instance, $this->instance->setDateTime($fixture));\n $this->assertSame($fixture, $this->instance->getDateTime());\n }",
"public function testSetDataTypeDateTime()\n {\n $statement = (new ColumnBuilder($this->mockConnection));\n $return = $statement->dateTime();\n $array = $statement->toArray();\n\n $this->assertInstanceOf(ColumnBuilder::class, $return);\n $this->assertEquals([\n 'datatype' => [\n 'type' => 'dateTime',\n 'fsp' => null,\n ],\n ], $array);\n }",
"public function testDatetimeWithDefault() {\n\t\t$result = $this->Form->dateTime('Contact.updated', ['value' => '2009-06-01 11:15:30']);\n\t\t$this->assertMatchesRegularExpression('/<option[^<>]+value=\"2009\"[^<>]+selected=\"selected\"[^>]*>2009<\\/option>/', $result);\n\t\t$this->assertMatchesRegularExpression('/<option[^<>]+value=\"01\"[^<>]+selected=\"selected\"[^>]*>1<\\/option>/', $result);\n\t\t$this->assertMatchesRegularExpression('/<option[^<>]+value=\"06\"[^<>]+selected=\"selected\"[^>]*>June<\\/option>/', $result);\n\n\t\t$result = $this->Form->dateTime('Contact.updated', [\n\t\t\t'default' => '2009-06-01 11:15:30',\n\t\t]);\n\t\t$this->assertMatchesRegularExpression('/<option[^<>]+value=\"2009\"[^<>]+selected=\"selected\"[^>]*>2009<\\/option>/', $result);\n\t\t$this->assertMatchesRegularExpression('/<option[^<>]+value=\"01\"[^<>]+selected=\"selected\"[^>]*>1<\\/option>/', $result);\n\t\t$this->assertMatchesRegularExpression('/<option[^<>]+value=\"06\"[^<>]+selected=\"selected\"[^>]*>June<\\/option>/', $result);\n\t}",
"public function testDate()\n {\n // string that has the date format (YYYY-MM-DD).\n $this->assertDate(new \\DateTime());\n $this->assertDate('1999-12-31');\n\n // The date time assertion tests if a value is valid DateTime object or\n // string that has the date time format (YYYY-MM-DD HH:MM:SS)\n $this->assertDateTime(new \\DateTime());\n $this->assertDateTime('1999-12-31 23:59:59');\n\n // The time assertion tests if a value is a valid DateTime object or a\n // string that has the time format (HH:MM:SS)\n $this->assertTime(new \\DateTime());\n $this->assertTime('23:59:59');\n }",
"function testTimeDataType() {\n $data = array(\n 'id' => 1,\n 'timefield' => date('H:i:s'),\n );\n $this->insertValues($data);\n $this->selectAndCheck($data);\n }",
"public function testIsDateTime()\n {\n self::assertFalse(tx_mklib_util_Date::isDateTime('1983-07-05 12:24.48'), '1983-07-05 12:24 ist kein Datetime.');\n self::assertTrue(tx_mklib_util_Date::isDateTime('1983-07-05 12:24:48'), '1983-07-05 12:24:48 ist ein Datetime.');\n }",
"public function testDateTimeToDateTimeVerbose()\n {\n $today = date('Y-m-d');\n $yesterday = date('Y-m-d', strtotime('yesterday'));\n\n $mySqlDateTimeRecord = array(\n \"$today 12:40:00\", // data semplice\n \"$yesterday 12:40:00\", // data x testare formattazione gg/mm/aaaa e non mm/gg/aaaa\n '0000-00-00 00:00:00' // data vuota\n\n );\n\n $dateVer = array(\n 'today at 12:40:00', // data semplice\n 'yesterday at 12:40:00', // data x testare formattazione gg/mm/aaaa e non mm/gg/aaaa\n ''\n );\n\n foreach ($mySqlDateTimeRecord as $key => $data) {\n $data = self::$utDate->dateTimeToDateTime($data, true);\n $this->assertEquals($dateVer[$key], $data);\n }\n }",
"public function testRenderDayWidget() {\n\t\t$now = new DateTime('2010-09-09 12:00:00');\n\t\t$result = $this->DateTime->render([\n\t\t\t'name' => 'date',\n\t\t\t'year' => false,\n\t\t\t'month' => false,\n\t\t\t'day' => [\n\t\t\t\t'data-foo' => 'test',\n\t\t\t],\n\t\t\t'hour' => false,\n\t\t\t'minute' => false,\n\t\t\t'second' => false,\n\t\t\t'val' => $now,\n\t\t], $this->context);\n\t\t$expected = [\n\t\t\t'select' => ['name' => 'date[day]', 'data-foo' => 'test'],\n\t\t\t['option' => ['value' => '01']], '1', '/option',\n\t\t\t['option' => ['value' => '02']], '2', '/option',\n\t\t\t['option' => ['value' => '03']], '3', '/option',\n\t\t\t['option' => ['value' => '04']], '4', '/option',\n\t\t\t['option' => ['value' => '05']], '5', '/option',\n\t\t\t['option' => ['value' => '06']], '6', '/option',\n\t\t\t['option' => ['value' => '07']], '7', '/option',\n\t\t\t['option' => ['value' => '08']], '8', '/option',\n\t\t\t['option' => ['value' => '09', 'selected' => 'selected']], '9', '/option',\n\t\t\t['option' => ['value' => '10']], '10', '/option',\n\t\t\t['option' => ['value' => '11']], '11', '/option',\n\t\t\t['option' => ['value' => '12']], '12', '/option',\n\t\t\t['option' => ['value' => '13']], '13', '/option',\n\t\t\t['option' => ['value' => '14']], '14', '/option',\n\t\t\t['option' => ['value' => '15']], '15', '/option',\n\t\t\t['option' => ['value' => '16']], '16', '/option',\n\t\t\t['option' => ['value' => '17']], '17', '/option',\n\t\t\t['option' => ['value' => '18']], '18', '/option',\n\t\t\t['option' => ['value' => '19']], '19', '/option',\n\t\t\t['option' => ['value' => '20']], '20', '/option',\n\t\t\t['option' => ['value' => '21']], '21', '/option',\n\t\t\t['option' => ['value' => '22']], '22', '/option',\n\t\t\t['option' => ['value' => '23']], '23', '/option',\n\t\t\t['option' => ['value' => '24']], '24', '/option',\n\t\t\t['option' => ['value' => '25']], '25', '/option',\n\t\t\t['option' => ['value' => '26']], '26', '/option',\n\t\t\t['option' => ['value' => '27']], '27', '/option',\n\t\t\t['option' => ['value' => '28']], '28', '/option',\n\t\t\t['option' => ['value' => '29']], '29', '/option',\n\t\t\t['option' => ['value' => '30']], '30', '/option',\n\t\t\t['option' => ['value' => '31']], '31', '/option',\n\t\t\t'/select',\n\t\t];\n\t\t$this->assertHtml($expected, $result);\n\t}",
"#[@test]\n public function selectDate() {\n $cmp= new Date('2009-08-14 12:45:00');\n $result= $this->db()->query('select cast(%s as date) as value', $cmp)->next('value');\n \n $this->assertInstanceOf('util.Date', $result);\n $this->assertEquals($cmp->toString('Y-m-d'), $result->toString('Y-m-d'));\n }",
"public function filterDateTimePass()\n {\n $dateTime = new \\DateTime('now');\n $this->assertSame($dateTime, DateTime::filter($dateTime));\n }",
"public function testDateTimeWithGetForms() {\n $this->Form->create($this->article, ['type' => 'get']);\n $result = $this->Form->datetime('created');\n $expected = [\n 'input' => [\n 'type' => 'datetime-local',\n 'name' => 'created',\n 'value' => '',\n 'step' => '1',\n 'class' => 'form-control'\n ],\n ];\n\n $this->assertHtml($expected, $result);\n\n $result = $this->Form->datetime('created', ['default' => true]);\n $expected = [\n 'input' => [\n 'type' => 'datetime-local',\n 'name' => 'created',\n 'value' => 'preg:/' . date('Y-m-d') . 'T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}/',\n 'step' => '1',\n 'class' => 'form-control'\n ],\n ];\n\n $this->assertHtml($expected, $result);\n }",
"public function testRenderHour24SelectedValues() {\n\t\t$now = new DateTime('2010-09-09 23:00:00');\n\t\t$data = [\n\t\t\t'name' => 'date',\n\t\t\t'year' => false,\n\t\t\t'month' => false,\n\t\t\t'day' => false,\n\t\t\t'hour' => [],\n\t\t\t'minute' => false,\n\t\t\t'second' => false,\n\t\t\t'val' => $now,\n\t\t];\n\t\t$result = $this->DateTime->render($data, $this->context);\n\t\t$this->assertStringContainsString('<option value=\"23\" selected=\"selected\">23</option>', $result);\n\n\t\t$data['val'] = '2010-09-09 23:00:00';\n\t\t$result = $this->DateTime->render($data, $this->context);\n\t\t$this->assertStringContainsString('<option value=\"23\" selected=\"selected\">23</option>', $result);\n\t}",
"public function testSetRangeDateTime()\n {\n $start = new DateTime('2014-01-01 12:30:59');\n $end = new DateTime('2014-01-02 14:30:59');\n $timerange = new TimeRange('2013-09-01 12:30:59', '2013-10-02 14:30:59');\n \n $timerange->setRange($start, $end);\n\n $this->assertEquals($start, $timerange->getStart());\n $this->assertEquals($end, $timerange->getEnd());\n }",
"public function test_datetime() {\n $time = 1;\n\n $datestr = transform::datetime($time);\n\n // Assert it is a string.\n $this->assertInternalType('string', $datestr);\n\n // To prevent failures on MAC where we are returned with a lower-case 'am' we want to convert this to 'AM'.\n $datestr = str_replace('am', 'AM', $datestr);\n\n // Assert the formatted date is correct.\n $dateobj = new DateTime();\n $dateobj->setTimestamp($time);\n $this->assertEquals($dateobj->format('l, j F Y, g:i A'), $datestr);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function sorts the hashmap array so that all the similar models are together | function sortNeuronModel($hashmaparray){
#FOr eg: [1] => leaky_integrate_and_fire [2] => leaky_integrate_and_fire [3] => leaky_integrate_and_fire
# [4] => Izhikevich [5] => leaky_integrate_and_fire [6] => leaky_integrate_and_fire
# [7] => leaky_integrate_and_fire [8] => Izhikevich [9] => leaky_integrate_and_fire
# [10] => Izhikevich
# This array will be sorted as so that all leaky_integrate_and_fire are together.
# [1] => leaky_integrate_and_fire [2] => leaky_integrate_and_fire [3] => leaky_integrate_and_fire
# [5] => leaky_integrate_and_fire [6] => leaky_integrate_and_fire
# [7] => leaky_integrate_and_fire [9] => leaky_integrate_and_fire
# [4] => Izhikevich [8] => Izhikevich [10] => Izhikevich
#This will make easier for model assignment on FPGA.
# Simple counting from 1-8 models which are same can be assigned to one FPGA
# For eg: here Neurons 1,2,3,5,6,7,9 will be mapped into one FPGA and neurons 4,8,10 onto another since they are different models.
# The neuron number is stil the same so that its easy to track.
asort($hashmaparray);
echo "<br>Sorted hasmap: ";
print_r($hashmaparray);
echo "<br>";
echo "\nAfter sorting..........\n";
echo "<br>";
foreach($hashmaparray as $key=>$val){
echo "$key = $val\n";
}
return $hashmaparray;
} | [
"private function sort() {\n\t\tkrsort($this->data, SORT_REGULAR);\n\t}",
"protected function _sort() {}",
"function sortTransits() {\n $sortedtransits = array();\n for ($aspect = 0; $aspect < count($this->m_transit); $aspect++) {\n $sortedtransits[substr($this->m_transit[$aspect], 17, 11)] = $this->m_transit[$aspect];\n }\n ksort($sortedtransits);\n\n unset($this->m_transit);\n $this->m_transit = array();\n reset($sortedtransits);\n while (list($key, $value) = each($sortedtransits)) {\n array_push(\n $this->m_transit, $value\n );\n }\n }",
"public function asort () {}",
"public function sort();",
"function sortEntriesAlphabetical()\n {\n $assoc = array();\n foreach ($this->arrEntries as $key => $entry ) {\n $assoc[$entry['translation'][$this->_intLanguageId]['subject']] = $key;\n }\n\n ksort($assoc);\n $newEntries = array();\n foreach ($assoc as $key) {\n $newEntries[$key] = $this->arrEntries[$key];\n }\n $this->arrEntries = $newEntries;\n }",
"function _scratchpads_backend_views_sort_by_label($array_to_sort){\n $label_keyed = array();\n $other = array();\n foreach($array_to_sort as $key => $filter){\n if(isset($filter['expose'])){\n $label_keyed[$filter['expose']['label']] = array(\n $key => $filter\n );\n }else{\n $other[$key] = $filter;\n }\n }\n ksort($label_keyed);\n $final = array();\n foreach($label_keyed as $key => $element){\n $array_values = array_values($element);\n $final[key($element)] = array_shift($array_values);\n }\n return array_merge($final, $other);\n}",
"private static function core_sort()\n {\n $array_core_addons = array();\n $array_core = array(); $array_normal = array();\n foreach (self::$addon_index as $key => $var)\n { key_exists($key, $array_core_addons) ? $array_core[$key] = $var : $array_normal[$key] = $var; }\n self::$addon_index = array_merge($array_core,$array_normal);\n }",
"public function _model_resolution_order($models){\n $order_models = [];\n\n // loop as many times as the size of models passed in.\n $i = 0;\n while($i< count($models)):\n\n foreach ($models as $name=>$model) :\n\n if(empty($model->relations_fields)):\n $order_models[$name]= $model;\n endif;\n\n $existing_models = array_merge(array_keys($order_models), $this->migrated_models());\n\n $dependencies = [];\n foreach ($model->relations_fields as $field) :\n\n $dependencies[] = $this->stable_name($field->related_model->meta->model_name);\n\n $missing =array_diff($dependencies, $existing_models);\n\n // if there is nothing missing or this is just an inverse relation just add.\n if(count($missing)==0 || $field instanceof InverseRelation):\n $order_models[$name]= $model;\n endif;\n\n // also self add those that have self refernces\n $dependencies[] = $name;\n if($this->_self_referencing($name, $dependencies)):\n $order_models[$name]= $model;\n endif;\n endforeach;\n\n endforeach;\n $i++;\n endwhile;\n return $order_models;\n }",
"public function shuffleObjects()\n {\n $objKeys = array();\n\n // create an array with the keys\n foreach (array_keys($this->objects) as $index) {\n $objKeys[] = $index;\n }\n\n // shuffle the array of keys\n shuffle($objKeys);\n\n // create new arrays\n $newObjects = array();\n $newSolution = array();\n\n // fill the new arrays with the shuffled keys\n foreach ($objKeys as $index => $key) {\n $newObjects[$index] = $this->objects[$key];\n $newSolution[$index] = $this->solutions[$key];\n }\n\n // Copy in the exercise object arrays\n $this->objects = $newObjects;\n $this->solutions = $newSolution;\n }",
"public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}",
"function sortMemUsage(&$array)\r\n {\r\n usort($array, \"Smapsparser::cmpKey\");\r\n }",
"function dfm_weight_sort($r1, $r2) {\n return $r1['weight'] - $r2['weight'];\n}",
"public function searchResultsResort(Model $Model, $results, $ids) {\r\n\t\t$sorted = array();\r\n\t\tforeach ($ids as $i => $id) {\r\n\t\t\tforeach (array_keys($results) as $j) {\r\n\t\t\t\tif ($results[$j][$Model->alias][$Model->primaryKey] == $id) {\r\n\t\t\t\t\t$sorted[$i] = $results[$j];\r\n\t\t\t\t\tunset($results[$j]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if there are any $results left, append\r\n\t\tforeach (array_keys($results) as $j) {\r\n\t\t\t$sorted[] = $results[$j];\r\n\t\t\tunset($results[$j]);\r\n\t\t}\r\n\t\treturn $sorted;\r\n\t}",
"public function jaroSort() {\n usort($this->items,\n // Sort results to put higher string similarities first\n function(PokemonBase $first, PokemonBase $second) {\n $jaroFirst = $first->getLastJaroResult()->getSimilarity();\n $jaroSecond = $second->getLastJaroResult()->getSimilarity();\n\n // Values are floats, so manually specify cases to prevent int cast rounding errors\n if ($jaroFirst < $jaroSecond)\n return 1;\n elseif ($jaroFirst > $jaroSecond)\n return -1;\n return 0;\n }\n );\n }",
"function sort(Phlickr_Framework_IPhotoList $photolist) {\n foreach ($photolist->getPhotos() as $photo) {\n $id = $photo->getId();\n $keys[$id] = $this->_strategy->stringFromPhoto($photo);\n $photos[$id] = $photo;\n }\n\n if ($this->isInReverse()) {\n arsort($keys);\n } else {\n asort($keys);\n }\n\n $ret = array();\n foreach($keys as $id => $key) {\n $ret[] = $photos[$id];\n }\n return $ret;\n }",
"public static function sortByModel($searchResult)\n {\n $sortedResult = [];\n foreach($searchResult as $obj) {\n $sortedResult[$obj->modelName][] = $obj;\n }\n\n return $sortedResult;\n }",
"public function keySort()\n {\n ksort($this->variables);\n }",
"public function sort()\n {\n sort($this->coordsArray, SORT_NATURAL);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse station details from stations file (can be done several times; with global files read in first and local ones last to overwrite URLs) | protected function parseStations($stationsFile) {
$this->callDirsRecursively('parseStations', $stationsFile);
$entries = $this->getFileEntries($stationsFile);
foreach ($entries as $entry) {
if (!$entry || 0 === strpos($entry, '#')) {
continue;
}
$parts = explode('"', $entry);
$slug = trim($parts[0]);
$name = trim($parts[1]);
$rest = explode('#', $parts[2]);
$url = trim($rest[0]);
$comment = isset($rest[1]) ? trim($rest[1]) : '';
$this->stations[$slug] = array('name' => $name, 'url' => $url, 'comment' => $comment);
}
ksort($this->stations);
return $this;
} | [
"function getNextStation()\n\t{\n\t\t// load next line\n\t\tglobal $fin_meta;\n\t\t$line = fgets($fin_meta);\n\t\t\n\t\t// station id\n\t\t$station_id = strtok($line, \" \\n\");\n\t\t\n\t\t// skip to coords\n\t\t/**\n\t\t * Must check four at a time since city info\n\t\t * is completely unpredictable. The only certainty\n\t\t * is that there will be three numbers at the end\n\t\t * of each line.\n\t\t */\n\t\t$one = strtok(\" \\n\");\n\t\t$two = strtok(\" \\n\");\n\t\t$thr = strtok(\" \\n\");\n\t\t$fou = strtok(\" \\n\");\n\t\twhile( $fou !== false ) // not identical\n\t\t{\n\t\t\t// shift values down the line\n\t\t\t$one = $two;\n\t\t\t$two = $thr;\n\t\t\t$thr = $fou;\n\t\t\t$fou = strtok(\" \\n\");\n\t\t}\n\t\t\n\t\t// lat\n\t\t$lat = $one;\n\t\t// lng\n\t\t$lng = $two;\n\t\t\n\t\t// find distance to coords\n\t\tglobal $in_lat, $in_lng;\n\t\t$dist = findDistance($in_lat, $in_lng, $lat, $lng);\n\t\t// only need 2 digits\n\t\t$dist = round($dist, 2);\n\t\t\n\t\treturn new Station($station_id, $lat, $lng, $dist);\n\t}",
"public static function parseStations($url)\n { \n \t $station = NULL;\t\t\n $stations = array();\n \n $xml = simplexml_load_file($url); \n $rootNode = $xml;\n $stationNodes = $rootNode->children(); \n\n\t\t if ($rootNode->getName() == \"error\")\n {\n \t\t$child = $rootNode->children();\n throw new Exception(\"error:\" + $child[0]);\n }\n for ($i = 0; $i < $rootNode->count(); $i++)\n { \n $station = self::readStation($stationNodes[$i]);\t//Station \n array_push($stations, $station);\n }\n return $stations;\n }",
"function recheckstation($wrstation) {\n\n\t$myfile = WR_DIR . WR_SUPPORT . 'stations.txt';\n\t\n\tif (file_exists($myfile)) {\n\t\t$stationlist = fopen($myfile, r);\n\t\t\n\t\twhile (!feof($stationlist)) {\n\t\t\t$line = fgets($stationlist, 512);\n\t\t\tif (substr($line, 0, 1) == '#') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$callcode = substr($line, 0, 4);\n\t\t\t\n\t\t\tif (strstr($callcode, $wrstation['id'])) {\n\t\t\t\t$wrstation['loc'] = getstationloc($line);\n\t\t\t\tfclose ($stationlist);\n\t\t\t\treturn ($wrstation);\n\t\t\t}\n\t\t}\n\t\tfclose ($stationlist);\n\t\t$wrstation['id'] = \"invalid station\";\n\t}\n\treturn ($wrstation);\n\n}",
"function getNameGeo($stationID) {\n $in_file = fopen(\"air-quality-data-2004-2019.csv\", \"r\") or die(\"Unable to open file!\");\n while ($data = fgets($in_file)) {\n $arr = explode(\";\", $data); // explode the line into array\n\n if ($arr[4] == $stationID) { // if a line with station Id is found\n $name = $arr[17]; // set $name and geocode\n $geocode = $arr[18];\n break;\n }\n }\n\n fclose($in_file);\n\n return [$name, $geocode];\n}",
"public static function loadStations() {\n\n $filename = $_ENV['dirroot'] . '/src/assets/json/stations.json';\n $stations = json_decode(file_get_contents($filename));\n //dd('STATIONS',$stations);\n foreach ($stations->locations as $station) {\n $s = ORM::forTable('station')->create();\n $s->crs = $station->crs;\n $s->name = $station->name;\n $s->save();\n }\n }",
"function linkstationlist() {\n\tif (file_exists(WR_DIR . WR_SUPPORT . \"stationsbyname.php\")) {\n\t\techo ('<a href=\"' . weatherdocloc() . 'stationsbyname.php\">list of stations</a>');\n\t} elseif (file_exists(WR_DIR . WR_SUPPORT . \"stationsbyname.txt\")) {\n\t\techo ('<a href=\"' . weatherdocloc() . 'stationsbyname.txt\">list of stations</a>');\n\t} elseif (file_exists(WR_DIR . WR_SUPPORT . \"stations.txt\")) {\n\t\techo ('<a href=\"' . weatherdocloc() . 'stations.txt\">list of stations</a>');\n\t}\n}",
"function getData($stationnr){\n\n // Directory\n $dir = \"../weatherdata-mounting-point/\" . $stationnr;\n\n $data = [];\n\n // Looping through Files\n foreach (new DirectoryIterator($dir) as $f){\n if ($f->isDot()){\n continue;\n }\n\n // get file with filepath\n $path = $f->getPathname();\n\n // Check if file exists\n if ($f->isFile()) {\n $jsonfile = file_get_contents($path);\n $array = json_decode($jsonfile, true);\n \n // Check if it's actually the correct station. (remove if this part gets removed from file)\n if ($array['stn'] == $stationnr){\n array_push($data, $array);\n }\n }\n }\n return ($data);\n }",
"function getStations(){\t\t\n\t\t$json1 = file_get_contents('http://sensorweb.demo.52north.org/sensorwebclient-webapp-stable/api/v1/stations?service=srv_1a5bde0a6d702f193f7be463402ec12f&phenomenon=phe_9eb82ebc5a37b3c8e97f736e85c3032a');\n\t\t$json2 = file_get_contents('http://sensorweb.demo.52north.org/sensorwebclient-webapp-stable/api/v1/stations?service=srv_738111ed219f738cfc85be0c8d87843c&phenomenon=phe_9eb82ebc5a37b3c8e97f736e85c3032a');\n\t\t$json1 = json_decode($json1);\n\t\t$json2 = json_decode($json2);\n\t\t$json = json_encode(array_merge($json1, $json2));\n\t\treturn $json;\n\t}",
"private function parseStationData($stationData) {\n \n // prepare return\n $return = array();\n \n // walk through station data\n foreach($stationData as $uuid => $data) {\n \n // check open\n if($data['status'] == 'open') {\n \n // create Station\n $return[] = new Station(array(\n 'uuid' => $uuid,\n 'name' => $this->config['stations'][$uuid],\n 'fuel' => $this->config['fuel'],\n 'price' => $data[$this->config['fuel']],\n 'runtime' => $this->runtime,\n ));\n } else {\n \n // create Station with empty price\n $return[] = new Station(array(\n 'uuid' => $uuid,\n 'name' => $this->config['stations'][$uuid],\n 'fuel' => $this->config['fuel'],\n 'price' => null,\n 'runtime' => $this->runtime,\n ));\n }\n }\n \n // return array\n return $return;\n }",
"private function whichStation() {\n\t\t$stations = @file(Flight::get(\"pathStation\"),FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif (count($stations) >=1 && $stations ) {\n\t\t\t$x = '';\n\t\t\tforeach ($stations as $st) {\n\t\t\t\tif (substr($st,0,1) == '1') {\n\t\t\t\t\t$x = substr($st,1);\n\t\t\t\t\t$x = explode(\" #\",$x);\n\t\t\t\t\t$x = $x[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x == '') {$x = Flight::get(\"defaultStation\");}\n\t\t}\n\t\telse $x = (Flight::get(\"defaultStation\"));\n\t\treturn trim($x);\n\t}",
"function station_code($station_name)\n{\n $json = file_get_contents('station_list.json');\n $data = json_decode($json, true);\n $new = array();\n for($i=0;$i<count($data);$i++)\n {\n array_push($new, strtoupper($data[$i]['station'] . \" - \" . $data[$i]['station_code']));\n }\n $count = 0;\n foreach ($new as $station)\n {\n if($station_name == $station)\n {\n break;\n }\n $count++;\n }\n return $data[$count]['station_code'];\n}",
"function write_station_info_to_db() \n{\n global $pdo;\n \n $error = false;\n $data = array();\n\n try\n {\n // connect to database\n $pdo = connect_to_database();\n }\n catch (Exception $e)\n {\n $error = \"Could not connect to database.\";\n\treturn;\n }\n\n try\n {\n\t$query = sprintf(\"SELECT * FROM stations WHERE address='12th St. Oakland City Center'\");\n $results = $pdo->query($query);\n\n\tif ($results == NULL)\n\t{\n\t $query = sprintf(\"CREATE TABLE stations (\n\t\t\t name VARCHAR(30) NOT NULL,\n\t\t\t\tabbreviation CHAR(4) NOT NULL,\n\t\t\t\tlatitude FLOAT(11,8) NOT NULL,\n\t\t\t\tlongitude FLOAT(11,8) NOT NULL,\n\t\t\t\taddress VARCHAR(30) NOT NULL,\n\t\t\t\tcity VARCHAR(20) NOT NULL,\n\t\t\t\tstate CHAR(2) NOT NULL,\n\t\t\t\tzipcode INT(6) NOT NULL,\n\t\t\t\tPRIMARY KEY ( name )\n\t\t );\");\n $pdo->query($query);\n\n\t $url = 'http://api.bart.gov/api/stn.aspx?cmd=stns&key=MW9S-E7SL-26DU-VV8V';\n $xml = simplexml_load_file($url);\n\n foreach ($xml->xpath(\"/root/stations/station\") as $station)\n {\n\t\t$name = $station->name;\n\t\t$abbr = $station->abbr;\n\t\t$latitude = $station->gtfs_latitude;\n\t\t$longitude = $station->gtfs_longitude;\n\t\t$address = $station->address;\n\t\t$city = $station->city;\n\t\t$state = $station->state;\n\t\t$zipcode = $station->zipcode;\n\n\t\ttry\n \t{\n \t $query = sprintf(\"INSERT INTO stations (`name`, `abbreviation`, `latitude`, \n\t\t\t`longitude`, `address`, `city`, `state`, `zipcode`) \n\t\t\t VALUES ('$name', '$abbr', '$latitude', '$longitude', '$address', \n\t\t\t '$city', '$state', '$zipcode')\");\n \t $results = $pdo->query($query);\n \t}\n \tcatch (Exception $e)\n \t {\n \t $error = \"Unable to query database. Please check username and password.\";\n\t \t return $error;\n \t}\t\n \t }\n\t}\n }\n catch (Exception $e)\n {\n\t$error = \"Could not query table 'stations'.\";\n\treturn $error;\n }\n\n return $error;\n}",
"function read_gps_from_file($directory) {\n $ret = array();\n// echo 'read_gps_from_file<br>';\n\n $myfile = fopen(\"$directory/gps.csv\", \"r\") or die(\"Unable to open file!\");\n while (!feof($myfile)) {\n\n //Get one line\n $line = fgets($myfile);\n\n // Ignore empty lines\n if (strlen($line) == 0)\n continue;\n\n // Ignore comment lines\n if ($line[0] == '#')\n continue;\n\n// list($filename, $lat, $lon) = explode(',', $line);\n// echo \"1 myfile=$myfile, line=$line. <br>\";\n// trigger_error(\"read_gps_from_file: line=>>>$line<<<\");\n\n $parts = array();\n preg_match('/(.+)\\t(\\d+\\.\\d+)\\s(\\d+\\.\\d+)\\t(.+)\\t(.+)/', $line, $parts);\n// echo \"count parts=\" . count($parts) . \"<br>\";\n $filename = $parts[1];\n $lat = $parts[2];\n $lon = $parts[3];\n $title = $parts[4];\n $description = $parts[5];\n\n\n// echo \"1 filename=$filename, lat=$lat, lon=$lon title=$title description=$description <br>\";\n // Ignore incorrect lines\n// if (strlen($filename) == 0 or strlen($lat) == 0 or strlen($lon) == 0)\n// continue;\n//\n// ///TEST\n// $info = exif_read_data(\"$directory/$filename\", 'ANY_TAG');\n// if ($info == false) {\n// trigger_error(\">>>>>>>>>>>>>>>>>>>>>$directory/$filename: no EXIFs\");\n// } else {\n// $t = $info['title'];\n// trigger_error(\">>>>>>>>$directory/$filename: title=$t\");\n// }\n ///ENDTEST\n // echo \"3 myfile=$myfile, line=$line. <br>\";\n// $filename = substr($filename, 2);\n// $res = array();\n// preg_match('/\"(\\d+\\.\\d+) \\w/', $lat, $res);\n// $lat = $res[1];\n// $res = array();\n// preg_match('/(\\d+\\.\\d+) \\w\"/', $lon, $res);\n// $lon = $res[1];\n//\n// echo $filename . ' ' . $lat . ', ' . $lon . '.<br>';\n// trigger_error(\"read_gps_from_file: Description of file \" . $filename . \": >>>\" . $description . \"<<<\");\n $gps = array();\n $gps['lon'] = $lon;\n $gps['lat'] = $lat;\n $gps['title'] = $title;\n $gps['description'] = $description;\n $ret[$filename] = $gps;\n\n// echo \"$filename $lat $lon $title $description <br>\";\n }\n fclose($myfile);\n\n// echo var_dump($ret) . '<br>';\n return $ret;\n}",
"function getStationNames() {\n\t\t$names = array();\n\t\t$raw = laut_get($this->origin, $this->token, \"/stations\");\n\t\tif($raw != \"\") {\n\t\t\t$response = json_decode($raw);\n\t\t\tfor($s = 0; $s < count($response->{'stations'}); $s++) {\n\t\t\t\t$id = $response->{'stations'}[$s]->{'id'};\n\t\t\t\t$station = $response->{'stations'}[$s]->{'name'};\n\t\t\t\t$names[$s] = $station;\n\t\t\t\t// echo \"$station = $id<br>\";\n\t\t\t\t$this->stationIds[$station] = $id;\n\t\t\t}\t\t\n \t}\n\t\treturn $names;\n\t}",
"function readLocations() {\n $locations = array();\n\n //opening the file so we can read everything.\n $file = fopen(\"Locations.txt\", \"r\");\n\n while(!feof($file)) {\n $line = fgets($file);\n\n // making sure line isnt empty.\n if($line != \"\")\n {\n $line = trim($line);\n\n $splitted = explode(\":\", $line);\n $country = trim($splitted[0]);\n\n $locations[$country] = $line;\n }\n }\n\n // done with the file so lets close it.\n fclose($file);\n\n return $locations;\n }",
"function getParsedData($file) {\r\n\r\n // Read everything from logs and write it to array $array\r\n $input = fopen($file, 'r');\r\n $array = null;\r\n \r\n if($input) {\r\n while(($buffer = fgets($input)) !== false) {\r\n $array[] = $buffer;\r\n }\r\n }\r\n \r\n fclose($input); // Close file\r\n \r\n $items = array();\r\n for($i = 0; $i < sizeof($array); $i++) {\r\n \r\n $matches = null; // IP\r\n $matches1 = null; // DATE & TIME\r\n $matches2 = null; // USER LOCATION\r\n \r\n preg_match(\"/[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*/\", $array[$i], $matches);\r\n preg_match(\"/[0-9]+\\-[0-9]+\\-[0-9]+ [0-9]+\\:[0-9]+\\:[0-9]+/\", $array[$i], $matches1);\r\n preg_match(\"/https:.*/\", $array[$i], $matches2);\r\n \r\n $items[] = array(\r\n \"date\" => $matches1[0],\r\n \"ip\" => $matches[0],\r\n \"location\" => $matches2[0]\r\n );\r\n }\r\n \r\n return $items;\r\n }",
"function windInit()\n{\n\n echo \"windInit<br />\\n\";\n\n // West Coast stations\n\n $wxdb1 = new stationInfo(\n trim(\"SJC\"), // weather station\n trim(\"San Jose, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb2 = new stationInfo(\n trim(\"zmw:94614.5.99999\"),// weather station\n trim(\"Oakland, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb3 = new stationInfo(\n trim(\"LAX\"), // weather station\n trim(\"Los Angeles, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb4 = new stationInfo(\n trim(\"zmw:92101.1.99999\"),// weather station\n trim(\"San Diego, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb5 = new stationInfo(\n trim(\"93101.1.99999\"), // weather station\n trim(\"Santa Barbara, CA\"),// location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb6 = new stationInfo(\n trim(\"zmw:97201.1.99999\"),// weather station\n trim(\"Portland, OR\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb7 = new stationInfo(\n trim(\"SEA\"), // weather station\n trim(\"Seattle, WA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdb8 = new stationInfo(\n trim(\"SFO\"), // weather station\n trim(\"San Francisco\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n\n $wxdb9 = new stationInfo(\n trim(\"zmw:93901.1.99999\"),// weather station\n trim(\"Salinas, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdba = new stationInfo(\n trim(\"zmw:95060.1.99999\"),// weather station\n trim(\"Santa Cruz, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbb = new stationInfo(\n trim(\"zmw:94203.1.99999\"),// weather station\n trim(\"Sacramento, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbc = new stationInfo(\n trim(\"zmw:93650.1.99999\"),// weather station\n trim(\"Fresno, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n\n $wxdbd = new stationInfo(\n trim(\"zmw:93301.1.99999\"),// weather station\n trim(\"Bakersfield, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbe = new stationInfo(\n trim(\"santa%20clarita\"), // weather station\n trim(\"Santa Clarita, CA\"),// location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbf = new stationInfo(\n trim(\"zmw:92373.1.99999\"),// weather station\n trim(\"Redlands, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbg = new stationInfo(\n trim(\"Riverside%20CA\"), // weather station\n trim(\"Riverside, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n\n $wxdbh = new stationInfo(\n trim(\"zmw:92602.1.99999\"),// weather station\n trim(\"Irvine, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbi = new stationInfo(\n trim(\"zmw:95401.1.99999\"),// weather station\n trim(\"Santa Rosa, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbj = new stationInfo(\n trim(\"zmw:96001.1.99999\"),// weather station\n trim(\"Redding, CA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbk = new stationInfo(\n trim(\"zmw:99001.3.99999\"),// weather station\n trim(\"Spokane, WA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbk = new stationInfo(\n trim(\"zmw:99001.3.99999\"),// weather station\n trim(\"Spokane, WA\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n // Arizona\n\n $wxdbl = new stationInfo(\n trim(\"TUCSON\"), // weather station\n trim(\"Tucson, AZ\"),// location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbm = new stationInfo(\n trim(\"zmw:85001.1.99999\"),// weather station\n trim(\"Phoenix, AZ\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n // Utah\n\n $wxdbn = new stationInfo(\n trim(\"zmw:84601.1.99999\"),// weather station\n trim(\"Provo, UT\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbo = new stationInfo(\n trim(\"zmw:84060.1.99999\"),// weather station\n trim(\"Park City, UT\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n // Mountain States\n\n $wxdbp = new stationInfo(\n trim(\"zmw:81301.1.99999\"),// weather station\n trim(\"Durango, CO\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbq = new stationInfo(\n trim(\"zmw:81001.1.99999\"),// weather station\n trim(\"Pueblo, CO\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbr = new stationInfo(\n trim(\"zmw:80901.1.99999\"), // weather station\n trim(\"Colorado Springs, CO\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbs = new stationInfo(\n trim(\"zmw:80202.1.99999\"),// weather station\n trim(\"Denver, CO\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbt = new stationInfo(\n trim(\"zmw:80301.1.99999\"),// weather station\n trim(\"Boulder, CO\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbu = new stationInfo(\n trim(\"zmw:80301.1.99999\"),// weather station\n trim(\"Ft Collins, CO\"), // location\n 20 // tweet wind speed forecasts over this value\n );\n\n $wxdbv = new stationInfo(\n trim(\"albuquerque\"),\n trim(\"Albuquerque, NM\"),\n 15\n );\n\n // Texas\n\n $wxdbw = new stationInfo(\n trim(\"zmw:79821.2.99999\"),\n trim(\"El Paso, TX\"),\n 20\n );\n\n $wxdbx = new stationInfo(\n trim(\"zmw:78201.1.99999\"),\n trim(\"San Antonio, TX\"),\n 20\n );\n\n $wxdby = new stationInfo(\n trim(\"zmw:78701.1.99999\"),\n trim(\"Austin, TX\"),\n 20\n );\n\n $wxdbz = new stationInfo(\n trim(\"Plano%20TX\"),\n trim(\"Plano, TX\"),\n 20\n );\n\n $wxdbA = new stationInfo(\n trim(\"Houston%20TX\"),\n trim(\"Houston, TX\"),\n 20\n );\n\n $wxdbB = new stationInfo(\n trim(\"Benbrook%20TX\"),\n trim(\"Benbrook, TX\"),\n 20\n );\n\n $wxdbC = new stationInfo(\n trim(\"Wichita%20Falls%20TX\"),\n trim(\"Wichita Falls, TX\"),\n 20\n );\n\n // Oklahoma \n\n $wxdbD = new stationInfo(\n trim(\"Oklahoma%20City%20OK\"),\n trim(\"Oklahoma City, OK\"),\n 20\n );\n\n $wxdbE = new stationInfo(\n trim(\"Tulsa%20OK\"),\n trim(\"Tulsa, OK\"),\n 20\n );\n\n // Midwest\n\n $wxdbF = new stationInfo(\n trim(\"Kansas%20City%20MO\"),\n trim(\"Kansas City, MO\"),\n 20\n );\n $wxdbG = new stationInfo(\n trim(\"Omaha%20NE\"),\n trim(\"Omaha, NE\"),\n 20\n );\n\n $wxdbH = new stationInfo(\n trim(\"Minneapolis%20MN\"),\n trim(\"Minneapolis, MN\"),\n 20\n );\n\n $wxdbI = new stationInfo(\n trim(\"St%20Louis%20MO\"),\n trim(\"St Louis, MO\"),\n 20\n );\n\n\n\n $wxdb = array(\n $wxdb1,$wxdb2,$wxdb3,$wxdb4,$wxdb5,$wxdb6,$wxdb7,$wxdb8,$wxdb9,$wxdba,\n $wxdbb,$wxdbc,$wxdbd,$wxdbe,$wxdbf,$wxdbg,$wxdbh,$wxdbi,$wxdbj,$wxdbk,\n $wxdbl,$wxdbm,$wxdbn,$wxdbo,$wxdbp,$wxdbq,$wxdbr,$wxdbs,$wxdbt,$wxdbu,\n $wxdbv,$wxdbw,$wxdbx,$wxdby,$wxdbz,$wxdbA,$wxdbB,$wxdbC,$wxdbD,$wxdbE,\n $wxdbF,$wxdbG,$wxdbH,$wxdbI,\n );\n\n //$wxdb = array($wxdbI,$wxdbH); // XXX for debug\n\n return $wxdb;\n}",
"function parseWeather()\n\t{\n\t\tif(sizeof($this->racine->loc->dnam)>0)\n\t\t{\n\t\t$this->stationNom = $this->racine->loc->dnam;\n\t\t$this->stationLat = $this->racine->loc->lat;\n\t\t$this->stationLon = $this->racine->loc->lon;\n\t\t\n\t\t$this->dirVentDeg = $this->racine->cc->wind->d;\n\t\t$this->dirVentTxt = $this->racine->cc->wind->t;\n\t\t$this->vitVentKmh = $this->racine->cc->wind->s;\n\t\t$this->rafaleVent = $this->racine->cc->wind->gust;\n\t\t$this->vitVentUs = $this->racine->head->us;\n\t\t$this->vitVentMps = 1000*$this->vitVentKmh/3600.0;\n\t\t\n\t\t$this->pressionAt = $this->racine->cc->bar->r;\n\t\t$this->pressionUp = $this->racine->head->up;\n\t\t$evol = $this->racine->cc->bar->d;\n\t\tswitch($evol){\n\t\t\tcase 'rising':$this->pressEvol = \"en hausse\";break;\n\t\t\tdefault: $this->pressEvol = $evol;\n\t\t}\n\t\t\n\t\t$this->humidite = $this->racine->cc->hmid;\n\t\t$this->visibilite = $this->racine->cc->vis;\n\t\t\n\t\t$this->forceUVval = $this->racine->cc->uv->i;\n\t\t$this->forceUVtxt = $this->racine->cc->uv->t;\n\t\t\n\t\t$this->dewPoint = $this->racine->cc->dewp;\n\t\t\n\t\t$this->temperature = $this->racine->cc->tmp;\n\t\t\n\t\t$this->lastMesure = $this->racine->cc->lsup;\n\t\t\n\t\t$couvert = $this->racine->cc->t;\n\t\tswitch($couvert){\n\t\t\tcase 'Mostly Cloudy':$this->couverture = 'Nuages épars';break;\n\t\t\tcase 'Cloudy':$this->couverture = 'Quelques Nuages';break;\n\t\t\tdefault: $this->couverture = $couvert; break;\n\t\t}\n\t\t\n\t\t$phase = $this->racine->cc->moon->t;\n\t\tswitch($phase){\n\t\t\tcase 'Waxing Crescent':$this->phaseLune='1er croissant';break;\n\t\t\tdefault: $this->phaseLune=$phase;break;\n\t\t}\n\t }\n\t}",
"function getTrains($station) {\n\n\t\t$retval = array();\n\t\t$redis_key = \"station/getTrains-${station}\";\n\t\t//$redis_key .= time(); // Debugging\n\n\t\tif ($retval = $this->redisGet($redis_key)) {\n\t\t\treturn($retval);\n\n\t\t} else {\n\n\t\t\t$query = 'search index=\"septa_analytics\" '\n\t\t\t\t. 'earliest=-24h late != 999 '\n\t\t\t\t. 'nextstop=\"' . $station . '\" '\n\t\t\t\t. '| eval time=strftime(_time,\"%Y-%m-%dT%H:%M:%S\") '\n\t\t\t\t. '| stats max(late) AS \"Minutes Late\", max(time) AS \"time\", max(train_line) AS \"Train Line\" by trainno '\n\t\t\t\t. '| sort time desc';\n\n\t\t\t$retval = $this->query($query);\n\t\t\t$retval[\"metadata\"][\"_comment\"] = \"Most recent trains that have arrived at the station named '$station'\";\n\n\t\t\t$this->redisSet($redis_key, $retval);\n\t\t\treturn($retval);\n\n\t\t}\n\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes newly excluded authors from database upon filed update | public function removeExcludedAuthors()
{
//Get list of excludes
$excludes = $this->coreManager->getSettingsManager()->getOption('excludes')->getValue();
$excludedArray = explode(',', $excludes);
$excludedArray = array_map('trim', $excludedArray);
$query = "DELETE FROM ".$this->coreManager->getDbManager()->getTableNameFor('authors')." WHERE twitter IN ('".implode("','", $excludedArray)."')";
$this->coreManager->getDbManager()->query($query);
} | [
"public function clearAuthors()\n {\n $query = \"DELETE FROM \".$this->coreManager->getDbManager()->getTableNameFor('authors');\n $this->coreManager->getDbManager()->query($query);\n }",
"private function remove_indexable_rows_for_disabled_authors_archive()\n {\n }",
"protected function _syncAuthor() {}",
"function __clear_multi_author_cache() {\n\tdelete_transient( 'is_multi_author' );\n}",
"function __clear_multi_author_cache() {}",
"public function testUpdateUnownedAuthorAsAdmin()\n {\n $user = User::factory()\n ->create();\n\n $user->assignRole(Role::create(['name' => User::ADMIN]));\n $user->save();\n\n $token = $user->createToken('normal');\n\n $author = Author::factory()\n ->create(['user_id' => User::factory()->create()->id]);\n\n $response = $this->put(\"/api/v1/authors/{$author->id}\", [\n 'website' => $this->faker->url,\n 'address' => $this->faker->address,\n 'email' => $user->email,\n 'name' => $this->faker->name,\n ], [\n 'Accept' => 'application/json',\n 'Authorization' => \"Bearer {$token->plainTextToken}\"\n ]);\n\n $response->assertOk();\n }",
"public function updateAuthor()\n {\n }",
"function ensureAuthorsInDatabase($authors)\r\n {\r\n $CI = &get_instance();\r\n if (!is_array($authors))\r\n return null;\r\n \r\n $tempresult = array();\r\n foreach ($authors as $author)\r\n {\r\n $current = $this->getByExactName($author->firstname, $author->von, $author->surname, $author->jr);\r\n if ($current == null)\r\n $current = $this->add($author);\r\n \r\n $tempresult[] = $current;\r\n }\r\n //silently drop duplicate authors from list\r\n $authorids = array();\r\n $authors = array();\r\n foreach ($tempresult as $a)\r\n {\r\n if (!in_array($a->author_id,$authorids))\r\n {\r\n $authorids[] = $a->author_id;\r\n $authors[] = $a;\r\n }\r\n else\r\n {\r\n appendMessage(__(\"Dropped duplicate author\").\"<br/>\");\r\n }\r\n }\r\n\r\n return $authors;\r\n }",
"function deleteUser(){\n $current_user = wp_get_current_user();\n $post = get_post();\n $coauthor_taxonomy = 'author';\n $coauthors = array();\n\n $existing_coauthors = get_coauthors( $post->ID );\n\n foreach ( $existing_coauthors as $author ) {\n if ( $author->ID == $current_user->ID) {\n //remove procedure -> skip for user that needs to be removed\n }else{\n $remainingAuthor = array($author->user_login);\n $coauthors = array_unique( array_merge( $coauthors, $remainingAuthor ) ); \n }\n }\n wp_set_post_terms( $post->ID, $coauthors, $coauthor_taxonomy, false );\n}",
"function wpse17106_author_rewrite_rules( $author_rewrite_rules )\n{\n foreach ( $author_rewrite_rules as $pattern => $substitution ) {\n if ( FALSE === strpos( $substitution, 'author_name' ) ) {\n unset( $author_rewrite_rules[$pattern] );\n }\n }\n return $author_rewrite_rules;\n}",
"public function clearAuthors()\n {\n $this->collAuthors = null; // important to set this to NULL since that means it is uninitialized\n }",
"function removeAuthorRevisedFilesFromSignoffs() {\n\t\timport('classes.article.Article');\n\t\t$signoffDao =& DAORegistry::getDAO('SignoffDAO'); /* @var $signoffDao SignoffDAO */\n\n\t\t$result =& $signoffDao->retrieve(\n\t\t\t'SELECT DISTINCT s.signoff_id\n\t\t\tFROM articles a\n\t\t\t\tJOIN signoffs s ON (a.article_id = s.assoc_id)\n\t\t\tWHERE s.symbolic = ?\n\t\t\t\tAND s.file_id = a.revised_file_id',\n\t\t\t'SIGNOFF_COPYEDITING_INITIAL'\n\t\t);\n\n\t\twhile (!$result->EOF) {\n\t\t\t$row = $result->GetRowAssoc(false);\n\n\t\t\t$signoff = $signoffDao->getById($row['signoff_id']); /* @var $signoff Signoff */\n\t\t\t$signoff->setFileId(null);\n\t\t\t$signoff->setFileRevision(null);\n\t\t\t$signoffDao->updateObject($signoff);\n\n\t\t\t$result->MoveNext();\n\t\t}\n\n\t\treturn true;\n\t}",
"function remove_quick_edit_authors_box() {\n\t\tglobal $pagenow;\n\n\t\tif ( 'edit.php' == $pagenow && $this->is_post_type_enabled() )\n\t\t\tremove_post_type_support( get_post_type(), 'author' );\n\t}",
"public function clearBiblioAuthors()\n {\n $this->collBiblioAuthors = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function reschedule_indexable_cleanup_when_author_archives_are_disabled($old_value, $new_value)\n {\n }",
"protected function disableAuthorArchives()\n {\n // Return 404 for all author queries\n add_action('wp', function($wp) {\n if (\n count($wp->query_vars) == 1 &&\n (\n array_key_exists('author', $wp->query_vars) ||\n array_key_exists('author_name', $wp->query_vars)\n )\n ) {\n global $wp_query;\n\n $wp_query->set_404();\n status_header(404);\n }\n });\n\n // Never return author URLs\n add_filter('author_link', function($link) {\n return get_bloginfo('url');\n }, 10, 1);\n\n // Prevent the_author_posts_link() from returning a link\n add_filter('the_author_posts_link', function($link) {\n return strip_tags($link);\n });\n }",
"function remove_author_post_metabox() { remove_meta_box( 'authordiv', 'post', 'normal' ); }",
"function arnon_on_technology_disable_author_archives() {\n\tif ( is_author() ) {\n\t\tglobal $wp_query;\n\t\t$wp_query->set_404();\n\t\tstatus_header( 404 );\n\t\tnocache_headers();\n\t}\n}",
"protected function updateAuthors() {\n\n // Find all content authors.\n $query = \\Drupal::entityQuery('node')\n ->condition('status', 1);\n $nids = $query->execute();\n $nodes = Node::loadMultiple($nids);\n\n // Add a content subscription flag for each owner.\n $flag_service = \\Drupal::service('flag');\n $flag_id = 'subscribe_node';\n $flag = $flag_service->getFlagById($flag_id);\n foreach ($nodes as $node) {\n $account = $node->getOwner();\n // Skip inactive users.\n if ($account->isBlocked()) {\n continue;\n }\n // Skip admin and anonymous users.\n if (in_array($account->id(), [0, 1])) {\n continue;\n }\n // Check if already flagged to avoid exception error.\n $flagging = $flag_service->getFlagging($flag, $node, $account);\n if (!$flagging) {\n $flag_service->flag($flag, $node, $account);\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cron to process all of the posts that don't have bitly urls | function bitly_process_posts( $hourly_limit = null ) {
global $wpdb;
if ( ! bitly_is_url_generation_enabled() ) {
bitly_log( 'Bit.ly backfill is currently disabled via code' );
return;
}
// Check if we should even be running this
$bitly_processed = get_option( 'bitly_processed' );
if ( ! empty( $bitly_processed ) ) {
bitly_log( "All bit.ly URLs were processed. Run reset_process_status if you think this is in error and try again." );
return;
}
// Use the default limit if one was not set
if ( empty( $hourly_limit ) || ! is_numeric( $hourly_limit ) )
$hourly_limit = apply_filters( 'bitly_hourly_limit', 100 );
// Generate a shortlink for the homepage, if it doesn't exist
$blog_shortlink = bitly_get_blog_url();
if ( ! $blog_shortlink ) {
bitly_log( "Set short URL for blog" );
bitly_generate_blog_short_url();
}
$post_type_sql = "";
// get the post types that are supported
$post_types = bitly_get_post_types();
// build the sql for querying post types
if( count( $post_types ) ) {
foreach( $post_types as $post_type ) {
$sanitized_post_types[] = $wpdb->prepare( '%s', $post_type );
}
$post_type_sql = sprintf( '%s IN ( %s )', "$wpdb->posts.post_type", implode( ',', $sanitized_post_types ) );
}
// Only do the query if there's post_type sql
if( ! empty( $post_type_sql ) ) {
bitly_log( "Starting to process posts without bit.ly short URLs with a limit of {$hourly_limit}" );
// Get $limit published posts that don't have a bitly url
// Only query for a maximum of 100 posts at a time
$processed = 0;
$per_page = 100;
do {
$query = "
SELECT $wpdb->posts.ID
FROM $wpdb->posts
LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'bitly_url' )
WHERE 1=1
AND ( $post_type_sql )
AND ( $wpdb->posts.post_status = 'publish' )
AND ( $wpdb->postmeta.post_id IS NULL )
GROUP BY $wpdb->posts.ID
ORDER BY $wpdb->posts.post_date DESC
LIMIT $per_page
";
// Get the posts
$posts = $wpdb->get_results( $query );
// Increment the counter
$processed += count( $posts );
// This could be empty if there was no $post_type_sql
if ( ! empty( $posts ) ) {
// Process these posts
foreach( $posts as $p ) {
bitly_log( "Generating short_url for post ID {$p->ID}" );
bitly_generate_short_url( $p->ID );
}
} else {
// Kill our scheduled event
bitly_log( "No posts were found. Killing the event." );
bitly_processed();
}
bitly_log( "Processed {$processed} posts" );
sleep( 2 );
} while ( count( $posts ) && $processed < $hourly_limit );
} else {
// Kill our scheduled event
bitly_log( "No bit.ly post types were found. Killing the event." );
bitly_processed();
}
// If $per_page isn't equal to the number of posts found on the last run, we should disable this forever
if ( $per_page != count( $posts ) ) {
bitly_log( "All bit.ly posts were processed. Killing the event." );
bitly_processed();
}
} | [
"function bitly_process_posts() {\n\n\tglobal $wpdb;\n\n\t// get 100 published posts that don't have a bitly url\n\t$query = \"\n\t\tSELECT $wpdb->posts.ID\n\t\tFROM $wpdb->posts\n\t\tWHERE NOT EXISTS (\n\t\t\tSELECT ID\n\t\t\tFROM $wpdb->postmeta\n\t\t\tWHERE $wpdb->posts.ID = $wpdb->postmeta.post_id\n\t\t\tAND $wpdb->postmeta.meta_key = 'bitly_url'\n\t\t)\n\t\tAND ( $wpdb->posts.post_type = 'post' OR $wpdb->posts.post_type = 'page' )\n\t\tAND ( $wpdb->posts.post_status = 'publish' )\n\t\tGROUP BY $wpdb->posts.ID\n\t\tORDER BY $wpdb->posts.post_date DESC\n\t\tLIMIT 0, 100\n\t\t\";\n\n\t$posts = $wpdb->get_results( $query );\n\n\tif( $posts ) {\n\n\t\t// process these posts\n\t\tforeach( $posts as $p ) {\n\t\t\tBitly::generate_bitly_url( $p->ID );\n\t\t}\n\t} else {\n\n\t\t// kill our scheduled event\n\t\tadd_option( 'bitly_processed', 1 );\n\t\twp_clear_scheduled_hook( 'bitly_hourly_hook' );\n\t}\n}",
"function _quail_server_cron() {\n module_load_include('inc', 'quail_server');\n $links_to_check = variable_get('quail_server_links_to_check', array());\n $max = variable_get('quail_server_cron_max', 50);\n $update = 0;\n $last_nid = 0;\n foreach($links_to_check as $link) {\n \t$website = node_load($link['website']);\n \t$result = drupal_http_request($link['link']);\n\tif($result->redirect_code == '200' && $result->redirect_url) {\n\t\t$result = drupal_http_request($result->redirect_url);\n\t\t$link['link'] = $result->redirect_url;\n\t}\n\tif($result->data && strpos($result->data, '<html') !== false && ($result->code == '200' || $result->redirect_code == '200') && _quail_server_page_can_be_crawled($website, $link['link'], $result->data)) {\n\t\t$links = quail_server_parse_links($link['link'], $result->data, $website->ac_server);\n\t\tforeach($links as $link_part) {\n\t\t\tif(!$links_to_check[$link_part] && !quail_server_get_node($link_part)) {\n\t\t\t\t$links_to_check[$link_part] = array('link' => $link_part, 'website' => $website->nid);\n\t\t\t}\n\t\t}\n\t\t$url = parse_url($link['link']);\n\t\t$html = _quail_server_get_content_from_template($result->data, $website, $link['link']);\n\t\t$cms_mode = ($html != $result->data);\n\t\t$accessibility = quail_server_check_string($html, $link['link'], \n\t\t\t\t\t\t\t\t\t\t$website->ac_server['guideline_nid'], $cms_mode);\n\t\tif($accessibility !== false) {\n\t\t\t$node = quail_server_get_node($link['link']);\n\t\t\tif(!property_exists($node, 'content_hash') && $node->content_hash != md5($result->data)) {\n\t\t\t\t$node->accessibility_results = array('content' => $accessibility);\n\t\t\t\t$node->website = $website->nid;\n\t\t\t\t$node->revision = TRUE;\n\t\t\t\t$node->total_nodes = _quail_server_count_nodes($result->data);\n\t\t\t\t$node->file_path = $url['path'];\n\t\t\t\tif($url['query']) {\n\t\t\t\t\t$node->file_path .= '?'. $url['query'];\n\t\t\t\t}\n\t\t\t\t$node->content_hash = md5($result->data);\n\t\t\t\t$node->title = _quail_server_get_title($result->data, $url['path']);\n\t\t\t\tnode_save($node);\n\t\t\t\t$last_nid = $node->nid;\n\t $update++;\n\t\t\t}\n\t\t}\n\t}\n\t$max--;\n }\n //If there's still time, start checking existing nodes\n if($max) {\n\t $nodes = db_query('SELECT n.nid, w.url, w.hash, w.website_nid FROM {quail_server_webpage} w LEFT JOIN {node} n ON n.nid = w.nid AND n.vid = w.vid WHERE n.nid > %d ORDER BY nid LIMIT %d',\n\t variable_get('quail_server_last_nid', 0),\n\t $max\n\t );\n\t while($row = db_fetch_object($nodes)) {\n\t $last_nid = $row->nid;\n\t $website = node_load($row->website_nid);\n\t $result = drupal_http_request($row->url);\n\t if($result->redirect_code == '200' && $result->redirect_url) {\n\t \t$result = drupal_http_request($result->redirect_url);\n\t \t$link['link'] = $row->url;\n\t }\n\t if($result->data && strpos($result->data, '<html') !== false && ($result->code == '200' || $result->redirect_code == '200') && _quail_server_page_can_be_crawled($website, $row->url, $result->data)) {\n\t if(md5($result->data) != $row->hash) {\n\t $links = quail_server_parse_links($row->url, $result->data, $website->ac_server);\n\t foreach($links as $link) {\n\t if(!quail_server_get_node($link)) {\n\t $links_to_check[$link] = array('link' => $link, 'website' => $website->nid);\n\t }\n\t }\n\t $url = parse_url($row->url);\n\t\t\t$html = _quail_server_get_content_from_template($result->data, $website, $row->url);\n\t\t\t$cms_mode = ($html != $result->data);\n\t $accessibility = quail_server_check_string($html, $row->url, \n\t \t\t\t\t\t\t$website->ac_server['guideline_nid'], $cms_mode);\n\t if($accessibility !== false) {\n\t $node = node_load($row->nid);\n\t if(!property_exists($node, 'content_hash') && $node->content_hash != md5($result->data)) {\n\t\t $node->accessibility_results = array('content' => $accessibility);\n\t\t $node->website = $context['sandbox']['node']->nid;\n\t\t $node->revision = TRUE;\n\t\t\t\t $node->total_nodes = _quail_server_count_nodes($result->data);\n\t\t $node->file_path = $url['path'];\n\t\t\t\t if($url['query']) {\n\t\t\t\t \t$node->file_path .= '?'. $url['query'];\n\t\t\t\t }\n\t\t $node->content_hash = md5($result->data);\n\t\t $node->title = _quail_server_get_title($result->data, $url['path']);\n\t\t node_save($node);\n\t\t $update++;\n\t\t\t }\n\t }\n\t }\n\t }\n\t }\n }\n if($last_nid == 0) {\n \t $last_nid = variable_get('quail_server_last_nid', 0) + \n \t\t\t\t variable_get('quail_server_cron_max', 50);\n }\n $max_nid = db_result(db_query('select max(nid) from {node}'));\n if($last_nid > $max_nid) {\n \t$last_nid = 0;\n }\n variable_set('quail_server_last_nid', $last_nid);\n variable_set('quail_server_links_to_check', $links_to_check);\n watchdog('quail_server', t('Checked %number pages for accessibility and updated %updated pages', \n \t\t\t\t\t array('%number' => variable_get('quail_server_cron_max', 50), \n \t\t\t\t\t '%updated' => $update)));\n}",
"function ciniki_blog_cron_jobs(&$ciniki) {\n ciniki_cron_logMsg($ciniki, 0, array('code'=>'0', 'msg'=>'Checking for blog jobs', 'severity'=>'5'));\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'blog', 'private', 'processAudio');\n\n //\n // Get any blog audio files that need to be processed\n //\n $strsql = \"SELECT id, uuid, tnid \"\n . \"FROM ciniki_blog_post_audio \"\n . \"WHERE (flags&0x02) = 0x02 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.sapos', 'audio');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['rows']) ) {\n return array('stat'=>'ok');\n }\n $files = $rc['rows'];\n \n foreach($files as $file) {\n $rc = ciniki_blog_processAudio($ciniki, $file['tnid'], $file['id']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_cron_logMsg($ciniki, $file['tnid'], array('code'=>'ciniki.blog.70', 'msg'=>'Unable to process audio file: ' . $file['id'],\n 'cron_id'=>0, 'severity'=>50, 'err'=>$rc['err'],\n ));\n }\n }\n\n return array('stat'=>'ok');\n}",
"function wp_rss_multi_cron() {\n\tfind_db_transients();\n}",
"function load_posts() {\n\n\t\t/** @var WPDB $wpdb */\n\t\tglobal $wpdb;\n\n\t\t// Tag names which are skipped when reading incoming posts\n\t\t$skip_tags = array(\n\t\t\t'Okategoriserade',\n\t\t\t'Okategoriserat',\n\t\t\t'Uncategorized',\n\t\t\t'Okategoriserad'\n\t\t);\n\n\t\t$sites = get_option( 'pp-ettan-sites' );\n\n\t\t// Load post keys from the postmeta table\n\t\t$meta = $wpdb->get_results( 'SELECT post_id, meta_value, meta_key FROM ' . $wpdb->prefix . 'postmeta WHERE meta_key IN (\"pp-ettan-post-key\", \"pp-ettan-checksum\")' );\n\t\t$posts = array();\n\t\t$checksums = array();\n\n\t\t// Transform the result into a lookup list\n\t\tforeach ( $meta as $item ) {\n\t\t\tswitch ( $item->meta_key ) {\n\t\t\t\tcase 'pp-ettan-post-key':\n\t\t\t\t\t$posts[ intval( $item->meta_value ) ] = intval( $item->post_id );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'pp-ettan-checksum':\n\t\t\t\t\t$checksums[ intval( $item->post_id ) ] = intval( $item->meta_value );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Free up some memory\n\t\tunset( $meta );\n\n\t\t// Sort the sites array to begin with the site which has waited the longest to be updated\n\t\tusort( $sites, function ( $a, $b ) { return strtotime( $a->lastupdate ) - strtotime( $b->lastupdate ); } );\n\n\t\t// Set feed cache time to one second to get fresh results\n\t\tadd_filter( 'wp_feed_cache_transient_lifetime', array( $this, 'wp_feed_cache_transient_lifetime' ) );\n\n\t\t// Iterate all the sites\n\t\tforeach ( $sites as $key => $site ) {\n\t\t\t$sites[ $key ]->lastupdate = date( 'Y-m-d H:i:s' );\n\n\t\t\t$uri = '';\n\n\t\t\t// Create the URI for the feed\n\t\t\t$uri .= $site->url;\n\t\t\t$uri .= substr( $uri, - 1, 1 ) != '/' ? '/' : '';\n\t\t\t$uri .= '?feed=rss2';\n\n\t\t\t// Try to load the RSS feed\n\t\t\t$feed = fetch_feed( $uri );\n\n\t\t\t// Update the status to 'Error' if loading fails\n\t\t\tif ( is_wp_error( $feed ) ) {\n\t\t\t\t$sites[ $key ]->status = 'Error';\n\t\t\t\t$sites[ $key ]->lastbuild = '';\n\t\t\t\t$sites[ $key ]->posts = 0;\n\t\t\t} else {\n\t\t\t\t// Fetch the channel and items for easier access\n\t\t\t\t$channel = $feed->data[ 'child' ][ '' ][ 'rss' ][ 0 ][ 'child' ][ '' ][ 'channel' ][ 0 ][ 'child' ][ '' ];\n\t\t\t\t$items = $channel[ 'item' ];\n\n\t\t\t\t// If the feed is empty, fall back to an empty array to be type safe\n\t\t\t\tif ( ! $items ) {\n\t\t\t\t\t$items = array();\n\t\t\t\t}\n\n\t\t\t\tforeach ( $items as $item ) {\n\t\t\t\t\t// GUID and post_key/checksum\n\t\t\t\t\t$guid = $item[ 'child' ][ '' ][ 'guid' ][ 0 ][ 'data' ];\n\t\t\t\t\t$post_key = crc32( $guid );\n\t\t\t\t\t$checksum = crc32( serialize( $item ) );\n\t\t\t\t\t$post_id = false;\n\n\t\t\t\t\tif ( isset( $posts[ $post_key ] ) ) {\n\t\t\t\t\t\t$post_id = $posts[ $post_key ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the checksum calculated from $item matches the stored value, no update is necessary\n\t\t\t\t\tif ( $checksums[ $post_id ] === $checksum ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Tags\n\t\t\t\t\t$_tags = $item[ 'child' ][ '' ][ 'category' ];\n\t\t\t\t\t$tags = array();\n\n\t\t\t\t\tif ( is_array( $_tags ) ) {\n\t\t\t\t\t\tforeach ( $_tags as $tag ) {\n\n\t\t\t\t\t\t\tif ( in_array( $tag[ 'data' ], $skip_tags )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$tags[ ] = $tag[ 'data' ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_time = strtotime( $item[ 'child' ][ '' ][ 'pubDate' ][ 0 ][ 'data' ] );\n\n\t\t\t\t\t$post = array(\n\t\t\t\t\t\t'comment_status' => 'closed',\n\t\t\t\t\t\t'ping_status' => 'closed',\n\t\t\t\t\t\t'post_content' => $item[ 'child' ][ 'http://purl.org/rss/1.0/modules/content/' ][ 'encoded' ][ 0 ][ 'data' ],\n\t\t\t\t\t\t'post_date' => date( 'Y-m-d H:i:s', $post_time ),\n\t\t\t\t\t\t'post_date_gmt' => gmdate( 'Y-m-d H:i:s', $post_time ),\n\t\t\t\t\t\t'post_excerpt' => $item[ 'child' ][ '' ][ 'description' ][ 0 ][ 'data' ],\n\t\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t\t'post_title' => $item[ 'child' ][ '' ][ 'title' ][ 0 ][ 'data' ],\n\t\t\t\t\t\t'post_type' => 'post',\n\t\t\t\t\t\t'tags_input' => join( ',', $tags ),\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( $post_id ) {\n\t\t\t\t\t\t$post[ 'ID' ] = $post_id;\n\t\t\t\t\t}\n\n\t\t\t\t\t$post_id = wp_insert_post( $post );\n\n\t\t\t\t\tupdate_post_meta( $post_id, 'comment_count', $item[ 'child' ][ 'http://purl.org/rss/1.0/modules/slash/' ][ 'comments' ][ 0 ][ 'data' ] );\n\t\t\t\t\tupdate_post_meta( $post_id, 'permalink', $item[ 'child' ][ '' ][ 'link' ][ 0 ][ 'data' ] );\n\t\t\t\t\tupdate_post_meta( $post_id, 'pp-ettan-post-key', $post_key );\n\t\t\t\t\tupdate_post_meta( $post_id, 'pp-ettan-checksum', $checksum );\n\t\t\t\t\tupdate_post_meta( $post_id, 'pp-ettan-site-name', $site->name );\n\t\t\t\t\tupdate_post_meta( $post_id, 'pp-ettan-site-url', $site->url );\n\t\t\t\t}\n\n\t\t\t\t// Update some status fields for the site\n\t\t\t\t$sites[ $key ]->status = 'OK';\n\t\t\t\t$sites[ $key ]->posts = count( $items );\n\t\t\t\t$sites[ $key ]->lastbuild = $channel[ 'lastBuildDate' ][ 0 ][ 'data' ];\n\t\t\t}\n\n\t\t\t// Update the sites option after each iteration\n\t\t\t$sites[ ] = rand(); // Ever heard of a ugly hack?\n\t\t\tupdate_option( 'pp-ettan-sites', $sites );\n\t\t\tarray_pop( $sites ); // http://core.trac.wordpress.org/ticket/22233\n\t\t\tupdate_option( 'pp-ettan-sites', $sites );\n\t\t}\n\n\t\t// Remove the filter again\n\t\tremove_filter( 'wp_feed_cache_transient_lifetime', array( $this, 'wp_feed_cache_transient_lifetime' ) );\n\t}",
"public function publishScheduledEntries()\n\t{\n\t\t$strReq = 'SELECT post_id, post_dt, post_tz '.\n\t\t\t\t'FROM '.$this->prefix.'post '.\n\t\t\t\t'WHERE post_status = -1 '.\n\t\t\t\t\"AND blog_id = '\".$this->con->escape($this->id).\"' \";\n\t\t\n\t\t$rs = $this->con->select($strReq);\n\t\t\n\t\t$now = dt::toUTC(time());\n\t\t$to_change = array();\n\t\t\n\t\tif ($rs->isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\twhile ($rs->fetch())\n\t\t{\n\t\t\t# Now timestamp with post timezone\n\t\t\t$now_tz = $now + dt::getTimeOffset($rs->post_tz,$now);\n\t\t\t\n\t\t\t# Post timestamp\n\t\t\t$post_ts = strtotime($rs->post_dt);\n\t\t\t\n\t\t\t# If now_tz >= post_ts, we publish the entry\n\t\t\tif ($now_tz >= $post_ts) {\n\t\t\t\t$to_change[] = (integer) $rs->post_id;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!empty($to_change))\n\t\t{\n\t\t\t$strReq =\n\t\t\t'UPDATE '.$this->prefix.'post SET '.\n\t\t\t'post_status = 1 '.\n\t\t\t\"WHERE blog_id = '\".$this->con->escape($this->id).\"' \".\n\t\t\t'AND post_id '.$this->con->in($to_change).' ';\n\t\t\t\n\t\t\t$this->con->execute($strReq);\n\t\t\t$this->triggerBlog();\n\t\t}\n\t}",
"function schedule_missed_posts() {\n\t$args = array(\n\t\t'numberposts' => - 1,\n\t\t'post_type' => 'post',\n\t\t'post_status' => 'any'\n\t);\n\t$posts = get_posts( $args );\n\t$datetime = new DateTime();\n\t$unixtime = $datetime->getTimestamp();\n\n\tforeach ( $posts as $post ) {\n\t\t$publishtime = strtotime( $post->post_date_gmt );\n\t\tif ( $post->post_status == 'published' AND $publishtime < $unixtime ) {\n\t\t\t$postarr = array(\n\t\t\t\t'ID' => $post->ID,\n\t\t\t\t'post_status' => 'published',\n\t\t\t);\n\t\t\twp_update_post( $postarr );\n\t\t}\n\t}\n}",
"static function _flush_urls() {\n\n\t\t$datetime = date( 'Ymdhis', filemtime( __FILE__ ) );\n\n\t\tif ( ! get_option( $option_name =\"epr-event-urls-flushed-{$datetime}\" ) ) {\n\n\t\t\tflush_rewrite_rules();\n\t\t\tupdate_option( $option_name, true );\n\n\t\t}\n\n\t}",
"public function cron()\n {\n $websites = Mage::app()->getWebsites();\n\n /** @var $indexer Mage_Index_Model_Indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n foreach ($websites as $website) {\n /* @var $website Mage_Core_Model_Website */\n $store = $website->getDefaultStore();\n $date = Mage::app()->getLocale()->storeDate($store);\n if ($date->equals(0, Zend_Date::HOUR)) {\n $indexer->logEvent(\n new Varien_Object(array('type_id' => null, 'store' => $website->getStoreIds())),\n self::ENTITY_TARGETRULE,\n self::EVENT_TYPE_CLEAN_TARGETRULES\n );\n }\n }\n $indexer->indexEvents(\n self::ENTITY_TARGETRULE,\n self::EVENT_TYPE_CLEAN_TARGETRULES\n );\n }",
"function hourly_cron() {\n\t\n\t\t//get a random domain and inspect it\n\t\t//this allows us to continously update via cron \n\t\twhile ( $domain = $this->get_random_domain() )\n\t\t\t\t$this->inspect( $domain );\n\t\n\t}",
"function polizeipresse_load_stories_hourly() {\r\n polizeipresse_load_stories_and_create_posts();\r\n}",
"protected function purgeInvalidUrls()\n {\n $purgeWhereStatement = 'valid_until>0 AND valid_until<' . time();\n $purgeWhereStatement = $this->configUtils->appendPidQuery($purgeWhereStatement);\n\n $this->getDatabaseConnection()->exec_DELETEquery(\n 'tx_tinyurls_urls',\n $purgeWhereStatement\n );\n }",
"public function cron()\n\t{\n\t\t$last_check = get_setting('fs_cron_stopforumspam');\n\n\t\t// every 10 minutes\n\t\t// only needed for asagi autorun\n\t\tif(get_setting('fs_asagi_autorun_enabled') && time() - $last_check > 600)\n\t\t{\n\t\t\tset_setting('fs_cron_10m', time());\n\n\t\t\tif('fs_asagi_autorun_enabled')\n\t\t\t{\n\t\t\t\t$this->load->model('asagi_model', 'asagi');\n\t\t\t\t$this->asagi->run();\n\t\t\t}\n\n\t\t}\n\n\t\t// every 13 hours\n\t\tif (false && time() - $last_check > 86400)\n\t\t{\n\t\t\tset_setting('fs_cron_13h', time());\n\n\t\t\t$url = 'http://www.stopforumspam.com/downloads/listed_ip_90.zip';\n\t\t\tif (function_exists('curl_init'))\n\t\t\t{\n\t\t\t\t$this->load->library('curl');\n\t\t\t\t$zip = $this->curl->simple_get($url);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$zip = file_get_contents($url);\n\t\t\t}\n\t\t\tif (!$zip)\n\t\t\t{\n\t\t\t\tlog_message('error',\n\t\t\t\t\t'MY_Controller cron(): impossible to get the update from stopforumspam');\n\t\t\t\tset_setting('fs_cron_13h', time());\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tdelete_files('content/cache/stopforumspam/', TRUE);\n\t\t\tif (!is_dir('content/cache/stopforumspam'))\n\t\t\t\tmkdir('content/cache/stopforumspam');\n\t\t\twrite_file('content/cache/stopforumspam/stopforumspam.zip', $zip);\n\t\t\t$this->load->library('unzip');\n\t\t\t$this->unzip->extract('content/cache/stopforumspam/stopforumspam.zip');\n\t\t\t$ip_list = file_get_contents('content/cache/stopforumspam/listed_ip_90.txt');\n\n\t\t\t$this->db->truncate('stopforumspam');\n\t\t\t$ip_array = array();\n\t\t\tforeach (preg_split(\"/((\\r?\\n)|(\\r\\n?))/\", $ip_list) as $line)\n\t\t\t{\n\t\t\t\t$ip_array[] = '(INET_ATON(' . $this->db->escape($line) . '))';\n\t\t\t}\n\t\t\t$this->db->query('\n\t\t\t\tINSERT IGNORE INTO ' . $this->db->protect_identifiers('stopforumspam',\n\t\t\t\t\tTRUE) . '\n\t\t\t\tVALUES ' . implode(',', $ip_array) . ';');\n\n\n\t\t\tdelete_files('content/cache/stopforumspam/', TRUE);\n\t\t}\n\t}",
"function drush_hosting_pause($url) {\n // Wipe out cron entry.\n _hosting_setup_cron($add = FALSE);\n}",
"public function purgeInvalidUrls();",
"function network_latest_posts($how_many=10, $how_long=0, $titleOnly=true, $begin_wrap=\"\\n<li>\", $end_wrap=\"</li>\", $blog_id='null', $thumbnail=false, $cpt=\"post\", $ignore_blog='null', $cat='null', $tag='null', $paginate=false, $excerpt_length='null', $display_root=false, $auto_excerpt=false, $full_meta=false) {\n\tglobal $wpdb;\n\tglobal $table_prefix;\n\t$counter = 0;\n $hack_cont = 0;\n // Custom post type\n $cpt = htmlspecialchars($cpt);\n // Ignore blog or blogs\n // if the user passes one value\n if( !preg_match(\"/,/\",$ignore_blog) ) {\n // Always clean this stuff ;)\n $ignore_blog = htmlspecialchars($ignore_blog);\n // Check if it's numeric\n if( is_numeric($ignore_blog) ) {\n // and put the sql\n $ignore = \" AND blog_id != $ignore_blog \";\n }\n // if the user passes more than one value separated by commas\n } else {\n // create an array\n $ignore_arr = explode(\",\",$ignore_blog);\n // and repeat the sql for each ID found\n for($z=0;$z<count($ignore_arr);$z++){\n $ignore .= \" AND blog_id != $ignore_arr[$z]\";\n }\n }\n\t// get a list of blogs in order of most recent update. show only public and nonarchived/spam/mature/deleted\n\tif ($how_long > 0) {\n // Select by blog id\n if( !empty($blog_id) && $blog_id != 'null' ) {\n $blog_id = htmlspecialchars($blog_id);\n $blogs = $wpdb->get_col(\"SELECT blog_id FROM $wpdb->blogs WHERE\n public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'\n AND blog_id = $blog_id $ignore AND last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY last_updated DESC\");\n } else {\n $blogs = $wpdb->get_col(\"SELECT blog_id FROM $wpdb->blogs WHERE\n public = '1' $ignore AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'\n AND last_updated >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY last_updated DESC\"); \n }\n\t} else {\n if( !empty($blog_id) && $blog_id != 'null' ) {\n $blog_id = htmlspecialchars($blog_id);\n $blogs = $wpdb->get_col(\"SELECT blog_id FROM $wpdb->blogs WHERE\n\t\t\tpublic = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id = $blog_id\n\t\t\t$ignore ORDER BY last_updated DESC\");\n } else {\n $blogs = $wpdb->get_col(\"SELECT blog_id FROM $wpdb->blogs WHERE\n\t\t\tpublic = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0'\n\t\t\t$ignore ORDER BY last_updated DESC\"); \n }\n\t}\n\n\tif ($blogs) {\n // Count how many blogs we've found\n $nblogs = count($blogs);\n // Lets dig into each blog\n\t\tforeach ($blogs as $blognlp) {\n\t\t\t// we need _posts and _options tables for this to work\n // Get the options table for each blog\n if( $display_root == true ) {\n if( $blognlp == 1 ) {\n $blogOptionsTable = $wpdb->base_prefix.\"options\";\n // Get the posts table for each blog\n $blogPostsTable = $wpdb->base_prefix.\"posts\";\n // Get the terms relationships table for each blog\n $blogTermRelationship = $wpdb->base_prefix.\"term_relationships\";\n // Get the term taxonomy table for each blog\n $blogTermTaxonomy = $wpdb->base_prefix.\"term_taxonomy\";\n // Get the terms table for each blog\n $blogTerms = $wpdb->base_prefix.\"terms\";\n } else {\n $blogOptionsTable = $wpdb->base_prefix.$blognlp.\"_options\";\n // Get the posts table for each blog\n $blogPostsTable = $wpdb->base_prefix.$blognlp.\"_posts\";\n // Get the terms relationships table for each blog\n $blogTermRelationship = $wpdb->base_prefix.$blognlp.\"_term_relationships\";\n // Get the term taxonomy table for each blog\n $blogTermTaxonomy = $wpdb->base_prefix.$blognlp.\"_term_taxonomy\";\n // Get the terms table for each blog\n $blogTerms = $wpdb->base_prefix.$blognlp.\"_terms\";\n }\n } else {\n $blogOptionsTable = $wpdb->base_prefix.$blognlp.\"_options\";\n // Get the posts table for each blog\n $blogPostsTable = $wpdb->base_prefix.$blognlp.\"_posts\";\n // Get the terms relationships table for each blog\n $blogTermRelationship = $wpdb->base_prefix.$blognlp.\"_term_relationships\";\n // Get the term taxonomy table for each blog\n $blogTermTaxonomy = $wpdb->base_prefix.$blognlp.\"_term_taxonomy\";\n // Get the terms table for each blog\n $blogTerms = $wpdb->base_prefix.$blognlp.\"_terms\";\n }\n // --- Because the categories and tags are handled the same way by WP\n // --- I'm hacking the $cat variable so I can use it for both without\n // --- repeating the code\n if( !empty($cat) && $cat != 'null' && (empty($tag) || $tag == 'null') ) { // Categories\n $cat_hack = $cat;\n $taxonomy = \"taxonomy = 'category'\";\n } elseif( !empty($tag) && $tag != 'null' && (empty($cat) || $cat == 'null') ) { // Tags\n $cat_hack = $tag;\n $taxonomy = \"taxonomy = 'post_tag'\";\n } elseif( !empty($cat) && $cat != 'null' && !empty($tag) && $tag != 'null' ) { // Categories & Tags\n $cat_hack = $cat.\",\".$tag;\n $taxonomy = \"(taxonomy = 'category' OR taxonomy = 'post_tag')\";\n }\n // --- Categories\n if( !empty($cat_hack) && $cat_hack != 'null' ) {\n if( !preg_match('/,/',$cat_hack) ) {\n $cat_hack = htmlspecialchars($cat_hack);\n // Get the category's ID\n $catid = $wpdb->get_results(\"SELECT term_id FROM $blogTerms WHERE slug = '$cat_hack'\");\n $cats{$blognlp} = $catid[0]->term_id;\n } else {\n $cat_arr = explode(',',$cat_hack);\n for($x=0;$x<count($cat_arr);$x++){\n $cat_ids = $wpdb->get_results(\"SELECT term_id FROM $blogTerms WHERE slug = '$cat_arr[$x]' \");\n if( !empty($cat_ids[0]->term_id) ) {\n // Get the categories' IDs\n $catsa{$blognlp}[] = $cat_ids[0]->term_id;\n }\n }\n }\n }\n // Let's find the ID for the category(ies) or tag(s) \n if( count($cats{$blognlp}) == 1 ) {\n $taxo = $wpdb->get_results(\"SELECT term_taxonomy_id FROM $blogTermTaxonomy WHERE $taxonomy AND term_id = \".$cats{$blognlp});\n $taxs{$blognlp} = $taxo[0]->term_taxonomy_id;\n } elseif( count($catsa{$blognlp}) >= 1 ) {\n for( $y = 0; $y < count($catsa{$blognlp}); $y++ ) {\n $tax_id = $wpdb->get_results(\"SELECT term_taxonomy_id FROM $blogTermTaxonomy WHERE $taxonomy AND term_id = \".$catsa{$blognlp}[$y]);\n if( !empty($tax_id[0]->term_taxonomy_id) ) {\n $taxsa{$blognlp}[] = $tax_id[0]->term_taxonomy_id;\n }\n }\n }\n // Next, let's find how they are related to the posts\n if( count($taxs{$blognlp}) == 1 ) {\n $pids = $wpdb->get_results(\"SELECT object_id FROM $blogTermRelationship WHERE term_taxonomy_id = \".$taxs{$blognlp});\n for( $w=0;$w<count($pids);$w++ ) {\n $postids{$blognlp}[] = $pids[$w]->object_id;\n }\n } elseif( count($taxsa{$blognlp}) >= 1 ) {\n for( $w = 0; $w < count($taxsa{$blognlp}); $w++ ) {\n $p_id = $wpdb->get_results(\"SELECT object_id FROM $blogTermRelationship WHERE term_taxonomy_id = \".$taxsa{$blognlp}[$w]);\n for( $q = 0; $q < count($p_id); $q++ ){\n $postidsa{$blognlp}[] = $p_id[$q]->object_id;\n }\n }\n }\n // Finally let's find the posts' IDs\n if( count($postids{$blognlp}) == 1 ) {\n $filter_cat = \" AND ID = \".$postids{$blognlp};\n if(!empty($filter_cat)) {\n if( !preg_match('/\\(/',$filter_cat) ) {\n $needle = ' AND ';\n $replacement = ' AND (';\n $filter_cat = str_replace($needle, $replacement, $filter_cat);\n }\n }\n } elseif( count($postids{$blognlp}) > 1 ) {\n for( $v = 0; $v < count($postids{$blognlp}); $v++ ) {\n if( $v == 0 && $hack_cont == 0 ) {\n $filter_cat .= \" AND ID = \".$postids{$blognlp}[$v];\n $hack_cont++;\n } elseif( $hack_cont > 0 ) {\n $filter_cat .= \" OR ID = \".$postids{$blognlp}[$v];\n }\n }\n if(!empty($filter_cat)) {\n if( !preg_match('/\\(/',$filter_cat) ) {\n $needle = ' AND ';\n $replacement = ' AND (';\n $filter_cat = str_replace($needle, $replacement, $filter_cat);\n }\n }\n } elseif( count($postidsa{$blognlp}) >= 1 ) {\n for( $v = 0; $v < count($postidsa{$blognlp}); $v++ ) {\n if( $v == 0 && $hack_cont == 0 ) {\n $filter_cat .= \" AND ID = \".$postidsa{$blognlp}[$v];\n $hack_cont++;\n } elseif( $hack_cont > 0 ) {\n $filter_cat .= \" OR ID = \".$postidsa{$blognlp}[$v];\n }\n }\n if(!empty($filter_cat)) {\n if( !preg_match('/\\(/',$filter_cat) ) {\n $needle = ' AND ';\n $replacement = ' AND (';\n $filter_cat = str_replace($needle, $replacement, $filter_cat);\n }\n }\n }\n // --- Categories\\\\\n // Get the saved options\n\t\t\t$options = $wpdb->get_results(\"SELECT option_value FROM\n\t\t\t\t$blogOptionsTable WHERE option_name IN ('siteurl','blogname','links_updated_date_format') \n\t\t\t\tORDER BY option_name DESC\");\n\t\t // we fetch the title, excerpt and ID for the latest post\n\t\t\tif ($how_long > 0) {\n if( !empty( $filter_cat ) && !empty($cat_hack) ) {\n // Without pagination\n if( !$paginate ) {\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n $filter_cat )\n AND post_type = '$cpt'\n AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY id DESC LIMIT 0,$how_many\");\n // Paginated results\n } else {\n $posts_per_page = $how_many;\n $page = isset( $_GET['pnum'] ) ? abs( (int) $_GET['pnum'] ) : 1;\n $total_records = $wpdb->get_var(\"SELECT COUNT(ID)\n FROM $blogPostsTable WHERE post_status = 'publish'\n $filter_cat )\n AND post_type = '$cpt'\n AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY id DESC\");\n $total = $total_records;\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n $filter_cat )\n AND post_type = '$cpt'\n AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY id DESC LIMIT \".(($page * $posts_per_page) - $posts_per_page) .\",$posts_per_page\");\n }\n } elseif( empty( $filter_cat ) && empty($cat_hack) ) {\n // Without pagination\n if( !$paginate ) {\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n AND ID > 1\n AND post_type = '$cpt'\n AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY id DESC LIMIT 0,$how_many\");\n // Paginated results\n } else {\n $posts_per_page = $how_many;\n $page = isset( $_GET['pnum'] ) ? abs( (int) $_GET['pnum'] ) : 1;\n $total_records = $wpdb->get_var(\"SELECT COUNT(ID)\n FROM $blogPostsTable WHERE post_status = 'publish'\n AND ID > 1\n AND post_type = '$cpt'\n AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY id DESC\");\n $total = $total_records;\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n AND ID > 1\n AND post_type = '$cpt'\n AND post_date >= DATE_SUB(CURRENT_DATE(), INTERVAL $how_long DAY)\n ORDER BY id DESC LIMIT \".(($page * $posts_per_page) - $posts_per_page) .\",$posts_per_page\");\n }\n }\n\t\t\t} else {\n if( !empty( $filter_cat ) && !empty($cat_hack) ) {\n // Without pagination\n if( !$paginate ) {\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n $filter_cat )\n AND post_type = '$cpt'\n ORDER BY id DESC LIMIT 0,$how_many\");\n // Paginated results\n } else {\n $posts_per_page = $how_many;\n $page = isset( $_GET['pnum'] ) ? abs( (int) $_GET['pnum'] ) : 1;\n $total_records = $wpdb->get_var(\"SELECT COUNT(ID)\n FROM $blogPostsTable WHERE post_status = 'publish'\n $filter_cat )\n AND post_type = '$cpt'\n ORDER BY id DESC\");\n $total = $total_records;\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n $filter_cat )\n AND post_type = '$cpt'\n ORDER BY id DESC LIMIT \".(($page * $posts_per_page) - $posts_per_page) .\",$posts_per_page\");\n }\n } elseif( empty( $filter_cat ) && empty($cat_hack) ) {\n // Without pagination\n if( !$paginate ) {\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n AND ID > 1\n AND post_type = '$cpt'\n ORDER BY id DESC LIMIT 0,$how_many\");\n } else {\n $posts_per_page = $how_many;\n $page = isset( $_GET['pnum'] ) ? abs( (int) $_GET['pnum'] ) : 1;\n $total_records = $wpdb->get_var(\"SELECT COUNT(ID)\n FROM $blogPostsTable WHERE post_status = 'publish'\n AND ID > 1\n AND post_type = '$cpt'\n ORDER BY id DESC\");\n $total = $total_records;\n $thispost = $wpdb->get_results(\"SELECT ID, post_title, post_excerpt, post_content, post_author, post_date\n FROM $blogPostsTable WHERE post_status = 'publish'\n AND ID > 1\n AND post_type = '$cpt'\n ORDER BY id DESC LIMIT \".(($page * $posts_per_page) - $posts_per_page) .\",$posts_per_page\");\n }\n }\n\t\t\t}\n\t\t\t// if it is found put it to the output\n\t\t\tif($thispost) {\n // Remember we are doing this for multiple blogs?, well we need to display\n // the number of posts chosen for each of them\n for($i=0; $i < count($thispost); $i++) {\n // get permalink by ID. check wp-includes/wpmu-functions.php\n $thispermalink = get_blog_permalink($blognlp, $thispost[$i]->ID);\n // If we want to show the excerpt, we do this\n if ($titleOnly == false || $titleOnly == 'false') {\n // Widget list\n if( ( !empty($begin_wrap) || $begin_wrap != '' ) && preg_match(\"/\\bli\\b/\",$begin_wrap) && $thumbnail == false ) { \n echo $begin_wrap.'<div class=\"network-posts blog-'.$blognlp.'\"><h4 class=\"srp-post-title\"><a href=\"'\n .$thispermalink.'\">'.$thispost[$i]->post_title.'</a></h4><span class=\"network-posts-source\"> '.__('published in','trans-nlp').' <a href=\"'\n .$options[0]->option_value.'\">'\n .$options[2]->option_value.'</a>';\n // Full metadata\n if( !empty($full_meta) && $full_meta == 'true' ){\n $format = (string)$options[1]->option_value;\n $dateobj = new DateTime(trim($thispost[$i]->post_date));\n $datepost = $dateobj->format(\"$format\");\n echo ' ' . __('by','trans-nlp'). ' ' . get_the_author_meta( 'display_name' , $thispost[$i]->post_author ) . ' ' . __('on','trans-nlp') . ' ' . $datepost;\n }\n echo '</span><p class=\"network-posts-excerpt\">';\n if( $auto_excerpt == false ) {\n echo custom_excerpt($excerpt_length, $thispost[$i]->post_excerpt, $thispermalink);\n } else {\n $auto_excerpt = auto_excerpt($thispost[$i]->post_content, $excerpt_length, $thispermalink);\n if( preg_match( \"/\\[caption/\", $auto_excerpt ) == true ) {\n echo do_shortcode($auto_excerpt);\n } else {\n echo custom_excerpt($excerpt_length, $auto_excerpt, $thispermalink);\n }\n }\n echo '</p></div>'.$end_wrap;\n // Shortcode\n } else {\n // Display thumbnail\n if( $thumbnail ) {\n if( $i == 0 ) {\n echo '<div id=\"wrapper-'.$blognlp.'\">';\n }\n echo $begin_wrap.'<div class=\"network-posts blog-'.$blognlp.'\"><h4 class=\"network-posts-title\"><a href=\"'.$thispermalink.'\">'.$thispost[$i]->post_title.'</a></h1><span class=\"network-posts-source\"> '.__('published in','trans-nlp').' <a href=\"'\n .$options[0]->option_value.'\">'\n .$options[2]->option_value.'</a>';\n // Full metadata\n if( !empty($full_meta) && $full_meta == 'true' ){\n $format = (string)$options[1]->option_value;\n $dateobj = new DateTime(trim($thispost[$i]->post_date));\n $datepost = $dateobj->format(\"$format\");\n echo ' ' . __('by','trans-nlp'). ' ' . get_the_author_meta( 'display_name' , $thispost[$i]->post_author ) . ' ' . __('on','trans-nlp') . ' ' . $datepost;\n }\n echo '</span><a href=\"'\n .$thispermalink.'\">'.the_post_thumbnail_by_blog($blognlp,$thispost[$i]->ID).'</a> <p class=\"network-posts-excerpt\">';\n if( $auto_excerpt == false ) {\n echo custom_excerpt($excerpt_length, $thispost[$i]->post_excerpt, $thispermalink);\n } else {\n $auto_excerpt = auto_excerpt($thispost[$i]->post_content, $excerpt_length, $thispermalink);\n if( preg_match( \"/\\[caption/\", $auto_excerpt ) == true ) {\n echo do_shortcode($auto_excerpt);\n } else {\n echo custom_excerpt($excerpt_length, $auto_excerpt, $thispermalink);\n }\n }\n echo '</p>';\n if( $i == (count($thispost)-1) && $paginate == true ) {\n echo '<div class=\"network-posts-pagination\">';\n echo paginate_links( array(\n 'base' => add_query_arg( 'pnum', '%#%' ),\n 'format' => '',\n 'prev_text' => __('«'),\n 'next_text' => __('»'),\n 'total' => ceil($total / $posts_per_page),\n 'current' => $page,\n 'type' => 'list'\n ));\n echo '</div>';\n echo \n '<script type=\"text/javascript\" charset=\"utf-8\">\n jQuery(document).ready(function(){\n\n jQuery(\".blog-'.$blognlp.' .network-posts-pagination a\").live(\"click\", function(e){\n e.preventDefault();\n var link = jQuery(this).attr(\"href\");\n jQuery(\"#wrapper-'.$blognlp.'\").html(\"<img src=\\\"'.plugins_url('/img/loader.gif', __FILE__) .'\\\" />\");\n jQuery(\"#wrapper-'.$blognlp.'\").load(link+\" .blog-'.$blognlp.'\");\n\n });\n\n });\n </script>';\n }\n echo \"</div>\".$end_wrap;\n if($i == (count($thispost)-1)){\n echo \"</div>\";\n }\n // Without thumbnail\n } else {\n if( $i == 0 ) {\n echo '<div id=\"wrapper-'.$blognlp.'\">';\n }\n echo $begin_wrap.'<div class=\"network-posts blog-'.$blognlp.'\"><h1 class=\"network-posts-title\"><a href=\"'.\n $thispermalink.'\">'.$thispost[$i]->post_title.'</a></h1><span class=\"network-posts-source\"> '.__('published in','trans-nlp').' <a href=\"'\n .$options[0]->option_value.'\">'\n .$options[2]->option_value.'</a>';\n // Full metadata\n if( !empty($full_meta) && $full_meta == 'true' ){\n $format = (string)$options[1]->option_value;\n $dateobj = new DateTime(trim($thispost[$i]->post_date));\n $datepost = $dateobj->format(\"$format\");\n echo ' ' . __('by','trans-nlp'). ' ' . get_the_author_meta( 'display_name' , $thispost[$i]->post_author ) . ' ' . __('on','trans-nlp') . ' ' . $datepost;\n }\n echo '</span><p class=\"network-posts-excerpt\">';\n if( $auto_excerpt == false ) {\n echo custom_excerpt($excerpt_length, $thispost[$i]->post_excerpt, $thispermalink);\n } else {\n $auto_excerpt = auto_excerpt($thispost[$i]->post_content, $excerpt_length, $thispermalink);\n if( preg_match( \"/\\[caption/\", $auto_excerpt ) == true ) {\n echo do_shortcode($auto_excerpt);\n } else {\n echo custom_excerpt($excerpt_length, $auto_excerpt, $thispermalink);\n }\n }\n echo '</p>';\n if( $i == (count($thispost)-1) && $paginate == true ) {\n echo '<div class=\"network-posts-pagination\">';\n echo paginate_links( array(\n 'base' => add_query_arg( 'pnum', '%#%' ),\n 'format' => '',\n 'prev_text' => __('«'),\n 'next_text' => __('»'),\n 'total' => ceil($total / $posts_per_page),\n 'current' => $page,\n 'type' => 'list'\n ));\n echo '</div>';\n echo \n '<script type=\"text/javascript\" charset=\"utf-8\">\n jQuery(document).ready(function(){\n\n jQuery(\".blog-'.$blognlp.' .network-posts-pagination a\").live(\"click\", function(e){\n e.preventDefault();\n var link = jQuery(this).attr(\"href\");\n jQuery(\"#wrapper-'.$blognlp.'\").html(\"<img src=\\\"'.plugins_url('/img/loader.gif', __FILE__) .'\\\" />\");\n jQuery(\"#wrapper-'.$blognlp.'\").load(link+\" .blog-'.$blognlp.'\");\n\n });\n\n });\n </script>';\n }\n echo \"</div>\".$end_wrap;\n if($i == (count($thispost)-1)){\n echo \"</div>\";\n }\n }\n }\n // Otherwise we just show the titles (useful when used as a widget)\n } else {\n // Widget list\n if( $i == 0 ) {\n echo '<div id=\"wrapperw-'.$blognlp.'\">';\n }\n if( preg_match(\"/\\bli\\b/\",$begin_wrap) ) { \n echo $begin_wrap.'<div class=\"network-posts blogw-'.$blognlp.'\"><a href=\"'.$thispermalink\n .'\">'.$thispost[$i]->post_title.'</a>';\n if( $i == (count($thispost)-1) && $paginate == true ) {\n echo '<div class=\"network-posts-pagination\">';\n echo paginate_links( array(\n 'base' => add_query_arg( 'pnum', '%#%' ),\n 'format' => '',\n 'show_all' => false,\n 'prev_text' => __('«'),\n 'next_text' => __('»'),\n 'total' => ceil($total / $posts_per_page),\n 'current' => $page,\n 'type' => 'list'\n ));\n echo '</div>';\n echo \n '<script type=\"text/javascript\" charset=\"utf-8\">\n jQuery(document).ready(function(){\n\n jQuery(\".blogw-'.$blognlp.' .network-posts-pagination a\").live(\"click\", function(e){\n e.preventDefault();\n var link = jQuery(this).attr(\"href\");\n jQuery(\"#wrapperw-'.$blognlp.'\").html(\"<img src=\\\"'.plugins_url('/img/loader.gif', __FILE__) .'\\\" />\");\n jQuery(\"#wrapperw-'.$blognlp.'\").load(link+\" .blogw-'.$blognlp.'\");\n\n });\n\n });\n </script>';\n }\n echo '</div>'.$end_wrap;\n if($i == (count($thispost)-1)){\n echo \"</div>\";\n }\n // Shortcode\n } else {\n if( $i == 0 ) {\n echo '<div id=\"wrapper-'.$blognlp.'\">';\n }\n echo $begin_wrap.'<div class=\"network-posts blog-'.$blognlp.'\"><h1 class=\"network-posts-title\"><a href=\"'.$thispermalink\n .'\">'.$thispost[$i]->post_title.'</a></h1>';\n if( $i == (count($thispost)-1) && $paginate == true ) {\n echo '<div class=\"network-posts-pagination\">';\n echo paginate_links( array(\n 'base' => add_query_arg( 'pnum', '%#%' ),\n 'format' => '',\n 'prev_text' => __('«'),\n 'next_text' => __('»'),\n 'total' => ceil($total / $posts_per_page),\n 'current' => $page,\n 'type' => 'list'\n ));\n echo '</div>';\n echo \n '<script type=\"text/javascript\" charset=\"utf-8\">\n jQuery(document).ready(function(){\n\n jQuery(\".blog-'.$blognlp.' .network-posts-pagination a\").live(\"click\", function(e){\n e.preventDefault();\n var link = jQuery(this).attr(\"href\");\n jQuery(\"#wrapper-'.$blognlp.'\").html(\"<img src=\\\"'.plugins_url('/img/loader.gif', __FILE__) .'\\\" />\");\n jQuery(\"#wrapper-'.$blognlp.'\").load(link+\" .blog-'.$blognlp.'\");\n\n });\n\n });\n </script>';\n }\n echo '</div>'.$end_wrap;\n if($i == (count($thispost)-1)){\n echo \"</div>\";\n }\n }\n }\n }\n // Count only when all posts has been displayed\n $counter++;\n\t\t\t}\n\t\t\t// don't go over the limit of blogs\n\t\t\tif($counter >= $nblogs) {\n break; \n\t\t\t}\n\t\t}\n\t}\n}",
"public function CronNewsAction(){\r\n\t ini_set('max_execution_time', 0);\r\n\t $newsModel = new NewsModel();\r\n\r\n\t $sec_to_delete_news_from_feeds = $this->getParam(\"SEC_TO_DELETE_NEWS_FROM_FEEDS\");\r\n\r\n\t $newsModel -> deleteOldNews(date(\"Y-m-d H:i:s\", time()-$sec_to_delete_news_from_feeds));\t \r\n\t \r\n\t $lastRSS = new lastRSS();\r\n\t $lastRSS->cache_dir = './rss_cache';\r\n $lastRSS->cache_time = 3600; // one hour\r\n \r\n\t $aNewsTreeFeeds = $newsModel -> getAllNewsTreeFeeds(\"\", true, true, true);\r\n\t foreach ($aNewsTreeFeeds as $newsTreeFeeds){\r\n\t \t\t \r\n\t echo $newsTreeFeeds['url'];\r\n\t echo \"<br>\";\r\n\t $aFeeds = $lastRSS->Get($newsTreeFeeds['url']);\r\n\t echo \"<pre>\";\r\n\t //print_r($aFeeds);\r\n\t //print_r($newsTreeFeeds);\r\n\t //echo $newsTreeFeeds['last_parse_date'].\"<br>\";\r\n\t $n = 0;\r\n\t if (is_array($aFeeds) && count($aFeeds)>0 && is_array($aFeeds['items'])){\r\n\t foreach ($aFeeds['items'] as $item){\r\n\t //print_r($item); echo \"<hr>\";\r\n $pubDate = (isset($item['pubDate']))?$item['pubDate']:date(\"Y-m-d H:i:s\");\r\n $title = (isset($item['title']))?$item['title']:\"\";\r\n $link = (isset($item['link']))?$item['link']:\"\";\r\n $description = (isset($item['description']))?$item['description']:\"\";\r\n $category = (isset($item['category']))?$item['category']:\"\";\r\n $enclosure = (isset($item['enclosure']))?$item['enclosure']:\"\";\r\n $enclosure_type = (isset($item['enclosure_type']))?$item['enclosure_type']:\"\";\r\n \r\n if (strtoupper($aFeeds['encoding']) != 'UTF-8' ){\r\n $title = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $title);\r\n $description = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $description);\r\n $category = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $category);\r\n $enclosure = iconv(strtoupper($aFeeds['encoding']), 'UTF-8', $enclosure);\r\n }\r\n\t\t $short_text = $newsModel -> getNWordsFromText($description, 40);\r\n\t\t $pub_date = date(\"Y-m-d H:i:s\", strtotime($pubDate));\r\n\t\t if (!$newsTreeFeeds['category_tag'] || strtoupper($newsTreeFeeds['category_tag']) == strtoupper($category)){\r\n\t\t // if RSS-feeds have different categories => it should be same as in item\r\n\t\t $pub_date_in_sec = strtotime($pub_date);\r\n\t\t if (\r\n\t\t (!$newsTreeFeeds['last_parse_date'] || $newsTreeFeeds['last_parse_date'] < $pub_date) && // check parse date\r\n\t\t (time()-$sec_to_delete_news_from_feeds < $pub_date_in_sec) // check news publication date\r\n\t\t )\r\n\t\t { // not parsed yet\r\n\t\t $n++;\r\n\t\t $newsModel -> addNews(\r\n\t\t $newsTreeFeeds['id'], $title, $link, $short_text, $description, \r\n\t\t $category, $pub_date, $enclosure, $enclosure_type, 0, 0, 0, $newsTreeFeeds['text_parse_type']);\r\n\t\t $newsModel -> setParseDate($newsTreeFeeds['feed_id'], date(\"Y-m-d H:i:s\"));\r\n\t\t }\r\n\t\t }\r\n\t }\r\n\t }\r\n\t echo \"Added \".$n.\" News\";\r\n\t echo \"</pre>\";\r\n\r\n\t echo \"<hr>\";\r\n\t }\r\n\t \r\n\t}",
"protected function schedulePruning()\n {\n $schedule = $this->app->make(Schedule::class);\n $schedule->call(new PruneStaleWysiwygFiles)->daily();\n }",
"public function cron_jobs();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the Root Certification Authority file path. | public function getCertificateAuthority()
{
return $this->rootCertAuthorityFile;
} | [
"public function getCertificateAuthorityPath()\n {\n return $this->certificateAuthorityPath;\n }",
"public function get_certificate_file() {\n return '../data/certificates/' . hash_secure($this->name) . '.crt';\n }",
"public function getCertificateBundle() {\n\t\treturn $this->user->getHome() . '/files_external/rootcerts.crt';\n\t}",
"public static function get_certificate_path()\n {\n }",
"public function getCACertPath()\n\t{\n\t \treturn $this->ca_cert_path;\n\t}",
"protected function getCertsDir()\r\n {\r\n return dirname($this->configFile) . DIRECTORY_SEPARATOR . 'certificates' . DIRECTORY_SEPARATOR;\r\n }",
"public function getRootFile() {\n\t\treturn $this->getFile($this->rootPath);\n\t}",
"public function getCertificatePath()\n\t{\n\t\treturn CLIENT_WEB_DIR . \"/certificates/scorm/\" . $this->object->getId() . \"/\";\n\t}",
"protected function getCACertFilePath()\n {\n return null;\n }",
"public function get_certificate_authority_filename()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! $this->is_loaded)\n $this->configuration = $this->_load_configuration();\n\n // SSL directory\n $dir = SSL::PATH_SSL;\n\n // Default CA section name\n $ca = $this->configuration['ca']['default_ca'];\n\n // Set SSL directory prefix\n // Sanitize/validate other configuration parameters before expansion.\n $this->configuration['global']['dir'] = $dir;\n\n // Expand configuration variables\n $this->_expand_configuration();\n\n // If the CA certification doesn't exist, throw and exception\n $file = new File($this->configuration[$ca]['certificate'], TRUE);\n\n if (!$file->exists())\n throw new Certificate_Not_Found_Exception();\n\n return $this->configuration[$ca]['certificate'];\n }",
"public function getPkcCertPath()\n {\n return $this->paymentHandler->createFilePath($this->pkcCertPath);\n }",
"public function getCertFile()\n {\n return $this->getKey('CertFile');\n }",
"public function issuerPath(): CertificationPath\n {\n return $this->_issuerPath;\n }",
"public function getCaCertificateTemplate(): string\n {\n return $this->_buildPath('ca');\n }",
"public static function getPathToCertificate() {\n return self::$pathToCertificate;\n }",
"public function getCertPath()\n {\n if (!$this->getContent()) {\n throw new LocalizedException(__('The certificate does not exist.'));\n }\n\n $certFileName = sprintf('cert_%s_%s.pfx', $this->getWebsiteId(), strtotime($this->getUpdatedAt()));\n $certFile = self::BASEPATH_CERT.$certFileName;\n\n if (!$this->varDirectory->isExist($certFile)) {\n $this->createCertFile($certFile);\n }\n\n return $this->varDirectory->getAbsolutePath($certFile);\n }",
"public function get_cert_path() {\n\n\t\treturn get_option( 'sv_wc_apple_pay_cert_path' );\n\t}",
"public function getCertificatePath()\n {\n return $this->certificate;\n }",
"static public function root_path()\n\t{\n\t\treturn realpath($_SERVER[\"DOCUMENT_ROOT\"]);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the lists of upgrade steps for the given source | public function getUpgradeSteps(Upgrade $context)
{
return $this->get($context . '_upgrade_steps', []);
} | [
"public function getUpgrades()\n {\n $upgrades = $this->getData('upgrades');\n if (is_array($upgrades)) {\n return $upgrades;\n }\n\n try {\n $dir = $this->getUpgradesPath();\n if (!is_readable($dir)) {\n return array();\n }\n $dir = new DirectoryIterator($dir);\n } catch (Exception $e) {\n // module doesn't has upgrades\n return array();\n }\n\n $upgrades = array();\n foreach ($dir as $file) {\n $file = $file->getFilename();\n if (false === strstr($file, '.php')) {\n continue;\n }\n $upgrades[] = substr($file, 0, -4);\n }\n usort($upgrades, 'version_compare');\n $this->setData('upgrades', $upgrades);\n return $upgrades;\n }",
"public function getPlugins($source);",
"protected function getProcessedUpgrades() {\n\t\treturn $this->config->processed_upgrades;\n\t}",
"public function getUpgradeSteps(Upgrade $context)\n {\n throw new WrongProviderException('Not implemented');\n }",
"public function getUpgrades($context = null) {\n if (! $context) {\n $context = $this->getContext();\n }\n\n if (isset($this->_upgradeStack[$context])) {\n return $this->_upgradeStack[$context];\n }\n return array();\n }",
"public function getUpgradeHistory()\n {\n return $this->upgrade_history;\n }",
"protected function buildDiscoveredDestinationsBySource($version, array $migrations, array $source_system_data) {\n $discovered_upgrade_paths = [];\n $table_data = [];\n foreach ($migrations as $migration) {\n $migration_id = $migration->getPluginId();\n $source_module = $migration->getSourcePlugin()->getSourceModule();\n if (!$source_module) {\n $this->messenger()\n ->addError($this->t('Source module not found for @migration_id.', ['@migration_id' => $migration_id]));\n }\n $destination_module = $migration->getDestinationPlugin()\n ->getDestinationModule();\n if (!$destination_module) {\n $this->messenger()\n ->addError($this->t('Destination module not found for @migration_id.', ['@migration_id' => $migration_id]));\n }\n\n if ($source_module && $destination_module) {\n $discovered_upgrade_paths[$source_module][] = $destination_module;\n $table_data[$source_module][$destination_module][$migration_id] = $migration->label();\n }\n }\n\n // Add entries for the field plugins to discovered_upgrade_paths.\n $definitions = $this->fieldPluginManager->getDefinitions();\n foreach ($definitions as $definition) {\n // This is not strict so that we find field plugins with an annotation\n // where the Drupal core version is an integer and when it is a string.\n if (in_array($version, $definition['core'])) {\n $source_module = $definition['source_module'];\n $destination_module = $definition['destination_module'];\n $discovered_upgrade_paths[$source_module][] = $destination_module;\n $table_data[$source_module][$destination_module][$definition['id']] = $definition['id'];\n }\n }\n ksort($table_data);\n foreach ($table_data as $source_module => $destination_module_info) {\n ksort($table_data[$source_module]);\n }\n $this->discoveredBySource[$version] = array_map('array_unique', $discovered_upgrade_paths);\n }",
"public function getAvailableMigrations($target=null)\n\t{\n\t\t// for normal migration we need all files to target\n\t\t// for rollbacks we need from target to the greatest migration\n\t\t$filter = $this->getFilter();\n\t\tif (!$this->isDownwards($target)) {\n\t\t\tif (null !== $target) {\n\t\t\t\t$filter->setToVersion($target);\n\t\t\t}\n\t\t} else {\t// rollback\n\t\t\t$filter->setFromVersion($target);\n\t\t\t$filter->setToVersion($this->getGreatestMigration());\n\t\t}\n\n\t\t$migration_steps = $this->getMigrationSteps();\n\n\t\t// migrations to be executed\n\t\t$to_execute = array();\n\t\tif ($this->isDownwards($target)) {\n\t\t\t// rollback: execute the common part of $executed and $migration_refs\n\t\t\t$executed = $this->getExecutedMigrations();\n\t\t\tforeach($migration_steps as $ref => $migration_class) {\n\t\t\t\tif (array_key_exists($ref, $executed)) {\n\t\t\t\t\t$to_execute[] = $ref;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// migration: execute what's missing - the different of $executed and $available\n\t\t\t$to_execute = array_diff(array_keys($migration_steps), array_keys($this->getExecutedMigrations()));\n\t\t}\n\t\t\n\t\t// go through $to_execute and find the migration steps\n\t\t$migrations = array();\n\t\tforeach ($to_execute as $ref) {\n\t\t\t$migrations[$ref] = $migration_steps[$ref];\n\t\t}\n\t\t\n\t\t// sort migrations according to filter and target\n\t\t// remove one so that to avoid executing target in the case of rollback\n\t\t$this->sortMigrations($migrations, $target);\n\t\tif ($this->isDownwards($target)) {\n\t\t\tarray_pop($migrations);\n\t\t}\n\t\treturn $migrations;\n\t}",
"function getModInstallerSteps()\n\t{\n\t\t$steps = array();\n\n\t\t// Support for mod installer\n\t\t$pluginsDir = null;\n\t\tif (is_dir($this->readmeFileDir.'/plugins/'))\n\t\t\t$pluginsDir = $this->readmeFileDir.'/plugins/';\n\t\telseif (is_dir($this->readmeFileDir.'/files/plugins/'))\n\t\t\t$pluginsDir = $this->readmeFileDir.'/files/plugins/';\n\t\telse\n\t\t\treturn $steps;\n\n\t\t$d = dir($pluginsDir);\n\t\twhile ($f = $d->read())\n\t\t{\n\t\t\tif (substr($f, 0, 1) == '.')\n\t\t\t\tcontinue;\n\n\t\t\t// Mod installer\n\t\t\tif (is_dir($pluginsDir.'/'.$f) && file_exists($pluginsDir.'/'.$f.'/search_insert.php'))\n\t\t\t{\n\t\t\t\trequire $pluginsDir.'/'.$f.'/search_insert.php';\n\t\t\t\t$list_files = array();\n\t\t\t\t$list_base = array();\n\t\t\t\t// Do not modify the order below, otherwise some mods cannot be installed\n\t\t\t\t// 1st files_to_insert - 2nd files_to_add - 3rd files_to_replace - 4th files_to_move\n\t\t\t\tif (isset($files_to_insert))\n\t\t\t\t\t$list_files[] = \"files_to_insert\";\n\t\t\t\tif (isset($files_to_add))\n\t\t\t\t\t$list_files[] = \"files_to_add\";\n\t\t\t\tif (isset($files_to_replace))\n\t\t\t\t\t$list_files[] = \"files_to_replace\";\n\t\t\t\tif (isset($files_to_move))\n\t\t\t\t{\n\t\t\t\t\t$list_files[] = \"files_to_move\";\n\t\t\t\t\t$move_start = \"//modif oto - mod \"/*.$mod_config['mod_name']*/.\" - Beginning of the block moved\\n\";\n\t\t\t\t\t$move_end = \"//modif oto - mod \"/*.$mod_config['mod_name']*/.\" - End of the block moved\\n\";\n\t\t\t\t}\n\t\t\t\t// Database to modify\n\t\t\t\tif (isset($fields_to_add))\n\t\t\t\t\t$list_tables[] = \"fields_to_add\";\n\t\t\t\tif (isset($config_to_insert))\n\t\t\t\t\t$list_tables[] = \"config_to_insert\";\n\n\t\t\t\t// is there database modifications to do?\n\t\t\t\tif (!empty($list_tables))\n\t\t\t\t{\n\t\t\t\t\t$code_array = array();\n\t\t\t\t\tglobal $db;\n\n\t\t\t\t\tforeach ($list_tables as $base_name)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach($$base_name as $table_value)\n\t\t\t\t\t\t{//$table_value is name of table for modifications\n\t\t\t\t\t\t\tif ($base_name == \"fields_to_add\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor ($i =0 ; $i < count($add_field_name[$table_value]); $i++)\n\t\t\t\t\t\t\t\t\t// If the field already exist there is no error.\n\t\t\t\t\t\t\t\t\t$code_array[] = '$db->add_field(\\''.$table_value.'\\', \\''.$add_field_name[$table_value][$i].'\\', \\''.$add_field_type[$table_value][$i].'\\', \\''.$add_allow_null[$table_value][$i].'\\', \\''.$add_default_value[$table_value][$i].'\\') or error(\\'Unable to add column '.$add_field_name[$table_value][$i].' to table '.$table_value.'\\', __FILE__, __LINE__, $db->error());';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telseif ($base_name == \"config_to_insert\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sql = \"REPLACE INTO `\".$db->prefix.$table_value.\"` (`conf_name`, `conf_value`) VALUES \";\n\t\t\t\t\t\t\t\tfor ($i = 0; $i < count($values[$table_value]); $i = $i + 2)\n\t\t\t\t\t\t\t\t\t$sql .= \"(\\'\".$db->escape($values[$table_value][$i]).\"\\', \\'\".$db->escape($values[$table_value][$i+1]).\"\\'),\";\n\n\t\t\t\t\t\t\t\t$sql = substr($sql, 0, -1);\n\t\t\t\t\t\t\t\t$code_array[] = '$db->query(\\''.$sql.'\\') or error(\\'Unable to INSERT values INTO '.$table_value.'\\', __FILE__, __LINE__, $db->error());';\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\t$steps[] = array('action' => 'RUN CODE', 'code' => 'if ($this->patcher->actionType == \\'install\\')'.\"\\n{\\n\".implode(\"\\n\", $code_array).\"\\n}\\n\");\n\t\t\t\t}\n\n\t\t\t\tforeach ($list_files as $file_name)\n\t\t\t\t{\n\t\t\t\t\tforeach ($$file_name as $file_value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$steps[] = array('command' => 'OPEN', 'code' => $file_value);\n\n\t\t\t\t\t\tlist($name_file,$ext_file) = explode('.', $file_value);\n\n\t\t\t\t\t\tif ($file_name == \"files_to_insert\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Inserting the code before an existing line.\n\t\t\t\t\t\t\tfor($i = 0; $i < count($insert_file[$name_file]); $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$steps[] = array('command' => 'FIND', 'code' => $search_file[$name_file][$i]);\n\t\t\t\t\t\t\t\t$steps[] = array('command' => 'BEFORE ADD', 'code' => $insert_file[$name_file][$i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($file_name == \"files_to_add\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Adding the code after an existing line.\n\t\t\t\t\t\t\tfor($i = 0; $i < count($insert_add_file[$name_file]); $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$steps[] = array('command' => 'FIND', 'code' => $search_add_file[$name_file][$i]);\n\t\t\t\t\t\t\t\t$steps[] = array('command' => 'AFTER ADD', 'code' => $insert_add_file[$name_file][$i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ($file_name == \"files_to_replace\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Replacing an existing code by another one.\n\t\t\t\t\t\t\tfor($i=0; $i < count($insert_replace_file[$name_file]); $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$steps[] = array('command' => 'FIND', 'code' => $search_replace_file[$name_file][$i]);\n\t\t\t\t\t\t\t\t$steps[] = array('command' => 'REPLACE', 'code' => $insert_replace_file[$name_file][$i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// currently unsupported\n/*\t\t\t\t\t\telseif ($file_name == \"files_to_move\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Move code between two lines to another location\n\t\t\t\t\t\t\tfor ($i=0; $i < count($move_get_start[$name_file]); $i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$pos_start = strpos($file_content, $move_get_start[$name_file][$i]) + strlen($move_get_start[$name_file][$i]);\n\t\t\t\t\t\t\t\t$pos_end = strpos($file_content, $move_get_end[$name_file][$i]);\n\t\t\t\t\t\t\t\t$move_string = substr($file_content, $pos_start, $pos_end - $pos_start);\n\n\t\t\t\t\t\t\t\t$searching[] = $move_get_start[$name_file][$i].$move_string.$move_get_end[$name_file][$i];\n\t\t\t\t\t\t\t\t$replacement[] = $move_get_start[$name_file][$i].$move_get_end[$name_file][$i];\n\t\t\t\t\t\t\t\t$searching[] = $move_to_start[$name_file][$i].$move_to_end[$name_file][$i];\n\t\t\t\t\t\t\t\t$replacement[] = $move_to_start[$name_file][$i].$move_start.$move_string.$move_end.$move_to_end[$name_file][$i];\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\t}\n\t\t\t// Mod installer\n\t\t\tif (is_dir($pluginsDir.'/'.$f) && file_exists($pluginsDir.'/'.$f.'/update_install.php'))\n\t\t\t{\n\t\t\t\t$code = 'if ($this->patcher->actionType == \\'install\\')'.\"\\n{\\n?>\".file_get_contents($pluginsDir.'/'.$f.'/update_install.php').\"<?php\\n\".'}';\n\t\t\t\tif (file_exists($pluginsDir.'/'.$f.'/update_uninstall.php'))\n\t\t\t\t\t$code .= \"\\n\\n\".'if ($this->patcher->actionType == \\'uninstall\\')'.\"\\n{\\n?>\".file_get_contents($pluginsDir.'/'.$f.'/update_uninstall.php').\"<?php\\n\".'}';\n\n\t\t\t\t$code = str_replace('?><?php', '', $code);\n\t\t\t\t$steps[] = array('command' => 'RUN CODE', 'code' => $code);\n\t\t\t}\n\t\t}\n\n\t\treturn $steps;\n\t}",
"public function getStepHistory();",
"public function getDifferringRevisionIdsOnSource();",
"function lg_addon_update_register_source( $sources )\n\t{\n\t\tglobal $EXT;\n\t\t// -- Check if we're not the only one using this hook\n\t\tif($EXT->last_call !== FALSE)\n\t\t\t$sources = $EXT->last_call;\n\n\t\t// add a new source\n\t\t// must be in the following format:\n\t\t/*\n\t\t<versions>\n\t\t\t<addon id='LG Addon Updater' version='2.0.0' last_updated=\"1218852797\" docs_url=\"http://leevigraham.com/\" />\n\t\t</versions>\n\t\t*/\n\t\tif($this->settings['check_for_updates'] == 'y')\n\t\t{\n\t\t\t$sources[] = 'http://leevigraham.com/version-check/versions.xml';\n\t\t}\n\n\t\treturn $sources;\n\n\t}",
"static function getPulldownFromSource($source){\n\t\t// Get arguments\n\t\t$args = null;\n\t\tpreg_match('(\\(\\'.*\\'\\))', $source, $matches);\n\t\tif((sizeof($matches) == 1)) {\n\t\t\t// Args are included into the source\n\t\t\t$args = split(\"','\", substr($matches[0], 2, (strlen($matches[0]) - 4)));\n\t\t\t$source = str_replace($matches[0], '', $source);\n\t\t}\n\n\t\tlist($pulldown_model, $pulldown_function) = split('::', $source);\n\t\t$pulldown_plugin = NULL;\n\t\tif (strpos($pulldown_model,'.') !== false){\n\t\t\t$combined_plugin_model_name = $pulldown_model;\n\t\t\tlist($pulldown_plugin, $pulldown_model) = explode('.',$combined_plugin_model_name);\n\t\t}\n\n\t\t$pulldown_result = array();\n\t\tif ($pulldown_model && ($pulldown_model_object = AppModel::getInstance($pulldown_plugin, $pulldown_model, true))){\n\t\t\t// run model::function\n\t\t\t$pulldown_result = $pulldown_model_object->{$pulldown_function}($args);\n\t\t}\n\n\t\treturn $pulldown_result;\n\t}",
"public static function get_extraction_rules_and_types( $source ) {\n\t\t// Get the rules and the types and merge them into one array\n\t\t$rules = self::get_extraction_rules( $source );\n\t\t$types = self::get_extraction_rule_types( $source );\n\t\t$rules_and_types = array_combine( $rules, $types );\n\n\t\t// Builtin rules\n\t\t$builtin_rules = self::get_built_in_rules();\n\n\t\t// Return the finished array of extraction rules\n\t\treturn array_merge( $rules_and_types, $builtin_rules );\n\t}",
"function lg_addon_update_register_source( $sources )\n\t{\n\t\tglobal $EXT;\n\n\t\t// Check if we're not the only one using this hook\n\t\tif($EXT->last_call !== FALSE) $sources = $EXT->last_call;\n\n\t\t// add a new source\n\t\t// must be in the following format:\n\t\t/*\n\t\t<versions>\n\t\t\t<addon id='LG Addon Updater' version='2.0.0' last_updated=\"1218852797\" docs_url=\"http://leevigraham.com/\" />\n\t\t</versions>\n\t\t*/\n\t\tif($this->settings['check_for_updates'] == 'y' && $this->settings['enable'] == 'y')\n\t\t{\n\t\t\t$sources[] = 'http://leevigraham.com/version-check/versions.xml';\n\t\t}\n\n\t\treturn $sources;\n\n\t}",
"function yourls_upgrade($step, $oldver, $newver, $oldsql, $newsql ) {\n\n /**\n * Sanitize input. Two notes :\n * - they should already be sanitized in the caller, eg admin/upgrade.php\n * (but hey, let's make sure)\n * - some vars may not be used at the moment\n * (and this is ok, they are here in case a future upgrade procedure needs them)\n */\n $step = intval($step);\n $oldsql = intval($oldsql);\n $newsql = intval($newsql);\n $oldver = yourls_sanitize_version($oldver);\n $newver = yourls_sanitize_version($newver);\n\n yourls_maintenance_mode(true);\n\n // special case for 1.3: the upgrade is a multi step procedure\n\tif( $oldsql == 100 ) {\n\t\tyourls_upgrade_to_14( $step );\n\t}\n\n\t// other upgrades which are done in a single pass\n\tswitch( $step ) {\n\n\tcase 1:\n\tcase 2:\n\t\tif( $oldsql < 210 )\n\t\t\tyourls_upgrade_to_141();\n\n\t\tif( $oldsql < 220 )\n\t\t\tyourls_upgrade_to_143();\n\n\t\tif( $oldsql < 250 )\n\t\t\tyourls_upgrade_to_15();\n\n\t\tif( $oldsql < 482 )\n\t\t\tyourls_upgrade_482(); // that was somewhere 1.5 and 1.5.1 ...\n\n\t\tif( $oldsql < 506 ) {\n /**\n * 505 was the botched update with the wrong collation, see #2766\n * 506 is the updated collation.\n * We want :\n * people on 505 to update to 506\n * people before 505 to update to the FIXED complete upgrade\n */\n\t\t\tif( $oldsql == 505 ) {\n yourls_upgrade_505_to_506();\n } else {\n yourls_upgrade_to_506();\n }\n }\n\n\t\tyourls_redirect_javascript( yourls_admin_url( \"upgrade.php?step=3\" ) );\n\n\t\tbreak;\n\n\tcase 3:\n\t\t// Update options to reflect latest version\n\t\tyourls_update_option( 'version', YOURLS_VERSION );\n\t\tyourls_update_option( 'db_version', YOURLS_DB_VERSION );\n yourls_maintenance_mode(false);\n\t\tbreak;\n\t}\n}",
"public function getAllVotesForSource($source){\n return $this->JACKED->MySQL->getRows($this->config->dbt_votes, 'Source = \\'' . $source . '\\'');\n }",
"protected function getPlugins() {\n $source = $this->migration->get('source');\n\n // Declare some default plugins.\n $plugins = [\n 'data_fetcher' => 'file',\n 'data_parser' => 'json',\n ];\n\n // Data fetcher.\n if (isset($source['data_fetcher_plugin'])) {\n $plugins['data_fetcher'] = $source['data_fetcher_plugin'];\n }\n\n // Data parser.\n if (isset($source['data_parser_plugin'])) {\n $plugins['data_parser'] = $source['data_parser_plugin'];\n }\n\n return $plugins;\n }",
"function lg_addon_update_register_source($sources)\n\t{\n\t\tglobal $EXT;\n\t\t\n\t\t// Retrieve the data from the previous call, if applicable.\n\t\tif ($EXT->last_call !== FALSE)\n\t\t{\n\t\t\t$sources = $EXT->last_call;\n\t\t}\n\t\t\n\t\t// Register a new source.\n\t\tif ($this->settings[$this->site_id]['update_check'] == 'y')\n\t\t{\n\t\t\t$sources[] = 'http://labs.fusionary.com/ee/versions.xml';\n\t\t}\n\t\t\n\t\treturn $sources;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Due date distance in words | public function due_date_distance_in_words($date) {
$ret = null;
if ($date) {
$time = strtotime($date);
$now = time();
$days = (integer) (abs($time - $now) / (60 * 60 * 24)) .__('days');
if ($time < $now) {
$ret = sprintf(__('%s late'),$days);
} else {
$ret = sprintf(__('Due in %s'),$days);
}
}
return $ret;
} | [
"function distance_of_time_in_words($from_time, $to_time)\n{\n\t$distance_in_minutes = abs($to_time - $from_time) / 60;\n\tif ($distance_in_minutes <= 44)\n\t\treturn c(round($distance_in_minutes), 'less than a minute', 'one minute', '%s minutes');\n\telseif ($distance_in_minutes <= 1439)\n\t\treturn c(round($distance_in_minutes / 60), 'about one hour', 'about one hour', 'about %s hours');\n\telseif ($distance_in_minutes <= 43199)\n\t\treturn c(round($distance_in_minutes / 1440), 'one day', 'one day', '%s days');\n\telseif ($distance_in_minutes <= 525599)\n\t\treturn c(round($distance_in_minutes / 43200), 'about one month', 'about one month', 'about %s months');\n\telse\n\t{\n\t\t$distance_in_years = $distance_in_minutes / 525600;\n\t\t$minute_offset_for_leap_year = ($distance_in_years / 4) * 1440;\n\t\t$remainder = ($distance_in_minutes - $minute_offset_for_leap_year) % 525600;\n\t\tif ($remainder < 131400)\n\t\t\treturn c(round($distance_in_years), 'about one year', 'about one year', 'about %s years');\n\t\telseif ($remainder < 394200)\n\t\t\treturn c(round($distance_in_years), 'over one year', 'over one year', 'over %s years');\n\t\telse\n\t\t\treturn c(round($distance_in_years + 1), 'almost one year', 'almost one year', 'almost %s years');\n\t}\n}",
"function domingos()\n{\n\t$fecha1[0] = 3; $fecha1[1] = 3; $fecha1[2] = 2003;\n\t$fecha2[0] = date(\"d\"); $fecha2[1] = date(\"m\"); $fecha2[2] = date(\"Y\");\n\t\n\t$dias_diferencia = calcular_dias_fecha($fecha2, $fecha1);\n\t\n\t$total = round($dias_diferencia / 7);\n\t\n\treturn $total;\n}",
"public function dateDifferential()\n {\n if (Carbon::now()->lessThan(Carbon::parse($this->start_date))) {\n return Carbon::parse($this->start_date)->diffInDays(Carbon::now()) . ' hari lagi';\n } elseif (Carbon::now()->lessThanOrEqualTo(Carbon::parse($this->finish_date))) {\n return 'sedang berlangsung';\n } else {\n return Carbon::parse($this->finish_date)->diffInDays(Carbon::now()) . ' hari yang lalu';\n }\n }",
"public function getDateAddedInWords()\n {\n $timeAgo = new \\TimeAgo();\n return $timeAgo->inWords($this->getDateAdded()->format('Y-m-d H:i:s'));\n }",
"public function testDateAgoInWordsNegativeValues(): void\n {\n $date = new Date('-2 months -2 days');\n $result = $date->timeAgoInWords(['end' => '3 month']);\n $this->assertSame('2 months, 2 days ago', $result);\n\n $date = new Date('-2 months -2 days');\n $result = $date->timeAgoInWords(['end' => '3 month']);\n $this->assertSame('2 months, 2 days ago', $result);\n\n $date = new Date('-2 months -2 days');\n $result = $date->timeAgoInWords(['end' => '1 month', 'format' => 'yyyy-MM-dd']);\n $this->assertSame('on ' . date('Y-m-d', strtotime('-2 months -2 days')), $result);\n\n $date = new Date('-2 years -5 months -2 days');\n $result = $date->timeAgoInWords(['end' => '3 years']);\n $this->assertSame('2 years, 5 months, 2 days ago', $result);\n\n $date = new Date('-2 weeks -2 days');\n $result = $date->timeAgoInWords(['format' => 'yyyy-MM-dd']);\n $this->assertSame('2 weeks, 2 days ago', $result);\n\n $date = new Date('-3 years -12 months');\n $result = $date->timeAgoInWords();\n $expected = 'on ' . $date->format('n/j/y');\n $this->assertSame($expected, $result);\n\n $date = new Date('-1 month -1 week -6 days');\n $result = $date->timeAgoInWords(\n ['end' => '1 year', 'accuracy' => ['month' => 'month']]\n );\n $this->assertSame('1 month ago', $result);\n\n $date = new Date('-1 years -2 weeks -3 days');\n $result = $date->timeAgoInWords(\n ['accuracy' => ['year' => 'year']]\n );\n $expected = 'on ' . $date->format('n/j/y');\n $this->assertSame($expected, $result);\n\n $date = new Date('-13 months -5 days');\n $result = $date->timeAgoInWords(['end' => '2 years']);\n $this->assertSame('1 year, 1 month, 5 days ago', $result);\n }",
"public function calculateDistance()\n {\n if ($this->isBothEmpty()) return \"Both strings are empty. The minimum Edit Distance is 0\";\n if (!$this->isSameLength()) return \"Not of same length! Hamming can not be performed. Refer to Levenshtein\";\n return $this->calculate();\n }",
"public static function num_count($date)\r\n { \r\n \r\n $domain = str_word_count($date);\r\n echo \"Solution 5: </br>\";\r\n\r\n echo'Number of words --> '.$domain.\"\\r\"; \r\n\r\n }",
"public static function lpos_diff() {\n \n\tglobal $thislink;\n\tassert_link();\n\t\n\tif($thislink['date']) {\n\t\treturn time() - $thislink['date'] ;\n\t} else {\n\t\treturn 0;\n\t\t}\n }",
"function getdays($date1,$date2)\r\n {\r\n return round((strtotime($date2)-strtotime($date1))/(24*60*60),0);\r\n }",
"function getReferredDays() {\n\t\t$upl = new DateTime($this->getUploadDate());\n\t\t$reg = new DateTime($this->_User->getRegistered());\n\t\t$diff = $upl->diff($reg);\n\t\treturn $diff->format('%a');\n\t}",
"function getDistanceByCommonUniqueChars($word1,$word2)\n{\n\t$word1Arr = preg_split('//u', $word1, -1, PREG_SPLIT_NO_EMPTY);\n $word2Arr = preg_split('//u', $word2, -1, PREG_SPLIT_NO_EMPTY);\n\n \n $uniqueCommonChars = array_unique(array_intersect($word1Arr, $word2Arr));\n \n $commonChars = implode($uniqueCommonChars);\n \n $extraPoints = 0;\n \n\n //echoN(\"$word1,$word2 $commonChars\");\n // if tword 1 mtches word2 in both first and last character then add more similarity score\n if ( current($uniqueCommonChars)==current($word2Arr) )\n {\n \n \t$extraPoints = $extraPoints+1;\n }\n \n if ( end($uniqueCommonChars)==end($word2Arr) )\n {\n \n \t$extraPoints = $extraPoints+1;\n }\n \n \n \n\n \n return (mb_strlen($commonChars)+$extraPoints);\n}",
"public function estimatedDays();",
"function invoice_calc_duedate($date)\n{\n\tlog_debug(\"inc_invoices\", \"Executing invoice_calc_duedate($date)\");\n\t\n\t// get the terms\n\t$terms = sql_get_singlevalue(\"SELECT value FROM config WHERE name='ACCOUNTS_TERMS_DAYS' LIMIT 1\");\n\n\t// break up the date, and reconfigure\n\t$date_array\t= explode(\"-\", $date);\n\t$timestamp\t= mktime(0, 0, 0, $date_array[1], ($date_array[2] + $terms), $date_array[0]);\n\n\t// generate the date\n\treturn date(\"Y-m-d\", $timestamp);\n}",
"function calc_utf_date_diff( $upper_date, $lower_date )\n{\n $time_diff = $upper_date - $lower_date;\n $minutes_diff = $time_diff/60;\n\n return $minutes_diff;\n}",
"function dates_difference($date1, $date2) {\n\t$day_of_year1 = intval($date1->format(\"z\"));\t//The day of the year (starting from 0)\n\t$day_of_year2 = intval($date2->format(\"z\"));\n\treturn $day_of_year2 - $day_of_year1;\n}",
"public function testDateAgoInWordsAccuracy(string $class): void\n {\n $date = new $class('+8 years +4 months +2 weeks +3 days');\n $result = $date->timeAgoInWords([\n 'accuracy' => ['year' => 'year'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years';\n $this->assertSame($expected, $result);\n\n $date = new $class('+8 years +4 months +2 weeks +3 days');\n $result = $date->timeAgoInWords([\n 'accuracy' => ['year' => 'month'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years, 4 months';\n $this->assertSame($expected, $result);\n\n $date = new $class('+8 years +4 months +2 weeks +3 days');\n $result = $date->timeAgoInWords([\n 'accuracy' => ['year' => 'week'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years, 4 months, 2 weeks';\n $this->assertSame($expected, $result);\n\n $date = new $class('+8 years +4 months +2 weeks +3 days');\n $result = $date->timeAgoInWords([\n 'accuracy' => ['year' => 'day'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years, 4 months, 2 weeks, 3 days';\n $this->assertSame($expected, $result);\n\n $date = new $class('+1 years +5 weeks');\n $result = $date->timeAgoInWords([\n 'accuracy' => ['year' => 'year'],\n 'end' => '+10 years',\n ]);\n $expected = '1 year';\n $this->assertSame($expected, $result);\n\n $date = new $class('now');\n $result = $date->timeAgoInWords([\n 'accuracy' => 'day',\n ]);\n $expected = 'today';\n $this->assertSame($expected, $result);\n }",
"public function testTimeAgoInWordsAccuracy(): void\n {\n $time = new DateTime('+8 years +4 months +2 weeks +3 days');\n $result = $time->timeAgoInWords([\n 'accuracy' => ['year' => 'year'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+8 years +4 months +2 weeks +3 days');\n $result = $time->timeAgoInWords([\n 'accuracy' => ['year' => 'month'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years, 4 months';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+8 years +4 months +2 weeks +3 days');\n $result = $time->timeAgoInWords([\n 'accuracy' => ['year' => 'week'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years, 4 months, 2 weeks';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+8 years +4 months +2 weeks +3 days');\n $result = $time->timeAgoInWords([\n 'accuracy' => ['year' => 'day'],\n 'end' => '+10 years',\n ]);\n $expected = '8 years, 4 months, 2 weeks, 3 days';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+1 years +5 weeks');\n $result = $time->timeAgoInWords([\n 'accuracy' => ['year' => 'year'],\n 'end' => '+10 years',\n ]);\n $expected = '1 year';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+58 minutes');\n $result = $time->timeAgoInWords([\n 'accuracy' => 'hour',\n ]);\n $expected = 'in about an hour';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+23 hours');\n $result = $time->timeAgoInWords([\n 'accuracy' => 'day',\n ]);\n $expected = 'in about a day';\n $this->assertSame($expected, $result);\n\n $time = new DateTime('+20 days');\n $result = $time->timeAgoInWords(['accuracy' => 'month']);\n $this->assertSame('in about a month', $result);\n }",
"function GetDiffDays($dt1, $dt2){\n \n list($dia1, $mes1, $anio1) = explode( '/', $dt1); \n list($dia2, $mes2, $anio2) = explode( '/', $dt2);\n \n //calculo timestam de las dos fechas \n $timestamp1 = mktime(0,0,0,$mes1,$dia1,$anio1); \n $timestamp2 = mktime(4,12,0,$mes2,$dia2,$anio2); \n\n //resto a una fecha la otra \n $segundos_diferencia = $timestamp1 - $timestamp2; \n //echo $segundos_diferencia; \n\n //convierto segundos en días \n $dias_diferencia = $segundos_diferencia / (60 * 60 * 24); \n\n //obtengo el valor absoulto de los días (quito el posible signo negativo) \n $dias_diferencia = abs($dias_diferencia); \n\n //quito los decimales a los días de diferencia \n $dias_diferencia = floor($dias_diferencia); \n\n return $dias_diferencia; \n}",
"function DateDifference($date1,$date2) {\n\t$date_1 = strtotime($date1);\n $date_2 = strtotime($date2);\n \n // Find the difference \n $difference = abs($date_2 - $date_1);\n\n // Find the year difference\n $years = floor($difference / (365 * 60 * 60 * 24));\n \n // Find the months difference\n $months = floor(($difference - $years * 365 * 60 * 60 * 24 ) /\n\t\t (30 * 60 * 60 * 24));\n\n // Find the day difference\n $days = floor(($difference - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 ) /\n\t\t (60 * 60 * 24));\n \n return printf(\"\\n%d years, %d months, %d days\", $years,$months,$days);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajax callback to replace the content sandwich artist settings. | public function updateSelectedContentSandwichArtist(array &$form, FormStateInterface $form_state) {
$response = new AjaxResponse();
$response->addCommand(new ReplaceCommand(
'#content-sandwich-artist',
$form['content_sandwich_artist_settings']
));
return $response;
} | [
"public function set_js()\n {\n $is_assets_installed = array_key_exists('assets', ee()->addons->get_installed()) ? 'y' : 'n';\n\n ee()->javascript->set_global('publisher.is_assets_installed', $is_assets_installed);\n\n ee()->javascript->set_global('publisher.ajax_get_category',\n $this->mod_link('ajax_get_category', array('type' => 'category')));\n\n ee()->javascript->set_global('publisher.ajax_save_category',\n $this->mod_link('ajax_save_category', array('type' => 'category')));\n\n ee()->javascript->set_global('publisher.ajax_get_phrase',\n $this->mod_link('ajax_get_phrase', array('type' => 'phrase')));\n\n ee()->javascript->set_global('publisher.ajax_save_phrase',\n $this->mod_link('ajax_save_phrase', array('type' => 'phrase')));\n\n ee()->javascript->set_global('publisher.ajax_deny_approval',\n $this->mod_link('ajax_deny_approval'));\n\n ee()->javascript->set_global('publisher.ajax_get_translation_status',\n $this->mod_link('ajax_get_translation_status'));\n\n ee()->javascript->set_global('publisher.ajax_get_entry_status',\n $this->mod_link('ajax_get_entry_status'));\n\n // ee()->javascript->set_global('publisher.ajax_get_approval_status',\n // $this->mod_link('ajax_get_approval_status'));\n }",
"public function displayAjaxChangeCustomDisplayedName()\n {\n $this->ajax_json['success'] = false;\n $custom_displayed_name = (int) Tools::getValue('custom_displayed_name');\n $id_product = (int) Tools::getValue('id_product');\n if (!$id_product) {\n exit(Tools::jsonEncode($this->ajax_json));\n }\n $product_setting = new HsMaProductSetting($id_product);\n $product_setting->id_product = (int) $id_product;\n $product_setting->custom_displayed_name = (int) $custom_displayed_name;\n $this->ajax_json['success'] = $product_setting->save();\n $this->ajax_json['message'] = $this->module->i18n['data_saved'];\n exit(Tools::jsonEncode($this->ajax_json));\n }",
"public function ajax_config_theme() {\n\t\tif ( ! wp_verify_nonce( $_GET['_wpnonce'], 'soo_demo_import' ) ) {\n\t\t\twp_send_json_error( esc_html__( 'Verifing failed', 'soodi' ) );\n\t\t\teixt;\n\t\t}\n\n\t\t$demo = $_GET['demo'];\n\n\t\t// Setup pages\n\t\t$this->setup_pages( $demo );\n\n\t\t// Setup menu locations\n\t\t$this->setup_menus( $demo );\n\n\t\t// Update options\n\t\t$this->update_options( $demo );\n\n\t\twp_send_json_success( esc_html__( 'Finish setting up front page and blog page.', 'soodi' ) );\n\t}",
"function overlay_ajax() {\n $sURL = (isset($_GET['url'] ))? $_GET['url'] : '';\n $url = $this->action_url( $sURL );\n $urlIsFile = strpos($sURL, '/File:');\n //$source_url = esc_url( urldecode( $sURL ) );\n \n $sRemove = (isset($_GET['remove'] ))? $_GET['remove'] : '';\n $remove = esc_attr( urldecode( $sRemove ) );\n \n $sTitle = (isset($_GET['title'] ))? $_GET['title'] : '';\n $title = '';\n if(FALSE !== $urlIsFile){\n $sTitle = stripslashes ($sTitle);\n $sTitle = self::entitiesPlain($sTitle);\n }else{\n $title = esc_html( urldecode( $sTitle ) ); \n }\n\n\n $plain_html = (isset($_GET['plain_html'] ))? $_GET['plain_html'] : '';\n //$source_url = $this->remove_action_render( $source_url );\n\n // constuct \n $sWikiEmbedURL = (isset($_GET['wikiembed-url'] ))? $_GET['wikiembed-url'] : '';\n $wiki_page_id = esc_url( $sWikiEmbedURL ).\",\";\n \n if(empty($this->options['default']['accordion']))$this->options['default'] += array('accordion' => '2');\n if(empty($this->options['default']['tabs']))$this->options['default'] += array('tabs' => '1');\n if(empty($this->options['default']['no-contents']))$this->options['default'] += array('no-contents' => '1');\n if(empty($this->options['default']['no-edit']))$this->options['default'] += array('no-edit' => '1');\n if(empty($this->options['default']['no-infobox']))$this->options['default'] += array('no-infobox' => '0');\n if(empty($this->options['default']['source']))$this->options['default'] += array('source' => '1');\n if ( $this->options['default']['tabs'] == 2 ) $wiki_page_id .= \"accordion,\";\n if ( $this->options['default']['tabs'] == 1 ) $wiki_page_id .= \"tabs,\";\n if ( $this->options['default']['no-contents'] ) $wiki_page_id .= \"no-contents,\";\n if ( $this->options['default']['no-infobox'] ) $wiki_page_id .= \"no-infobox,\";\n if ( $this->options['default']['no-edit'] ) $wiki_page_id .= \"no-edit,\";\n\n $wiki_page_id = substr( $wiki_page_id, 0, -1 );\n\n $content = $this->get_wiki_content(\n $url,\n $this->options['default']['accordion']=='2',\n $this->options['default']['tabs']=='1',\n $this->options['default']['no-contents'],\n $this->options['default']['no-edit'],\n $this->options['default']['no-infobox'],\n $this->options['wiki-links'],\n $this->options['default']['source'],\n $remove\n );\n\n if ( $plain_html ):\n echo $content;\n else:\n ?>\n <!doctype html>\n\n <!--[if lt IE 7 ]> <html class=\"ie6\" <?php language_attributes(); ?>> <![endif]-->\n <!--[if IE 7 ]> <html class=\"ie7\" <?php language_attributes(); ?>> <![endif]-->\n <!--[if IE 8 ]> <html class=\"ie8\" <?php language_attributes(); ?>> <![endif]-->\n <!--[if (gte IE 9)|!(IE)]><!--> <html <?php language_attributes(); ?>> <!--<![endif]-->\n <head>\n <meta http-equiv=\"Content-Type\" content=\"<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>\" />\n <title><?php echo urldecode(esc_attr($_GET['title'])); ?></title>\n\n <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js\"></script>\n <link media=\"screen\" href=\"<?php echo bloginfo('stylesheet_url')?>\" type=\"text/css\" rel=\"stylesheet\" >\n <link media=\"screen\" href=\"<?php echo plugins_url('/resources/css/wiki-embed.css', __FILE__) ; ?>\" type=\"text/css\" rel=\"stylesheet\" >\n <link media=\"screen\" href=\"<?php echo plugins_url('/resources/css/wiki-overlay.css', __FILE__) ; ?>\" type=\"text/css\" rel=\"stylesheet\" >\n <script src=\"<?php echo plugins_url('/resources/js/wiki-embed-overlay.js', __FILE__) ; ?>\" ></script>\n </head>\n <body>\n <div id=\"wiki-embed-iframe\">\n <div class=\"wiki-embed-content\">\n <h1 class=\"wiki-embed-title\" ><?php echo $title; ?>\n </h1>\n <?php\n if(FALSE !== $urlIsFile){\n echo $sTitle;\n }else{\n echo $content; \n }\n ?>\n </div>\n </div>\n </body>\n </html>\n <?php\n endif;\n die(); // don't need any more help \n }",
"protected function onUpdateAjax() {}",
"public function ajax_widget_settings()\n\t{\n\t\t$wgt = $this->EE->input->get('wgt');\n\n\t\tif(array_key_exists($wgt, $this->_widgets))\n\t\t{\n\t\t\t$widget = $this->_widgets[$wgt];\n\n\t\t\t$obj = $this->_get_widget_object($widget['mod'],$widget['wgt']);\n\t\t\techo $obj->settings_form(json_decode($widget['stng']));\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo '<p>Widget could not be found.</p>';\n\t\t}\n\t}",
"public function ajax_load_settings_editor() {\n\t\t$slide_settings = json_decode( stripslashes( $_POST['data'] ), true );\n\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\n\t\t$content_type = isset( $slide_settings['content_type'] ) ? $slide_settings['content_type'] : $slide_default_settings['content_type']['default_value'];\n\n\t\tinclude( 'views/settings-editor.php' );\n\n\t\tdie();\n\t}",
"function settings_callback() {}",
"function easy_modal_ajax() {\r\n // get the submitted parameters\r\n\tforeach ($_POST as $key => $value) {\r\n\t\t$_POST[$key] = mysql_real_escape_string($value);\r\n\t}\r\n\textract($_POST);\r\n \r\n global $eModal, $post;\r\n\t$settings = $eModal->getAdminOptions($modalId);?>\r\n \r\n <h1 class='eM-title'><?php echo $settings['title'] ?></h1><?php \r\n\t\techo apply_filters('the_content',do_shortcode($settings['content']));\r\n\r\n // IMPORTANT: don't forget to \"exit\"\r\n\t\r\n exit;\r\n}",
"function wp_ajax_update_widget() {}",
"function mbtpro_amazon_affiliate_settings_init() {\n\tremove_filter('mbt_affiliate_settings_render', 'mbt_amazon_affiliate_settings_render');\n\tadd_filter('mbt_affiliate_settings_render', 'mbtpro_amazon_affiliate_settings_render');\n\tadd_action('mbt_settings_save', 'mbtpro_amazon_affiliate_settings_save');\n\tadd_action('wp_ajax_mbtpro_amazon_affiliate_code_refresh', 'mbtpro_amazon_affiliate_code_refresh_ajax');\n}",
"public function set_elementor_ajax() {\n\t\t\t$this->is_elementor_ajax = true;\n\t\t}",
"protected function _process_ajax() {}",
"function load_artist()\n{\n global $mysqli;\n //BLOCK:\n //artist_name<-link artist website\n //artist_desc\n $artist_id = get_get(\"artist_id\");\n if ($artist_id){\n $query = \"SELECT * FROM artist WHERE artist_id = $artist_id\";\n $res = $mysqli->query($query);\n if ($res->num_rows)\n {\n $r = $res->fetch_assoc();\n $artist_name = world_link($r[\"artist_name\"], $r[\"artist_website\"]);\n $edit = \"\";\n if (dj())\n $edit = tiny_form(\"edit_artist\", \"Edit\", \"artist_id\", $artist_id);\n //form w/ set_id hiddin and name = \"edit_artist\"\n echo(block($artist_name, \"\", $r[\"artist_desc\"], \"\", $edit));\n $query =\"SELECT track.track_id,\n TIME(start) as start_time,\n start, track_name,\n album.album_id,\n album_name,\n label.label_name,\n album_website,\n artist_name,\n label_website, duration,\n dj.dj_id,\n length,\n dj_name,\n sets.show_name,\n sets.set_id\n FROM track_played INNER JOIN\n dj ON dj.dj_id = track_played.dj_id\n INNER JOIN sets\n ON track_played.set_id = sets.set_id\n INNER JOIN track\n on track_played.track_id = track.track_id\n LEFT OUTER JOIN artist\n on track.artist_id = artist.artist_id\n LEFT OUTER JOIN album\n on track.album_id = album.album_id\n LEFT OUTER JOIN label\n on album.label_name = label.label_name\n WHERE artist.artist_id = $artist_id\n GROUP BY track.track_id\n ORDER BY start DESC\";\n $query = str_replace(\"\\r\\n\",\" \", $query);\n\n $res = $mysqli->query($query);\n if ($res && $res->num_rows > 0){\n $r = $res->fetch_assoc();\n table_title(\"Recently Played Tracks by \".$r[\"artist_name\"].\":\");\n table_start();\n echo(hline(array(\n \n hcell(\"Name\", \"track_name name\"),\n hcell(\"Album\", \"album_name name\"),\n hcell(\"Label\", \"label_name name\"),\n \n //hcell(\"Length\", \"time duration\"),\n //hcell(\"Last Play\", \"datetime start\"),\n hcell(\"On Show\", \"Show_name name\"),\n hcell(\"Set Link\", \"set_id website\"),\n hcell(\"Played By\", \" dj_name name\" ),\n \n \n )));\n $i = 1;\n while($r){\n \n \n \n $track_name = local_link($r[\"track_name\"], \"search.php?search=\".urlencode($r[\"track_name\"]).\"&type=all&submit_search=Search\");\n\n $album_name = world_link($r[\"album_name\"], $r[\"album_website\"]);\n $label_name = world_link($r[\"label_name\"], $r[\"label_website\"]);\n $length = $r[\"length\"];\n $start=$r[\"start\"];\n $show_name = local_link($r[\"show_name\"], \"show.php?show_name=\".urlencode($r[\"show_name\"]));\n $set = local_link(\"Set\", \"set.php?set_id=\".$r[\"set_id\"]);\n $dj_name = local_link($r[\"dj_name\"], \"dj.php?dj_id=\".$r[\"dj_id\"]);\n \n \n echo(line(array(\n cell($track_name, \"track_name name\"),\n cell($album_name, \"album name name\"),\n cell($label_name, \"label_name name\"),\n //cell($length, \"length time\"),\n //cell($start, \"datetime time\"),\n cell($show_name, \"show_name name\"),\n cell($set, \"set_link link\"), \n cell($dj_name, \"dj_name name\")\n\n \n )));\n $r = $res->fetch_assoc();\n }\n table_stop();\n }\n else\n print_error_message(\"no tracks found\");\n }\n else print_error_message(\"artist not found\");\n \n //LINE:\n //set_tracks\n //start\n //track_name\n //artist <--link artist?artist_id=$artist_id\n //album <--link album_website\n //label <--link label_website\n //show_name <--link to show.php?show_name=$show_name\n //set <--No description, or id, just \"set\" with link to set.php?set_id=$set_id\n //dj <--link dj.php?dj_id=$dj_id\n //duration\n \n\n \n \n}\n}",
"public function ajax_load_thumbnail_editor() {\n\t\t$slide_default_settings = BQW_SliderPro_Settings::getSlideSettings();\n\n\t\t$data = json_decode( stripslashes( $_POST['data'] ), true );\n\t\t$content_type = isset( $_POST['content_type'] ) ? $_POST['content_type'] : $slide_default_settings['content_type']['default_value'];\n\t\t$content_class = $content_type === 'custom' ? 'custom' : 'dynamic';\n\n\t\tinclude( 'views/thumbnail-editor.php' );\n\n\t\tdie();\n\t}",
"function admin_updatefeaturedartist() {\n\t\t$errorMsg = '';\n\t\t$this->Featuredartist->id = $this -> data[ 'Artist' ][ 'id' ];\n\t\t$artistName = '';\n\t\tif(isset($_REQUEST[ 'artistName' ])){\n\t\t\t$artistName = $_REQUEST[ 'artistName' ];\n\t\t}\n\t\t$artist = '';\n\t\tif(isset($_REQUEST[ 'artistName' ])){\n\t\t\t$artist = $_REQUEST[ 'artistName' ];\n\t\t} else{\n\t\t\t$artist = $this->data[ 'Artist' ][ 'artist_name' ];\n\t\t}\n\t\tif(isset($_REQUEST[ 'album' ])){\n\t\t\t$album = $_REQUEST[ 'album' ];\n\t\t} else{\n\t\t\t$album = $this->data[ 'Artist' ][ 'album' ];\n\t\t}\n\t\tif( $artist == '' ) {\n\t\t\t$errorMsg .= 'Please select an Artist.<br/>';\n\t\t}\n\t\tif( $this -> data[ 'Artist' ][ 'territory' ] == '' ) {\n\t\t\t$errorMsg .= 'Please Choose a Territory';\n\t\t}\n\t\tif( $album == '' ) {\n\t\t\t$errorMsg .= 'Please select an Album.<br/>';\n\t\t}\n\t\t$updateArr = array();\n\t\t$updateArr[ 'id' ] = $this -> data[ 'Artist' ][ 'id' ];\n\t\t$updateArr[ 'artist_name' ] = $artist;\n\t\t$updateArr[ 'territory' ] = $this -> data[ 'Artist' ][ 'territory' ];\n\t\t$updateArr[ 'language' ] = Configure::read('App.LANGUAGE');\n\t\t$updateArr[ 'album' ] = $album;\n\t\t$updateObj = new Featuredartist();\n\t\tif( empty( $errorMsg ) ) {\n\t\t\tif( $updateObj -> insert( $updateArr ) ){\n\t\t\t\t$this -> Session -> setFlash( 'Data has been updated successfully!', 'modal', array( 'class' => 'modal success' ) );\n\t\t\t\t$this -> redirect( 'managefeaturedartist' );\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this -> Session -> setFlash( $errorMsg, 'modal', array( 'class' => 'modal problem' ) );\n\t\t\t$this -> redirect( 'managefeaturedartist' );\n\t\t}\n\t\t$memcache = new Memcache;\n\t\t$memcache->addServer(Configure::read('App.memcache_ip'), 11211);\n\t\tmemcache_delete($memcache, Configure::read('App.memcache_key').\"_featured_u_s\");\n\t\tmemcache_delete($memcache, Configure::read('App.memcache_key').\"_featured_c_a\");\n\t\tmemcache_delete($memcache, Configure::read('App.memcache_key').\"_featured_i_t\");\n\t\tmemcache_delete($memcache, Configure::read('App.memcache_key').\"_featured_n_z\");\n\t\tmemcache_delete($memcache, Configure::read('App.memcache_key').\"_featured_a_u\");\n\t\tmemcache_close($memcache);\n\t}",
"static function save_custom_global_style_ajaxify() {\n\n\t\tcheck_ajax_referer( 'tb_load_nonce', 'nonce' );\n\t\t$data = $response = array();\n\t\tif ( isset( $_POST['form_data'] ) ) {\n\t\t\tparse_str( $_POST['form_data'], $data );\n\t\t\t$insert_post = self::add_new( $data );\n\t\t\tif ( false === $insert_post ) {\n\t\t\t\t$response['status'] = 'failed';\n\t\t\t\t$response['msg'] = __( 'Something went wrong', 'themify' );\n\t\t\t} else {\n\t\t\t\t$response['status'] = 'success';\n\t\t\t\t$response['url'] = $insert_post['url'] . '#builder_active';\n\t\t\t}\n\t\t}\n\t\twp_send_json( $response );\n\t}",
"public function set_get_js(){\n\t\t//@\n\t\t$change_function = sprintf('\n\t\t<script>\n\t\t//! for typing on santri field\n function change_kalender_add(){\n\t\t\tvar url \t\t= \t\"%1$s\";\n\t\t\tvar postData = $(\"#%2$s\").serializeArray();\n $.ajax({\n\t\t\t url:url,\n data : postData,\n\t\t\t\tdataType: \"json\",\n success:function(result){\n\t\t\t\t\t$(\"#%3$s\").val(result.%3$s);\n\t\t\t\t\t$(\"#%4$s\").val(result.%4$s);\n\t\t\t\t}\n\t\t\t}); // end of ajax\n\t\t\tevent.preventDefault(); // disable normal form submit behavior\n\t\t\treturn false; // prevent further bubbling of event \n }\n\t\t</script>\n\t\t',$this->get_url_cha_id_kal() ,$this->get_form_name(), $this->get_session_name() , $this->get_event_name()\n\t\t);\n\t\t$js = $change_function;\n\t\t$js .= sprintf(\n\t\t'\n\t\t<script>\t\t\t\n\t\t\t$(function() {\n\t\t\t\taddTextAreaCallback(document.getElementById(\"%5$s\"), change_kalender_add\t, 200 );\n\t\t\t\t$(\"#%1$s\").click(function(){\n\t\t\t\t\t$(\"#%2$s\").modal({keyboard: true});\t\n\t\t\t\t});\n\t\t\t\t$(\"#%4$s\").click(function(){\n\t\t\t\t\t$(\"#%3$s\").submit();\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t})\t\t\n\t\t</script>' , $this->get_button_name() , $this->get_dialog_name() , $this->get_form_name(),$this->get_submit_name(),\n\t\t$this->get_id_kalender_name()\n\t\t);\t\t\n\t\treturn $js;\t\t\n\t}",
"function wp_ajax_update_welcome_panel()\n {\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
UpdateStatement ::= UpdateClause [WhereClause] | public function UpdateStatement()
{
$updateStatement = new AST\UpdateStatement($this->UpdateClause());
$updateStatement->whereClause = $this->lexer->isNextToken(Lexer::T_WHERE) ? $this->WhereClause() : null;
return $updateStatement;
} | [
"abstract public static function updates($clause = \"\");",
"function compileQueryUpdate(array $statement);",
"function walkUpdateClause($updateClause);",
"public function walkUpdateClause($updateClause);",
"function updateStmt()\n {\n }",
"private function evaluateUpdate(Statement $statement)\n\t\t{\n\t\t\t$TABLES = $this->evaluateTables($statement);\n\t\t\t$SETS = $this->evaluateSets($statement);\n\t\t\t$WHERE = $this->evaluateWhere($statement);\t\t\t\n\t\t\t\n\t\t\treturn \n\t\t\t\t'UPDATE ' . $TABLES .\n\t\t\t\t' SET ' . $SETS .\n\t\t\t\t$WHERE;\n\t\t}",
"public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }",
"public function compileUpdate(Update $query) : CompiledQuery;",
"private function getUpdateQuery()\n {\n if (isset($this->parts['from'][0]['alias'])) {\n $fromClause = $this->parts['from'][0]['alias'].' FROM '.$this->getFromClause();\n } else {\n $fromClause = $this->parts['from'][0]['table'];\n }\n\n $setClause = array();\n\n foreach ($this->parts['set'] as $idenfier => $value) {\n $setClause[] = $this->getExpressionBuilder()->equal($idenfier, $value);\n }\n\n return 'UPDATE '.$fromClause.\n ' SET '.implode(', ', $setClause).\n (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null);\n }",
"public function update(): UpdateQuery;",
"public function forUpdate($sql);",
"public function exec_UPDATEquery($table, $where, $fields_values, $no_quote_fields = false);",
"function update($table, $assocArray, $clause)\n\t{ \n\t\t$where = \"\";\n\t\t$columns = \"\";\n\t\tforeach ($clause as $key => $value) {\n\t\t\t$where .= \" and \" .$key. \" = \".\"'\".$value.\"'\";\n\t\t}\n\t\tforeach ($assocArray as $key => $value) {\n\t\t\t$columns .= $key. \" = \".\"'\".$value.\"'\".\", \";\n\t\n\t\t}\n\t\t$columns = rtrim($columns,\", \");\n\t\t$result = $this->db->query(\"UPDATE $table SET $columns WHERE 1=1 \".$where);\n return $result;\n }",
"function parseUpdate() {\n $sql_object = new SqlUpdate();\n $this->getToken();\n if ($this->token == 'identifier') {\n $sql_object->addTable($this->lexer->tokenText);\n }\n else {\n throw new SqlParserException('Expected table name', $this->token, $this->lexer);\n }\n\n $this->parseSetFields($sql_object);\n\n while (!is_null($this->token) && $this->token != ')' && $this->token != ')') {\n switch ($this->token) {\n case 'where':\n $conditional = $this->parseSearchClause();\n $sql_object->setConditional($conditional);\n break;\n\n case 'order':\n $this->parseOrderBy($sql_object);\n break;\n\n case 'limit':\n $this->parseLimit($sql_object);\n break;\n\n case ';':\n // @todo: handle multiple sql strings.\n $this->getToken();\n continue;\n\n default:\n throw new SqlParserException('Unexpected clause', $this->token, $this->lexer);\n }\n }\n return $sql_object;\n }",
"protected function compileUpdate()\n\t{\n\t\t$params = [];\n\t\t$query = 'UPDATE ';\n\t\t$query .= $this->quoteTable($this->table) . ' ';\n\t\t$query .= 'SET ';\n\n\t\t$separator = '';\n\t\tforeach ($this->values as $identifier => $value) {\n\t\t\t$query .= $separator . $this->quoteIdentifier($identifier) . ' = ';\n\t\t\tlist($valueQuery, $valueParams) = $this->compileValue($value, $identifier);\n\t\t\t$params = array_merge($params, $valueParams);\n\t\t\t\n\t\t\t\n\t\t\t$query .= $valueQuery;\n\t\t\t$separator = ', ';\n\t\t}\n\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\treturn [$query, $params];\n\t}",
"public function compilePreparedUpdate(Table $table, array $updateColumns, array $whereColumnNameParameterMap);",
"public function is_update_statement(): bool\n {\n $sql = $this->get_query();\n return StatementTypes::is_update_statement($sql);\n }",
"function executeUpdate($query, array $parameters = array(), array $types = array());",
"public function forUpdate($sqlQuery) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtener todos los torrents de un usuario. | private function getTorrentsCliente() {
$configuracionVO = $this->getGestor()->loadConfiguracionVO();
$transmission = $this->getTransmissionObject($configuracionVO);
$rutasUsuario = $this->getGestor()->getRutasTorrents();
$torrents = array();
foreach($transmission->all() as $torrent) {
foreach($rutasUsuario as $ruta) {
$rutaExplode = explode("/", $torrent->getDownloadDir());
if($ruta == $rutaExplode[count($rutaExplode) - 1]) {
array_push($torrents, array(
"idTorrent" => $torrent->getId(),
"nombre" => $torrent->getName(),
"ratioDescarga" => $torrent->getDownloadRate() / 1000000,
"tiempoEstimado" => $torrent->getEta(),
"completado" => $torrent->getPercentDone(),
"finalizado" => $torrent->isFinished(),
"rutaBBDD" => $ruta,
"isPausado" => ($torrent->getStatus() == 0 ? true : false)
));
}
}
}
$this->updateTorrentsFinalizados($torrents, $transmission);
return $torrents;
} | [
"public function getRutasTorrents() {\n\t\treturn $this->getGestorTorrent()->getRutasTorrents($_SESSION[\"idUsuario\"]);\n\t}",
"public function getRutasTorrents($conn, $idUsuario) {\n $ret = array();\n $sql = \"SELECT codigoTorrent FROM Torrent WHERE idUsuario = \". $idUsuario .\" AND finalizado = 0\";\n\n $result = $conn->query($sql);\n\n if($result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n array_push($ret, $row[\"codigoTorrent\"]);\n }\n }\n\n return $ret;\n }",
"public function cargarUsuarios(){\n\t\t$usuarios = new usuario();\n\t\t$usuarios->search_clause = '1';\n\t\t$this->usuarios = $usuarios->read('id,email,password,nombre,tipo_usuario');\n\t}",
"public function getAllTorrents(){\n $results = $this->db_connection->query( \"SELECT * FROM Torrents;\" ); \n return $this->buildTorrentInfoHelper( $results ); \n }",
"public function getTodosUsuarios(){\n $usuarios=$this->selectDB(\n \"*\",\n \"users\",\n \"\",\n array(\n )\n );\n return $usuarios;\n }",
"public function todosUsuarios ()\r\n\t{\r\n\r\n\t\t$busca = $this->queryExec (\"SELECT * FROM usuarios\", [], false);\r\n\t\t\treturn $busca->fetchAll ();\r\n\t\t\t\r\n\t}",
"public function buscarTodosUsuarios()\n {\n $temp = [];\n $temp = $this->usuarioDao->selectALL();\n return $temp;\n }",
"public function getAllTodosToUser(){\n \n if(isset($_GET['id'])){\n $id=$_GET['id'];\n $todo = new Todo();\n $todo->setSlug('todos?userId='.$id);//slug para saber a que url hacer la peticion\n $userTodos=$todo->getTodosToUser();\n\n //obtener datos del usuario\n $userId=$userTodos[0]->{'userId'};\n $user=$this->getUser($userId);\n \n //vista a mostrar\n require_once 'views/todo/show.php';\n }\n }",
"static function ListarUsuarios(){\n $objDB = AccesoDatos::DameUnObjetoAcceso();\n\t\t $consulta = $objDB->RetornarConsulta(\"SELECT nombre,apellido,mail,estado,turno,admin,pathFoto,id FROM usuarios\");\n $consulta->execute();\n return $consulta->fetchAll(PDO::FETCH_OBJ);\n }",
"public function getAllUserTweeter();",
"function listar_usuarios()\n\t{\n\t\n\t\t$sql_usuarios ='SELECT * FROM usuarios;';\n\t\t$stmt2 = $this->instancia_conexion->Consulta($sql_usuarios);\n\t\n\t\t$usuarios=array();\n\t\n\t\twhile ($registro = $this->instancia_conexion->LeeRegistro($stmt2))\n\t\t{\n\t\t\t$usuarios[]=$registro;\n\t\t}\n\t\n\t\treturn $usuarios;\n\t}",
"function getAllUsers(){\n \n $archivo = file_get_contents('users.json');\n $usuariosJson = explode(PHP_EOL, $archivo);\n array_pop($usuariosJson);\n $finalUsers = [];\n\n foreach($usuariosJson as $usuario){\n $finalUsers[] = json_decode($usuario, true);\n\n }\n return $finalUsers;\n }",
"public function getListaUsuarioPago()\r\n\t\t{\r\n\t\t\treturn ArrayHelper::map(self::findUsuarioPagoRecibo(), 'usuario', 'nombre');\r\n\t\t}",
"public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}",
"public function listarUsuarios ()\n\t{\n\t\t$retorno = array ();\n\n\t\t$resultado = $this->consulta (\"SELECT usuario.id, CONCAT(usuario.apellidos,', ',usuario.nombre) as nombre FROM usuario WHERE id !=\".$this->idusuario().\" ORDER BY usuario.apellidos \");\n\t\t\t\t\n\t\tif ($resultado != null)\n\t\t\twhile ($obj = $resultado->fetch_object())\n\t\t \t\t$retorno[] = $obj;\n\t\t \t\n\t return $retorno;\t\t\n\t}",
"public function listaUsuarios(){\n $this->load->model('usuario_model');\n $usuarios = $this->usuario_model->obtener_todos();\n $this->asignarDatosVista('usuarios',$usuarios);\n $this->mostrarVista('usuarios/listaUsuarios');\n }",
"public function listarUsuarios(){\n $listaActivos=[];\n $listaUsuarios = $this->buscar(null);\n if(count($listaUsuarios)>0){\n foreach ($listaUsuarios as $usuario){\n if($usuario->getUsactivo()==1){\n $roles=[];\n // $datosUSuario va a guardar un obj usuario y un array de roles de dicho usuario\n $datosUsuario=[];\n $usuarioRol= new AbmUsuariorol();\n $roles=$usuarioRol->buscarRolesUsuario($usuario);\n array_push($datosUsuario,$usuario);\n array_push($datosUsuario,$roles);\n array_push($listaActivos, $datosUsuario);\n }\n }\n }\n return $listaActivos;\n }",
"public function colecaoUsuarioTarefas()\n\t{\n\t\t$query = $this->db->prepare(\"select usuarios.id as idUsuario, tarefas.id as idTarefas, \n nome, login, perfil, usuarios.dataCadastro as usuarioDataDoCadastro,\n titulo, texto, tarefas.dataCadastro as tarefasDataDoCadastro,\n situacao, dataAcao, criadorDaTarefa, vinculoUsuario \n from usuarios join tarefas on tarefas.criadorDaTarefa = \n usuarios.id order by tarefas.id desc\");\n\t\t\n $query->execute();\n\t\treturn $query->fetchAll(PDO::FETCH_OBJ);\n\t}",
"function obtenerUsuarios(){\n $db = obtenerBaseDeDatos();\n $sentencia = $db->query(\"SELECT * FROM usuarios\");\n return $sentencia->fetchAll(); \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
public function update6(Store2tqf5 $request, $id) | public function update6($id)
{
$tqf5 = tqf5::findOrFail($id);
$validatedData = $request->validated();
$tqf5->fill($validatedData);
$tqf5->save();
// $request->session()->flash('status','tqf5 was updated!');
// return redirect()->route('tqf5.index');
return redirect()->route('tqf5.show', compact('tqf5'));
} | [
"public function update(StoreTqf5 $request, $id)\n {\n $tqf5 = Tqf5::findOrFail($id);\n $validatedData = $request->validated();\n $tqf5->fill($validatedData);\n $tqf5->save();\n $request->session()->flash('status','TQF5 was updated!');\n return redirect()->route('tqf5.index');\n }",
"public function updatedSaleById(Request $request, $id);",
"public function update($id, UpdateTest3Request $request)\n\t{\n\t\t$test3 = Test3::findOrFail($id);\n\n \n\n\t\t$test3->update($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.test3.index');\n\t}",
"public function updatedbookById(Request $request, $id);",
"public function update_topicSaleOff(Request $request, $id){\n\n }",
"public function update($id, UpdateStoreReviewRequest $request)\n {\n $this->storeReviewRepository->pushCriteria(new StoreReviewsOfUserCriteria(auth()->id()));\n $storeReview = $this->storeReviewRepository->findWithoutFail($id);\n\n if (empty($storeReview)) {\n Flash::error('Store Review not found');\n return redirect(route('storeReviews.index'));\n }\n $input = $request->all();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->storeReviewRepository->model());\n try {\n $storeReview = $this->storeReviewRepository->update($input, $id);\n\n\n foreach (getCustomFieldsValues($customFields, $request) as $value) {\n $storeReview->customFieldsValues()\n ->updateOrCreate(['custom_field_id' => $value['custom_field_id']], $value);\n }\n } catch (ValidatorException $e) {\n Flash::error($e->getMessage());\n }\n\n Flash::success(__('lang.updated_successfully', ['operator' => __('lang.store_review')]));\n\n return redirect(route('storeReviews.index'));\n }",
"public function update($id, UpdateE3debatec3m1Request $request)\n {\n $e3debatec3m1 = $this->e3debatec3m1Repository->find($id);\n\n if (empty($e3debatec3m1)) {\n Flash::error('E3Debatec3M1 not found');\n\n return redirect(route('e3debatec3m1s.index'));\n }\n\n $e3debatec3m1 = $this->e3debatec3m1Repository->update($request->all(), $id);\n\n Flash::success('E3Debatec3M1 updated successfully.');\n\n return redirect(route('e3debatec3m1s.index'));\n }",
"public function update($id, UpdateF2debatec3m1Request $request)\n {\n $f2debatec3m1 = $this->f2debatec3m1Repository->find($id);\n\n if (empty($f2debatec3m1)) {\n Flash::error('F2Debatec3M1 not found');\n\n return redirect(route('f2debatec3m1s.index'));\n }\n\n $f2debatec3m1 = $this->f2debatec3m1Repository->update($request->all(), $id);\n\n Flash::success('F2Debatec3M1 updated successfully.');\n\n return redirect(route('f2debatec3m1s.index'));\n }",
"public function updateShowtime(Request $request, $id);",
"public function update($id, Request $request)\n {\n\n \n $data = $this->getData($request);\n \n $buySms = BuySms::findOrFail($id);\n $buySms->update($data);\n\n return redirect()->route('buy_sms.buy_sms.index')\n ->with('success_message', 'Buy Sms was successfully updated.');\n\n }",
"public function update($id, UpdateFQAsRequest $request)\n\t{\n\t\t$fQAs = $this->fQAsRepository->find($id);\n\n\t\tif(empty($fQAs))\n\t\t{\n\t\t\tFlash::error('FQAs not found');\n\n\t\t\treturn redirect(route('fQAs.index'));\n\t\t}\n\n\t\t$this->fQAsRepository->updateRich($request->all(), $id);\n\n\t\tFlash::success('FQAs updated successfully.');\n\n\t\treturn redirect(route('fQAs.index'));\n\t}",
"public function update(StoreShippingMethodRequest $request, $id)\n {\n $this->shippingMethodService->update($request, $id); \n return redirect('/shippingMethods')->with('success','The shipping method modifyed successfully!');\n }",
"public function update($id, Updatecategoria_espRequest $request)\n {\n $categoriaEsp = $this->categoriaEspRepository->findWithoutFail($id);\n\n if (empty($categoriaEsp)) {\n Flash::error('No s\\'ha trobat cap categoria específica');\n\n return redirect(route('categoriaEsps.index'));\n }\n\n $categoriaEsp = $this->categoriaEspRepository->update($request->all(), $id);\n\n Flash::success('S\\'ha actualitzat la categoria específica correctament');\n\n return redirect(route('categoriaEsps.index'));\n }",
"public function update($id , $data)\n {\n //\n\n }",
"public function update($id, UpdateFunctionsRequest $request)\n\t{\n\t\t$functions = Functions::findOrFail($id);\n\n \n\n\t\t$functions->update($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.functions.index');\n\t}",
"public function update($id, UpdateF3exercicioc1m2Request $request)\n {\n $f3exercicioc1m2 = $this->f3exercicioc1m2Repository->find($id);\n\n if (empty($f3exercicioc1m2)) {\n Flash::error('F3Exercicioc1M2 not found');\n\n return redirect(route('f3exercicioc1m2s.index'));\n }\n\n $f3exercicioc1m2 = $this->f3exercicioc1m2Repository->update($request->all(), $id);\n\n Flash::success('F3Exercicioc1M2 updated successfully.');\n\n return redirect(route('f3exercicioc1m2s.index'));\n }",
"public function updateItem($id, Request $request, \\App\\Models\\Boekenkast $Boekenkast){\n $Boekenkast::where('user_id', '=', $id)->update(['item_id_slot' . $request->slot => $request->item_id]);\n return;\n }",
"public function update($id, UpdateGodStaffsRequest $request)\n\t{\n\t\t$godstaffs = GodStaffs::findOrFail($id);\n\n $request = $this->saveFiles($request);\n\n\t\t$a =$godstaffs->update($request->all());\n\t\tif ($request->shopslist_id ==1) {\n\t\t\treturn redirect()->route(config('quickadmin.route').'.godstaffs.index');\n\t\t}else{\n\t\t\tif ($request->shopslist_id == 2) {\n\t\t\t\treturn redirect()->route('admin.godstaffs.gigolo');\n\t\t\t}else{\n\t\t\t\treturn redirect()->route('admin.godstaffs.g5');\n\t\t\t}\n\t\t}\n\t}",
"public function update($id, UpdateE3exercicioc1m1Request $request)\n {\n $e3exercicioc1m1 = $this->e3exercicioc1m1Repository->find($id);\n\n if (empty($e3exercicioc1m1)) {\n Flash::error('E3Exercicioc1M1 not found');\n\n return redirect(route('e3exercicioc1m1s.index'));\n }\n\n $e3exercicioc1m1 = $this->e3exercicioc1m1Repository->update($request->all(), $id);\n\n Flash::success('E3Exercicioc1M1 updated successfully.');\n\n return redirect(route('e3exercicioc1m1s.index'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flags the Auspost instance as StarTrack | public function useStarTrack() {
$this->account_number = $this->raw_account;
return $this;
} | [
"private function tracking_enabled()\n {\n }",
"function setTracking($bol)\n{\n}",
"function TrackOpens($trackopens=false)\n\t{\n\t\t$this->trackopens = (bool)$trackopens;\n\t}",
"public static function slimtrack() {\n\t\tself::$stat[ 'dt' ] = self::date_i18n( 'U' );\n\n\t\tif ( empty( self::$stat[ 'notes' ] ) ) {\n\t\t\tself::$stat[ 'notes' ] = array();\n\t\t}\n\n\t\t// Allow third-party tools to initialize the stat array\n\t\tself::$stat = apply_filters( 'slimstat_filter_pageview_stat_init', self::$stat );\n\n\t\t// Third-party tools can decide that this pageview should not be tracked, by setting its datestamp to zero\n\t\tif ( empty( self::$stat ) || empty( self::$stat[ 'dt' ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Reset the pageview ID, if it's set for some obscure reason\n\t\tunset( self::$stat[ 'id' ] );\n\n\t\t// Opt-out of tracking via cookie\n\t\tif ( self::$settings[ 'display_opt_out' ] == 'on' ) {\n\t\t\t$cookie_names = array( 'slimstat_optout_tracking' => 'true' );\n\n\t\t\tif ( !empty( self::$settings[ 'opt_out_cookie_names' ] ) ) {\n\t\t\t\t$cookie_names = array();\n\n\t\t\t\tforeach ( self::string_to_array( self::$settings[ 'opt_out_cookie_names' ] ) as $a_cookie_pair ) {\n\t\t\t\t\tlist( $name, $value ) = explode( '=', $a_cookie_pair );\n\n\t\t\t\t\tif ( !empty( $name ) && !empty( $value ) ) {\n\t\t\t\t\t\t$cookie_names[ $name ] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ( $cookie_names as $a_name => $a_value ) {\n\t\t\t\tif ( isset( $_COOKIE[ $a_name ] ) && strpos( $_COOKIE[ $a_name ], $a_value ) !== false ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Opt-in tracking via cookie (only those who have a cookie will be tracked)\n\t\tif ( !empty( self::$settings[ 'opt_in_cookie_names' ] ) ) {\n\t\t\t$cookie_names = array();\n\t\t\t$opt_in_cookie_names = self::string_to_array( self::$settings[ 'opt_in_cookie_names' ] );\n\n\t\t\tforeach ( $opt_in_cookie_names as $a_cookie_pair ) {\n\t\t\t\tlist( $name, $value ) = explode( '=', $a_cookie_pair );\n\n\t\t\t\tif ( !empty( $name ) && !empty( $value ) ) {\n\t\t\t\t\t$cookie_names[ $name ] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t$cookie_found = false;\n\t\t\tforeach ( $cookie_names as $a_name => $a_value ) {\n\t\t\t\tif ( isset( $_COOKIE[ $a_name ] ) && $_COOKIE[ $a_name ] == $a_value ) {\n\t\t\t\t\t$cookie_found = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$cookie_found ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// IP address\n\t\tlist ( self::$stat[ 'ip' ], self::$stat[ 'other_ip' ] ) = self::_get_remote_ip();\n\n\t\tif ( empty( self::$stat[ 'ip' ] ) || self::$stat[ 'ip' ] == '0.0.0.0' ) {\n\t\t\t$error = self::_log_error( 202 );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Should we ignore this IP address?\n\t\tforeach ( self::string_to_array( self::$settings[ 'ignore_ip' ] ) as $a_ip_range ) {\n\t\t\t$ip_to_ignore = $a_ip_range;\n\n\t\t\tif ( strpos( $ip_to_ignore, '/' ) !== false ) {\n\t\t\t\tlist( $ip_to_ignore, $cidr_mask ) = explode( '/', trim( $ip_to_ignore ) );\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$cidr_mask = self::_get_mask_length( $ip_to_ignore );\n\t\t\t}\n\n\t\t\t$long_masked_ip_to_ignore = substr( self::_dtr_pton( $ip_to_ignore ), 0, $cidr_mask );\n\t\t\t$long_masked_user_ip = substr( self::_dtr_pton( self::$stat[ 'ip' ] ), 0, $cidr_mask );\n\t\t\t$long_masked_user_other_ip = substr( self::_dtr_pton( self::$stat[ 'other_ip' ] ), 0 , $cidr_mask );\n\n\t\t\tif ( $long_masked_user_ip === $long_masked_ip_to_ignore || $long_masked_user_other_ip === $long_masked_ip_to_ignore ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Do we need to anonymize this IP address?\n\t\tif ( self::$settings[ 'anonymize_ip' ] == 'on' ) {\n\t\t\t// IPv4 or IPv6\n\t\t\t$needle = '.';\n\t\t\t$replace = '.0';\n\t\t\tif ( self::_get_mask_length( self::$stat[ 'ip' ] ) == 128 ) {\n\t\t\t\t$needle = ':';\n\t\t\t\t$replace = ':0000';\n\t\t\t}\n\n\t\t\tself::$stat[ 'ip' ] = substr( self::$stat[ 'ip' ], 0, strrpos( self::$stat[ 'ip' ], $needle ) ) . $replace;\n\n\t\t\tif ( !empty( self::$stat[ 'other_ip' ] ) ) {\n\t\t\t\tself::$stat[ 'other_ip' ] = substr( self::$stat[ 'other_ip' ], 0, strrpos( self::$stat[ 'other_ip' ], $needle ) ) . $replace;\n\t\t\t}\n\t\t}\n\n\t\t// Resource URL\n\t\tif ( !isset( self::$stat[ 'resource' ] ) ) {\n\t\t\tself::$stat[ 'resource' ] = self::get_request_uri();\n\t\t}\n\n\t\t// Is this a 'seriously malformed' URL?\n\t\t$parsed_url = parse_url( self::$stat[ 'resource' ] );\n\t\tif ( !$parsed_url ) {\n\t\t\t$error = self::_log_error( 203 );\n\t\t\treturn false;\n\t\t}\n\n\t\t// Don't store the domain name in the database\n\t\tself::$stat[ 'resource' ] = $parsed_url[ 'path' ] . ( !empty( $parsed_url[ 'query' ] ) ? '?' . $parsed_url[ 'query' ] : '' ) . ( !empty( $parsed_url[ 'fragment' ] ) ? '#' . $parsed_url[ 'fragment' ] : '' );\n\n\t\t// Is this resource blacklisted?\n\t\tif ( !empty( self::$settings[ 'ignore_resources' ] ) && self::_is_blacklisted( self::$stat[ 'resource' ], self::$settings[ 'ignore_resources' ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Referrer URL\n\t\tif ( !isset( self::$stat[ 'referer' ] ) && !empty( $_SERVER[ 'HTTP_REFERER' ] ) ) {\n\t\t\tself::$stat[ 'referer' ] = $_SERVER[ 'HTTP_REFERER' ];\n\t\t}\n\n\t\tif ( !empty( self::$stat[ 'referer' ] ) ) {\n\t\t\t// Is this a 'seriously malformed' URL?\n\t\t\t$parsed_url = parse_url( self::$stat[ 'referer' ] );\n\t\t\tif ( !$parsed_url ) {\n\t\t\t\t$error = self::_log_error( 201 );\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( !empty( $parsed_url[ 'scheme' ] ) && !in_array( strtolower( $parsed_url[ 'scheme' ] ), array( 'http', 'https', 'android-app' ) ) ) {\n\t\t\t\tself::$stat[ 'notes' ][] = sprintf( __( 'Attempted XSS Injection: %s', 'wp-slimstat' ), self::$stat[ 'referer' ] );\n\t\t\t\tunset( self::$stat[ 'referer' ] );\n\t\t\t}\n\n\t\t\t// Is this referer blacklisted?\n\t\t\tif ( !empty( self::$settings[ 'ignore_referers' ] ) && self::_is_blacklisted( self::$stat[ 'referer' ], self::$settings[ 'ignore_referers' ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Search terms\n\t\t\tself::$stat[ 'searchterms' ] = self::_get_search_terms( self::$stat[ 'referer' ] );\n\n\t\t\t// Are we storing internal referrers in the database?\n\t\t\t$parsed_site_url = parse_url( get_site_url(), PHP_URL_HOST );\n\t\t\tif ( !empty( $parsed_url[ 'host' ] ) && $parsed_url[ 'host' ] == $parsed_site_url && self::$settings[ 'track_same_domain_referers' ] != 'on' ) {\n\t\t\t\tunset( self::$stat[ 'referer' ] );\n\t\t\t}\n\t\t}\n\n\t\t// Internal WP search?\n\t\tif ( empty( self::$stat[ 'searchterms' ] ) && !empty( $_POST[ 's' ] ) ) {\n\t\t\tself::$stat[ 'searchterms' ] = sanitize_text_field( str_replace( '\\\\', '', $_REQUEST[ 's' ] ) );\n\t\t}\n\n\t\t// If this function was called by the js tracker (client mode), we've already determined this pageview's content information\n\t\tif ( !isset( self::$stat[ 'content_type' ] ) ) {\n\t\t\t$content_info = self::_get_content_info();\n\n\t\t\t// Is this content type blacklisted?\n\t\t\tif ( !empty( self::$settings[ 'ignore_content_types' ] ) && self::_is_blacklisted( $content_info[ 'content_type' ], self::$settings[ 'ignore_content_types' ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( is_array( $content_info ) ) {\n\t\t\t\tself::$stat = self::$stat + $content_info;\n\t\t\t}\n\t\t}\n\n\t\t// Number of results from query_posts\n\t\tif ( ( is_archive() || is_search() ) && !empty( $GLOBALS[ 'wp_query' ]->found_posts ) ) {\n\t\t\tself::$stat[ 'notes' ][] = 'results:' . intval( $GLOBALS['wp_query']->found_posts );\n\t\t}\n\n\t\t// Do not track report pages in the admin\n\t\tif ( ( !empty( self::$stat[ 'resource' ] ) && strpos( self::$stat[ 'resource' ], 'wp-admin/admin-ajax.php' ) !== false ) || ( !empty( $_GET[ 'page' ] ) && strpos( $_GET[ 'page' ], 'slimview' ) !== false ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Should we ignore this user?\n\t\tif ( !empty( $GLOBALS[ 'current_user' ]->ID ) ) {\n\t\t\t// Don't track logged-in users, if the corresponding option is enabled\n\t\t\tif ( self::$settings[ 'ignore_wp_users' ] == 'on' ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Don't track users with given capabilities\n\t\t\tforeach ( self::string_to_array( self::$settings[ 'ignore_capabilities' ] ) as $a_capability ) {\n\t\t\t\tif ( self::_is_blacklisted( $a_capability, self::$settings[ 'ignore_capabilities' ] ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Is this user blacklisted?\n\t\t\tif ( !empty( self::$settings[ 'ignore_users' ] ) && self::_is_blacklisted( $GLOBALS[ 'current_user' ]->data->user_login, self::$settings[ 'ignore_users' ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tself::$stat[ 'username' ] = $GLOBALS[ 'current_user' ]->data->user_login;\n\t\t\tself::$stat[ 'email' ] = $GLOBALS[ 'current_user' ]->data->user_email;\n\t\t\tself::$stat[ 'notes' ][] = 'user:' . $GLOBALS[ 'current_user' ]->data->ID;\n\t\t\t$not_spam = true;\n\t\t}\n\t\telseif ( isset( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) ) {\n\t\t\t// Is this a spammer?\n\t\t\t$spam_comment = self::$wpdb->get_row( self::$wpdb->prepare( \"\n\t\t\t\tSELECT comment_author, comment_author_email, COUNT(*) comment_count\n\t\t\t\tFROM `\" . DB_NAME . \"`.{$GLOBALS['wpdb']->comments}\n\t\t\t\tWHERE comment_author_IP = %s AND comment_approved = 'spam'\n\t\t\t\tGROUP BY comment_author\n\t\t\t\tLIMIT 0,1\", self::$stat[ 'ip' ] ), ARRAY_A );\n\n\t\t\tif ( !empty( $spam_comment[ 'comment_count' ] ) ) {\n\t\t\t\tif ( self::$settings[ 'ignore_spammers' ] == 'on' ){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tself::$stat[ 'notes' ][] = 'spam:yes';\n\t\t\t\t\tself::$stat[ 'username' ] = $spam_comment[ 'comment_author' ];\n\t\t\t\t\tself::$stat[ 'email' ] = $spam_comment[ 'comment_author_email' ];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ( !empty( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) ) {\n\t\t\t\t\tself::$stat[ 'username' ] = sanitize_user( $_COOKIE[ 'comment_author_' . COOKIEHASH ] );\n\t\t\t\t}\n\t\t\t\tif ( !empty( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] ) ) {\n\t\t\t\t\tself::$stat[ 'email' ] = sanitize_email( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Language\n\t\tself::$stat[ 'language' ] = self::_get_language();\n\n\t\t// Is this language blacklisted?\n\t\tif ( !empty( self::$stat[ 'language' ] ) && !empty( self::$settings[ 'ignore_languages' ] ) && stripos( self::$settings[ 'ignore_languages' ], self::$stat[ 'language' ] ) !== false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Geolocation \n\t\tinclude_once( plugin_dir_path( __FILE__ ) . 'vendor/maxmind.php' );\n\t\ttry {\n\t\t\t$geolocation_data = maxmind_geolite2_connector::get_geolocation_info( self::$stat[ 'ip' ] );\n\t\t}\n\t\tcatch( Exception $e ) {\n\t\t\t// Invalid MaxMind data file\n\t\t\t$error = self::_log_error( 205 );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( !empty( $geolocation_data[ 'country' ][ 'iso_code' ] ) && $geolocation_data[ 'country' ][ 'iso_code' ] != 'xx' ) {\n\t\t\tself::$stat[ 'country' ] = strtolower( $geolocation_data[ 'country' ][ 'iso_code' ] );\n\n\t\t\tif ( !empty( $geolocation_data[ 'city' ][ 'names' ][ 'en' ] ) ) {\n\t\t\t\tself::$stat[ 'city' ] = $geolocation_data[ 'city' ][ 'names' ][ 'en' ];\n\t\t\t}\n\n\t\t\tif ( !empty( $geolocation_data[ 'subdivisions' ][ 0 ][ 'iso_code' ] ) && !empty( self::$stat[ 'city' ] ) ) {\n\t\t\t\tself::$stat[ 'city' ] .= ' (' . $geolocation_data[ 'subdivisions' ][ 0 ][ 'iso_code' ] . ')';\n\t\t\t}\n\n\t\t\tif ( !empty( $geolocation_data[ 'location' ][ 'latitude' ] ) && !empty( $geolocation_data[ 'location' ][ 'longitude' ] ) ) {\n\t\t\t\tself::$stat[ 'location' ] = $geolocation_data[ 'location' ][ 'latitude' ] . ',' . $geolocation_data[ 'location' ][ 'longitude' ];\n\t\t\t}\n\t\t}\n\n\t\t// Is this country blacklisted?\n\t\tif ( !empty( self::$stat[ 'country' ] ) && !empty( self::$settings[ 'ignore_countries' ] ) && stripos( self::$settings[ 'ignore_countries' ], self::$stat[ 'country' ] ) !== false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark or ignore Firefox/Safari prefetching requests (X-Moz: Prefetch and X-purpose: Preview)\n\t\tif ( ( isset( $_SERVER[ 'HTTP_X_MOZ' ] ) && ( strtolower( $_SERVER[ 'HTTP_X_MOZ' ] ) == 'prefetch' ) ) ||\n\t\t\t( isset( $_SERVER[ 'HTTP_X_PURPOSE' ] ) && ( strtolower( $_SERVER[ 'HTTP_X_PURPOSE' ] ) == 'preview' ) ) ) {\n\t\t\tif ( self::$settings[ 'ignore_prefetch' ] == 'on' ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tself::$stat[ 'notes' ][] = 'pre:yes';\n\t\t\t}\n\t\t}\n\n\t\t// User Agent\n\t\t$browser = slim_browser::get_browser();\n\n\t\t// Are we ignoring bots?\n\t\tif ( self::$settings[ 'ignore_bots' ] == 'on' && $browser[ 'browser_type' ] == 1 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Is this browser blacklisted?\n\t\tif ( !empty( self::$settings[ 'ignore_browsers' ] ) && self::_is_blacklisted( array( $browser[ 'browser' ], $browser[ 'user_agent' ] ), self::$settings[ 'ignore_browsers' ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Is this operating system blacklisted?\n\t\tif ( !empty( self::$settings[ 'ignore_platforms' ] ) && self::_is_blacklisted( $browser[ 'platform' ], self::$settings[ 'ignore_platforms' ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tself::$stat = self::$stat + $browser;\n\n\t\t// Do we need to assign a visit_id to this user?\n\t\t$cookie_has_been_set = self::_set_visit_id( false );\n\n\t\t// Allow third-party tools to modify all the data we've gathered so far\n\t\tself::$stat = apply_filters( 'slimstat_filter_pageview_stat', self::$stat );\n\t\tdo_action( 'slimstat_track_pageview', self::$stat );\n\n\t\t// Third-party tools can decide that this pageview should not be tracked, by setting its datestamp to zero\n\t\tif ( empty( self::$stat ) || empty( self::$stat[ 'dt' ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Implode the notes\n\t\tif ( !empty( self::$stat[ 'notes' ] ) ) {\n\t\t\tself::$stat[ 'notes' ] = '[' . implode( '][', self::$stat[ 'notes' ] ) . ']';\n\t\t}\n\n\t\t// Remove empty values\n\t\tself::$stat = array_filter( self::$stat );\n\n\t\t// Save this information in the database\n\t\tself::$stat[ 'id' ] = self::_insert_row( self::$stat, $GLOBALS[ 'wpdb' ]->prefix . 'slim_stats' );\n\n\t\t// Did something go wrong during the insert?\n\t\tif ( empty( self::$stat[ 'id' ] ) ) {\n\n\t\t\t// Attempt to init the environment (plugin just activated on a blog in a MU network?)\n\t\t\tinclude_once ( plugin_dir_path( __FILE__ ) . 'admin/index.php' );\n\t\t\twp_slimstat_admin::init_environment( true );\n\n\t\t\t// Now let's try again\n\t\t\tself::$stat[ 'id' ] = self::_insert_row( self::$stat, $GLOBALS[ 'wpdb' ]->prefix . 'slim_stats' );\n\n\t\t\tif ( empty( self::$stat[ 'id' ] ) ) {\n\t\t\t\t$error = self::_log_error( 200 );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Does this visitor have a visit_id cookie?\n\t\t$set_cookie = apply_filters( 'slimstat_set_visit_cookie', ( !empty( self::$settings[ 'set_tracker_cookie' ] ) && self::$settings[ 'set_tracker_cookie' ] == 'on' ) );\n\t\tif ( $set_cookie ) {\n\t\t\tif ( empty( self::$stat[ 'visit_id' ] ) && !empty( self::$stat[ 'id' ] ) ) {\n\t\t\t\t// Set a cookie to track this visit (Google and other non-human engines will just ignore it)\n\t\t\t\t@setcookie(\n\t\t\t\t\t'slimstat_tracking_code',\n\t\t\t\t\tself::_get_value_with_checksum( self::$stat[ 'id' ] . 'id' ),\n\t\t\t\t\ttime() + 2678400, // one month\n\t\t\t\t\tCOOKIEPATH\n\t\t\t\t);\n\t\t\t}\n\t\t\telseif ( !$cookie_has_been_set && self::$settings[ 'extend_session' ] == 'on' && self::$stat[ 'visit_id' ] > 0 ) {\n\t\t\t\t@setcookie(\n\t\t\t\t\t'slimstat_tracking_code',\n\t\t\t\t\tself::_get_value_with_checksum( self::$stat[ 'visit_id' ] ),\n\t\t\t\t\ttime() + self::$settings[ 'session_duration' ],\n\t\t\t\t \tCOOKIEPATH\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn self::$stat[ 'id' ];\n\t}",
"protected function setTrack() {\n\t\t$Starttime = $this->Context->activity()->timestamp();\n\n\t\t$Trackdata = new Trackdata\\Loop($this->Context->trackdata());\n\t\t$Route = new Route\\Loop($this->Context->route());\n\n\t\t$hasElevation = $this->Context->route()->hasOriginalElevations();\n\t\t$hasHeartrate = $this->Context->trackdata()->has(Trackdata\\Object::HEARTRATE);\n\n\t\twhile ($Trackdata->nextStep()) {\n\t\t\t$Route->nextStep();\n\n\t\t\tif ($this->Activity->Lap[(int)floor($Trackdata->distance())]) {\n\t\t\t\t$Trackpoint = $this->Activity->Lap[(int)floor($Trackdata->distance())]->Track->addChild('Trackpoint');\n\t\t\t\t$Trackpoint->addChild('Time', $this->timeToString($Starttime + $Trackdata->time()));\n\n\t\t\t\t$Position = $Trackpoint->addChild('Position');\n\t\t\t\t$Position->addChild('LatitudeDegrees', $Route->latitude());\n\t\t\t\t$Position->addChild('LongitudeDegrees', $Route->longitude());\n\n\t\t\t\tif ($hasElevation) {\n\t\t\t\t\t$Trackpoint->addChild('AltitudeMeters', $Route->current(Route\\Object::ELEVATIONS_ORIGINAL));\n\t\t\t\t}\n\n\t\t\t\t$Trackpoint->addChild('DistanceMeters', 1000*$Trackdata->distance());\n\n\t\t\t\tif ($hasHeartrate) {\n\t\t\t\t\t$Heartrate = $Trackpoint->addChild('HeartRateBpm');\n\t\t\t\t\t$Heartrate->addChild('Value', $Trackdata->current(Trackdata\\Object::HEARTRATE));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function getIsStarred()\n {\n return $this->is_starred;\n }",
"public function setTracking($tracking) {\n $this->tracking = $tracking;\n }",
"public function isStarred() {\n\t\treturn $this->starred;\n\t}",
"private function has_tracking_enabled()\n {\n }",
"public function setUnderShip() {\n $this->underShip = true;\n }",
"public function setSmartTrackThreshold($thresh){\n\t\t$this->smarttrackthreshold = $thresh;\n\t}",
"public function smartTrackStatus(){\n\t\treturn $this->smarttrack;\n\t}",
"public function setFlagship()\n {\n $this->flagship = true;\n }",
"public function setOn($flag = true);",
"private function tracking_allowed() {\r\n\t\t\tif ( ! UM()->options()->get( 'allow_tracking' ) )\r\n\t\t\t\treturn 0;\r\n\t\t\treturn 1;\r\n\t\t}",
"public function trackMode($mode) \n {\n if($mode == 2) {\n $this->anchorTags = false;\n }\n }",
"function TRACKING() {\n\treturn TrackingInit::instance();\n}",
"public function trackDuplicates($track)\n\t{\n\t\t$this->trackDuplicates = (bool)$track;\n\t}",
"public function setPlaying()\n {\n $this->playing = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Content text of the mail. | public function getTextContent()
{
return $this->text_content;
} | [
"public function getContentText()\n\t\t{\n\t\t\treturn $this->content_text;\n\t\t}",
"public function getMessageContent()\n {\n return $this->get(self::MESSAGE_CONTENT);\n }",
"public function getBodyText()\n\t{\n\t\treturn $this->getMail()->getBodyText();\n\t}",
"public function getMessageContent()\n {\n return $this->messageContent;\n }",
"public function getMessageContent() {\n\t\treturn ($this->messageContent);\n\t}",
"public function getMessageContent(): string {\n\t\treturn($this->messageContent);\n\t}",
"public function getContentText()\n {\n return strip_tags($this->getContent());\n }",
"public function getMmtMessageContent()\n {\n return $this->mmt_message_content;\n }",
"public function getMailText()\n {\n return $this->mailText;\n }",
"public function getSmtMessageContent()\n {\n return $this->smt_message_content;\n }",
"public function getTextContent()\n {\n return $this->textContent;\n }",
"public function getBodyContent()\n\t{\n\t\treturn $this->_pageData['data']['content'];\n\t}",
"public function getContent ()\n {\n return $this->content;\n }",
"public function getInformSubjectContent()\n {\n return $this->inform_subject_content;\n }",
"public function getBodyText(): string\n {\n return $this->textMessage;\n }",
"public function getBodyContent()\n {\n return $this->bodyContent;\n }",
"public function getSmsContent()\n {\n return $this->smsContent;\n }",
"public function getStrContent()\n {\n return $this->get(self::STRCONTENT);\n }",
"public function get_content() {\n\t\treturn $this->post->post_content;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test outer content container class function with array arg. | function test_r_container_outer_class_array_arg() {
$this->expectOutputString( 'class="content test class"' );
r_container_outer_class( array( 'test', 'class' ) );
} | [
"public function testCallInvokesCallableDefinedByArray()\n {\n $expected = 'qux';\n $baz = new BazStatic;\n\n $c = new Container;\n $returned = $c->call([$baz, 'qux']);\n\n $this->assertSame($returned, $expected);\n }",
"public function testContainerSetArray()\n {\n $key = uniqid('key');\n $val = uniqid('val');\n $data = [$key => $val];\n $initialData = [uniqid('key') => uniqid('val')];\n $container = $initialData;\n $subject = $this->createInstance(['_normalizeKey']);\n\n $subject->expects($this->exactly(count($data)))\n ->method('_normalizeKey')\n ->with($key)\n ->will($this->returnValue((string) $key));\n\n $reflection = new ReflectionMethod($subject, '_containerSet');\n $reflection->setAccessible(true);\n $reflection->invokeArgs($subject, [&$container, $key, $val]);\n\n $this->assertEquals(array_merge($initialData, $data), $container, 'Modified state is wrong');\n }",
"public function instanciateArrayReturnCallResultWithGivenArrayAsArgs()\n {\n $this->assertEquals(array(), $this->object->instanciateArray());\n $this->assertTrue($this->called, '\"methodConstructor\" not called.');\n $this->called = false;\n $expected = array('arg1', 'arg2');\n $this->assertEquals($expected, $this->object->instanciateArray($expected));\n $this->assertTrue($this->called, '\"methodConstructor\" not called.');\n }",
"public function testElementGetElements()\r\n {\r\n\r\n }",
"public function translateAdapterNativeArrayContentParamExist(UnitTester $I)\n {\n $I->wantToTest('Translate\\Adapter\\NativeArray - constructor without content throws exception');\n\n $I->expectThrowable(\n new Exception('Translation content was not provided'),\n function () {\n new NativeArray(new InterpolatorFactory(), []);\n }\n );\n }",
"public function testWalk()\n {\n $array = array(1, 2, 3, 4, 5);\n \n $collection = new ValueCollection();\n $collection->addAll($array);\n \n $resultArray = array();\n \n $this->testInstance->walkCollection(\n $collection,\n function ($value, $index, $uargs) use (&$resultArray) {\n $unit = $uargs[0];\n if ($unit instanceof AbstractCollectionHelperTest) {\n $unit->assertEquals(\n $value,\n $index + 1,\n sprintf(\n \"The walk method of %s instance is\".\n \" expected to use the content array %s\",\n AbstractCollectionHelper::class,\n json_encode($uargs[1])\n )\n );\n \n $resultArray[] = $value;\n }\n },\n array($this, $array)\n );\n \n $this->assertEquals(\n $array,\n $resultArray,\n sprintf(\n \"the walk method of the %s instance is expected to\".\n \" traverse the entire content %s\",\n AbstractCollectionHelper::class,\n json_encode($array)\n )\n );\n }",
"public function testExecute_preProcessFieldArray()\n {\n\n }",
"public function __construct($array) {\n\t\t$this->contentArr = $array;\n\t}",
"public function testArrPrimitive() {\n $needle = [];\n $result = $this->couple->arr($needle, 10);\n $this->assertEquals($needle, $result);\n }",
"public function testCheckIsArray() {\n\t\t$this->assertFalse($this->viewDo->checkIsArray('testKey'));\n\n\t\t$this->viewDo->set('testNull', null);\n\t\t$this->viewDo->set('testEmptyArray', array());\n\t\t$this->viewDo->set('testArray', array('test' => array('testValue')));\n\n\t\t$this->assertFalse($this->viewDo->checkIsArray('testNull'));\n\t\t$this->assertTrue($this->viewDo->checkIsArray('testEmptyArray'));\n\t\t$this->assertTrue($this->viewDo->checkIsArray('testArray'));\n\t\t$this->assertTrue($this->viewDo->checkIsArray('testArray.test'));\n\t\t$this->assertFalse($this->viewDo->checkIsArray('testArray.test.test'));\n\t}",
"public function test_getArray_Coverage() \n {\n $oTestObject = oxNew('fcporequestlog');\n \n $aMockData = array('someVar'=>'someValue');\n $sMockData = serialize($aMockData);\n \n $this->assertEquals($aMockData, $oTestObject->getArray($sMockData));\n }",
"public function testAddContent() : void\r\n {\r\n $content = [\r\n 'some content',\r\n (new class {\r\n /**\r\n * Return this object as a string.\r\n * \r\n * @return string\r\n */\r\n public function __toString() : string {\r\n return 'class';\r\n }\r\n }),\r\n 12345,\r\n 6.789\r\n ];\r\n\r\n $this->assertEquals(\r\n $content,\r\n $this->getFake()\r\n ->addContent($content)\r\n ->getContent()\r\n );\r\n }",
"public function testSearchFieldArrayParameter()\n {\n $this->specify(\n \"searchField with array parameter returns invalid HTML Strict\",\n function () {\n $options = [\n 'x_name',\n 'class' => 'x_class',\n ];\n $expected = '<input type=\"search\" id=\"x_name\" name=\"x_name\" '\n . 'class=\"x_class\"';\n\n $this->tester->testFieldParameter(\n 'searchField',\n $options,\n $expected,\n false\n );\n }\n );\n\n $this->specify(\n \"searchField with array parameter returns invalid HTML XHTML\",\n function () {\n $options = [\n 'x_name',\n 'class' => 'x_class',\n ];\n $expected = '<input type=\"search\" id=\"x_name\" name=\"x_name\" '\n . 'class=\"x_class\"';\n\n $this->tester->testFieldParameter(\n 'searchField',\n $options,\n $expected,\n true\n );\n }\n );\n }",
"public function testGetFlexformValueFromSheetArray()\n {\n }",
"abstract public function elements();",
"public function test__FilterKeyArrayPart() {\n\t\t// Mock behavior\n\t\t$behavior = Stub::make( \"RestfulRecord\\behaviors\\CacheBehavior\", array(\n\t\t\t\"owner\" => Stub::make( \"RestfulRecord\\RestfulRecord\", array(\n\t\t\t\t\"restConfig\" => function() {\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\"foo\" => array( \"blacklist\", ),\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t) ),\n\t\t) );\n\n\t\t// Set input\n\t\t$input = array( \"foo\" => \"bar\", \"blacklist\" => \"baz\", );\n\n\t\t// Set expected output\n\t\t$output = array( \"foo\" => \"bar\", );\n\n\t\t// Verify return value\n\t\tverify( $this->tester->invokeMethod( $behavior, \"filterKeyArrayPart\", array( $input, \"foo\" ) ) )->equals( $output );\n\t}",
"public function testArrayAccess()\n {\n \t//Clear any previously set attributes\n \t$this->container->clearAttributes();\n\n\t\t$this->container['LOCALITY'] = 'Oyenhausen';\n\t\t$this->container['RECIPIENT'] = 'Eberhard Wellhausen';\n\t\t$this->container['ORGANIZATION'] = 'Wittekindshof';\n\t\t$this->container['POSTAL_CODE'] = '32547';\n\t\t$this->container['STREET_ADDRESS'] = 'Schulstrasse 4';\n\n\t\t$this->assertEquals(\n\t\t\t$this->container['LOCALITY'],\n\t\t\t'Oyenhausen'\n\t\t);\n\n\t\t$this->assertEquals(\n\t\t\t$this->container['RECIPIENT'],\n\t\t\t'Eberhard Wellhausen'\n\t\t);\n\n\t\t$this->assertEquals(\n\t\t\t$this->container['ORGANIZATION'],\n\t\t\t'Wittekindshof'\n\t\t);\n\n\t\t$this->assertEquals(\n\t\t\t$this->container['POSTAL_CODE'],\n\t\t\t'32547'\n\t\t);\n\n\t\t$this->assertEquals(\n\t\t\t$this->container['STREET_ADDRESS'],\n\t\t\t'Schulstrasse 4'\n\t\t);\n }",
"public function test_build_result_from_simple_array()\n {\n\n $this->array_param = array(0 =>\n array(\n 'id' => \"0\",\n 'name' => \"bar\",\n 'type' => \"foo\",\n 'description' => \"No MT\",\n 'base_url' => \"\",\n 'translate_relative_url' => \"\",\n 'contribute_relative_url' => NULL,\n 'delete_relative_url' => NULL,\n 'others' => \"{}\",\n 'class_load' => \"NONE\",\n 'extra_parameters' => \"\",\n 'google_api_compliant_version' => NULL,\n 'penalty' => \"100\",\n 'active' => \"0\",\n 'uid' => NULL\n ));\n\n\n $actual_array_of_engine_structures = $this->method->invoke($this->reflectedClass, $this->array_param);\n $actual_engine_struct = $actual_array_of_engine_structures['0'];\n $this->assertTrue($actual_engine_struct instanceof EnginesModel_EngineStruct);\n\n $this->assertEquals(\"bar\", $actual_engine_struct->name);\n $this->assertEquals(\"foo\", $actual_engine_struct->type);\n }",
"public function diServiceBuilderBuildInstanceWithCallsExceptionMethodArgumentsIsArray(UnitTester $I)\n {\n $I->wantToTest(\n 'Di\\Service\\Builder - build() - instance with calls exception method arguments is array'\n );\n\n $I->expectThrowable(\n new Exception(\n 'Call arguments must be an array on position 0'\n ),\n function () {\n $container = new Di();\n $builder = new Builder();\n\n $definition = [\n 'className' => PropertiesComponent::class,\n 'arguments' => [\n [\n 'type' => 'parameter',\n 'value' => 'one',\n ],\n [\n 'type' => 'parameter',\n 'value' => 2,\n ],\n ],\n 'calls' => [\n 0 => [\n 'method' => 'transform',\n 'arguments' => 444,\n ],\n ],\n ];\n\n $builder->build($container, $definition);\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the profile pic of sender of the note | public function getSenderPicUrl()
{
if (count($this->sender()->first()) > 0)
return URL::to($this->sender->user_pic);
else
return URL::to('/img/profiles/default.png');
} | [
"public function getSenderProfilePicImg(): string\n {\n return $this->data->sender->profilePicThumbObj->img;\n }",
"public function getProfilePicture();",
"public function getAuthorProfilePicture(): string {\n\t\treturn $this->authorProfilePicture;\n\t}",
"function getProfileImage()\n\t{\n\t\tif(!$this->isExists() || !$this->get('member_srl')) return;\n\t\t$oMemberModel = getModel('member');\n\t\t$profile_info = $oMemberModel->getProfileImage($this->get('member_srl'));\n\t\tif(!$profile_info) return;\n\n\t\treturn $profile_info->src;\n\t}",
"function getProfile_pic()\r\n\t{\r\n\t\treturn $this->profile_pic;\r\n\t}",
"public function getProfilePicture() {\r\n\t\tif ($this->_profilePicture == null) {\r\n\t\t\tif (strlen($this->email)) {\r\n\t\t\t\t$this->_profilePicture = UsersDataService::getUserProfilePicture(WebSoccer::getInstance(), null, $this->email);\r\n\t\t\t} else {\r\n\t\t\t\t$this->_profilePicture = '';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $this->_profilePicture;\r\n\t}",
"public function getProfilePicture()\n {\n return $this->profilePicture;\n }",
"public function getProfilePic()\n {\n return $this->profilePic;\n }",
"public function getPicture(){\n return $this->profile->picture;\n }",
"public function getProfilePicture()\n {\n $baseUrl = 'img/clients/' . $this->id;\n return file_exists($baseUrl . self::JPG) ? '/' . $baseUrl . self::JPG : (\n file_exists($baseUrl . self::PNG) ? '/' . $baseUrl . self::PNG : '/img/default_avatar.jpg'\n );\n }",
"public function getProfilePict()\n\t{\n\t\treturn $this->profile_pict;\n\t}",
"public function getProfile_photo()\n {\n return $this->profile_photo;\n }",
"public function getUserPic()\n {\n return $this->user_pic;\n }",
"public function getProfilePhoto()\r\n\t{ \r\n\t\t$username = $this->user['username'];\r\n\t\t$get_prof_pic_query = mysqli_query($this->db, \"SELECT prof_pic FROM users WHERE username='$username';\");\r\n\t\t$row = mysqli_fetch_array($get_prof_pic_query);\r\n\t\treturn $row['prof_pic']; \r\n\t}",
"public function getProfileImg()\n {\n return $this->profileImg;\n }",
"public function getProfile_img()\n {\n return $this->profile_img;\n }",
"public function getQqProfilePicture()\n {\n return $this->qqProfilePicture;\n }",
"function getProfilePicture()\r\n\t\t{\r\n\t\t\treturn APP_IMG_URL.$this->profilePictureImg;\r\n\t\t\t\r\n\t\t}",
"public function getVkontakteProfilePicture()\n {\n return $this->vkontakteProfilePicture;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Valid values = off or on. Determines whether CVV field is displayed. Default is on. | public function setCVV($v) {
if (strtolower($v) == 'on') {
$this->fields["CVV"] = 'on';
} else if (strtolower($v) == 'off') {
$this->fields["CVV"] = 'off';
}
return $this;
} | [
"public function isValidCVV()\n {\n return ctype_digit($this->cvvValue) && $this->validCVVLength();\n }",
"public function getCvv()\r\n {\r\n return $this->cvv;\r\n }",
"public function useCvv() {\n return $this->gatewayConfig->isCvvEnabled();\n }",
"public function isInCVT()\n {\n return $this->is_in_cvt;\n }",
"public function getCvv()\n {\n return $this->cvv;\n }",
"public function setCreditCardShowCvcField($showCvcField)\n\t{\n\t\t$this->_setField(self::$CREDITCARD_SHOW_CVC_FIELD, $showCvcField ? 'true' : 'false');\n\t}",
"public function getCvv(): string\n {\n return $this->cvv;\n }",
"public function getCavv()\n {\n return $this->cavv;\n }",
"public function getCvv()\r\n{\r\nreturn $this->cvv;\r\n}",
"public function getCvv() : string\n {\n return $this->cvv_number;\n }",
"public function setCvvFlag($cvvFlag)\n {\n $this->cvvFlag = $cvvFlag;\n }",
"public function getIsValide()\n {\n return $this->isValide;\n }",
"public function hasVTEC()\n {\n return !empty($this->vtec_strings);\n }",
"public function useOneClickCVV()\n {\n if ($this->_oneClickCVV === null) {\n $oneclick = $this->_getResource()->useOneClickCVV($this);\n if ($oneclick) {\n $this->_oneClickCVV = $oneclick->getActive();\n }\n }\n return $this->_oneClickCVV;\n }",
"function getCodcvv()\n {\n return $this->codcvv;\n }",
"function pmpro_braintree_dont_require_CVV($fields)\n {\n unset($fields['CVV']);\n $fields['cvv'] = true;\n return $fields;\n }",
"function validateCVV($cardNumber, $cvv)\n{\n$cardNumber = preg_replace(\"/\\D/\", \"\", $cardNumber);\n$cvv = preg_replace(\"/\\D/\", \"\", $cvv);\n\n//Checks to see whether the submitted value is numeric (After spaces and hyphens have been removed).\nif(is_numeric($cardNumber)) {\n//Checks to see whether the submitted value is numeric (After spaces and hyphens have been removed).\nif(is_numeric($cvv)) {\n//Splits up the card number into various identifying lengths.\n$firstOne = substr($cardNumber, 0, 1);\n$firstTwo = substr($cardNumber, 0, 2);\n\n//If the card is an American Express\nif($firstTwo == \"34\" || $firstTwo == \"37\") {\nif (!preg_match(\"/^\\d{4}$/\", $cvv))\n{\n// The credit card is an American Express card but does not have a four digit CVV code\nreturn false;\n}\n}\nelse if (!preg_match(\"/^\\d{3}$/\", $cvv)) {\n// The credit card is a Visa, MasterCard, or Discover Card card but does not have a three digit CVV code\nreturn false;\n}\nreturn true;\n}\nelse {\nreturn false;\n}\n}\nelse {\nreturn false;\n}\n}",
"public function isVatValid();",
"function get_vtec() {\n if(!empty($this->properties['vtec']['string'])) {\n return $this->properties['vtec'];\n }\n\n // No VTEC string found\n return false;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ This function trys to locate the entity_id of a specific mime element | function find_ent_id( $id, $message ) {
$ret = '';
for ($i=0; $ret == '' && $i < count($message->entities); $i++) {
if (( $message->entities[$i]->header->type1 == 'alternative') ||
( $message->entities[$i]->header->type1 == 'related') ||
( $message->entities[$i]->header->type1 == 'mixed')) {
$ret = find_ent_id( $id, $message->entities[$i] );
} else {
if ( strcasecmp( $message->entities[$i]->header->id, $id ) == 0 )
$ret = $message->entities[$i]->header->entity_id;
}
}
return( $ret );
} | [
"function find_ent_id($id, $message) {\n for ($i = 0, $ret = ''; $ret == '' && $i < count($message->entities); $i++) {\n if ($message->entities[$i]->header->type0 == 'multipart') {\n $ret = find_ent_id($id, $message->entities[$i]);\n } else {\n if (strcasecmp($message->entities[$i]->header->id, $id) == 0) {\n// if (sq_check_save_extension($message->entities[$i])) {\n return $message->entities[$i]->entity_id;\n// }\n } elseif (!empty($message->entities[$i]->header->parameters['name'])) {\n /**\n * This is part of a fix for Outlook Express 6.x generating\n * cid URLs without creating content-id headers\n * @@JA - 20050207\n */\n if (strcasecmp($message->entities[$i]->header->parameters['name'], $id) == 0) {\n return $message->entities[$i]->entity_id;\n }\n }\n }\n }\n return $ret;\n}",
"public static function find_ent_id($id, $message)\n {\n for ($i = 0, $ret = ''; $ret == '' && $i < count($message->entities); $i ++) {\n if ($message->entities[$i]->header->type0 == 'multipart') {\n $ret = self::find_ent_id($id, $message->entities[$i]);\n } else {\n if (strcasecmp($message->entities[$i]->header->id, $id) == 0) {\n return $message->entities[$i]->entity_id;\n } elseif (! empty($message->entities[$i]->header->parameters['name'])) {\n /**\n * This is part of a fix for Outlook Express 6.x generating\n * cid URLs without creating content-id headers\n * @@JA - 20050207\n */\n if (strcasecmp($message->entities[$i]->header->parameters['name'], $id) == 0) {\n return $message->entities[$i]->entity_id;\n }\n }\n }\n }\n return $ret;\n }",
"function getExactEntityId($enttName)\r\n{\r\n\tglobal $stdentities;\r\n\t//print_r($stdentities);\r\n\t//pattern:- EntityList_Id EntityName inactive desc_name\r\n\t$exact_ennt_id = 0;\r\n\tforeach ($stdentities as $key => $value) {\r\n\t\t$split_stdentities = explode('#', $value); \r\n\t\tif(strtolower($split_stdentities[1]) == strtolower($enttName)) {\r\n\t\t\t$exact_ennt_id = $split_stdentities[0];\r\n\t\t\tbreak;\r\n\t\t}\t\t\t\t\r\n\t}\t\t\r\n\tif($exact_ennt_id == 0)\r\n\t{\r\n\t\treturn $exact_ennt_id;\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn $exact_ennt_id;\r\n\t}\r\n}",
"function get_entity($str_data)\n {\n # chop the strings and locate the entityId parameter\n $entity_parameter = explode('&', $str_data);\n\n foreach ($entity_parameter as $item) {\n $key = explode('=', $item)[0];\n\n if ($key == 'entityId') {\n $value = explode('=', $item)[1];\n }\n }\n\n return $value;\n }",
"function findMimeBlobafterMimeSearch()\n {\n return $this->findMimeBlob($this->mimes_uid, $this->tablename);\n }",
"function _demtools_get_custom_entity_id($type, $name) {\n $result = civicrm_api3($type, 'get', array(\n 'sequential' => 1,\n 'return' => array('id'),\n 'name' => $name,\n ));\n return array_key_exists('id', $result) ? $result['id'] : FALSE;\n}",
"public function getMimeIndex()\n\t{\n\t\treturn $this->oBodyStructure ? $this->oBodyStructure->PartID() : '';\n\t}",
"public function getFeatureElementId()\n {\n \t$value = false;\n \t$urlPart = strrchr($this->getId(), '/');\n \tif( $urlPart ) {\n \t\t$value = trim( $urlPart, '/');\n \t} \t\n \treturn $value;\n }",
"function getIDfromURI ( $uri ) {\n \tpreg_match('/otvet(\\d+).html/s', $uri, $matches);\n\t\t//company\\/realty(\\d+).html/s\n \tif ( $matches[1] > 0 ) {\n \t\treturn $matches[1];\n \t}\n \treturn false;\n }",
"public function getContentMfGuid()\n {\n $mfGuid = '';\n $json = $this->getContent();\n if (!empty($json)) {\n $o = json_decode($json);\n $mfGuid = $o->mf_guid;\n }\n return $mfGuid;\n }",
"public function getDocumentIdentifier($entity);",
"abstract public function getIdFromEmbed($embed);",
"public function getElementIdByAttachment($aid = 0)\n\t{\n\t\tif (empty($this->_pub))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make sure we got attachments\n\t\t$attachments = $this->_pub->attachments();\n\t\tif (empty($attachments))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($attachments['elements'] as $elementId => $rows)\n\t\t{\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\tif ($row->id == $aid)\n\t\t\t\t{\n\t\t\t\t\treturn $elementId;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function getMapElementId()\n {\n \t$value = false;\n \t$urlPart = strrchr($this->getId(), '/');\n \tif( $urlPart ) {\n \t\t$value = trim( $urlPart, '/');\n \t} \t\n \treturn $value;\n }",
"public abstract function getItemId( $url, \\DOMElement $item ): string;",
"public function getMimetypeId() {\n\t\t$ret = (int) $this->getVar('mimetypeid');\n\t\treturn $ret;\n\t}",
"abstract protected function get_id($entry);",
"function parse_message_entities(&$msg, $id, $imap_stream) {\n global $uid_support;\n if (!empty($msg->entities)) foreach ($msg->entities as $i => $entity) {\n if (is_object($entity) && strtolower(get_class($entity)) == 'message') {\n if (!empty($entity->rfc822_header)) {\n $read = sqimap_run_command($imap_stream, \"FETCH $id BODY[\". $entity->entity_id .\".HEADER]\", true, $response, $message, $uid_support);\n $rfc822_header = new Rfc822Header();\n $rfc822_header->parseHeader($read);\n $msg->entities[$i]->rfc822_header = $rfc822_header;\n }\n parse_message_entities($msg->entities[$i], $id, $imap_stream);\n }\n }\n}",
"private function entityNumber() {\n $entity = $this->matches('&#');\n $entity .= $this->matchNumber();\n $len = strlen($entity);\n if ($len <= 2 || $len > 6) {\n // Invalid entity, escape &\n return htmlspecialchars($entity);\n }\n if ($this->look() === ';') {\n $entity .= $this->match(';');\n } else {\n $entity .= ';';\n }\n return $entity;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the ranks of the values Returns an array with both axes as title and ranks in the same order as sent to this function | private function getRanks($xTitle, $yTitle, $x, $y) {
//calculate the rank for both values without changing order
$x = $this->calculateRanks($x);
$y = $this->calculateRanks($y);
return [
$xTitle => $x,
$yTitle => $y
];
} | [
"public function getRanking(): array\n {\n return $this->ranking;\n }",
"public static function getRanks() {\n\t\treturn array_values( self::$rankMap );\n\t}",
"public function getTaxonomyRanksWithAssociativeArray()\n\t{\n\t\n\t\t//$query = \"SELECT taxonomy_rank_id, taxonomy_rank_name FROM taxonomyrank ORDER BY taxonomy_rank_name\";\n\t\t$query = \"SELECT * FROM taxonomybrowser.taxonomyrank\";\n\t\t$result = mysql_query($query, $this->Connection);\n\t\t$nodes = array();\n\t\tif(mysql_num_rows($result) == 0)\n\t\t{\n\t\t\treturn $nodes;\n\t\t}\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); ++$i)\n\t\t{\n\t\t\t//$tmp = array();\n\t\t\t//$tmp['taxonomy_rank_id'] = mysql_result($result ,$i, \"taxonomy_rank_id\");\n\t\t\t//$tmp['taxonomy_rank_name'] = mysql_result($result, $i, \"taxonomy_rank_name\");\n\t\t\t$nodes[mysql_result($result ,$i, \"taxonomy_rank_id\")] = mysql_result($result, $i, \"taxonomy_rank_name\");\n\t\t\t//array_push($nodes, $tmp);\n\t\t}\n\t\t\n\t\tmysql_free_result($result);\n\t\t\n\t\t//$nodes = stripslashesDeep($nodes);\n\t\t\n\t\treturn $nodes;\t\n\t\t\n\t}",
"public function getAllRanks() {\n $rankIds = [self::USER, self::MODERATOR, self::ADMIN];\n $ranks = [];\n foreach ($rankIds as $rankId) {\n $ranks[$rankId] = $this->getRankName($rankId);\n }\n return $ranks;\n }",
"public function listRanks()\n {\n $ranks = array(\n '' => \"No Rank\",\n -1 => \"Speeding Ticket\",\n 1 => \"1\",\n 2 => \"2\",\n 3 => \"3\",\n 4 => \"4\",\n 5 => \"5\",\n 6 => \"6\",\n 7 => \"7\",\n 8 => \"8\",\n 98 => \"No Show\",\n 99 => \"DQ\",\n );\n return $ranks;\n }",
"public function getTaxonomyRanks()\n\t{\n\t\n\t\t//$query = \"SELECT taxonomy_rank_id, taxonomy_rank_name FROM taxonomyrank ORDER BY taxonomy_rank_name\";\n\t\t$query = \"SELECT taxonomy_rank_id, taxonomy_rank_name FROM taxonomybrowser.taxonomyrank\";\n\t\t$result = mysql_query($query, $this->Connection);\n\t\t$nodes = array();\n\t\tif(mysql_num_rows($result) == 0)\n\t\t{\n\t\t\treturn $nodes;\n\t\t}\n\t\t\n\t\tfor($i = 0; $i < mysql_num_rows($result); ++$i)\n\t\t{\n\t\t\t$tmp = array();\n\t\t\t$tmp['taxonomy_rank_id'] = mysql_result($result ,$i, \"taxonomy_rank_id\");\n\t\t\t$tmp['taxonomy_rank_name'] = mysql_result($result, $i, \"taxonomy_rank_name\");\n\t\t\tarray_push($nodes, $tmp);\n\t\t}\n\t\t\n\t\tmysql_free_result($result);\n\t\t\n\t\t//$nodes = stripslashesDeep($nodes);\n\t\t\n\t\treturn $nodes;\t\n\t\t\n\t}",
"public function getRank();",
"public function getSalesRank()\n {\n if ($this->_fields['SalesRank']['FieldValue'] == null) {\n $this->_fields['SalesRank']['FieldValue'] = array();\n }\n return $this->_fields['SalesRank']['FieldValue'];\n }",
"abstract protected function getRankingName();",
"public function getRanks()\n {\n $request = \"SELECT * FROM rank\";\n $request = $this->connexion->query($request);\n $ranks = $request->fetchAll(PDO::FETCH_ASSOC);\n return $ranks;\n }",
"public function rank_by_cards(){\n\t\tarsort($this->cardArray);\n\t\t$it = 1;\n\t\tforeach($this->cardArray as $x => $x_value) {\n\t\t echo \"Team=\" . $x . \", Rank=\" . $it . \", Score=\" . $x_value;\n\t\t echo \"<br>\";\n\t\t $it++;\n\t\t}\n\t}",
"public static function get_all_ranks()\n {\n }",
"public function getRank(): int\n {\n return self::RANK[$this->value];\n }",
"public function getRanking()\n {\n }",
"public function getRankedResultsWithData()\n {\n $resultsWithData = $this->getResultsWithData();\n\n // Group results by rank\n $groupedResults = [];\n foreach ($resultsWithData as $result) {\n $groupedResults[$result->rank][] = $result;\n }\n\n // Alphabetize results in each rank\n foreach ($groupedResults as $rank => $resultsInRank) {\n $sortedResults = [];\n foreach ($resultsInRank as $resultInRank) {\n $subject = isset($resultInRank->school) ? 'school' : 'school_district';\n // Combine name and ID in case any two subjects (somehow) have identical names\n $key = $resultInRank->$subject->name . $resultInRank->$subject->id;\n $sortedResults[$key] = $resultInRank;\n }\n ksort($sortedResults);\n $groupedResults[$rank] = array_values($sortedResults);\n }\n\n // Convert into numerically-indexed array so it can be passed to a React component\n $indexedResults = [];\n foreach ($groupedResults as $rank => $resultsInRank) {\n $indexedResults[] = [\n 'rank' => $rank,\n 'subjects' => $resultsInRank,\n ];\n }\n\n return $indexedResults;\n }",
"public function getRankCollection()\n {\n return Mage::getSingleton('core/session')->getToosoRankCollection();\n }",
"public function getRankingList() {\n\t\treturn $this->rankingList;\n\t}",
"public function getQueryRanklist()\n {\n return $this->get(self::_QUERY_RANKLIST);\n }",
"public function getRankingByCompany();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the Regular Expression string to match a source URL | public static function get_source_regexp() {
return '^(https?:\/\/)?(www\.)?eventbrite\.com(\.[a-z]{2})?\/';
} | [
"public static function get_source_regexp() {\n\t\treturn '^(https?:\\/\\/)?(www\\.)?meetup\\.com(\\.[a-z]{2})?\\/';\n\t}",
"public static function get_source_regexp() {\n\t\treturn '^(https?:\\/\\/)?(www\\.)?facebook\\.com(\\.[a-z]{2})?\\/';\n\t}",
"protected function getUrlRegexp()\r\n {\r\n if (!$this->urlRegexp) {\r\n $dlm = '|';\r\n $regexp = preg_replace('#%[^%]+%#', '(.*)', $url = preg_quote(rtrim($this->getUrl(), '/'), $dlm));\r\n if (null === $regexp) {\r\n $this->formatOutput = true;\r\n throw new \\RuntimeException(\"Error on calculation URL's regular expression for URL: $url of page:\\n\" . $this->saveXML());\r\n }\r\n $this->urlRegexp = $dlm . $regexp . '$' . $dlm . 'U';\r\n }\r\n\r\n return $this->urlRegexp;\r\n }",
"public function getURLRegex() {\n\t\treturn implode($this->patternRegex);\n\t}",
"public static function getRegularExpression();",
"public function getRegExpression()\n {\n // coub valid hosts\n $r = self::REGEXP_HTTP_SCHEME.'coub\\.com\\/';\n // video ID\n $r .= '(view|embed)\\/([^\\/\\?\\#]+)';\n // more params\n $r .= '('.self::REGEXP_ALLOWED_IN_URL.'*)';\n\n return $r;\n }",
"private function getUrlRegex() {\n return '%^(?:(?:https?|ftp)://)(?:\\S+(?::\\S*)?@|\\d{1,3}(?:\\.\\d{1,3}){3}|(?:(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)(?:\\.(?:[a-z\\d\\x{00a1}-\\x{ffff}]+-?)*[a-z\\d\\x{00a1}-\\x{ffff}]+)*(?:\\.[a-z\\x{00a1}-\\x{ffff}]{2,6}))(?::\\d+)?(?:[^\\s]*)?$%iu';\n }",
"public function getRegExpression()\n {\n // Vine valid hosts\n $r = self::REGEXP_HTTP_SCHEME.'vine\\.co\\/v\\/';\n // video ID\n $r .= '([^\\/\\?\\#]+)(\\/embed\\/(simple|postcard)?)?';\n // more params\n $r .= '('.self::REGEXP_ALLOWED_IN_URL.'*)';\n\n return $r;\n }",
"abstract public function getRegularExpression();",
"public function getRawUrlRegex()\n\t{\n\t\treturn 'http:\\/\\/www.scribd.com\\/doc\\/([0-9]{1,})\\/[^\\s]{1,}';\n\t}",
"public function getRegExpression()\n {\n // youtube valid hosts\n $r = self::REGEXP_HTTP_SCHEME.'(youtube\\.com|youtu\\.be|youtube-nocookie\\.com)\\/';\n // video ID\n $r .= '(watch\\?v=|v\\/|u\\/|embed\\/?)?(videoseries\\?list=(.*)|[\\w-]{11}|\\?listType=(.*)&list=(.*))';\n // more params\n $r .= '('.self::REGEXP_ALLOWED_IN_URL.'*)';\n\n return $r;\n }",
"public function getUrlPattern();",
"public function getRawUrlRegex()\n\t{\n\t\treturn '\\n(http:\\/\\/instagram.com\\/p\\/[a-zA-Z0-9_-]{1,}[\\/]{1,})';\n\t}",
"public function getURLPattern();",
"public function regex() {\n\t\treturn $this->_regex_string;\n\t}",
"public function getRegex();",
"public function getLinkSanitizerRegEx() : string\n {\n return (string)$this->scopeConfig->getValue(self::XML_PATH_CONFIG_LINK_SANITIZER_REGEX);\n }",
"protected function findListOfUrl($source){\n //preg_match_all(\"/<p class=\\\"info\\\"> <span class=\\\"url\\\">[a-zA-Z\\.\\/(<b>)(<\\/b>)0-9\\-#&_;+?=\\[\\]\\(\\)\\\"\\'\\$\\:%áčďéěíňóřšťúůýžÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ\\<\\>~,!]*<\\/span>/i\", $source, $match);\n preg_match_all(\"/<div class=ro>http:\\/\\/([a-zA-Z0-9-]*\\.)+[a-zA-Z]{2,4}/i\", $source, $match);\n return $match;\n }",
"protected function getSrcAttributeNameForRegex(): string\n {\n if (count($this->settings->sourceAttribute) < 1) {\n return 'src';\n }\n\n return implode('|', $this->settings->sourceAttribute);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that authentication procedure fails with broken hash to compare to | public function authenticationFailsWithBrokenHash() {} | [
"public function testHashFail()\n {\n try {\n static::$config->hash(3);\n } catch (\\Exception $e) {\n $class = static::$config;\n $this->assertEquals($class::ERR_INVALID_SESSION_HASH, $e->getMessage());\n }\n }",
"public function testHashThatNotNeedRehash(): void\n {\n $this->assertFalse(self::$password->needsRehash(self::$password->hash('password')));\n }",
"public function testInvalidPasswordHashVerification()\n {\n $this->expectException(InvalidArgumentException::class);\n $hasher = new PasswordHasher();\n $result = $hasher->verifyHashedPassword(null, 'very strong password');\n }",
"public function testValidationCaseForInvalidInputDataForDigestVerification()\n {\n $hasher = $this->getHashAlgorithmInstanceForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $hasher->verifyHash(['wrong'], '1234abcd');\n } else {\n $hasThrown = null;\n\n try {\n $hasher->verifyHash(['wrong'], '1234abcd');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"public function It_should_rechallenge_if_incorrect_username_given()\n\t{\n\t\t$callback = array( $this, 'assertDigestAuthChallenge' );\n\t\t$this->requestWithDigestAuth( 'GET', '/', 'Bob', 'correct-password', null, $callback );\n\t}",
"public function testValidateAuthkeyFailed()\n {\n $user = User::findByUsername($this->model->getUserName()->getValue());\n expect_not($user->validateAuthKey('not-existing'));\n }",
"public function testAuthenticationFailure()\n {\n $this->visit('/')\n ->click('Login')\n ->seePageIs('/login')\n ->type('test+normal@example.ex', '#email')\n ->type('123password', '#password')\n ->click('#login-button')\n ->see('These credentials do not match our records');\n }",
"public function testVerifyByDatabaseFailure()\n {\n $request = ServerRequestFactory::fromGlobals(['REQUEST_URI' => '/']);\n\n $this->sessionMock->expects($this->once())\n ->method('read')\n ->with('Auth')\n ->will($this->returnValue([\n 'username' => 'does-not',\n 'password' => 'exist',\n ]));\n\n $request = $request->withAttribute('session', $this->sessionMock);\n\n $authenticator = new SessionAuthenticator($this->identifiers, [\n 'identify' => true,\n ]);\n $result = $authenticator->authenticate($request);\n\n $this->assertInstanceOf(Result::class, $result);\n $this->assertSame(Result::FAILURE_CREDENTIALS_INVALID, $result->getStatus());\n }",
"public function testAuthz_INVALID_SESSION()\n {\n putenv('AUTH=' . escapeshellarg(Q\\implode_assoc(\";\", array('uid'=>1, 'checksum'=>md5(1 . md5('abc') . 's3cret')))));\n \n $this->setExpectedException('Q\\Auth_SessionException', \"Invalid session checksum\");\n $this->Auth->authz();\n \n $this->assertEquals(Auth::INVALID_CHECKSUM, $this->Auth->getStatus(), 'status code');\n $this->assertNotNull($this->Auth->user(), 'user');\n $this->assertEquals(1, $this->Auth->user()->getId(), 'id');\n }",
"public function test_check_password_throws_exception()\n\t{\n\t\t$this->login();\n\t\t$this->auth->check_password('dave');\n\t}",
"public function testValidationCaseForInvalidSaltUsedForHashing()\n {\n $hasher = $this->getHashAlgorithmInstanceForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $hasher->setSalt(['none']);\n } else {\n $hasThrown = null;\n\n try {\n $hasher->setSalt(['none']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"public function testCheckFunctionReturnsFalseOnSafeHash()\n {\n $safeResponse = MalwareChecker::check($this->safeHash);\n\n $this->assertFalse($safeResponse);\n }",
"public function testValidateUserFailed()\n {\n $user = User::findByUsername($this->model->username);\n expect_not($user->validateAuthKey('not-existing'));\n }",
"public function testLoginWithWrongCredentials()\n {\n $user = new User();\n $this->assertFalse($user->login('LOREM IPSUM', 'LOREM IPSUM'));\n }",
"public static function test_password($password, $hash);",
"public function testPasswordVerify1(): void\n {\n $hash = Password::passwordHash('qwerty');\n $pass = Password::passwordVerify('qwerty', $hash);\n self::assertTrue($pass);\n }",
"public function testAuthenticationWithWrongPwd()\n {\n $response = $this->isAuthenticated('user', 'noPassword');\n \n //identity was not set\n $this->assertFalse(\n $response,\n '\"authentication\" should not be granted' \n );\n }",
"public function testAuthenticateSuccessWithRehash(): void\n {\n $newAuthenticator = new Authenticator(['hashOptions' => ['cost' => 5]]);\n $result = $newAuthenticator->authenticate($this->mockAuthenticatableUser, $this->password);\n $this->assertTrue($result);\n }",
"public function test_maybe_hash_passwords_no_clear_password() {\n global $yourls_user_passwords;\n $copy = $yourls_user_passwords;\n\n $yourls_user_passwords = array();\n $yourls_user_passwords['md5'] = $copy['md5'];\n\n $this->assertFalse( yourls_maybe_hash_passwords() );\n\n $yourls_user_passwords = $copy;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receive an parse map data from Game | private function receiveMap() {
// Get new Map State from Server
$frame = explode(" ", $this->read());
// Seperate Owners Data from Strength Data
$ownersLength = count($frame) - $this->height * $this->width;
// Owners Data is the first section
$owners = array_slice($frame, 0, $ownersLength);
// Populate Map with Owners
$this->parseOwners($owners);
// Strength Data is the second Section
$strengths = array_slice($frame, -$this->height * $this->width);
// Parse Strengths
$this->parseStrengths($strengths);
// Find all New Borders
$this->registerBorders();
} | [
"function parse_recv_0071(GenericBot &$o, $p, $d) {\n\t\t$d = parse_str_packet($d, 'a[id;map;ip;port]lz[16]rlnf[ip]w');\n\n\t\t$o->map = new Map($d['map']);\n\n\t\tif ($o->overwriteIp) list($d['ip']) = getIpAndPort($o->masterServer, 6900);\n\t\t$o->mapServer = $d['ip'] . ':' . $d['port'];\n\t\t$o->sock->connect($d['ip'], $d['port']);\n\n\t\tsendMapLogin($o);\n\n\t\t$o->connectionData['id_map'] = getr32($o->sock->extract(4));\n\n\t\t$o->step = GB_STEP_MAP_PROCESS;\n\t}",
"public function parseMap($map=null)\n {\n if(!is_null($this->xmlmapfile))\n $filenmame = Dota_Replay_Parser_Maps::getMapFilePath($this->xmlmapfile);\n elseif(!is_null($map))\n $filenmame = Dota_Replay_Parser_Maps::getMapFilePath($map);\n else\n {\n require_once 'Dota/Replay/Parser/Exception.php';\n throw new Dota_Replay_Parser_Exception(sprintf('Map is not set.'));\n }\n\n if (!($fp = fopen($filenmame, \"r\")))\n {\n require_once 'Dota/Replay/Parser/Exception.php';\n throw new Dota_Replay_Parser_Exception(sprintf('Cannot open %s', $filenmame));\n }\n\n $datas = \"\";\n while ($data = fread($fp, 4096))\n {\n // Remove all blankspaces\n $datas .= $data;\n }\n // $datas = eregi_replace(\">\".\"[[:space:]]+\".\"<\",\"><\",$datas);\n // Parsing\n $parser = self::getInstance()->getXmlParser();\n\n if (!xml_parse($parser, $datas, feof($fp)))\n {\n $reason = xml_error_string(xml_get_error_code($parser));\n $reason .= xml_get_current_line_number($parser);\n }\n\n xml_parser_free($parser);\n }",
"public function loadLocalMap() {\n\t\t\t// Declare Classes\n\t\t\t$RepMap\t\t\t= new RepMap();\n\t\t\t$RepCharacter\t= new RepCharacter();\n\t\t\t$ModMap\t\t\t= new ModMap();\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t$mouseovers\t\t= false;\n\t\t\t$ids\t\t\t= false;\n\t\t\t$childmaps\t\t= false;\n\t\t\t$user\t\t\t= Session::getVar('user');\n\t\t\t$id_areamap\t\t= (isset($_POST['id_areamap'])) ? trim($_POST['id_areamap']) : false;\n\t\t\t// If values were sent\n\t\t\tif ($id_areamap) {\n\t\t\t\t// Get char info\n\t\t\t\t$character\t\t\t= $RepCharacter->getCharByUserId($user['id']);\n\t\t\t\t// Get open courses for this player\n\t\t\t\t$courses\t\t\t= ($character) ? $RepMap->getOpenCoursesCountMaps($character['id']) : false;\n\t\t\t\t// Load Parent map's info\n\t\t\t\t$parent\t\t\t\t= $RepMap->getParentMapInfoIdByMapId($id_areamap);\n\t\t\t\t$id_parentmap\t\t= ($parent) ? $parent['id'] : false;\n\t\t\t\t// Load Map info\n\t\t\t\t$map\t\t\t\t= $RepMap->getMapById($id_areamap);\n\t\t\t\t// Get linking info\n\t\t\t\t$links\t\t\t\t= $RepMap->getLinksIconsByAreaId($id_areamap);\n\t\t\t\t// Get maps log info\n\t\t\t\tforeach ($links as $link) {\n\t\t\t\t\t$childmaps[]\t= $link['id_map_target'];\n\t\t\t\t}\n\t\t\t\t$gonetrhu\t\t\t= ($map['id'] == 101) ? $RepMap->getGoneThruFromList($character['id'], $childmaps) : false;\n\t\t\t\t// links\n\t\t\t\tif ($links) {\n\t\t\t\t\tforeach ($links as $link) {\n\t\t\t\t\t\t$ids\t= ($ids) ? $ids.','.$link['id_map_target'] : $link['id_map_target'];\n\t\t\t\t\t}\n\t\t\t\t\t$mouseovers\t= $RepMap->getAllMouseOversByMapId($ids);\n\t\t\t\t}\n\t\t\t\t// Get Map level\n\t\t\t\t$level\t\t\t= ($level = $RepMap->getAreaInfoByMapId($id_areamap)) ? $level['int_level'] : false;\n\t\t\t\t// Get courses' names\n\t\t\t\t$RepQuestion\t= new RepQuestion();\n\t\t\t\t$courses\t\t= ($courses) ? $RepQuestion->getCoursesNamesById($courses) : false;\n\t\t\t\t// Model Course List\n\t\t\t\t$courses\t\t= ($courses) ? $ModMap->courseList($courses) : false;\n\t\t\t\t// Model Return\n\t\t\t\tif ($map) {\n\t\t\t\t\t$return['id_areamap']\t= $id_areamap;\n\t\t\t\t\t$return['id_parentmap']\t= $id_parentmap;\n\t\t\t\t\t$return['area_name']\t= $map['vc_name'];\n\t\t\t\t\t$return['level']\t\t= $level;\n\t\t\t\t\t$return['courses']\t\t= $courses;\n\t\t\t\t\t$return['map']\t\t\t= $ModMap->map($map, $id_parentmap, 'world', $links, $mouseovers, $gonetrhu);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return\n\t\t\theader('Content-Type: application/json');\n\t\t\techo json_encode($return);\n\t\t}",
"function parseMap($clientid)\n{\n\n\tglobal $map, $players, $map_width, $map_height, $display_width, $display_height;\n\t$player = $players[$clientid];\n\n\t$x = $player->x;\n\t$y = $player->y;\n\t$display_height = 21;\n\n\t/* TODO */\n\t// Fix walking to the right, and removing camera centering there.\n\n\tif(($x - ((($display_width - 1)/2))) > 0) // If approaching left of screen, don't center on player.\n\t{\n\t\t$startx = $x - (($display_width - 1)/2);\n\t} else { // Centero on player horizontally.\n\t\t$startx = 0;\n\t}\n\tif($y > 10)\n\t{\n\t\t$starty = $y - 10; //If not at top of map, center screen.\n\t} else {\n\t\t$starty = $y - ($y); //If approaching top of map, do not center screen.\n\t}\n\n\n\t$localmap = array_slice($map, $startx, $display_width); // Get the part of map we want to show player.\n\t$localmap = array_values($localmap); //Reset coordinates.\n\n\t$parsedMap = [];\n\t\n\t$i = 0;\n\tfor ($xi=0; $xi < $display_width; $xi++) {\n\t\t$yi = 0;\n\t\t$y = $localmap[$xi];\n\t\t$y = array_slice($y, $starty, $display_height);\n\t\t$y = array_values($y);\n\t\tforeach ($y as $tile) {\n\t\t\tif($tile != null)\n\t\t\t{\n\t\t\t\t$tilecolor = $tile->color($player);\n\t\t\t\t\n\t\t\t\tif(isset($tile->clientid)) //If player is not me, paint it RED!\n\t\t\t\t{\n\t\t\t\t\tif($tile->clientid != $clientid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tilecolor = \"#ff0000\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isset($tile->rarity))\n\t\t\t\t{\n\t\t\t\t\tif($tile->rarity == \"legendary\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$tilecolor = \"#ff8000\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$parsedMap[$xi][$yi] = json_encode([\"rep\" => $tile->representation(), \"color\" => $tilecolor]);\n\t\t\t\t$yi++;\n\t\t\t}\n\t\t}\n\t}\n\treturn $parsedMap;\n}",
"function _getMap()\n {\n // map : de_dust2 at: 0 x, 0 y, 0 z\n $map_regex = \"/^map\\s*:\\s*(\\w+)\\s/m\";\n return preg_match($map_regex, $this->status(), $match) ? $match[1] : 'Unknown';\n }",
"static function ajax_load_map() {\n $saved_maps = get_option(WF_GMP_MAPS_KEY);\n $map_name = substr($_POST['map_name'], 0, 20);\n\n $out = $saved_maps[$map_name];\n $out['map_name'] = $map_name;\n\n die(json_encode($out));\n }",
"public function showMap(){\n $battlefieldId = filter_input(INPUT_GET, 'battlefieldId', FILTER_SANITIZE_NUMBER_INT);\n $battlefield = new Battlefield($this->_DI, $battlefieldId);\n $battlefieldData = $battlefield->getData();\n $this->picturePath = $battlefield->generateMap();\n $this->battlefieldName = $battlefieldData['name'];\n $this->hives = $battlefieldData['hives'];\n }",
"function GetMapContent() {\n\treturn Send ( \"Website:234524:MAPCONTENT:GET:PHP\" );\n}",
"function getMap()\n\t{\n\t\tif(isset($_POST['gid']))\n\t\t\t$gid = mysql_real_escape_string($_POST['gid']);\n\t\telse\n\t\t\t$gid = mysql_real_escape_string($_GET['gid']);\n\t\t\n\t\t$query = \"SELECT i.uid, c.year, c.season, i.country, c.aid, c.type\n\t\t\t\t\tFROM in_game i, games g, curr_map c\n\t\t\t\t\tWHERE g.gid=i.gid and g.gid=$gid and c.gid=g.gid and i.uid=c.owner and g.year=c.year and g.season=c.season;\";\n\t\t$result = mysql_query($query) or die(\"db access error\" . mysql_error());\n\t\t$map = array();\n\t\tfor($i = 0; $i < mysql_num_rows($result); $i++)\n\t\t{\n\t\t\tarray_push($map, mysql_fetch_assoc($result));\n\t\t}\n\t\t\n\t\treturn $map;\n\t}",
"protected abstract function mapData();",
"public function processMapData(): JsonResponse {\r\n $filter = array(\r\n 'password' => FILTER_SANITIZE_STRING,\r\n 'game_id' => FILTER_SANITIZE_NUMBER_INT,\r\n 'map_name' => FILTER_SANITIZE_STRING,\r\n 'record' => array(\r\n 'filter' => FILTER_DEFAULT,\r\n 'flags' => FILTER_REQUIRE_ARRAY,\r\n )\r\n );\r\n $data = filter_input_array(INPUT_POST, $filter);\r\n\r\n // verify that api password is correct\r\n if ($data['password'] != Config::get('tfts.mapApiPassword')) {\r\n return new JsonResponse('Invalid password');\r\n }\r\n\r\n // verify that game exists\r\n $game = Game::getById($data['game_id']);\r\n if (!is_object($game)) {\r\n return new JsonResponse('Invalid game id: ' . $data['game_id']);\r\n }\r\n\r\n // verify that map exists\r\n $map_repository = $this->em->getRepository(Map::class);\r\n $map = $map_repository->findOneBy(['game' => $game, 'map_name' => $data['map_name']]);\r\n if (is_null($map)) {\r\n return new JsonResponse('Invalid map: ' . $data['map_name']);\r\n }\r\n\r\n // verify that map is not processed\r\n if ($map->isProcessed()) {\r\n return new JsonResponse('Map has already been processed: ' . $data['map_name']);\r\n }\r\n\r\n $response = [];\r\n foreach ($data['record'] as $record) {\r\n // verify that user exists\r\n $userList = new UserList();\r\n $userList->filterByUserName($record['user']);\r\n if (sizeof($userList->getResults()) != 1) {\r\n $response[$record['user']] = 'Invalid user';\r\n continue;\r\n }\r\n $user = $userList->getResults()[0]->getUserObject();\r\n\r\n // prepare datetime object\r\n $datetime = new \\DateTime($record['date'] . ' ' . $record['time']);\r\n\r\n $mapTime = intval($record['mapTime']);\r\n $record_repository = $this->em->getRepository(MapRecord::class);\r\n $current_record = $record_repository->findOneBy(['map' => $map, 'user' => $user->getUserId()]);\r\n // new?\r\n if (is_null($current_record)) {\r\n $this->em->persist(new MapRecord($this->userToEntity($user), $map, $datetime, $mapTime));\r\n $this->em->flush();\r\n $response[$record['user']] = 'Added new record';\r\n continue;\r\n }\r\n\r\n // improvement?\r\n if ($mapTime < $current_record->getRecord()) {\r\n $current_record->setDateTime($datetime);\r\n $current_record->setRecord($mapTime);\r\n $this->em->persist($current_record);\r\n $this->em->flush();\r\n $response[$record['user']] = 'Record improved';\r\n } else {\r\n $response[$record['user']] = 'No improvement';\r\n }\r\n }\r\n return new JsonResponse($response);\r\n }",
"protected function getMapData() {\n\t\treturn $this->arrCompiledMap;\n\t}",
"public function parse() {\n\t\t$cachePath = co\\dirpath(realpath(sys_get_temp_dir()), \"sc2rep_cache\", $this->identify[\"repHash\"]);\n\n\t\t$json = exec(co\\registry('pythonExe').' '.co\\registry('app.path').\"/lib/parse.py {$cachePath} {$this->path} 2>&1\", $out, $retcode);\n\t\tif($retcode != 0) {\n\t\t\tthrow new ParseException(\"the replay file appears to be corrupt [2]\", 400);\n\t\t}\n\n\t\t$this->data = json_decode($json, true);\n\t}",
"function grab_map($gamer=\"\"){\n if($gamer==\"\"){\n echo $error;\n }\n $url=\"http://www.bungie.net/Stats/Reach/CareerStats/maps.aspx?player=\".$gamer.\"&vc=3\"; //maps url\n $gamerstats=array();\n $file=file($url);\n $cnt=count($file);\n\t$maparr=array();\n\t$bestmap=-1;//invalid K/d's\n\t$worstmap=100;\n\t$wpos;\n\t$bpos;\n\t$count=0;\n for($i=0;$i<$cnt;$i++){\n\t if(preg_match(\"/<h4><strong>/\", $file[$i])){\n\t\t$m=explode(\">\", $file[$i]);\n\t\t$t=explode(\"<\", $m[2]);\n\t\tarray_push($maparr, $t[0]);$count++;\n\t }\n if(preg_match(\"/<strong>K\\/D:/\", $file[$i])){\n $kd=explode(\":\", $file[$i]);\n $temp=explode(\">\", $kd[1]);\n $k2d=explode(\"<\", $temp[2]);\n if($k2d[0]<$worstmap){\n\t\t $worstmap=$k2d[0];\n\t\t $wpos=$count-1;\n\t\t}\n\t\telseif($k2d[0]>$bestmap){\n\t\t $bestmap=$k2d[0];\n\t\t $bpos=$count-1;\n\t\t}\n }\n }\n\t$bmapwKd=$maparr[$bpos] .\" (\".$bestmap.\")\";\n\t$wmapwKd=$maparr[$wpos] .\" (\".$worstmap.\")\";\n\t$returnarr=array();\n\tarray_push($returnarr, $bmapwKd);\n\tarray_push($returnarr, $wmapwKd);\n\treturn $returnarr;\n }",
"function mapPart($clientID, $receivedMappart)\n{\n\t\treturn;\n\tglobal $map, $mapset;\n\t$receivedMap = $receivedMappart[\"map\"];\n\tif(!$mapset)\n\t{\n\t\tforeach($receivedMap as $key => $value) {\n\t $parts = explode(\",\", $key);\n\t $x = $parts[0];\n\t $y = $parts[1];\n\t $parsedRep = parseRepresentation($receivedMap[$key]);\n\t setTile($x, $y, $parsedRep);\n\t }\n\t if($receivedMappart['part'] == $receivedMappart['endpart'])\n\t { //Received final chunk.\n\t \t$mapset = true;\n\t \tpopulateMap();\n\t\t}\n\t}\n}",
"function mode_onBeginMap($map) {\n\t\t$challenge = $this->connection->getCurrentMapInfo();\n\t\t$this->connection->chatSendServerMessage('$fff»» $06fNew map: $fff'.Core::stripColors($challenge->name).'$06f by $fff'.$challenge->author.'$06f.');\n\t\t$this->karma();\n\t}",
"function list_map($site) {\n $bluewave = new bluewaveapi(null, null, null, $site);\n echo json_encode($bluewave->list_map());\n\n return;\n }",
"public function actionGetMap() {\n // input\n $round_id = empty($this->params['round_id'])?'':$this->params['round_id'];\n\n // output\n $result['success'] = true;\n $result['data'] = [];\n $result['data']['grids'] = [];\n\n if (!empty($round_id)) {\n $round = Round::findOne($round_id);\n } else {\n $round = Round::find()->orderBy('id DESC')->one();\n }\n if ($round && $round->is_start && $round->is_end == 0) {\n $result['data']['grids'] = Map::find()->all();\n }\n\n $result['query_time'] = microtime(true) - $this->ini_time;\n return $result;\n }",
"protected abstract function parseMappings(): void;"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the marker icon Available prototype: public function setIcon(string $url); public function setIcon(Ivory\GoogleMapBundle\Model\MarkerImage $markerImage) | public function setIcon()
{
$args = func_get_args();
if(isset($args[0]) && is_string($args[0]))
{
if($this->icon === null)
$this->icon = new MarkerImage();
$this->icon->setUrl($args[0]);
}
else if(isset($args[0]) && ($args[0] instanceof MarkerImage))
$this->icon = $args[0];
else
throw new \InvalidArgumentException();
} | [
"public function setIcon()\n {\n $args = func_get_args();\n\n if(isset($args[0]) && is_string($args[0]))\n {\n if($this->icon === null)\n $this->icon = new MarkerImage();\n\n $this->icon->setUrl($args[0]);\n }\n else if(isset($args[0]) && ($args[0] instanceof MarkerImage))\n {\n if(!is_null($args[0]->getUrl()))\n $this->icon = $args[0];\n else\n throw new \\InvalidArgumentException('A marker image icon must have an url.');\n }\n else if(!isset($args[0]))\n $this->icon = null;\n else\n throw new \\InvalidArgumentException(sprintf('%s'.PHP_EOL.'%s'.PHP_EOL.'%s'.PHP_EOL.'%s',\n 'The icon setter arguments is invalid.',\n 'The available prototypes are :',\n ' - public function setIcon(string $url)',\n ' - public function setIcon(Ivory\\GoogleMapBundle\\Model\\Overlays\\MarkerImage $markerImage)'));\n }",
"public function setMarkerImageHelper(MarkerImageHelper $markerImageHelper)\n {\n $this->markerImageHelper = $markerImageHelper;\n }",
"public function setIcon(Icon $icon) {\n\t\t$this->icon = $icon;\n\t}",
"public function setIcon($icon);",
"public function setIconUrl($icon_url)\n {\n $this->icon_url = $icon_url;\n }",
"public function setIconUrl($v) { $this->_imgUrl = (string)$v; }",
"public function loadMarkerIcons()\n {\n foreach($this->markers as $marker)\n {\n if ($marker->getIcon() instanceof Radcodes_Lib_Google_Map_Icon)\n {\n $this->addIcon($marker->getIcon());\n }\n }\n }",
"function SetWindowIcon(\\raylib\\Image $image): void { }",
"public function SetIcon() {\n\n if ($this->icon) {\n echo '<link rel=\"shortcut icon\" href=\"'.$this->icon.'.ico\" />';\n }\n }",
"public function updateIconImage($projectId, $networkId, $iconImage)\r\n {\r\n try {\r\n $this->updateSomething($projectId, $networkId, 'icon_image', $iconImage);\r\n } catch (RuntimeException $e) {\r\n throw $e;\r\n }\r\n }",
"function SetIcon(wxIcon $icon){}",
"public function setIcon($url)\n {\n $this->emoji = '';\n $this->icon = $url;\n }",
"public function setIconUrl(?string $value): void {\n $this->getBackingStore()->set('iconUrl', $value);\n }",
"public function setIconId($value) {\r\n $this->iconId = $value;\r\n }",
"public static function setToolbarIcon($image, $default = 'article.png', $path = 'images/admin-icons')\r\n\t{\r\n\r\n\t}",
"public function setIhmIcon($icon);",
"public function setIdentityProviderIcon($value)\n {\n $this->ipIcon = (string) $value;\n\n return $this;\n }",
"public function setCategoryIcon($categoryIcon);",
"public function setIconMap($icon_map) {\n $this->icon_map = $icon_map;\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Receive webhook payload and returns it. | public static function processWebHook()
{
$body = @file_get_contents('php://input');
return $body ? json_decode($body) : false;
} | [
"public function fetchWebhook($webhook): Webhook;",
"private function get_webhook_content() {\n\t\t/*\n\t\tif( $webhook = fopen('php://input' , 'rb') ) {\n\t\t\t$webhookContent = '';\n\t\t\twhile (!feof($webhook)) {\n\t\t\t\t$webhookContent .= fread($webhook, 4096);\n\t\t\t}\n\t\t\tfclose($webhook);\n\t\t\treturn $webhookContent;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\treturn $_REQUEST;\n\t}",
"public function get_payload();",
"public function process()\n {\n $post = file_get_contents('php://input');\n\n $data = json_decode($post, true);\n\n if (json_last_error() !== 0)\n {\n return;\n }\n\n $enabled = Configuration::get('ENABLE_RAZORPAY_WEBHOOK');\n\n if (($enabled === 'on') and\n (empty($data['event']) === false))\n {\n \n if (isset($_SERVER['HTTP_X_RAZORPAY_SIGNATURE']) === true)\n {\n $razorpayWebhookSecret = Configuration::get('RAZORPAY_WEBHOOK_SECRET');\n\n if (empty($razorpayWebhookSecret) === false)\n {\n\n try\n {\n $this->api->utility->verifyWebhookSignature($post,\n $_SERVER['HTTP_X_RAZORPAY_SIGNATURE'],\n $razorpayWebhookSecret);\n }\n catch (Errors\\SignatureVerificationError $e)\n {\n $log = array(\n 'message' => $e->getMessage(),\n 'data' => $data,\n 'event' => 'razorpay.wc.signature.verify_failed'\n );\n\n Logger::addLog(\"Error: \". json_encode($log), 4);\n //Set the validation error in response\n header('Status: 400 Signature Verification failed', true, 400); \n exit;\n }\n\n switch ($data['event'])\n {\n case Razorpay::PAYMENT_AUTHORIZED:\n return $this->paymentAuthorized($data);\n\n case Razorpay::PAYMENT_FAILED:\n return $this->paymentFailed($data);\n\n case Razorpay::ORDER_PAID:\n return $this->orderPaid($data);\n\n default:\n return;\n }\n\n }\n }\n \n }\n }",
"public function webhook() {\n\n\n\n }",
"function payload() {\n $body = file_get_contents('php://input');\n if (strlen($body) == 0) {\n return json_decode('{}');\n }\n if (!isJSON($body)) {\n httpErr(400, 'invalid json payload');\n }\n $json = json_decode($body, false);\n return $json;\n}",
"public function processWebhookRequest(WebhookEvent $webhookEvent);",
"private function getPayload(){\n\t\t$requestType = $this->input->get_request_header(\"content-type\");\n\t\t$data = $_POST;\n\n\t\tif($requestType == \"application/json\"){\n\t\t\t$data = json_decode($this->input->raw_input_stream, true);\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function processWebhook(array $data);",
"abstract public function handle(WebhookPayload $payload): void;",
"public function webhook() {\n \n\t\t\n \n\t \t}",
"public function processWebHook(): WebResponse\n {\n\n }",
"public function webhook(Request $request)\n {\n }",
"function get_webhook($webhook_id)\n {\n $data = $this->make_request('webhooks/'.$webhook_id, 'GET');\n return $data;\n }",
"public function webhook()\n\t\t{\n\t\t}",
"public static function process(){\n\t $webhook_service = WC_Wallee_Service_Webhook::instance();\n\t \n\t //We set the status to 500, so if we encounter a state where the process crashes the webhook is marked as failed.\n\t header('HTTP/1.1 500 Internal Server Error');\n\t\t$requestBody = trim(file_get_contents(\"php://input\"));\n\t\tset_error_handler(array(__CLASS__, 'handle_webhook_errors'));\n\t\ttry{\n\t\t $request = new WC_Wallee_Webhook_Request(json_decode($requestBody));\n\t\t\t$webhook_model = $webhook_service->get_webhook_entity_for_id($request->get_listener_entity_id());\n\t\t\tif ($webhook_model === null) {\n\t\t\t WooCommerce_Wallee::instance()->log(sprintf('Could not retrieve webhook model for listener entity id: %s', $request->get_listener_entity_id()), WC_Log_Levels::ERROR);\n\t\t\t\techo sprintf('Could not retrieve webhook model for listener entity id: %s', $request->get_listener_entity_id());\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t\t$webhook_handler_class_name = $webhook_model->get_handler_class_name();\n\t\t\t$webhook_handler = $webhook_handler_class_name::instance();\n\t\t\t$webhook_handler->process($request);\n\t\t\theader('HTTP/1.1 200 OK');\n\t\t}\n\t\tcatch(Exception $e){\n\t\t WooCommerce_Wallee::instance()->log($e->getMessage(), WC_Log_Levels::ERROR);\n\t\t\techo sprintf($e->getMessage());\n\t\t\texit();\n\t\t}\n\t\texit();\n\t}",
"public function getPayload()\n {\n return $this->request->getJsonRawBody();\n }",
"public function webhook(){\n $this->config->load('flutterwave');\n \n $local_secret_hash = $this->config->item('secret_hash');\n \n $body = @file_get_contents(\"php://input\");\n \n $response = json_decode($body,1);\n \n\t\t/* \n\t\t\tto store the flutter wave response and server response into the log file, \n\t\t\twhich can be found under 'application/logs/' folder\n\n\t\t\tMake a note many times codeIgniter cannot directly read the values of '$_SERVER' variable therefore if such problem arises \n\t\t\tyou can add the following line in your root .htaccess file\n\t\t\t\n\t\t\tSetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=$1 \n\t\t\t\n\t\t*/\n log_message('debug', 'Flutter Wave Webhook - Normal Response - JSON DATA --> ' . var_export($response, true));\n log_message('debug', 'Server Variable --> '.var_export($_SERVER,true));\n \n\t\t/* Reading the signature sent by flutter wave webhook */\n $signature = (isset($_SERVER['HTTP_VERIF_HASH']))?$_SERVER['HTTP_VERIF_HASH']:'';\n \n\t\t/* comparing our local signature with received signature */\n if(empty($signature) || $signature != $local_secret_hash ){\n log_message('error', 'Flutter Wave Webhook - Invalid Signature - JSON DATA --> ' . var_export($response, true));\n log_message('error', 'Server Variable --> '.var_export($_SERVER,true));\n exit();\n }\n\t\t\n if(strtolower($response['status']) == 'successful') {\n // TIP: you may still verify the transaction\n // before giving value.\n $response = $this->flutterwave->verify_transaction($response['txRef']);\n \n $response = json_decode($response,1);\n \n if(!empty($response) && isset($response['data']['status']) && strtolower($response['data']['status']) == 'successful' \n && isset($response['data']['chargecode']) && ( $response['data']['chargecode'] == '00' || $response['data']['chargecode'] == '0')\n ){\n \n $payer_email = $response['data']['custemail'];\n $paymentplan = $response['data']['paymentplan'];\n \n /* \n\t\t\t\t\tPerform Database Operations here \n\t\t\t\t\tAdd your custom code here for any other operation like \n\t\t\t\t\tselling good / inserting / update transaction record in database / anything else\n\t\t\t\t*/\n \n }else{\n /* Transaction failed */\n log_message('error', 'Flutter Wave Webhook - Inner Verification Failed --> ' . var_export($response, true));\n log_message('error', 'Server Variable --> '.var_export($_SERVER,true));\n }\n \n }else{\n /* Transaction failed */\n log_message('error', 'Flutter Wave Webhook - Outter Verification Failed --> ' . var_export($response, true));\n log_message('error', 'Server Variable --> '.var_export($_SERVER,true));\n }\n \n }",
"private function getPayload(){\n\t\t\treturn $this->payload;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Display a checkbox field. | function _display_checkbox_field($name, $value) {
?>
<input type="checkbox" name="<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]" id="http_authentication_<?php echo htmlspecialchars($name); ?>"<?php if ($value) echo ' checked="checked"' ?> value="1" /><br />
<?php
} | [
"function render_checkbox_field() {\n\t\t$this->render_checkbox( $this->input_name, $this->label, $this->get_saved_value() );\n\t}",
"private function Checkboxfield() {\n \t$dv = strtolower($this->default_value);\n \t$checked = \"\";\n \tif($dv == \"checked\" || $dv == \"true\" || $dv == 1) $checked = \"checked\";\n \treturn '<input type=\"checkbox\" name=\"' . $this->name . '\" ' . $checked . '/>';\n }",
"function render_checkboxes_field() {\n\t\t$saved_value = $this->get_saved_value();\n\t\t$saved_value = is_array( $saved_value ) ? $saved_value : [];\n\n\t\techo '<fieldset>';\n\t\tprintf( '<legend class=\"screen-reader-text\"><span>%s</span></legend>', esc_html( $this->name ) );\n\n\t\tforeach ( $this->options as $option => $label ) {\n\t\t\t$this->render_checkbox( $this->input_name . \"[$option]\", $label, in_array( $option, $saved_value ) );\n\t\t\techo '<br>';\n\t\t}\n\n\t\techo '</fieldset>';\n\t}",
"public function output_checkbox() {\r\n\t\techo $this->yikes_get_checkbox();\r\n\t}",
"function proj_echo_safely_checkbox( $fieldname, $label, $is_checked = NULL, $value_when_checked = 1, \n $tabindex=1, $input_instance = NULL, $parms = NULL, $label_on_left = FALSE ) {\n\n $field_id = HTML::field_id_from_fieldname( $fieldname, $input_instance );\n\n echo NEWLINE;\n\n if( $label_on_left ) {\n echo '<label for=\"' . $field_id . '\">';\n $label = trim( $label );\n $this->echo_safely( $label );\n echo '</label>';\n }\n\n echo '<input type=\"checkbox\" name=\"' . $fieldname . '\" id=\"' . $field_id . '\" value=\"';\n $this->echo_safely( $value_when_checked );\n echo '\"';\n if( $is_checked ) echo ' CHECKED ';\n if( $tabindex > 0 ) echo ' tabindex=\"' . $tabindex . '\" ';\n if( $parms ) echo ' ' . $parms . ' ';\n echo ' />';\n\n if( ! $label_on_left ) {\n echo '<label for=\"' . $field_id . '\">';\n $label = trim( $label );\n $this->echo_safely( $label );\n echo '</label>';\n }\n echo NEWLINE;\n }",
"function theme_form_checkbox ($field) {\n $output = '<fieldset class=\"form-row form-row-checkbox\">';\n $output .= '<input type=\"checkbox\" name=\"' . $field['name'] . '\" value=\"1\"';\n if ($field['checked']) {\n $output .= ' checked=\"checked\"';\n }\n $output .= '/>';\n if (!empty($field['label'])) {\n $output .= '<label>' . $field['label'] . '</label>';\n }\n $output .= '</fieldset>';\n return $output;\n}",
"function checkbox($args) {\r\n\t\t$options = get_option($this->options);\r\n\t\techo \"<input name='$this->options[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $options[$args['id'] ]); \r\n\t\techo \" /><span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t}",
"function print_checkbox($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\techo '<div class=\"on-off\"><span></span></div>';\n\t\tif($input_value=='true'){\n\t\t\t$input_value='on';\n\t\t}\n\t\tif($input_value=='false'){\n\t\t\t$input_value='off';\n\t\t}\n\t\techo '<input name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"hidden\" value=\"'.$input_value.'\" />';\n\t\t$this->close_option($value);\n\t}",
"function print_checkbox($value){\n\t\techo wp_kses_post($this->before_option_title.$value['name'].$this->after_option_title);\n\t\tif (isset($value['std']))\n\t\t$input_value = $this->get_field_value($value['id'], $value['std']);\n\t\techo '<div class=\"on-off\"><span></span></div>';\n\t\tif(isset($input_value) && $input_value=='true'){\n\t\t\t$input_value='on';\n\t\t}\n\t\tif(isset($input_value) && $input_value=='false'){\n\t\t\t$input_value='off';\n\t\t}\n\t\tif (isset($input_value))\n\t\techo '<input name=\"'.esc_attr($value['id']).'\" id=\"'.esc_attr($value['id']).'\" type=\"hidden\" value=\"'.esc_attr($input_value).'\" />';\n\t\t$this->close_option($value);\n\t}",
"function lfe_faster_np_checkbox_display() {\n\t?>\n<!-- Here we are comparing stored value with 1. Stored value is 1 if user checks the checkbox otherwise empty string. -->\n<input type='checkbox' name='lfe-faster-np-checkbox' value='1'\n\t<?php checked( 1, get_option( 'lfe-faster-np-checkbox' ), true ); ?> />\n<p class='description'>\nCheck this box to speed up the Nested Pages tool. When checked, the hidden Events will not be accessible.\n</p>\n\t<?php\n}",
"function _nighthawk_control_boolean( $id, $label, $value = 0 ) {\n\tprint \"\\n\\n\" . '<input' . ( ! empty( $value ) ? ' checked=\"checked\"' : '' ) . ' type=\"checkbox\" id=\"' . esc_attr( $id ) . '\" name=\"' . esc_attr( $id ) . '\" value=\"1\" /> ';\n\tprint \"\\n\" . '<label for=\"' . esc_attr( $id ) . '\">' . esc_html( $label ) . '</label><br />';\n}",
"function scbirs_add_checkout_checkbox() {\r\n\twoocommerce_form_field( 'scbirs_checkbox', array(\r\n\t\t'type' => 'checkbox',\r\n\t\t'class' => array('form-row privacy'),\r\n\t\t'label_class' => array('woocommerce-form__label woocommerce-form__label-for-checkbox checkbox'),\r\n\t\t'input_class' => array('woocommerce-form__input woocommerce-form__input-checkbox input-checkbox'),\r\n\t\t'required' => true,\r\n\t\t'label' => 'Ich bin Mitglied des ScBirs und habe die <a href=\"/so-funktionierts/\">Bedingungen</a> gelesen und verstanden.',\r\n\t)); \r\n}",
"protected function renderSingleCheckbox() {\n\n $content = '';\n \n // Adds the hidden input element\n $content .= \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlInputHiddenElement(\n array(\n \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlAddAttribute('name', $this->getItemConfiguration('itemName')),\n \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlAddAttribute('value', '0'),\n )\n );\n\n // Adds the checkbox input element\n $content .= \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlInputCheckBoxElement(\n array(\n \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlAddAttribute('name', $this->getItemConfiguration('itemName')),\n \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlAddAttribute('value', '1'),\n \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlAddAttributeIfNotNull('checked', $this->getCheckedAttribute()),\n \\SAV\\SavLibraryPlus\\Utility\\HtmlElements::htmlAddAttribute('onchange', 'document.changed=1;'),\n )\n );\n\n return $content;\n }",
"public function show_checkbox( $name = \"ids[]\" ) {\n\t\t?>\n\t\t<input type=\"checkbox\" name=\"<?php echo $name; ?>\" value=\"<?php echo $this->get_ID(); ?>\"/>\n\t\t<?php\n\t}",
"function print_checkbox($id, $value) {\n echo '<div class=\"checkbox\">\n <input id=\"'.$id.'\" type=\"checkbox\" name=\"'.$id.'\" value=\"'.$value.'\">\n <label for=\"'.$id.'\"></label>\n </div>';\n }",
"function Checkbox( $data ){\n global $WP_Top_Slider;\n\n $checked = ( isset( $WP_Top_Slider->options[ $data['id'] ] ) ) ? 'checked=\"checked\"' : '' ;\n\n echo '<input ' . $checked . ' id=\"' . $data['id'] . '\" name=\"WPTS_OPTIONS[' . $data['id'] . ']\" type=\"checkbox\" /> <span class=\"description\">' . $data['description'] . '</span>';\n \n }",
"public static function checkbox() {\r\n\r\n\t\tif( ! is_user_logged_in() AND ! bbp_is_reply_edit() ) {\r\n?>\r\n\t\t<p>\r\n\t\t\t<input name=\"bbp_anonymous_subscribe\" id=\"bbp_anonymous_subscribe\" type=\"checkbox\" value=\"1\" tabindex=\"<?php bbp_tab_index(); ?>\" checked=\"checked\" />\r\n\t\t\t<label for=\"bbp_anonymous_subscribe\"><?php _e( 'Notify me of follow-up replies via email', 'bbp-anonymous-subscriptions' ); ?></label>\r\n\t\t</p>\r\n\r\n\t\t\t<?php } /*else {\r\n\r\n\t\t\tif( bbp_is_reply_edit() ) {\r\n\r\n\t\t\t\t<p>\r\n\t\t\t\t<input name=\"bbp_anonymous_subscribe\" id=\"bbp_anonymous_subscribe\" type=\"checkbox\" <?php echo self::is_user_subscribed( get_the_author_meta( 'ID' ) ); ?> tabindex=\"<?php bbp_tab_index(); ?>\" />\r\n\t\t\t\t<label for=\"bbp_anonymous_subscribe\"><?php _e( 'Notify author of follow-up replies via email.', 'bbp-anonymous-subscriptions' ); ?></label>\r\n\t\t\t\t</p>\r\n\r\n\t\t\t<?php } ?>\r\n\r\n<?php\r\n\t\t}*/\r\n\t}",
"function writeCheckbox ($ce) {\n\t\t\techo \"<tr><td align=\\\"right\\\"><strong>$ce->label: </strong></td><td>\" .\n\t\t\t\t\t\t\"<input type=\\\"checkbox\\\" name=\\\"\" . $ce->name . \"\\\" \";\n\t\t\tif ($ce->value == true)\n\t\t\t\techo \"checked\";\n\t\t\techo\t\t\t\" >\" .\n\t\t\t\t\t \"</td></tr>\";\n\t\t}",
"function create_check_feld()\n\t\t{\n\t\t\t\t$cfeld = \"\";\n\t\t\t\t$cfeld .= '<input type=\"checkbox\" name=\"' . $this->name . '\" value=\"1\" {$checked' . $this->name .$value. '} class=\"' . $this->name . '\" id=\"' . $this->name .\n\t\t\t\t\t\t'\"/>';\n\t\t\t\t$cfeld .= '<label for=\"' . $this->name . '\">{$plugin_' . $this->praefix . \"_\" .\n\t\t\t\t\t\t$this->name_org . '}{$plugin_error.'.$this->name.'} </label>';\n\t\t\t\t$cfeld .= \"\\n\";\n\t\t\t\t$cfeld .= '<br />';\n\t\t\t\t#echo $cfeld;\n\t\t\t\t$this->cfeld = $cfeld;\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets a new exceptionId Unique identifier for an exception associated with an error. | public function setExceptionId($exceptionId)
{
$this->exceptionId = $exceptionId;
return $this;
} | [
"public function getExceptionID()\n\t{\n\t\treturn $this->uniqueId;\n\t}",
"public function getExceptionId()\n {\n return $this->exceptionId;\n }",
"public function getIdException ()\r\n\t\t{\r\n\t\t\treturn $this->id_exception;\r\n\t\t}",
"public function setExceptionReferenceId(string $referenceId);",
"protected function setError($id) {\n\n\t\t$this->errorId = $id;\n\t}",
"function setCodeErrorId($arg0) {\n\t\t\t$this->code_error_id = $arg0;\n\t\t\treturn $this;\n\t\t}",
"protected function setEmailId(){\n\t\t$this -> emailId = $this -> $name . ' <' . $this -> $emailAddress . '>';\n\t}",
"function setEventId($id)\r\n {\r\n $this->_eventid = $id ;\r\n }",
"public function setId($id): void\n {\n throw new RecordException('Cannot change an id of an immutable record.');\n }",
"public function getErrorId()\n {\n return $this->errorId;\n }",
"public function setEventId($id) {\n\t\t$this->id = $id;\n\t}",
"public function getErrorId()\n {\n return $this->getProperty(self::ERROR_ID);\n }",
"public function setIdentifier(int $identifier): void\n {\n if ($identifier < 0 || $identifier > USHORT_MAXVALUE) {\n throw new Exception(\"Invalid ICMP identifier: \" . $identifier);\n }\n $this->identifier = $identifier;\n $this->rebuildChecksum();\n }",
"public function setException(\\Exception $e) {\n $this->exception = $e;\n }",
"function setId($puzzle_id)\n {\n $this->puzzle_id = -1;\n if (!is_int($puzzle_id)) {\n throw new Exception(\"Puzzle_Id must be an integer!\");\n } else if ($puzzle_id !== -1 && !checkPuzzleId($puzzle_id)) {\n throw new Exception(\"Puzzle_Id did not find a match!\");\n }\n $this->puzzle_id = $puzzle_id;\n }",
"public function setEventId($event_id)\r\n\t{\r\n\t\t$this->event_id = $event_id;\r\n\t}",
"public function setID($id)\n\t{\n\t\tif ( ! is_numeric($id) )\n\t\t{\n\t\t\tthrow new DOFaultyIDException();\n\t\t}\n\t\t\n\t\t$this->id = (int)$id;\n\t}",
"public function setException(\\Exception $exception){\n $this->exception = $exception;\n }",
"public function setException(Exception $exception)\n {\n $this->exception = $exception;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set BrandId value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setBrandId($brandId = null)
{
// validation for constraint: int
if (!is_null($brandId) && !is_numeric($brandId)) {
throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($brandId)), __LINE__);
}
if (is_null($brandId) || (is_array($brandId) && empty($brandId))) {
unset($this->BrandId);
} else {
$this->BrandId = $brandId;
}
return $this;
} | [
"public function setBrandId($brand_id)\n {\n $this->brand_id = $brand_id;\n }",
"public function setBrandId($brandId)\n {\n $this->brandId = $brandId;\n }",
"public function setIdBrand(int $idBrand) {\n $this->idBrand = $idBrand;\n }",
"public function getBrandId()\n {\n return $this->brandId;\n }",
"public function getBrandId()\n {\n return $this->brand_id;\n }",
"function getBrandId()\n {\n return $this->brand_id;\n }",
"public function getBrand_id()\n {\n return $this->brand_id;\n }",
"public function getId_brand()\n {\n return $this->id_brand;\n }",
"public function getBrandId()\n {\n return $this->getParameter('brandId');\n }",
"public function setBrand($brand);",
"public function setBrand(Brand $brand)\n {\n $this->brand = $brand;\n }",
"public function setBrand(BrandBean $object = null) {\n $this->setRef('cars_ibfk_1', $object, 'cars');\n }",
"public function deleteById($brandId);",
"public function setBrand($newBrand) {\r\n $this->brand = $newBrand;\r\n }",
"public function manage_brand($brand_id='')\n\t{\n\t\t$data['brand_details']='';\n\t\tif($brand_id)\n\t\t{\n\t\t\t$data['brand_details']=$this->ref_brand->get($brand_id);\n\t\t\t$data['brand_images']=$this->lnk_brands_to_docs->get_brand_images($brand_id);\n\t\t}\n\t\t$data['page']='Manage brand';\n\t\t$view = 'admin/collection/brands/admin_manage_brand_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\n\t}",
"public function patchBrandItemRequest($id, $brand962c5489a05f3ff6192cd4c630d8abd7 = 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 patchBrandItem'\n );\n }\n\n $resourcePath = '/brands/{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/ld+json', 'application/json', 'text/html']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/ld+json', 'application/json', 'text/html'],\n ['application/merge-patch+json']\n );\n }\n\n // for model (json/xml)\n if (isset($brand962c5489a05f3ff6192cd4c630d8abd7)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($brand962c5489a05f3ff6192cd4c630d8abd7));\n } else {\n $httpBody = $brand962c5489a05f3ff6192cd4c630d8abd7;\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 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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function deleteById($brandsId);",
"function delete_brand($id) {\n return $this->db->delete('brands', array('id' => $id));\n }",
"public function setBrandName($brandName = null)\n {\n // validation for constraint: string\n if (!is_null($brandName) && !is_string($brandName)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($brandName)), __LINE__);\n }\n if (is_null($brandName) || (is_array($brandName) && empty($brandName))) {\n unset($this->BrandName);\n } else {\n $this->BrandName = $brandName;\n }\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all available TOC mode in keyvalue pairs. | public static function getAllTocMode() {
return Section::getAllCommentMode();
} | [
"public function getTOC()\n {\n return is_array($this->_tree) ? $this->_tree : array();\n }",
"function getTOC() {\n if (is_null($this->_config)) { $this->_config = new configuration($this->_file); }\n $this->setupLocale(true);\n\n $allow_debug = $GLOBALS['conf']['allowdebug']; // avoid global $conf; here.\n\n // gather toc data\n $has_undefined = false;\n $toc = array('conf'=>array(), 'plugin'=>array(), 'template'=>null);\n foreach($this->_config->setting as $setting) {\n if (is_a($setting, 'setting_fieldset')) {\n if (substr($setting->_key, 0, 10)=='plugin'.CM_KEYMARKER) {\n $toc['plugin'][] = $setting;\n } else if (substr($setting->_key, 0, 7)=='tpl'.CM_KEYMARKER) {\n $toc['template'] = $setting;\n } else {\n $toc['conf'][] = $setting;\n }\n } else if (!$has_undefined && is_a($setting, 'setting_undefined')) {\n $has_undefined = true;\n }\n }\n\n // build toc\n $t = array();\n\n $t[] = html_mktocitem('configuration_manager', $this->getLang('_configuration_manager'), 1);\n $t[] = html_mktocitem('dokuwiki_settings', $this->getLang('_header_dokuwiki'), 1);\n foreach($toc['conf'] as $setting) {\n $name = $setting->prompt($this);\n $t[] = html_mktocitem($setting->_key, $name, 2);\n }\n if (!empty($toc['plugin'])) {\n $t[] = html_mktocitem('plugin_settings', $this->getLang('_header_plugin'), 1);\n }\n foreach($toc['plugin'] as $setting) {\n $name = $setting->prompt($this);\n $t[] = html_mktocitem($setting->_key, $name, 2);\n }\n if (isset($toc['template'])) {\n $t[] = html_mktocitem('template_settings', $this->getLang('_header_template'), 1);\n $setting = $toc['template'];\n $name = $setting->prompt($this);\n $t[] = html_mktocitem($setting->_key, $name, 2);\n }\n if ($has_undefined && $allow_debug) {\n $t[] = html_mktocitem('undefined_settings', $this->getLang('_header_undefined'), 1);\n }\n\n return $t;\n }",
"public function getToc();",
"public static function getAllCommentMode() {\n return Section::getAllTocMode();\n }",
"private function _getTOC() {\n $tocFile = $this->getManifest('ncx');\n $tocContents = simplexml_load_file($this->ebookDir.'/'.$this->opfDir.'/'.$tocFile['href']);\n \n $toc = array();\n foreach($tocContents->navMap->navPoint AS $navPoint) {\n $navPointData = $navPoint->attributes();\n $toc[(string)$navPointData['playOrder']]['id'] = (string)$navPointData['id'];\n $toc[(string)$navPointData['playOrder']]['naam'] = (string)$navPoint->navLabel->text;\n $toc[(string)$navPointData['playOrder']]['src'] = (string)$navPoint->content->attributes();\n }\n \n $this->toc = $toc;\n }",
"function getTOC() {\n\t\treturn $this->toc;\n\t}",
"public function getListMode();",
"function scorm_get_hidetoc_array(){\n return array(0 =>get_string('sided','scorm'),\n 1 => get_string('hidden','scorm'),\n 2 => get_string('popupmenu','scorm'));\n}",
"public function tableOfContentsMain() {\n if (!$toc = $this->cache->get_value(self::CACHE_TOC_MAIN)) {\n $this->db->prepared_query(\"\n SELECT cat.Name AS categoryName, cat.ID AS categoryId,\n f.ID, f.Name, f.Description, f.NumTopics, f.NumPosts,\n f.LastPostTopicID, f.MinClassRead, f.MinClassWrite, f.MinClassCreate,\n f.Sort, f.AutoLock, f.AutoLockWeeks,\n ft.Title, ft.LastPostAuthorID, ft.LastPostID, ft.LastPostTime, ft.IsSticky, ft.IsLocked\n FROM forums f\n INNER JOIN forums_categories cat ON (cat.ID = f.CategoryID)\n LEFT JOIN forums_topics ft ON (ft.ID = f.LastPostTopicID)\n ORDER BY cat.Sort, cat.Name, f.Sort, f.Name\n \");\n $toc = [];\n while ($row = $this->db->next_row(MYSQLI_ASSOC)) {\n $category = $row['categoryName'];\n unset($row['categoryName']);\n $row['AutoLock'] = ($row['AutoLock'] == '1');\n if (!isset($toc[$category])) {\n $toc[$category] = [];\n }\n $toc[$category][] = $row;\n }\n $this->cache->cache_value(self::CACHE_TOC_MAIN, $toc, 86400 * 10);\n }\n return $toc;\n }",
"public function tableOfContentsMain() {\n $toc = self::$cache->get_value(self::CACHE_TOC_MAIN);\n if ($toc === false ) {\n self::$db->prepared_query(\"\n SELECT cat.Name AS categoryName, cat.ID AS categoryId,\n f.ID, f.Name, f.Description, f.NumTopics, f.NumPosts,\n f.LastPostTopicID, f.MinClassRead, f.MinClassWrite, f.MinClassCreate,\n f.Sort, f.AutoLock, f.AutoLockWeeks,\n ft.Title, ft.LastPostAuthorID, ft.LastPostID, ft.LastPostTime, ft.IsSticky, ft.IsLocked,\n (fp.TopicID IS NOT NULL AND fp.Closed = '0') AS has_poll\n FROM forums f\n INNER JOIN forums_categories cat ON (cat.ID = f.CategoryID)\n LEFT JOIN forums_topics ft ON (ft.ID = f.LastPostTopicID)\n LEFT JOIN forums_polls fp ON (fp.TopicID = ft.ID)\n ORDER BY cat.Sort, cat.Name, f.Sort, f.Name\n \");\n $toc = [];\n while ($row = self::$db->next_row(MYSQLI_ASSOC)) {\n $category = $row['categoryName'];\n $row['AutoLock'] = ($row['AutoLock'] == '1');\n if (!isset($toc[$category])) {\n $toc[$category] = [];\n }\n $toc[$category][] = $row;\n }\n self::$cache->cache_value(self::CACHE_TOC_MAIN, $toc, 86400 * 10);\n }\n return $toc;\n }",
"function getTableOfContents() {\n\t\t$helpToc = array();\n\t\t\n\t\t$helpDir = 'help/'.Locale::getLocale().'/.';\n\t\t$cacheFile = 'help/cache/helpToc.inc.php';\n\t\t\n\t\tif (file_exists($cacheFile) && Help::dirmtime($helpDir,true) < filemtime($cacheFile)) {\n\t\t\trequire($cacheFile);\n\t\t} else {\n\t\t\t$topicId = 'index/topic/000000';\n\n\t\t\t$helpToc = Help::buildTopicSection($topicId);\n\n\t\t\t$xmlDao = &new XMLDAO();\n\t\t\tif ((file_exists($cacheFile) && is_writable($cacheFile)) || (!file_exists($cacheFile) && is_writable(dirname($cacheFile)))) {\n\t\t\t\t$fp = fopen($cacheFile, 'w');\n\t\t\t\tif (function_exists('var_export')) {\n\t\t\t\t\tfwrite($fp, '<?php $helpToc = ' . var_export($helpToc, true) . '; ?>');\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tfwrite($fp, '<?php $helpToc = ' . $xmlDao->custom_var_export($helpToc, true) . '; ?>');\n\t\t\t\t}\t\t\t\t\n\t\t\t\tfclose($fp);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn Help::buildToc($helpToc);\n\t}",
"public function actionKnowledgebaseTOC() \n\t{\n\t\t$viewData = array(\n\t\t\t'title' => 'Knowledgebase Table of Contents',\n\t\t\t'some_key' => 'Table of Contents'\n\t\t);\n\n\t\treturn View::make('mockup.knowledgebase.toc', $viewData);\n\t}",
"public function get_modes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $system_mode = Mode::create();\n $system_modes = $system_mode->get_modes();\n\n $modes = array();\n $modes[self::MODE_STANDALONE] = lang('ldap_standalone');\n\n foreach ($system_modes as $mode => $mode_text) {\n if ($mode === Mode_Engine::MODE_MASTER)\n $modes[self::MODE_MASTER] = lang('ldap_master');\n else if ($mode === Mode_Engine::MODE_SLAVE)\n $modes[self::MODE_SLAVE] = lang('ldap_slave');\n }\n\n return $modes;\n }",
"public function get_modes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n return $this->modes;\n }",
"public function menuTermOptionList();",
"public function displayMode()\n {\n $modeList = array();\n\n try {\n $stmt = $this->db->prepare(\"SELECT * \n FROM Modes\");\n $stmt->execute();\n\n $row[] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if ($stmt->rowCount() > 0) {\n foreach ($row as $mode) {\n array_push($modeList, $mode);\n\n }\n return $modeList;\n\n }\n\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }",
"function html_TOC($toc){\n if(!count($toc)) return '';\n global $lang;\n $out = '<!-- TOC START -->'.DOKU_LF;\n $out .= '<div id=\"dw__toc\">'.DOKU_LF;\n $out .= '<h3 class=\"toggle\">';\n $out .= $lang['toc'];\n $out .= '</h3>'.DOKU_LF;\n $out .= '<div>'.DOKU_LF;\n $out .= html_buildlist($toc,'toc','html_list_toc','html_li_default',true);\n $out .= '</div>'.DOKU_LF.'</div>'.DOKU_LF;\n $out .= '<!-- TOC END -->'.DOKU_LF;\n return $out;\n}",
"function p_get_parsermodes(){\n global $conf;\n\n //reuse old data\n static $modes = null;\n if($modes != null && !defined('DOKU_UNITTEST')){\n return $modes;\n }\n\n //import parser classes and mode definitions\n require_once DOKU_INC . 'inc/parser/parser.php';\n\n // we now collect all syntax modes and their objects, then they will\n // be sorted and added to the parser in correct order\n $modes = array();\n\n // add syntax plugins\n $pluginlist = plugin_list('syntax');\n if(count($pluginlist)){\n global $PARSER_MODES;\n $obj = null;\n foreach($pluginlist as $p){\n /** @var DokuWiki_Syntax_Plugin $obj */\n if(!$obj = plugin_load('syntax',$p)) continue; //attempt to load plugin into $obj\n $PARSER_MODES[$obj->getType()][] = \"plugin_$p\"; //register mode type\n //add to modes\n $modes[] = array(\n 'sort' => $obj->getSort(),\n 'mode' => \"plugin_$p\",\n 'obj' => $obj,\n );\n unset($obj); //remove the reference\n }\n }\n\n // add default modes\n $std_modes = array('listblock','preformatted','notoc','nocache',\n 'header','table','linebreak','footnote','hr',\n 'unformatted','php','html','code','file','quote',\n 'internallink','rss','media','externallink',\n 'emaillink','windowssharelink','eol');\n if($conf['typography']){\n $std_modes[] = 'quotes';\n $std_modes[] = 'multiplyentity';\n }\n foreach($std_modes as $m){\n $class = \"Doku_Parser_Mode_$m\";\n $obj = new $class();\n $modes[] = array(\n 'sort' => $obj->getSort(),\n 'mode' => $m,\n 'obj' => $obj\n );\n }\n\n // add formatting modes\n $fmt_modes = array('strong','emphasis','underline','monospace',\n 'subscript','superscript','deleted');\n foreach($fmt_modes as $m){\n $obj = new Doku_Parser_Mode_formatting($m);\n $modes[] = array(\n 'sort' => $obj->getSort(),\n 'mode' => $m,\n 'obj' => $obj\n );\n }\n\n // add modes which need files\n $obj = new Doku_Parser_Mode_smiley(array_keys(getSmileys()));\n $modes[] = array('sort' => $obj->getSort(), 'mode' => 'smiley','obj' => $obj );\n $obj = new Doku_Parser_Mode_acronym(array_keys(getAcronyms()));\n $modes[] = array('sort' => $obj->getSort(), 'mode' => 'acronym','obj' => $obj );\n $obj = new Doku_Parser_Mode_entity(array_keys(getEntities()));\n $modes[] = array('sort' => $obj->getSort(), 'mode' => 'entity','obj' => $obj );\n\n // add optional camelcase mode\n if($conf['camelcase']){\n $obj = new Doku_Parser_Mode_camelcaselink();\n $modes[] = array('sort' => $obj->getSort(), 'mode' => 'camelcaselink','obj' => $obj );\n }\n\n //sort modes\n usort($modes,'p_sort_modes');\n\n return $modes;\n}",
"public function dumpTOC()\n {\n $this->dumpBranch($this->tree);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation addItemSubCategoryFileByURLAsync Attach a file to an itemSubCategory by URL. | public function addItemSubCategoryFileByURLAsync($body, $item_sub_category_id)
{
return $this->addItemSubCategoryFileByURLAsyncWithHttpInfo($body, $item_sub_category_id)
->then(
function ($response) {
return $response[0];
}
);
} | [
"public function addItemCategoryFileByURLAsync($body, $item_category_id)\n {\n return $this->addItemCategoryFileByURLAsyncWithHttpInfo($body, $item_category_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemSubCategoryFileByURL($body, $item_sub_category_id)\n {\n $this->addItemSubCategoryFileByURLWithHttpInfo($body, $item_sub_category_id);\n }",
"public function addItemSubCategoryFileAsync($item_sub_category_id, $file_name)\n {\n return $this->addItemSubCategoryFileAsyncWithHttpInfo($item_sub_category_id, $file_name)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemSubCategoryFile($item_sub_category_id, $file_name)\n {\n $this->addItemSubCategoryFileWithHttpInfo($item_sub_category_id, $file_name);\n }",
"protected function addItemSubCategoryFileByURLRequest($body, $item_sub_category_id)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling addItemSubCategoryFileByURL'\n );\n }\n // verify the required parameter 'item_sub_category_id' is set\n if ($item_sub_category_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $item_sub_category_id when calling addItemSubCategoryFileByURL'\n );\n }\n\n $resourcePath = '/beta/itemSubCategory/{itemSubCategoryId}/file';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($item_sub_category_id !== null) {\n $resourcePath = str_replace(\n '{' . 'itemSubCategoryId' . '}',\n ObjectSerializer::toPathValue($item_sub_category_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 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 addItemReceiptFileByURLAsync($body, $item_receipt_id)\n {\n return $this->addItemReceiptFileByURLAsyncWithHttpInfo($body, $item_receipt_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addBusinessTransactionFileByURLAsync($body, $business_transaction_id)\n {\n return $this->addBusinessTransactionFileByURLAsyncWithHttpInfo($body, $business_transaction_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemAccountCodeFileByURLAsync($body, $item_account_code_id)\n {\n return $this->addItemAccountCodeFileByURLAsyncWithHttpInfo($body, $item_account_code_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemSubCategoryAsync($body)\n {\n return $this->addItemSubCategoryAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemProductCodeFileByURLAsyncWithHttpInfo($body, $item_product_code_id)\n {\n $returnType = '';\n $request = $this->addItemProductCodeFileByURLRequest($body, $item_product_code_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 addInvoiceWorksheetFileByURLAsync($body, $invoice_worksheet_id)\n {\n return $this->addInvoiceWorksheetFileByURLAsyncWithHttpInfo($body, $invoice_worksheet_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addCustomFieldFileByURLAsync($body, $custom_field_id)\n {\n return $this->addCustomFieldFileByURLAsyncWithHttpInfo($body, $custom_field_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemAccountCodeFileByURLAsyncWithHttpInfo($body, $item_account_code_id)\n {\n $returnType = '';\n $request = $this->addItemAccountCodeFileByURLRequest($body, $item_account_code_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 addProductionModelFileByURLAsync($body, $production_model_id)\n {\n return $this->addProductionModelFileByURLAsyncWithHttpInfo($body, $production_model_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemReceiptActivityFileByURLAsyncWithHttpInfo($body, $item_receipt_activity_id)\n {\n $returnType = '';\n $request = $this->addItemReceiptActivityFileByURLRequest($body, $item_receipt_activity_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 addJobTimeActivityFileByURLAsync($body, $job_time_activity_id)\n {\n return $this->addJobTimeActivityFileByURLAsyncWithHttpInfo($body, $job_time_activity_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addInventoryAdjustmentFileByURLAsync($body, $inventory_adjustment_id)\n {\n return $this->addInventoryAdjustmentFileByURLAsyncWithHttpInfo($body, $inventory_adjustment_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }",
"public function addItemSerialFileByURL($body, $item_serial_id)\n {\n $this->addItemSerialFileByURLWithHttpInfo($body, $item_serial_id);\n }",
"public function addAisleFileByURLAsync($body, $aisle_id)\n {\n return $this->addAisleFileByURLAsyncWithHttpInfo($body, $aisle_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the proxyValidate URL of the CAS server. Used for all CAS 2.0 validations | public static function setServerProxyValidateURL($url = '') {
global $PHPCAS_CLIENT;
phpCAS :: traceBegin();
if (!is_object($PHPCAS_CLIENT)) {
phpCAS :: error('this method should only be called after
' . __CLASS__ . '::client()');
}
if (gettype($url) != 'string') {
phpCAS :: error('type mismatched for parameter $url (should be
`string\')');
}
$PHPCAS_CLIENT->setServerProxyValidateURL($url);
phpCAS :: traceEnd();
} | [
"public static function setServerProxyValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerProxyValidateURL($url);\t\t\n\t}",
"public function setServerProxyValidateURL($url)\n {\n // Argument Validation\n if (gettype($url) != 'string')\n throw new CAS_TypeMismatchException($url, '$url', 'string');\n\n return $this->_server['proxy_validate_url'] = $url;\n }",
"public static function setServerServiceValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerServiceValidateURL($url);\t\t\n\t}",
"public function setProxyRevalidate(): void\n {\n $this->proxyRevalidate = true;\n }",
"private function configureProxiedURLs() {\n $urlOverride = \"\";\n $proxyHeader = Config::get(\n \t'proxypass.proxy_path_header', 'HTTP_X_FORWARDED_PATH');\n \n // check the explicit path header (default is 'HTTP_X_FORWARDED_PATH') for rewrite purposes; this\n // header can take both regular subdomain hosting as well as a path within\n // a subdomain into account\n $forwardedPath = (!empty($_SERVER[$proxyHeader]) ? $_SERVER[$proxyHeader] : \"\");\n if(!empty($forwardedPath)) {\n $urlOverride = $forwardedPath;\n }\n \n // should there also be a schema override for HTTPS?\n $schemaOverride = \"\";\n if(!empty($_SERVER['SERVER_PORT'])) {\n // check port as a first attempt\n $schemaOverride = ($_SERVER['SERVER_PORT'] == '443' ? \"https\" : \"\");\n }\n if(!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n // check standard LB request header\n $schemaOverride = ($_SERVER['HTTP_X_FORWARDED_PROTO'] == \"https\" ? \"https\" : \"\");\n }\n if(!empty($urlOverride)) {\n // does the schema of the URL override begin with https?\n if(starts_with($urlOverride, 'https')) {\n // set the schema override explicitly because the URL override\n // in URL::forceRootUrl() does not take schema into account\n $schemaOverride = \"https\";\n }\n }\n if(!empty($schemaOverride)) {\n Config::set('proxypass.public_schema_override', $schemaOverride);\n }\n \n // if we now have a URL override, set it\n if(!empty($urlOverride)) {\n if($schemaOverride == \"https\") {\n // override the root URL to include HTTPS as well\n Config::set('proxypass.public_url_override',\n str_replace('http:', 'https:', $urlOverride));\n }\n else\n {\n Config::set('proxypass.public_url_override', $urlOverride);\n }\n }\n\t}",
"function setProxyServer($value)\n {\n $this->_props['ProxyServer'] = $value;\n }",
"public function setProxyServerUri($val)\n {\n $this->_propDict[\"proxyServerUri\"] = $val;\n return $this;\n }",
"public function setProxyApiUrl($url);",
"public function setHttpProxy($http_proxy);",
"public function getServerServiceValidateURL()\n\t{\n\t\tphpCAS::traceBegin();\n\t\t// the URL is build only when needed\n\t\tif(empty($this->server['serviceValidateUrl']))\n\t\t{\n\t\t\t$this->server['serviceValidateUrl'] = $this->_getServerBaseURL() . 'validate';\n\t\t}\n\t\t// $url = $this->_buildQueryUrl($this->server['serviceValidateUrl'],\n\t\t// 'service='.urlencode($this->getURL()));\n\t\tphpCAS::traceEnd($this->server['serviceValidateUrl']);\n\t\treturn $this->server['serviceValidateUrl'];\n\t}",
"public function setHttpsProxy($https_proxy);",
"public function getServerServiceValidateURL()\n {\n phpCAS::traceBegin();\n // the URL is build only when needed\n if ( empty($this->_server['service_validate_url']) ) {\n switch ($this->getServerVersion()) {\n case CAS_VERSION_1_0:\n $this->_server['service_validate_url'] = $this->_getServerBaseURL()\n .'validate';\n break;\n case CAS_VERSION_2_0:\n $this->_server['service_validate_url'] = $this->_getServerBaseURL()\n .'serviceValidate';\n break;\n case CAS_VERSION_3_0:\n $this->_server['service_validate_url'] = $this->_getServerBaseURL()\n .'p3/serviceValidate';\n break;\n }\n }\n $url = $this->_buildQueryUrl(\n $this->_server['service_validate_url'],\n 'service='.urlencode($this->getURL())\n );\n phpCAS::traceEnd($url);\n return $url;\n }",
"public function setProxyHost($host);",
"public function autoSetProxy() {\n\t\t$proxy = Environment::getEnv('SS_PROXY');\n\n\t\tif ($proxy) {\n\t\t\t$this->setOption('proxy', $proxy);\n\t\t}\n\n\t\tif (Config::inst()->get('Grasenhiller\\WkHtmlToX', 'bypass_proxy_for_own_site')) {\n\t\t\t$this->setOption('bypass-proxy-for', rtrim(str_replace(['http://', 'https://'], ['', ''], Director::absoluteBaseURL()), '/'));\n\t\t}\n\t}",
"public function setProxyServer($val)\n {\n $this->_propDict[\"proxyServer\"] = $val;\n return $this;\n }",
"public function setProxy()\n\t{\n\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t$this->proxy['server'] = $args['server'];\n\t\t$this->proxy['port'] = $args['port'];\n\t\t$this->proxy['username'] = ( isset( $args['username'] ) ) ? $args['username'] : '';\n\t\t$this->proxy['password'] = ( isset( $args['password'] ) ) ? $args['password'] : '';\n\t\t$this->proxy['auth_scheme'] = ( isset( $args['auth_scheme'] ) ) ? $args['auth_scheme'] : 'basic';\n\t\t$this->req->setConfig( array( 'proxy_host' => $this->proxy['server'],\n\t\t\t\t\t\t\t\t\t 'proxy_port' => $this->proxy['port'],\n\t\t\t\t\t\t\t\t\t 'proxy_user' => $this->proxy['username'],\n\t\t\t\t\t\t\t\t\t 'proxy_password' => $this->proxy['password'],\n\t\t\t\t\t\t\t\t\t 'proxy_auth_scheme' => $this->proxy['auth_scheme'] ) );\n }",
"public function setProxyServerUri(?string $value): void {\n $this->getBackingStore()->set('proxyServerUri', $value);\n }",
"protected function setProxyAuthScheme() {}",
"private function setSchemeFromProxy() {\n\t\tif (! $this->useProxy) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (isset ( $_SERVER ['SSL_HTTPS'] )) {\n\t\t\t$sslHttps = strtolower ( $_SERVER ['SSL_HTTPS'] );\n\t\t\tif (in_array ( $sslHttps, array (\n\t\t\t\t\t'on',\n\t\t\t\t\t1 \n\t\t\t) )) {\n\t\t\t\t$this->setScheme ( 'https' );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_FORWARDED_PROTO'] ) || empty ( $_SERVER ['HTTP_X_FORWARDED_PROTO'] )) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$scheme = trim ( strtolower ( $_SERVER ['HTTP_X_FORWARDED_PROTO'] ) );\n\t\tif (empty ( $scheme )) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$this->setScheme ( $scheme );\n\t\t\n\t\treturn true;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the target result ID for this Question response. Useful for cloning entire result sets. | public function setResultId($result_id) {
$this->result_id = $result_id;
} | [
"function setResultId($id)\r\n {\r\n $this->_resultid = $id ;\r\n }",
"public function setResult($result)\n\t{\n\t\t// Allow only a set of results\n\t\tif ( !in_array($result, array(1, 0, -1)))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$this->result = $result;\n\t}",
"public function setResult($result)\n\t{\n\t\t// Allow only a set of results\n\t\tif (!in_array($result, [1, 0, -1], true))\n\t\t{\n\t\t\t$result = -1;\n\t\t}\n\n\t\t$this->result = $result;\n\t}",
"protected function setResult( ResourceResult $result ) {\n\t\t$this->result = $result;\n\t}",
"public function setResult($result)\n {\n if ($result instanceof P4_Result) {\n $this->_result = $result;\n }\n }",
"private function setGeocoderResultId($geocoderResultId)\r\n\t{\r\n\t\t$this->geocoderResultId = $geocoderResultId;\r\n\t}",
"public function setResponseId($responseId) {\n\t\t$this->responseId = $responseId;\n\t}",
"public function setUniqResult()\n {\n $this->body = $this->body[0];\n }",
"protected function setResultUid(array &$result)\n {\n // If we're operating with the default uidKey there's nothing to do.\n if ($this->uidKey === \"uid\")\n {\n return;\n }\n\n if (isset($result[$this->uidKey]))\n {\n // The AccessToken expects a \"uid\" to have the key \"uid\".\n $result['uid'] = $result[$this->uidKey];\n }\n }",
"public function set_result($result) {\n\t\t$this->_result = \"$result\";\n\t}",
"public function setMatcherResult($result)\n {\n $this->_matcherResult = $result;\n }",
"public function set_result($result){\n $this->result = $result;\n }",
"public function setResponseId($var)\n {\n GPBUtil::checkString($var, True);\n $this->response_id = $var;\n\n return $this;\n }",
"public function setExecutionResult($executionResult);",
"public function setResult($results)\n {\n $this->results = $results;\n }",
"public function setIdQuestion($new_idQuestion)\n {\n $this->idQuestion = $new_idQuestion;\n }",
"public function setResponseID($responseID = null)\n {\n // validation for constraint: int\n if (!is_null($responseID) && !(is_int($responseID) || ctype_digit($responseID))) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($responseID, true), gettype($responseID)), __LINE__);\n }\n if (is_null($responseID) || (is_array($responseID) && empty($responseID))) {\n unset($this->ResponseID);\n } else {\n $this->ResponseID = $responseID;\n }\n return $this;\n }",
"public function set_result($result) {\n $this->acceptedresult = $result;\n }",
"public function getResultId(): string {\n\t\treturn $this->resultId;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the object associated with `$this` via a "has one" relationship. | protected function _get_has_one($field) {
$lookup_id = $this->classname() . $this->_meta['pk_separator'] . $this->_meta['key'];
$where = array($lookup_id => $this->get_pk());
$this->_db->find('`' . $this->_meta['key'] . '`', $field, $where, 'LIMIT 1');
$result = $this->_db->fetch('assoc');
$obj_id = $result[$this->_meta['key']];
$obj_name = $this->_meta['model_namespace'] . $field;
return new $obj_name(array('id' => $obj_id));
} | [
"public function getOneToOne()\n\t{\n\t\tif (!$this->associationsLoaded)\n\t\t\t$this->loadAssociations();\n\n\t\treturn $this->oneToOne;\n\t}",
"public function isHasOne();",
"public function person()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = user_id, localKey = id)\n return $this->hasOne(Person::class);\n }",
"public function hasOne($associated, array $options = []) {\n\t\t$options += ['sourceTable' => $this];\n\t\t$association = new HasOne($associated, $options);\n\t\treturn $this->_associations[strtolower($association->name())] = $association;\n\t}",
"public static function hasOne($related, $foreignKey = null){}",
"public function isHasOne() {\n return ($this->type == self::DT_HAS && !$this->is_many);\n }",
"private function _has_one($request)\n {\n $relation = $this->_relationships[$request];\n $this->_database->join($relation['foreign_table'], $relation['foreign_table'].'.'.$relation['foreign_key'].' = '.$this->table.'.'.$relation['local_key'], 'left');\n return TRUE;\n }",
"public function isRelationOne()\r\n\t{\r\n\t\treturn $this->getFieldInstance() instanceof O_Dao_Field_ToOne;\r\n\t}",
"public function owner() : \\Illuminate\\Database\\Eloquent\\Relations\\HasOne\n {\n return $this->hasOne(\\App\\Models\\User::class, 'id', 'owner_id');\n }",
"public static function traverse_has_one_relationship($cls) {\n if (is_object($cls))\n $cls = get_class($cls);\n\n $relation = Config::inst()->get($cls, 'has_one');\n $traverse = Config::inst()->get($cls, 'traverse_has_one');\n return !empty($relation) && !empty($traverse) && $traverse;\n }",
"public static function first()\n {\n return self::find()->one();\n }",
"public function oneToOne()\n {\n \t$user \t= User::find(1);\n \t$phone \t= $user->phone;\t\t// It contains one entry\n\n \t// Inverse\n \t$phone \t= Phone::find(1);\n \t$user \t= $phone->user;\t\t\t// It contains one entry\n\n \techo '<pre>';\tprint_r( $phone->toArray() );\n }",
"public function flag(): \\Illuminate\\Database\\Eloquent\\Relations\\HasOne\n {\n return $this->hasOne('App\\Models\\Flags', 'id', 'flagID');\n }",
"public function baby()\n {\n return $this->hasOne(Baby::class);\n }",
"public function find_one($id=null) {\r\n $result = $this->_create_model_instance(parent::find_one($id));\r\n if($result){\r\n // set result on an result set for the eager load to work\r\n $key = (isset($result->{$this->_instance_id_column}) && $this->_associative_results) ? $result->id() : 0;\r\n $results = array($key => $result);\r\n Eager::hydrate($this, $results, self::$_config[$this->_connection_name]['return_result_sets']);\r\n // return the result as element, not result set\r\n $result = $results[$key];\r\n }\r\n return $result;\r\n }",
"public function OneToOne()\n {\n \treturn Members::with(\"phones\")->get();\n\n\n\n }",
"public function isHasOne($key)\n {\n if (false === $this->isRelationship($key)) {\n return false;\n }\n return $this->getMetadata()->getRelationship($key)->isOne();\n }",
"public function getOneToOneResultWith()\n {\n return $this->oneToOneResultWith;\n }",
"public function person()\n {\n return $this->hasOne(Person::class, 'user_id');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add image part to a kooaba multipart request | function image_part($boundary, $attr_name, $file_name, $data) {
$str = "--" . $boundary . "\r\n";
$str .= 'Content-Disposition: form-data; name="'. $attr_name .'"; filename="' . $file_name . '"' . "\r\n";
$str .= 'Content-Transfer-Encoding: binary' ."\r\n";
$str .= 'Content-Type: image/jpeg' . "\r\n\r\n";
$str .= $data . "\r\n";
return $str;
} | [
"function &_addHtmlImagePart(&$obj, $value) {\n $params['content_type'] = $value['c_type'];\n $params['encoding'] = 'base64';\n $params['disposition'] = 'inline';\n $params['dfilename'] = $value['name'];\n $params['cid'] = $value['cid'];\n $obj->addSubpart($value['body'], $params);\n }",
"function _addHtmlImagePart(&$obj, $value) {\n $params['content_type'] = $value['c_type'];\n $params['encoding'] = 'base64';\n $params['disposition'] = 'inline';\n $params['dfilename'] = $value['name'];\n $params['cid'] = $value['cid'];\n $obj->addSubpart($value['body'], $params);\n }",
"function &_addHtmlImagePart(&$obj, $value)\n\t{\n\t\t$params['content_type'] = $value['c_type'];\n\t\t$params['encoding']\t = 'base64';\n\t\t$params['disposition'] = 'inline';\n\t\t$params['dfilename']\t= $value['name'];\n\t\t$params['cid']\t\t = $value['cid'];\n\t\t\n\t\t$ret = $obj->addSubpart($value['body'], $params);\n\t\treturn $ret;\n\t\n\t}",
"public function addImage(Request $request){\n $uploadedImage = $request->file('image');\n if(!$uploadedImage->isValid()){\n return $this->apiResponser->error('Upload gambar gagal.', 400);\n }\n\n // Siapkan nama untuk gambar yang baru diupload\n $newImageFilename = $request->product_id.'_'.$this->newGuid().'.'.$uploadedImage->extension();\n $uploadedImage->move('images/product/original/', $newImageFilename);\n\n // Handle gambar\n $imageMaker = new ImageMaker(base_path('public/images/product/original/'.$newImageFilename), $newImageFilename, 'product/');\n $imageMaker->makeAll();\n\n // Upload gambar ke microservice Product\n $image = $this->product->addImage([\n 'multipart' => [\n [\n 'name' => 'product_id',\n 'contents' => $request->product_id\n ],[\n 'name' => 'user',\n 'contents' => $request->auth->name\n ],[\n 'name' => 'icon',\n 'contents' => \\fopen($imageMaker->getBasePath().'icon/'.$newImageFilename, 'r')\n ],[\n 'name' => 'small',\n 'contents' => \\fopen($imageMaker->getBasePath().'small/'.$newImageFilename, 'r')\n ],[\n 'name' => 'medium',\n 'contents' => \\fopen($imageMaker->getBasePath().'medium/'.$newImageFilename, 'r')\n ],[\n 'name' => 'large',\n 'contents' => \\fopen($imageMaker->getBasePath().'large/'.$newImageFilename, 'r')\n ],[\n 'name' => 'original',\n 'contents' => \\fopen($imageMaker->getBasePath().'original/'.$newImageFilename, 'r')\n ]\n ]\n ]);\n\n return $this->apiResponser->success($image);\n }",
"private function prepareMultipartRequest($data) {\n\t\t$chunks = array();\n\t\t$contentLength = 0;\n\t\t$boundary = \"----moxiehttpclientboundary\";\n\n\t\t$items = $data->getItems();\n\t\tforeach ($items as $name => $item) {\n\t\t\tif (is_string($item)) {\n\t\t\t\t// Normal name/value field\n\t\t\t\t$chunk = \"--\" . $boundary . \"\\r\\n\";\n\t\t\t\t$chunk .= \"Content-Disposition: form-data; name=\\\"\" . $name . \"\\\"\\r\\n\\r\\n\";\n\t\t\t\t$chunk .= $item . \"\\r\\n\";\n\n\t\t\t\t// Add chunk and increase length\n\t\t\t\t$contentLength += strlen($chunk);\n\t\t\t\t$chunks[] = $chunk;\n\t\t\t} else {\n\t\t\t\tif (!file_exists($item[0])) {\n\t\t\t\t\tthrow new MOXMAN_Http_HttpClientException(\"Could not open file: \" . $item[0] . \" for upload using multipart.\");\n\t\t\t\t}\n\n\t\t\t\t// File/stream field\n\t\t\t\t$chunk = \"--\" . $boundary . \"\\r\\n\";\n\t\t\t\t$chunk .= \"Content-Disposition: form-data; name=\\\"\" . $name . \"\\\"; filename=\\\"\" . rawurlencode($item[1]) . \"\\\"\\r\\n\";\n\t\t\t\t$chunk .= \"Content-Type: \" . $item[2] . \"\\r\\n\\r\\n\";\n\n\t\t\t\t// Add before chunk\n\t\t\t\t$contentLength += strlen($chunk);\n\t\t\t\t$chunks[] = $chunk;\n\n\t\t\t\t// Add blob and use the blob size\n\t\t\t\t$contentLength += filesize($item[0]);\n\t\t\t\t$chunks[] = $item;\n\n\t\t\t\t// Add after chunk\n\t\t\t\t$chunk = \"\\r\\n--\" . $boundary . \"--\\r\\n\";\n\t\t\t\t$contentLength += strlen($chunk);\n\t\t\t\t$chunks[] = $chunk;\n\t\t\t}\n\t\t}\n\n\t\t// Set content type, boundary and length\n\t\t$this->setHeader(\"Content-Type\", \"multipart/form-data; boundary=\" . $boundary);\n\t\t$this->setHeader(\"Content-Length\", $contentLength);\n\n\t\treturn $chunks;\n\t}",
"function add_image_to_request($file, $sdoc_id){\n\t\t\t$sql = \"INSERT INTO imagen_solicitud_doc SET sdoc_id = '{$sdoc_id}', imsol_imagen = '{$file}'\";\n\t $result = $this->conn->query($sql);\n\t return $result;\n\t\t}",
"function wc_rest_set_uploaded_image_as_attachment($upload, $id = 0)\n {\n }",
"protected function marketplaceImageMyImagesRequest()\n {\n\n $resourcePath = '/1.0.0/marketplace/image/my_images/';\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/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 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 testImageLoadMultipart()\n {\n }",
"private function setImageMacroToRequest()\n {\n Request::macro('image', $this->getImageRetrivingClosure());\n }",
"public function setMultipartBody($data) {\n\t\t// check whether there is a request() method present to determine\n\t\t// the Guzzle capabilities and what array key to set\n\t\tif(method_exists($this->client, 'request')) {\n\t\t\t$this->request_options['multipart'] = $data;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// set the Content-Type header but don't replace it\n\t\t\t$this->setHeader('Content-Type', 'multipart/form-data', false);\n\t\t\t$this->setBody($data);\n\t\t}\n\t}",
"protected function uploadImageRequest($app_id, $image)\n {\n // verify the required parameter 'app_id' is set\n if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $app_id when calling uploadImage'\n );\n }\n // verify the required parameter 'image' is set\n if ($image === null || (is_array($image) && count($image) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $image when calling uploadImage'\n );\n }\n\n $resourcePath = '/api/v1.0/mobileapps/{appId}/submission/image';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($app_id !== null) {\n $resourcePath = str_replace(\n '{' . 'appId' . '}',\n ObjectSerializer::toPathValue($app_id),\n $resourcePath\n );\n }\n\n // form params\n if ($image !== null) {\n $multipart = true;\n $formParams['Image'] = \\GuzzleHttp\\Psr7\\try_fopen(ObjectSerializer::toFormValue($image), 'rb');\n }\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n ['multipart/form-data']\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 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function set_submit_multipart()\n {\n }",
"abstract public function multipartType();",
"public function upload_inspection_images_post() {\n\t\t$apiKey = $_REQUEST['api_key'];\n\t\t$message = \"\";\n\n\t\t$postBody = file_get_contents('php://input');\n\n\t\t// Match the boundary name by taking the first line with content\n//\t\tpreg_match('/^(?<boundary>.+)$/m', $postBody, $matches);\n//\n//\t\t// Explode the response using the previously match boundary\n//\t\t$parts = explode($matches['boundary'], $postBody);\n//\n//\t\t// Create empty array to store our parsed values\n//\t\t$form_data = array();\n//\n//\t\tforeach ($parts as $part)\n//\t\t{\n//\t\t\t// Now we need to parse the multi-part content. First match the 'name=' parameter,\n//\t\t\t// then skip the double new-lines, match the body and ignore the terminating new-line.\n//\t\t\t// Using 's' flag enables .'s to match new lines.\n//\t\t\t$matched = preg_match('/name=\"?(?<key>\\w+).*?\\n\\n(?<value>.*?)\\n$/s', $part, $matches);\n//\n//\t\t\t// Did we get a match? Place it in our form values array\n//\t\t\tif ($matched)\n//\t\t\t{\n//\t\t\t\t$form_data[$matches['key']] = $matches['value'];\n//\t\t\t}\n//\t\t}\n//\n//\t\t$uploadsDir = $this->rootDir . $this->appDir . $this->uploadsInspectionImagesDir;\n//\n////\t\tDecode to image\n////\t\t$image = base64_decode($form_data['PICHA']);\n//\t\tif(file_put_contents(\"$uploadsDir/\" . rand(10,5948) . \".png\", $form_data['PICHA'])) {\n//\t\t\t$copied = true;\n//\t\t}\n\n\t\t$filepath = $this->rootDir . $this->appDir .\n\t\t\t$this->uploadsInspectionImagesDir . \"/\" .\n\t\t\t$_POST['inspectionId'];\n\n\t\tif (!file_exists($filepath)) {\n\t\t\tmkdir($filepath, 0777, true);\n\t\t}\n\n\t\t$filename = $filepath . \"/\" .\n\t\t\t$_FILES['upload']['name'];\n\n\t\tif (!is_uploaded_file($_FILES['upload']['tmp_name']) or\n\t\t\t!copy($_FILES['upload']['tmp_name'], $filename)) {\n\t\t\t$message = \"Could not save file as $filename!\";\n\t\t} else {\n\t\t\t$copied = true;\n\t\t\t$message = \"Uploaded image successfully!\";\n\t\t}\n\n\t\tif($apiKey==API_KEY && $copied) {\n\t\t\t$this->load->model('Inspectionimage_model');\n\t\t\t$this->Inspectionimage_model->importInspectionimage($_POST);\n\n\t\t\t$this->response([\n\t\t\t\t'status' => TRUE,\n\t\t\t\t'message' => $message\n\t\t\t], REST_Controller::HTTP_OK);\n\t\t} else if ($apiKey==API_KEY && !$copied) {\n\t\t\t$this->response([\n\t\t\t\t'status' => FALSE,\n\t\t\t\t'message' => $message,\n\t\t\t\t'data' => [ 'files' => $_FILES, 'post' => $_POST ]\n\t\t\t], REST_Controller::HTTP_EXPECTATION_FAILED);\n\t\t} else {\n\t\t\t$this->response([\n\t\t\t\t'status' => FALSE,\n\t\t\t\t'message' => 'Invalid credentials. Please try again.'\n\t\t\t], REST_Controller::HTTP_UNAUTHORIZED);\n\t\t}\n\t}",
"public function testCreateUploadPhotoRequest()\n {\n }",
"function formMultiPart($file, $data, $mime_boundary, $eol, $content_type, $extraHeaders = array())\n {\n $rfhprefix = $this->common->cnf[HorusCommon::RFH_PREFIX];\n $mqmdprefix = $this->common->cnf[HorusCommon::MQMD_PREFIX];\n\n $cc = '';\n $cc .= '--' . $mime_boundary . $eol;\n $cc .= \"Content-Disposition: form-data; name=\\\"$file\\\"; filename=\\\"$file\\\"\" . $eol;\n $cc .= 'Content-Type: ' . $content_type . $eol;\n $cc .= 'Content-Transfer-Encoding: base64' . $eol;\n foreach ($extraHeaders as $key => $value)\n if(HorusHttp::DELETE_TAG!==$value)\n $cc .= HorusHttp::formatMQOutHeader($key, $value, $rfhprefix, $mqmdprefix) . $eol;\n $cc .= $eol;\n return $cc . chunk_split(base64_encode($data)) . $eol;\n }",
"public function splitMultipartBody()\n {\n\n }",
"public function addItemImage() {\n\t\t\tif (!$this->validCSRFToken()) $this->error(\"Invalid Request\");\n\n\t\t\t$this->requirePrivilege(\"manage products\");\n\t\t\t# Load Media Module\n\t\t\t$product = new \\Product\\Item();\n\t\t\t$product->get($_REQUEST['product_code']);\n\t\t\tif ($product->error()) app_error(\"Error finding product: \".$product->error(),__FILE__,__LINE__);\n\t\t\tif (! $product->id) $this->error(\"Product not found\");\n\t\n\t\t\t$image = new \\Media\\Item();\n\t\t\t$image->get($_REQUEST['image_code']);\n\t\t\tif ($image->error()) app_error(\"Error finding image: \".$image->error(),__FILE__,__LINE__);\n\t\t\tif (! $image->id) $this->error(\"Image not found\");\n\t\n\t\n\t\t\t$product->addImage($product->id,$image->id,$_REQUEST['label']);\n\t\t\tif ($product->error()) app_error(\"Error adding image: \".$product->error(),__FILE__,__LINE__);\n\t\t\t$response = new \\HTTP\\Response();\n\t\t\t$response->success = 1;\n\t\n\t\t\tprint $this->formatOutput($response);\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
$comics = Comic::where('name', 'like', $keyword.'%'); | public function search(Request $request, $keyword){
// return $comics->paginate(5);
return "OK";
} | [
"public function search($name)\n {\n return Product::where('name','like', '%'.$name.'%')->get();\n }",
"function getCitiesFromDb($query){\n return DB::table('airports')->where('city', 'like', 'col%')->get();\n\n\n }",
"function searchByKeyword(){\n $keyword = $this->validateKeyword()['keyword']; //Validated the keyword\n $items = Item::where('item_name', 'like', '%'.$keyword.'%')->where('sold', false)->paginate(10); //Searches all items that contain the given word or letters\n $categories = Category::get();\n $view = View::make('item.overview', [\n 'items' => $items, \n 'categories' => $categories,\n 'contentHeader' => \"Searching by keyword: \".$keyword]);\n $sections = $view->renderSections();\n return $sections['page'];\n }",
"function findByName($name)\n {\n $name = strtolower($name);\n $recipe = $this->makeModel();\n return $recipe->whereRaw(\"LOWER(name) like '%\".$name.\"%'\")->with('ingredients')->get();\n }",
"public static function search($keyword)\n {\n return static::where('title', 'like', \"%{$keyword}%\")->orWhere('description', 'like', \"%{$keyword}%\");\n }",
"public function search($race)\n {\n //\n return Dog::where('name', 'like', '%'.$race.'%')->get();\n }",
"public static function search() {\n\n $string = Input::get('string');\n\n $results = Ticketcategorie::Where('name_de', 'like', \"$string%\")->get();\n\n return ($results->toArray());\n }",
"public function search(Request $request)\n {\n $keyword = $request->input('search');\n \n $items = Items::where('item_title','like', '%'.$keyword.'%')->paginate(12);\n\n \n \n return view('home',['items' => $items]);\n }",
"public static function searchByName($name) {\n //prepare the pattern\n $pattern = '%' . str_replace(' ', '%', $name) . '%';\n\n //get all books with that pattern in their names\n $result = DB::select()->from('books')->join('categories')->on('books.category_id', '=', 'categories.category_id')->where('name', 'like', $pattern)->execute();\n\n //transform the result set into an array of BookDTO\n return self::toBooks($result);\n }",
"function searchByName($name) {\n $name = $name['search'];\n return db()->query(\"SELECT * FROM product where name like '%$name%'\");\n\n function selectEOnelectric($id) {\n return db()->query(\"SELECT * FROM product WHERE pro_id = $id\");\n }\n \n }",
"public static function search() {\n\n $string = Input::get('string');\n\n\n $results = Musician::Where('first_name', 'like', \"$string%\")\n ->orWhere('last_name', 'like', \"$string%\")\n ->orWhere('stagename', 'like', \"$string%\")->get();\n\n return ($results->toArray());\n }",
"function search_people_by_name($name){\r\n\t\t\t$query = 'select * from people as Person where name like \"%';\r\n\t\t\t$query = $query.$name;\r\n\t\t\t$query = $query.'%\"';\r\n\t\t\treturn $this->query($query);\r\n\t\t}",
"public function buscar(Request $request){\n //$users = User::where('type',2)->raw(\"where name + ' ' + surname like\" . '%' . $request->nombre . '%')->get();\n $users = User::where('type',2)->whereRaw(\"concat(name, ' ', surname) like '%\" . $request->name . \"%'\")->get();\n return view('widgets.search')->with('users', $users);\n\n }",
"public static function findLikeName($name) {\n \t$cons = \"select * from `\".ProductClass::$tableName.\"` where \".ProductClass::$colNameName.\" like '%\".$name.\"%'\";\n\t\treturn ProductClass::findByQuery( $cons );\n }",
"public function searchByName()\n {\n $request = \\Request::get('q');\n if ($request !== null){\n return Pokemon::searchByName($request);\n } else {\n return Raid::latest()->get();\n }\n }",
"public function searchByName($name)\n {\n $table = $this->getTableName();\n $statement = $this->connection->prepare(\"select * from {$table} where name like :name\");\n $like = '%'.$name.'%';\n $statement->bindParam(':name', $like);\n $statement->execute();\n return $statement->fetchAll(\\PDO::FETCH_CLASS, $this->modelName);\n }",
"public function search($title)\n {\n return Todo::where('title', 'like', '%'.$title.'%')->get();\n }",
"public function findCompany($query)\n {\n return Company::Where('company_name', 'ilike', '%' . $query . '%')->take(10)->get();\n }",
"public function search()\n {\n $data = Film::with(['images'])\n ->select(['id', 'name', 'director', 'actor'])\n ->where(DB::raw(\"CONCAT(`name`, ' ', `director`, ' ', `actor`, ' ', `producer`, ' ', `country`, ' ', `describe`)\"), 'LIKE', \"%\".request('query').\"%\")\n ->get();\n return $this->showAll($data);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Id of the technician for this PO. | public function getTechnicianId(): int
{
return $this->technicianId;
} | [
"public function getTechnicianId(): ?int\n {\n return $this->technicianId;\n }",
"public function getIdTecnico()\n {\n return $this->idTecnico;\n }",
"public function getIdTecnico() {\n return $this->idTecnico;\n }",
"public function getTechnician()\n\t{\n\t\treturn $this->technician;\n\t}",
"public function getTechId()\n {\n $value = $this->get(self::TECH_ID);\n return $value === null ? (integer)$value : $value;\n }",
"public function technician()\n {\n return $this->order->technician;\n }",
"public function getIdTeatro()\r\n {\r\n return $this->id_teatro;\r\n }",
"public function getObjektId()\n {\n return $this->objekt_id;\n }",
"public function getTipomovimentoId()\n {\n return $this->tipomovimento_id;\n }",
"public function get_tyk_id() {\n\t\treturn get_user_meta($this->user->ID, self::META_TYK_USER_ID_KEY, true);\n\t}",
"public function getTechnician_name()\n {\n return $this->technician_name;\n }",
"public function getTeacherId()\n {\n return $this->teacher ? $this->teacher->getId() : 0;\n }",
"public function getIdClinic(): int\n {\n return $this->idClinic;\n }",
"public function getTipoColegioId()\n\t{\n\t\treturn $this->tipoColegioId;\n\t}",
"public function getTelefoneId()\n {\n return $this->telefoneId;\n }",
"public function getUtenteId()\n {\n return $this->utente_id;\n }",
"public function getToid()\n {\n return $this->get(self::TOID);\n }",
"public function getIdEtudiant()\n {\n return $this->idEtudiant;\n }",
"public function getIdIte()\n {\n return $this->idIte;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Provided test data for testInstagramEmbedCodeConstraint(). | public function embedCodeProvider() {
return [
'valid URL' => ['https://instagram.com/p/2hi3DVDgsN/', 0],
'valid embed code' => ['<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="5" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAAGFBMVEUiIiI9PT0eHh4gIB4hIBkcHBwcHBwcHBydr+JQAAAACHRSTlMABA4YHyQsM5jtaMwAAADfSURBVDjL7ZVBEgMhCAQBAf//42xcNbpAqakcM0ftUmFAAIBE81IqBJdS3lS6zs3bIpB9WED3YYXFPmHRfT8sgyrCP1x8uEUxLMzNWElFOYCV6mHWWwMzdPEKHlhLw7NWJqkHc4uIZphavDzA2JPzUDsBZziNae2S6owH8xPmX8G7zzgKEOPUoYHvGz1TBCxMkd3kwNVbU0gKHkx+iZILf77IofhrY1nYFnB/lQPb79drWOyJVa/DAvg9B/rLB4cC+Nqgdz/TvBbBnr6GBReqn/nRmDgaQEej7WhonozjF+Y2I/fZou/qAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div></div> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://instagram.com/p/2hi3DVDgsN/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">Once upon a time there were 10 mysterious golden tickets.... #drupalcon</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">A photo posted by DrupalCon (@drupalcon) on <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2015-05-11T02:01:51+00:00">May 10, 2015 at 7:01pm PDT</time></p></div></blockquote><script async defer src="//platform.instagram.com/en_US/embeds.js"></script>', 0],
'invalid URL' => ['https://instagram.com/ppp/2hi3DVDgsN/', 1],
];
} | [
"public function testPutTranscoderEncodeAppConfigAdv()\n {\n\n }",
"public function testGetEmbedCode()\n {\n $code = Extract::getEmbedCode();\n\n self::assertContains(\"class Extract\\n{\", $code);;\n self::assertStringEndsWith(\"}\\n\", $code);\n }",
"public function test_addBillingCodeActivityTag() {\n\n }",
"public function testAugmentationIsCorrectSizeExact()\r\n {\r\n $this->container->setAugmentation(str_repeat('a',255));\r\n\r\n $error = $this->validator->validate($this->container);\r\n\r\n $this->assertEquals(0, count($error));\r\n }",
"public function testAugmentationIsCorrectSize()\r\n {\r\n $this->container->setAugmentation(str_repeat('a',50));\r\n\r\n $error = $this->validator->validate($this->container);\r\n\r\n $this->assertEquals(0, count($error));\r\n }",
"public function testGetInstagram()\n {\n $expected = $actual = 'instagram';\n\n self::assertEquals($this->organization, $this->organization->setInstagram($actual));\n self::assertEquals($expected, $this->organization->getInstagram());\n }",
"public function testCreativeWork()\n {\n }",
"public function testAddItemAccountCodeTag()\n {\n }",
"public function testCreativesAudienceVerifiedCreativeIdPut()\n {\n }",
"public function testTeamsIdDynamicDatasNkDesignsPost()\n {\n\n }",
"public function testReplaceProgramReviewTypeReviewImage()\n {\n }",
"public function testUserCredentialsEmbed()\n {\n }",
"public function test_addItemAccountCodeTag() {\n\n }",
"public function testDesignPermissionSetsIdPut()\n {\n\n }",
"public function testApplicationIdStageNextInterviewPost()\n {\n }",
"public function testValidateDocumentImageValidation()\n {\n }",
"public function testPutTranscoderTemplateAppConfigAdv()\n {\n\n }",
"public function testDesignPermissionSetsIdReplacePost()\n {\n\n }",
"public function testTagsIdDesignsPost()\n {\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check user if client | static function is_client() {
$ci = &get_instance();
return ($ci->tank_auth->user_role($ci->tank_auth->get_role_id()) == 'client') ? TRUE : FALSE;
} | [
"public static function isClient()\n {\n return isset($_SESSION['client_user']);\n }",
"public function isClient()\n {\n return ($this->user_type == 2);\n }",
"public function isClient()\n\t{\n\t\tif ($this->type == Constants::USER_TYPE_CLIENT) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isClient(){\n return boolval(Clients::findOne(['user_id' => $this->id]));\n }",
"public function isClient(): bool\n {\n return $this->userType == 'client'\n || $this->usertype == 'client';\n }",
"function checkuser() {\n\n return true;\n }",
"public function isClient()\n\t{\n\t\tif( !Auth::check() ) return false;\n\n\t\tif( $this->role_id == 3 ) return true;\n\n\t\treturn $this->role_id == 1 ? true : false;\n\t}",
"public function hasClient();",
"public function clientOwner($client, $user)\n {\n return $user == $client->getInvoiceUser() ? true : false;\n }",
"public function hasRemoteUser();",
"public static function verify_client() \n {\n $client = Request::input('client');\n\n $client_id = config('app.client_id');\n $client_secret = config('app.client_secret');\n if($client_id==$client['id'] && $client_secret==$client['secret'])\n {\n return true;\n } \n else\n {\n return false;\n }\n }",
"public static function requireClientLogin()\n {\n if (self::$environment == \"CLI\") {\n //Assume a client permission is always granted in CLI\n return true;\n }\n \n if (!isset($_SESSION['id'])) {\n self::redirect(\\UNL\\VisitorChat\\Controller::$URLService->generateSiteURL(\"clientLogin\", true, true));\n }\n }",
"public function check_client(){\n\t\t$sql = \"SELECT * FROM `add client` WHERE `ID number` = '$this->ID_number_p' AND `email_of_user` = '$this->session'\";\n\n\t\t$sql_run = $this->db_connect()->query($sql);\n\n\t\t$rows = $sql_run->fetch_assoc();\n\t\t\n\t\t$id_number = $rows[\"ID number\"];\n\t\t$email = $rows[\"email_of_user\"];\n\t\t\n\t\tif($id_number == $this->ID_number_p AND $email == $this->session)\n\t\t{\n\t\t\tdie(\"Client with this ID number is already added\");\n\t\t}\n\n\t}",
"public function isAdminOrClient(){\r\n\t\t$type = $this->getProfile()->getUserTypeId();\r\n\t\t\r\n\t\treturn ($type == sfConfig::get(\"app_user_type_admin\") ||\r\n\t\t $type == sfConfig::get(\"app_user_type_client\") ); \r\n\t}",
"public static function isCurrentClient($client)\r\n {\r\n return self::isConnected() && $client == $_SESSION[self::NICKNAME_SES];\r\n }",
"static function esCliente()\n\t{\n\t\tif( isset($_SESSION['permisos']) && $_SESSION['permisos'] == 'cliente' )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\t\n\t}",
"public static function isClientLogin()\r\n\t{\r\n\t\t$routes\t=\tself :: getRoutes();\r\n\t\t$data\t=\tfalse;\r\n\t\t\r\n\t\tif (\r\n\t\t\tin_array( 'login', $routes ) && \r\n\t\t\tin_array( 'client', $routes ) &&\r\n\t\t\t! empty( $_POST ) && \r\n\t\t\tisset( $_POST['username'] ) && \r\n\t\t\tisset( $_POST['password'] ) && \r\n\t\t\t! is_email( $_POST['username']\r\n\t\t) )\r\n\t\t{\r\n\t\t\t$data = true;\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t}",
"public static function verifyUserClient($client_id){\n $my_obj = new MyController;\n $projects = $my_obj->commonGetProjects();\n $client_ids = array();\n foreach ($projects as $key => $value) {\n $client_ids[] = $value->client_id;\n }\n if(in_array($client_id, $client_ids)){\n return true;\n }\n return false;\n }",
"public function checkCLIuser() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Format the instance as RFC2822 | public function toRfc2822String()
{
return $this->format(static::RFC2822);
} | [
"public function toRfc2822String()\r\n {\r\n return $this->format(static::RFC2822);\r\n }",
"public function toRfc2822String()\n {\n return $this->format(DateTime::RFC2822);\n }",
"public function formatRFC3966()\n {\n return $this->format(PhoneNumberFormat::RFC3966);\n }",
"public function formatRFC3966() {\n return $this->format(PhoneNumberFormat::RFC3966);\n }",
"public function toRFC822() {\n\t\treturn $this->format(\\DateTime::RFC822);\n\t}",
"function format($format);",
"public function date2rfc()\r\n\t{\r\n\t\treturn $this->format('Y-m-d\\TH:i:sP');\r\n\t}",
"public function date2rfc()\n\t{\n\t\treturn $this->format('Y-m-d\\TH:i:sP');\n\t}",
"public function addrFormat($addr)\n {\n }",
"public function addressFormatted(): string;",
"public function toRfc1036String()\n {\n return $this->format(DateTime::RFC1036);\n }",
"public function toRfc822String()\r\n {\r\n return $this->format(static::RFC822);\r\n }",
"public function toRfc822String()\n {\n return $this->format(static::RFC822);\n }",
"public function format()\n {\n return sprintf('%s-%s-%s', substr($this->number, 0, 2), ltrim(substr($this->number, 2, 6), '0'), substr($this->number, 8));\n }",
"public function toRFC3339String()\n {\n return $this->format(DateTime::RFC3339);\n }",
"public function addrFormat($addr)\n {\n }",
"protected function _applyFormat(){ }",
"public function toRfc822String()\n {\n return $this->format(DateTime::RFC822);\n }",
"public function getFormat();"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepare service name. Strip tags and entities from name | protected function _prepareServiceName($name)
{
$name = html_entity_decode((string)$name);
$name = strip_tags(preg_replace('#&\w+;#', '', $name));
return trim($name);
} | [
"private function getServiceName()\n {\n $service = Str::studly($this->argument('service'));\n\n if (Str::contains(strtolower($service), 'service') === false) {\n $service .= 'Service';\n }\n\n return $service;\n }",
"protected function createServiceName($name)\n {\n $name = preg_replace('/[^a-zA-Z0-9]+/', '', ucwords(str_replace('.', ' ', $name)));\n $pieces = preg_split('/(?=[A-Z])/', $name, null, PREG_SPLIT_NO_EMPTY);\n\n $string = '';\n foreach ($pieces as $piece) {\n $string .= ucfirst(strtolower($piece));\n }\n\n return $string;\n }",
"public static function service_name($service)\r\n {\r\n return str_replace('Service.php','',str_replace('Google_','',$service));\r\n }",
"public static function sanitizeServiceNameForCache($serviceName)\n {\n return preg_replace('#[^\\w]#', '_', $serviceName);\n }",
"public function get_service_name();",
"abstract function normalizedName();",
"public function generateServiceNameFromClassName($classname)\n {\n $classname = str_replace(['\\\\'], '.', $classname);\n $classname = Container::underscore($classname);\n\n return trim($classname, \"\\\\_. \\t\\n\\r\\0\\x0B\");\n }",
"function sf_create_name_extract($name)\r\n{\r\n\t$name=apply_filters('sf_show_topic_title', $name);\r\n\t$name = stripslashes($name);\r\n\tif(strlen($name) > 35) $name = substr($name, 0, 35).'...';\r\n\treturn $name;\r\n}",
"public function full_service_name() {\n\t\treturn $this->carrier_name().' '.$this->product_name;\n\t}",
"protected function getPureMethodNameFromService(){\n $service=$this->getServiceNameAndMethodFromRequestUri();\n return preg_replace('@\\?(.*)@is','',end($service));\n }",
"public function formatServiceNameFromPresenter($presenter)\n\t{\n\t\treturn strtolower(Strings::replace(strtr($presenter, ':', '.'), array(\n\t\t\t'~([A-Z]+)([A-Z][a-z])~' => '\\\\1_\\\\2',\n\t\t\t'~([a-z\\d])([A-Z])~' => '\\\\1_\\\\2'\n\t\t))) . '_presenter';\n\t}",
"public function get_subservice_name() {\n global $om;\n // the name of the subservice is everything but 'Omega' up front\n return substr(get_class($this), 5);\n }",
"private function getConfigName(string $name): string\n {\n return mb_substr($name, mb_strlen(self::SERVICE_PREFIX));\n }",
"function prepareName($name) {\n\t\t$nameArr \t\t\t= explode(\" \",$name);\n\t\t$nameArrCount \t\t= count($nameArr);\n\t\tif( $nameArrCount >2 ){\n\t\t\t$formattedName \t= $nameArr[0].\" \".$nameArr[1];\n\t\t}else{\n\t\t\t$formattedName \t= $nameArr[0];\n\t\t}\t\t\t\t\t\n\t\t$formattedName \t\t= substr($formattedName, 0, 14);\t\n \treturn $formattedName;\n }",
"protected function getTemplating_NameParserService()\n {\n return $this->services['templating.name_parser'] = new \\Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser(${($_ = isset($this->services['kernel']) ? $this->services['kernel'] : $this->get('kernel')) && false ?: '_'});\n }",
"protected function fetchNameFromServiceAttributes(array $attributes) {\n\t\t$attributes = array_change_key_case($attributes, CASE_LOWER);\n\t\t// Name specified directly:\n\t\tif (array_key_exists('name', $attributes)) {\n\t\t\treturn $attributes['name'];\n\t\t}\n\t\t// Combine name from first and last name:\n\t\tforeach ($attributes as $name => $value) {\n\t\t\t$canonicalName = str_replace(array(' ', '-', '_'), '', $name);\n\t\t\t$attributes[$canonicalName] = $value;\n\t\t}\n\t\t$nameParts = array();\n\t\tif (array_key_exists('firstname', $attributes)) {\n\t\t\t$nameParts[] = $attributes['firstname'];\n\t\t}\n\t\tif (array_key_exists('lastname', $attributes)) {\n\t\t\t$nameParts[] = $attributes['lastname'];\n\t\t}\n\t\treturn implode(' ', $nameParts);\n\t}",
"function clean_up_name($string) {\n\t$string = preg_replace(\"/[\\s\\.]+/\", \"_\", $string);\n\t$string = preg_replace(\"/[^a-zA-Z0-9_]+/\", \"\", $string);\n\t$string = preg_replace(\"/_{2,}/\", \"_\", $string);\n\n\treturn $string;\n}",
"private function getServiceId($name)\n {\n return sprintf('%s.%s.%s', $this->prefix, $this->resourceName, $name);\n }",
"private function buildName()\n {\n $name = null;\n foreach ($this->parts as $part) {\n $name .= $part;\n }\n return rtrim($name, '\\\\');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update the specified AvisosPreventivos in storage. | public function update($id, UpdateAvisosPreventivosRequest $request)
{
$avisosPreventivos = $this->avisosPreventivosRepository->findWithoutFail($id);
if (empty($avisosPreventivos)) {
Flash::error('Avisos Preventivos not found');
return redirect(route('avisosPreventivos.index'));
}
$avisosPreventivos = $this->avisosPreventivosRepository->update($request->all(), $id);
Flash::success('Avisos Preventivos updated successfully.');
return redirect(route('avisosPreventivos.index'));
} | [
"public function store(Request $request)\n {\n if (isset($request->id) && $request->method == 'update') {\n $url_evidencia = $request->archivos != 0 ? '' : $request->tempMultimedia;\n\n for ($i = 0; $i < $request->archivos; $i++) {\n if (is_numeric($i)) {\n if ($request->file(\"file$i\")) {\n $path = Storage::disk('public')->put('documentosPSI', $request->file(\"file$i\"));\n $url_evidencia .= 'PSIAPP./' . $path;\n }\n }\n }\n\n avances::where('id', $request->id)->update([\n 'actividad_id' => $request->actividad_id,\n 'descripcion' => $request->descripcion,\n 'fecha_avance' => $request->fecha_avance,\n 'evidencias' => $url_evidencia,\n ]);\n return response()->json(['status' => 'Avances updated successfully.']);\n } else {\n\n $url_evidencia = $request->archivos != 0 ? '' : null;\n\n for ($i = 0; $i < $request->archivos; $i++) {\n\n if (is_numeric($i)) {\n\n if ($request->file(\"file$i\")) {\n $path = Storage::disk('public')->put('documentosPSI', $request->file(\"file$i\"));\n $url_evidencia .= 'PSIAPP./' . $path;\n }\n }\n }\n\n // $input = $request->all();\n\n $avances = avances::create([\n 'actividad_id' => $request->actividad_id,\n 'descripcion' => $request->descripcion,\n 'fecha_avance' => $request->fecha_avance,\n 'evidencias' => $url_evidencia,\n ]);\n\n $rol_users = Role::with('users')->where('name', 'Psicoorientador')\n ->each(function (Role $role_user) use ($avances) {\n foreach ($role_user->users as $u) {\n\n // $u->notify(new NuevoAvance($avances));\n $psi = psicologo::where('correo', $u->email)->first();\n //Notificacion via sms\n // $nexmo = app('Nexmo\\Client');\n // $nexmo->message()->send([\n // 'to' => '57'.$psi->telefono,\n // 'from' => '573177765722',\n // 'text' => 'Hola '. $psi->nombres . ', Hay un nuevo comportamiento registrado: ' . $comportamiento->titulo .' Descripcion:'. $comportamiento->descripcion\n // ]);\n }\n });\n\n return response()->json(['status' => 'Avances saved successfully.']);\n }\n }",
"public function update($id, UpdateAspiranteSocioecomicoRequest $request)\n {\n $aspiranteSocioecomico = $this->aspiranteSocioecomicoRepository->findWithoutFail($id);\n\n if (empty($aspiranteSocioecomico)) {\n Flash::error('Aspirante Socioecomico not found');\n return redirect(route('aspiranteSocioecomicos.index'));\n }\n \n $aspiranteSocioecomico = $this->aspiranteSocioecomicoRepository->update($request->all(), $id);\n $aspiranteGeneral=AspiranteGeneral::find($aspiranteSocioecomico->aspirantes_generales_id);\n //Se busca el AspiranteGeneral para su actualizacion de estatus\n $status=$aspiranteGeneral->status_asp;\n\n if($status==1 or $status==null){\n $aspiranteGeneral->status_asp=13;\n\n }else if (str_contains($status, '3')==false) {\n $aspiranteGeneral->status_asp=str_finish($status,'3');\n\n }\n $aspiranteGeneral->update();\n //Redirecciona a registro de salud\n $asp_sal=AspiranteSalud::where('aspirantes_generales_id',$aspiranteSocioecomico->aspirantes_generales_id)->first();\n\n Flash::success('Datos Socioeconómicos actualizados con éxito');\n return redirect(route('aspiranteSaluds.edit',['aspiranteSalud'=> $asp_sal->id]));\n\n\n\n\n\n/*\n\n\n\n\n\n\n\n\n\n\n\n //Actualiza el status del aspirante \"Datos - Socioeconómicos capturados\"\n $aspiranteGeneral=AspiranteGeneral::where('id',$aspiranteSocioecomico->aspirantes_generales_id)->first();\n $status=$aspiranteGeneral->status_asp;\n $v=$status;\n if($status==1 or $status==null){\n $v=13;\n }else\n {\n $value = str_contains($v, '3');\n if($value==false){\n $v = str_finish($v,'3');\n }\n }\n DB::table('aspirantes_generales')\n ->where('id',$aspiranteSocioecomico->aspirantes_generales_id)\n ->update(['status_asp' =>$v]);\n\n if (empty($aspiranteSocioecomico)) {\n Flash::error('Aspirante Socioecomico not found');\n\n return redirect(route('aspiranteSocioecomicos.index'));\n }\n\n $aspiranteSocioecomico = $this->aspiranteSocioecomicoRepository->update($request->all(), $id);\n\n //Redirecciona a registro de salud\n $asp_sal=AspiranteSalud::where('aspirantes_generales_id',$aspiranteSocioecomico->aspirantes_generales_id)->first();\n $idSal=$asp_sal->id;\n Flash::success('Aspirante Socioecomico updated successfully.');\n return redirect(route('aspiranteSaluds.edit',[$idSal]));\n */\n }",
"public function updateEsitoPrivato(Request $request)\n {\n\n $prenotazioneprivato = Prenotazione_Privato::where('id',$request->id)->first();\n\n $prenotazioneprivato->esito = $request['esito'];\n \n $prenotazioneprivato->save();\n\n return redirect('laboratorio/home');\n \n }",
"public function updateIncentivos(){\n // ELIMINAR INCENTIVOS QUE PREVIAMENTE HAN SIDO ASIGNADOS\n $colaboradorId = MasterDom::getData('colaborador_id');\n $periodoId = MasterDom::getData('prorrateo_periodo_id');\n $tipo = MasterDom::getData('regreso');\n $regreso = \"/Incentivo/incentivos/{$colaboradorId}/{$periodoId}/{$tipo}\";\n \n $eliminarIncentivos = new \\stdClass();\n $eliminarIncentivos->_colaborador_id = MasterDom::getData('colaborador_id');\n $eliminarIncentivos->_prorrateo_periodo_id = MasterDom::getData('prorrateo_periodo_id');\n $eliminar = IncentivoDao::eliminarIncentivos($eliminarIncentivos);\n\n // ELIMINAR TODOS LOS INCENTIVOS\n if(empty($_POST))\n $this->alerta(MasterDom::getData('colaborador_id'), \"vacio\", MasterDom::getData('prorrateo_periodo_id'), $regreso);\n $incentivo = new \\stdClass();\n foreach (MasterDom::getDataAll('agregar') as $key => $value) {\n $explode = explode(\"|\", $value);\n $incentivo->_colaborador_id = MasterDom::getData('colaborador_id');\n $incentivo->_prorrateo_periodo_id = $explode['1'];\n $incentivo->_catalogo_incentivo_id = $explode['2'];\n $incentivo->_cantidad = $explode['3'];\n $incentivo->_asignado = $explode['4'];\n $incentivo->_valido = $explode['5'];\n $insertarIncentivo = IncentivoDao::insertIncentivos($incentivo);\n }\n\n if($insertarIncentivo>0)\n $this->alerta(MasterDom::getData('colaborador_id'), \"update-incentivos\", MasterDom::getData('prorrateo_periodo_id'), $regreso);\n else\n $this->alerta(MasterDom::getData('colaborador_id'), \"error\", MasterDom::getData('prorrateo_periodo_id'), $regreso);\n }",
"public function store(CreateAvisosPreventivosRequest $request)\n {\n $input = $request->all();\n\n $avisosPreventivos = $this->avisosPreventivosRepository->create($input);\n\n Flash::success('Avisos Preventivos saved successfully.');\n\n return redirect(route('avisosPreventivos.index'));\n }",
"function update() {\n\t\t\n\t\ttry {\n\t\t\n\t\t\tif (!$this->PermisosComponent->puedeEditar('ventas','update'))\n\t\t\t\tthrow new ForbiddenException('No tiene permiso para actualizar ventas'); \n\t\t\t\n\t\t\t$params = getPutParameters();\n\t\t\t\n\t\t\t$params = (isset($params['venta']))? $params['venta'] : array();\n\t\n\t\t\t// Campos obligatorios\n\t\t\tif (!$this->parametrosRequeridosEn(array('created', 'total', 'id'), $params))\n\t\t\t\tthrow new BadRequestException('Los datos de la venta están incompletos');\n\t\t\t\n\t\t\t//Datos de la venta\n\t\t\t$venta = array(\t'id'=>$params['id'],\n\t\t\t\t\t\t\t'total'=>$params['total'], \n\t\t\t\t\t\t\t'nota'=>$params['nota'],\n\t\t\t\t\t\t\t'deuda'=>$params['deuda'], \n\t\t\t\t\t\t\t'bonificacion'=>$params['bonificacion'],\n\t\t\t\t\t\t\t'montoFavor'=>$params['montoFavor'],\n\t\t\t\t\t\t\t'FP'=>$params['FP'],\n\t\t\t\t\t\t\t'created'=>$params['created']);\n\t\t\t\t\t\t\t\n\t\t\tif(isset($params['FP'])) $ped['FP'] = $params['FP'];\n\t\t\tif(isset($params['nota'])) $ped['nota'] = $params['nota'];\n\t\t\t\n\t\t\t\n\t\t\t// UPDATE de venta\t\t\t\n\t\t\t$mod = isset($params['modelos'])?$params['modelos']:array();\n\t\t\t$pagos = isset($params['pagos'])?$params['pagos']:array();\n\t\t\t$dev = isset($params['devoluciones'])?$params['devoluciones']:array();\n\t\t\t$pagos2delete = isset($params['pagos2delete'])?$params['pagos2delete']:array();\n\t\t\t$mod2delete = isset($params['mod2delete'])?$params['mod2delete']:array();\n\t\t\t$dev2delete = isset($params['dev2delete'])?$params['dev2delete']:array();\n\n\t\t\t$res = $this->Ventas->setVenta($venta, $mod, $pagos, $dev, $mod2delete, $pagos2delete, $dev2delete);\n\t\t\t\t\n\t\t\tif(!$res['success'])\t\n\t\t\t\tthrow new BadRequestException($res['msg']);\n\n\t\t\techo $this->json('La venta fue actualizada.', $res['venta']);\n\n\t\t} catch (Exception $e) {\t\n\n\t\t\tif ($e instanceof RequestException) \n\t\t\t\techo $this->json( $e->getMsg(), $e->getData(), $e->getSatusCode() );\n\t\t}\t\n\t}",
"public function atualizar(){\r\n return (new Database('atividades'))->update('id = '.$this->id,[\r\n 'titulo' => $this->titulo,\r\n 'descricao' => $this->descricao,\r\n 'ativo' => $this->ativo,\r\n 'data' => $this->data\r\n ]);\r\n }",
"function actVac(){\n $pdo= new conexion();\n $query = $pdo ->prepare(\"UPDATE vacaciones\"\n . \" SET FechaInicial = :FechaInicial,\"\n . \" FechaFinal = :FechaFinal,\"\n . \" Estado = :Estado WHERE idVacation = :idVacation;\");\n $query->bindValue(\":FechaInicial\", $this->FechaIni);\n $query->bindValue(\":FechaFinal\", $this->FechaFin);\n $query->bindValue(\":Estado\", $this->Estado);\n $query->bindValue(\":idVacation\", $this->idVacaciones);\n $query->execute();\n \n }",
"public function updateAction(Request $request, $id)\n {\n $session = $request->getSession();\n $menu = $session->get('_menu');\n \n \n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('VictoriaAppBundle:DatosPublicidad')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find DatosPublicidad entity.');\n }\n \n $actualUsuarioCreacion = $entity->getUsuarioCreacion();\n $actualFechaCreacion = $entity->getFechaCreacion();\n \n $actualUsuarioUltimaModificacion = $entity->getUsuarioUltimaModificacion();\n $actualFechaModificacion = $entity->getFechaUltimaModificacion();\n \n \n \n $actualMeGusta = $entity->getMeGusta();\n $actualMeEncanta = $entity->getMeEncanta();\n $actualMeDivierte = $entity->getMeDivierte();\n $actualMeEntristece = $entity->getMeEntristece();\n $actualMeEnoja = $entity->getMeEnoja();\n $actualComentariosPositivos = $entity->getComentariosPositivos();\n $actualComentariosNegativos = $entity->getComentariosNegativos();\n $actualCompartidos = $entity->getCompartidos();\n\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n \n $usr= $this->get('security.context')->getToken()->getUser();\n $usuario = $usr->getUsername();\n $fecha = new \\DateTime(\"now\");\n $entity->setUsuarioCreacion($actualUsuarioCreacion);\n $entity->setUsuarioUltimaModificacion($actualUsuarioUltimaModificacion);\n $entity->setFechaCreacion($actualFechaCreacion);\n $entity->setFechaUltimaModificacion($actualFechaModificacion);\n $entity->setEstado(1);\n $entity->setPreparadoPor(1);\n $entity->setMeGusta($actualMeGusta);\n $entity->setMeEncanta($actualMeEncanta);\n $entity->setMeDivierte($actualMeDivierte);\n $entity->setMeEntristece($actualMeEntristece);\n $entity->setMeEnoja($actualMeEnoja);\n $entity->setComentariosPositivos($actualComentariosPositivos);\n $entity->setComentariosNegativos($actualComentariosNegativos);\n $entity->setCompartidos($actualCompartidos);\n \n \n\n \n $em->flush();\n\n return $this->redirect($this->generateUrl('datospublicidad_edit', array('id' => $id)));\n }\n\n return $this->render('VictoriaAppBundle:DatosPublicidad:editDetalle.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n 'menu' => $menu,\n\n ));\n }",
"function modificarDatosEspacioAcademico() {\n $cadena_sql=$this->sql->cadena_sql($this->configuracion,\"actualizar_espacioAcademico\",$this->datosEspacio);\n $resultado_espacioAcad=$this->ejecutarSQL($this->configuracion, $this->accesoGestion, $cadena_sql,\"\" );\n return $this->totalAfectados($this->configuracion, $this->accesoGestion);\n }",
"public static function actualizarAsientos($asientos,$id){\r\n try{\r\n $conexion = connectDB::connectBD();\r\n $actualizar = \"UPDATE `Proyeccion` SET `Disponibles` = '$asientos' WHERE `Proyeccion`.`IdProyeccion` = '$id';\";\r\n $conexion->exec($actualizar);\r\n }catch(PDOException $error){\r\n echo $error->getMessage();\r\n }\r\n }",
"public function update(Request $request)\n {\n \n\n // para no volver vulnerable el sitio, accedera solo con la peticion ajax\n if (!$request->ajax()) return redirect('/'); // determina si la peticion es diferente , si es asi redirije a la ruta raiz \n $documental = Documentales::findOrFail($request->id); // busco en la tabla codigo\n $documental->idusuario = \\Auth::user()->id; // para capturar el usuario que hizo la accion y despues con trigger guardarlo en la tabla bitacora de movimientos\n $documental->nombre_documental = $request->nombre_documental; // le enviamos los datos\n $documental->codigo_diminutivo = $request->codigo_diminutivo; \n $documental->descripcion = $request->descripcion;\n $documental->vigencia = $request->vigencia;\n //$documental->estado = '1';\n $documental->save();\n\n\n }",
"public function update($id, UpdateAreasFisicasRequest $request)\n {\n $input = $request->all();\n\n $area = $input['Area'];\n if (isset($input['Enabled'])) {\n $Enabled = '1';\n }\n else {\n $Enabled = '0';\n }\n $Idioma ='2';\n $areasFisicas = DB::statement(\"EXEC [dbo].[sc_AreasFisicas_Guarda]\n '\".$id.\"',\n '\".$area.\"',\n '\".$Enabled.\"',\n '1',\n '\".$Idioma.\"'\");\n\n if ($areasFisicas) {\n Flash::success('Registro Guardado Corectamente.');\n }\n else {\n Flash::error('Revise Sus Datos');\n }\n\n return redirect(route('areasFisicas.index'));\n }",
"public function updateContato(){\n\n }",
"public function updateAbsence(Request $request,$zamestnanec_id,$smena_id){\n $user = Auth::user();\n /* Ziskani dochazky, nasledne zamestnance a smeny */\n $dochazka = Attendance::getEmployeeShiftParticularAttendance($smena_id, $zamestnanec_id);\n $rozhod = 0;\n $zamestnanec = Employee::find($zamestnanec_id);\n $smena = Shift::find($smena_id);\n if($request->attendance_absence_reason_id == 4 || $request->attendance_absence_reason_id == 5){ $rozhod = 1; }\n /* Ziskani ID smeny z dimenze smen */\n $shift_info_id = OlapETL::getShiftInfoId($zamestnanec_id, $user->company_id, $smena->shift_start, $smena->shift_end);\n if($dochazka->isEmpty()){ // pokud dochazka neexistuje\n if($rozhod == 1){ // pokud je statusem zpozdeni ci ok, tak se indikator prichodu nastavi na 1\n Attendance::create(['employee_id' => $zamestnanec_id, 'shift_id' => $smena_id, 'absence_reason_id' => $request->attendance_absence_reason_id, 'attendance_came' => 1]);\n }else{\n Attendance::create(['employee_id' => $zamestnanec_id, 'shift_id' => $smena_id, 'absence_reason_id' => $request->attendance_absence_reason_id, 'attendance_came' => 0]);\n }\n }else{ // pokud dochazka existuje, tak se jednotliva pole pouze aktualizuji\n if($request->attendance_absence_reason_id == 4 || $request->attendance_absence_reason_id == 5){\n Attendance::where(['employee_id' => $zamestnanec_id, 'shift_id' => $smena_id])->update(['absence_reason_id' => $request->attendance_absence_reason_id, 'attendance_came' => 1]);\n }else{\n Attendance::where(['employee_id' => $zamestnanec_id, 'shift_id' => $smena_id])->update(['attendance_check_in_company' => NULL, 'attendance_check_out_company' => NULL,'absence_reason_id' => $request->attendance_absence_reason_id,'attendance_came' => 0]);\n }\n }\n /* Extrakce statusu dochazky do tabulky faktu */\n OlapETL::extractAbsenceReasonToShiftFacts($shift_info_id, $zamestnanec_id, $user->company_id, $request->attendance_absence_reason_id);\n return response()->json(['success'=>'Status docházky zaměstnance: '.$zamestnanec->employee_name.' '.$zamestnanec->employee_surname.' byl úspěšně zapsán.']);\n }",
"public function updatePagamentoPedidoVenda(Request $request, $id){\n // Busca o pedido\n $pedido = Pedido::find($id);\n \n // Atualiza os pagamentos referente ao pedido\n if(isset($request['idPagamento'])){\n // Percorre os arrays passados no input\n for($i = 0; $i < sizeof($request['idPagamento']); $i++){\n // busca o pagamento pelo id\n $updatePagamento = Pagamento::find($request['idPagamento'][$i]);\n // se achar o pagamento, atualiza os valores e salva\n if(isset($updatePagamento)){\n $updatePagamento->obs = $request['updateObs'][$i];\n $updatePagamento->descontoPagamento = $request['updateDescontoPagamento'][$i];\n $updatePagamento->valorTotalPagamento = $request['updateValorTotalPagamento'][$i];\n $updatePagamento->status = 'aberto';\n $updatePagamento->funcionario_id = auth()->user()->funcionario->id;\n $updatePagamento->pedido_id = $id;\n $updatePagamento->formaPagamento_id = $request['updateFormaPagamento'][$i];\n $updatePagamento->save();\n }\n }\n }\n\n // Salva as novas formas de pagamento\n if(isset($request['valorTotalPagamento'])){\n for($i = 0; $i < sizeof($request['valorTotalPagamento']); $i++){\n $newPagamento = new Pagamento();\n $newPagamento->obs = $request['obs'][$i];\n $newPagamento->descontoPagamento = $request['descontoPagamento'][$i];\n $newPagamento->dataVencimento = $request['dataVencimento'][$i];\n $newPagamento->valorTotalPagamento = $request['valorTotalPagamento'][$i];\n $newPagamento->status = 'aberto';\n $newPagamento->funcionario_id = auth()->user()->funcionario->id;\n $newPagamento->pedido_id = $id;\n $newPagamento->formaPagamento_id = $request['formaPagamento'][$i];\n \n $newPagamento->save();\n }\n }\n \n // redireciona de acordo com o tipo do pedido 11\n if($pedido->tipo == \"p\"){\n return redirect()->route('listarPedidos');\n }else{\n return redirect()->route('listarVendas');\n }\n }",
"final protected function modificarArticulo(){\n\t\tif($this->articulo != null){\n\t\t\tthrow new Exception('Articulo sin datos');\n\t\t}\n\t\tDataAccess::update($this->articulo);\t\n\t}",
"public function modificar() {\n $objDatos = new clsDatos();\n $sql = \"UPDATE asigna_caso\n SET id_aca = '$this->id_aca',\n id_pac = '$this->id_pac',\n id_usu = '$this->id_usu',\n tip_aca = '$this->tip_aca',\n est_aca = '$this->est_aca';\";\n $objDatos->ejecutar($sql);\n $objDatos->crerrarconexion();\n }",
"public function update(UpdateArquivosRequest $request, $id)\n {\n if (! Gate::allows('arquivo_edit')) {\n return abort(401);\n }\n $request = $this->saveFiles($request);\n $arquivo = Arquivo::findOrFail($id);\n $arquivo->update($request->all());\n\n\n $media = [];\n foreach ($request->input('arquivo_id', []) as $index => $id) {\n $model = config('laravel-medialibrary.media_model');\n $file = $model::find($id);\n $file->model_id = $arquivo->id;\n $file->save();\n $media[] = $file->toArray();\n }\n $arquivo->updateMedia($media, 'arquivo');\n\n return redirect()->route('admin.arquivos.index');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets uptime of a process reference: | function getProcessUptime($process)
{
$process_pid = exec("pidof $process");
$system_uptime = exec('cut -d "." -f1 /proc/uptime');
$pid_uptime = round((exec("cut -d \" \" -f22 /proc/$process_pid//stat")/100), 0);
$seconds = $system_uptime-$pid_uptime;
$days = floor($seconds / 86400);
$hours = str_pad(floor(($seconds - ($days*86400)) / 3600), 2, "0", STR_PAD_LEFT);
$mins = str_pad(floor(($seconds - ($days*86400) - ($hours*3600)) / 60), 2, "0", STR_PAD_LEFT);
$secs = str_pad(floor($seconds % 60), 2, "0", STR_PAD_LEFT);
return "$days days, $hours:$mins:$secs";
} | [
"public function uptime() {\n $buf = \"\";\n CommonFunctions::rfts('/proc/uptime', $buf, 1);\n $ar_buf = split(' ', $buf);\n $result = trim($ar_buf[0]);\n return $result;\n }",
"public function uptime() : int\n {\n return $this->start ? (time() - $this->start) ?: 1 : 0;\n }",
"public function uptime(): int\n {\n return $this->request('uptime');\n }",
"public function memory_get_process_usage()\n {\n $status = file_get_contents('/proc/'.getmypid().'/status');\n\n $matchArr = array();\n preg_match_all('~^(VmRSS|VmSwap):\\s*([0-9]+).*$~im', $status, $matchArr);\n\n if (!isset($matchArr[2][0]) || !isset($matchArr[2][1])) {\n return false;\n }\n\n return intval($matchArr[2][0]) + intval($matchArr[2][1]);\n }",
"public function uptime_seconds() {\n\n\t}",
"function memory_get_process_usage()\n{\n $status = shell_exec('cat /proc/' . getmypid() . '/status');\n\n $matchArr = array();\n preg_match_all('~^(VmRSS|VmSwap):\\s*([0-9]+).*$~im', $status, $matchArr);\n\n if(!isset($matchArr[2][0]) || !isset($matchArr[2][1]))\n {\n return false;\n }\n\n return intval($matchArr[2][0]) + intval($matchArr[2][1]);\n}",
"public function getUptime() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = '';\n\t\t\t$cmd = 'uptime';\n\t\t\t\n\t\t\t// Execute Command/Parse Results\n\t\t\t$result = self::execute($cmd);\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}",
"public function getProcessDuration();",
"public function getUptime() {\n\t\t$s = explode(\" \", exec(\"/sbin/sysctl -n kern.boottime\") );\n\t\t$a = str_replace(\",\", \"\", $s[3]);\n\t\treturn $this->getDuration($a);\n\t}",
"protected function _uptime()\n {\n CommonFunctions::rfts('/proc/uptime', $buf, 1);\n $ar_buf = preg_split('/ /', $buf);\n $this->sys->setUptime(trim($ar_buf[0]));\n }",
"public function lookuptime() {\n return $this->info['namelookup_time'];\n }",
"public function uptime()\n {\n return $this->hasOne(Uptime::class, 'realmid');\n }",
"public function get_process_time()\n\t{\n\t\treturn $this->end_time - $this->start_time;\n\t}",
"private function _uptime()\n {\n if (CommonFunctions::executeProgram('uptime', '-u', $buf)) {\n if (preg_match(\"/^up (\\d+) minute[s]?/\", $buf, $ar_buf)) {\n $min = $ar_buf[1];\n $this->sys->setUptime($min * 60);\n } elseif (preg_match(\"/^up (\\d+) hour[s]?, (\\d+) minute[s]?/\", $buf, $ar_buf)) {\n $min = $ar_buf[2];\n $hours = $ar_buf[1];\n $this->sys->setUptime($hours * 3600 + $min * 60);\n } elseif (preg_match(\"/^up (\\d+) day[s]?, (\\d+) hour[s]?, (\\d+) minute[s]?/\", $buf, $ar_buf)) {\n $min = $ar_buf[3];\n $hours = $ar_buf[2];\n $days = $ar_buf[1];\n $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);\n }\n }\n }",
"function proc_get_status ($process) {}",
"function get_ppp_uptime($port) {\n\tif (file_exists(\"/conf/{$port}.log\")) {\n\t\t$saved_time = file_get_contents(\"/conf/{$port}.log\");\n\t\t$uptime_data = explode(\"\\n\", $saved_time);\n\t\t$sec = 0;\n\t\tforeach ($uptime_data as $upt) {\n\t\t\t/* Skip blank lines, trim, and cast to int to ensure type matches.\n\t\t\t * https://redmine.pfsense.org/issues/14117 */\n\t\t\tif (!empty($upt)) {\n\t\t\t\t$sec += (int) trim(substr($upt, 1 + strpos($upt, \" \")));\n\t\t\t}\n\t\t}\n\t\treturn convert_seconds_to_dhms($sec);\n\t} else {\n\t\t$total_time = gettext(\"No history data found!\");\n\t\treturn $total_time;\n\t}\n}",
"function mtUptime($host) {\r\n\r\n // Instanciate MT API call\r\n $API = new routeros_api();\r\n $API->debug = false;\r\n \r\n // Set a default return value if connection to MT fails\r\n $mtuptime = 0;\r\n \r\n // Query Mikrotik\r\n if ($API->connect($host, 'admin', 'DataCom')) {\r\n $API->write('/system/resource/print');\r\n $ARRAY = $API->read();\r\n $API->disconnect();\r\n $mtuptime = ExtractUptime($ARRAY[0]['uptime']);\r\n $rawuptime = $ARRAY[0]['uptime'];\r\n };\r\n\r\n // Return Uptime\r\n return(array($mtuptime,$rawuptime));\r\n}",
"public function userCpuUsage()\n {\n return $this->get('rusage-utime');\n }",
"protected function getProcessElapsed(){\n\t\t$elapsed = time() - $this->start_time;\n\t\t$this->logger->info( \"Elapsed Time: {$elapsed}\" );\n\t\treturn $elapsed;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if $user can view Category | public function canView(IdentityInterface $user, Category $category)
{
} | [
"public function view(User $user) {\n return $user->can('view-category');\n }",
"public function viewAny(User $user)\n {\n return $user->can('view_skill_categories');\n }",
"public function testOnlyAdminUsersCanViewACategory(): void\n {\n $admin = User::factory()->admin()->create();\n $user = User::factory()->create();\n\n $category = Category::factory()->create();\n\n $this->assertTrue($admin->can('view', $category));\n $this->assertFalse($user->can('view', $category));\n }",
"function cat_admin_access($category_id)\n{\n global $user;\n\n // $filter['visible_categories'] and $filter['visible_images']\n // are not used because it's not necessary (filter <> restriction)\n if (in_array($category_id, explode(',', $user['forbidden_categories'])))\n {\n return false;\n }\n return true;\n}",
"public function haveReadCategory($category, $userId);",
"function feed_category_access($allow_public = FALSE, $feed_category) {\r\n global $user;\r\n \r\n if ($allow_public && $feed_category->is_public) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category->uid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}",
"public function canView(IdentityInterface $user, ListingTypeCategoriesTable $listingTypeCategoriesTable)\n {\n }",
"public function manage_categories(User $user)\n {\n return $user->can_manage_categories;\n }",
"public function delete(User $user) {\n return $user->can('delete-category');\n }",
"public function check_permission($cat_id, $user_id)\n\t{\n\t\tif($cat_id != '' && $user_id != '' && is_numeric($cat_id))\n\t\t{\n\t\t\t $admin_query = \"SELECT ucr.user_id FROM user_category_relation AS ucr left join category c on c.category_id=ucr.category_id and ucr.user_id=\".$this->user_id.\" WHERE ucr.user_id = \".$user_id.\" AND ucr.category_id = \".$cat_id.\" AND ucr.permission_type = 1 and c.is_active=1\";\n\t\t\t$admin_result = $this->db->query($admin_query);\n\t\t\t$admin_permission = $admin_result->row_array();\n\t\t\tif(!empty($admin_permission)){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\t$rw_query = \"SELECT ucr.user_id FROM user_category_relation AS ucr left join category c on c.category_id=ucr.category_id and ucr.user_id=\".$this->user_id.\" AND ucr.permission_type =2 WHERE ucr.user_id = \".$user_id.\" AND ucr.category_id = \".$cat_id.\" and c.is_active=1\";\n\t\t\t$rw_result = $this->db->query($rw_query);\n\t\t\t$rw_permission = $rw_result->row_array();\n\t\t\tif(!empty($rw_permission)){\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\n\t\t\t$r_query = \"SELECT ucr.user_id FROM user_category_relation AS ucr left join category c on c.category_id=ucr.category_id and ucr.user_id=\".$this->user_id.\" AND ucr.permission_type = 3 WHERE ucr.user_id = \".$user_id.\" AND ucr.category_id = \".$cat_id.\" and c.is_active=1\";\n\t\t\t$r_result = $this->db->query($r_query);\n\t\t\t$r_permission = $r_result->row_array();\n\t\t\tif(!empty($r_permission)){\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t}",
"public function create(User $user)\n {\n return $user->canDo('category.category.create');\n }",
"public function isCategoryView($request) {\r\n $module = strtolower($request->getModuleName());\r\n $controller = strtolower($request->getControllerName());\r\n $action = strtolower($request->getActionName());\r\n\r\n if (($module == 'catalog') && ($controller == 'category') && ($action == 'view'))\r\n return true;\r\n else\r\n return false;\r\n }",
"public function create(User $user)\n {\n return $user->hasPermission('guide-categories-create');\n }",
"public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// unset some actions\n\t\t$GLOBALS['TL_DCA']['tl_boxes4ward_category']['config']['closed'] = true;\n\t\tunset($GLOBALS['TL_DCA']['tl_boxes4ward_category']['list']['operations']['copy']);\n\t\tunset($GLOBALS['TL_DCA']['tl_boxes4ward_category']['list']['operations']['delete']);\n\t\tunset($GLOBALS['TL_DCA']['tl_boxes4ward_category']['list']['operations']['editheader']);\n\n\t\tif(!is_array($this->User->boxes4ward)) $this->User->boxes4ward = array();\n\n\t\t// Set filter to hide elemts user hastn access\n\t\t$GLOBALS['TL_DCA']['tl_boxes4ward_category']['list']['sorting']['filter'][] = array('FIND_IN_SET(id,?)',implode(',',$this->User->boxes4ward));\n\n\t\tif($this->Input->get('act') && $this->Input->get('act') != 'show')\n\t\t{\n\t\t\t$this->log('Only admin can '.$this->Input->get('act').' boxes4ward categories', 'tl_boxes4ward_category checkPermission', TL_ERROR);\n\t\t\t$this->redirect('contao/main.php?act=error');\n\t\t}\n\t}",
"public function isCategoryAllowedByUser(array $context, string $category): bool\n {\n $cookieChecker = $this->getCookieChecker($context['app']->getRequest());\n\n return $cookieChecker->isCategoryAllowedByUser($category);\n }",
"public function create(User $user) {\n return $user->hasPermission('categories.create');\n }",
"public function view(User $user): bool\n {\n return $user->can('Read Ads');\n }",
"function feed_category_admin_access() {\r\n $arguments = func_get_args();\r\n $allow_public = array_shift($arguments);\r\n $feed_category = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_category_access($allow_public, $feed_category);\r\n}",
"function canAdd($user) {\n \treturn $user->isAdministrator() || $user->getSystemPermission('can_add_documents') && (boolean) DocumentCategories::findAll($user);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse configuration variable expression into PHP code | function _parse_conf_var($conf_var_expr)
{
$parts = explode('|', $conf_var_expr, 2);
$var_ref = $parts[0];
$modifiers = isset($parts[1]) ? $parts[1] : '';
$var_name = substr($var_ref, 1, -1);
$output = "\$this->_config[0]['vars']['$var_name']";
$this->_parse_modifiers($output, $modifiers);
return $output;
} | [
"function _parse_conf_var($conf_var_expr)\n {\n list($var_ref, $modifiers) = explode('|', $conf_var_expr, 2);\n\n $var_name = substr($var_ref, 1, -1);\n\n $output = \"\\$_config['$var_name']\";\n\n $this->_parse_modifiers($output, $modifiers);\n\n return $output;\n }",
"public function ParseConfig(){\n\t\tpreg_match_all('#\\{\\$config\\.([^}]*)\\}#is', $this->TemplateData, $matches);\n\n\t\tforeach($matches[1] as $regexKey=>$value){\n\t\t\t$this->TemplateData = str_replace($matches[0][$regexKey], '<?php echo '.$this->GetConfigFunction.'(\\''.$value.'\\'); ?>', $this->TemplateData);\n\t\t}\n\t}",
"function _parse_conf_var($conf_var_expr)\r\n {\r\n $parts = @explode('|', $conf_var_expr, 2);\r\n $var_ref = $parts[0];\r\n $modifiers = isset($parts[1]) ? $parts[1] : '';\r\n $var_name = substr($var_ref, 1, -1);\r\n $output = \"\\$this->_config[0]['vars']['$var_name']\";\r\n $this->_parse_modifiers($output, $modifiers);\r\n return $output;\r\n }",
"function getSpecialVariable($name,$configData)\n{\n $pattern = '+^\\s*' . $name . '\\s*=\\s*(.*)\\s*$+m';\n\n if(preg_match($pattern,$configData,$matches)) {\n\t return($matches[1]);\n } else {\n\t configError($name);\n\t return(NULL);\n }\n}",
"public function parse() {\n $value = $this->getRawValue();\n $matches = [];\n if (is_array($value)) {\n return $value;\n }\n\n if (preg_match(self::NESTED_CONFIGURATION_REGEX, $value, $matches) === 1) {\n return $this->parseNestedValue($value, $matches);\n } else {\n return $this->parser->parseIntelligent($value);\n }\n }",
"public function parse($expression);",
"function _parse_expressions($contents)\n\t{\n\t\t// foreach parsing\n\t\tif (preg_match_all(\"/\\{foreach (.+)\\}/sU\", $contents, $matches)) {\n\t\t\tforeach ($matches[1] as $k=>$exp) {\n\t\t\t\t$exp = trim(trim($exp,\"()\"));\n\t\t\t\tlist($e_left, $e_right) = explode(\" as \", $exp);\n\t\t\t\t$e_right = explode(\"=>\", $e_right);\n\n\t\t\t\t$left_exp = $this->_split_exp($e_left);\n\t\t\t\t$code = \"\";\n\t\t\t\tif (substr($left_exp, 0, 5) !== \"array\") {\n\t\t\t\t\t$code = \"if(!empty(\".$left_exp.\"))\";\n\t\t\t\t}\n\t\t\t\t$code .= \"foreach(\".$left_exp.\" as \".$this->_split_exp($e_right[0]);\n\t\t\t\tif (count($e_right)==2) {\n\t\t\t\t\t$code .= '=>'.$this->_split_exp($e_right[1]);\n\t\t\t\t}\n\t\t\t\t$code .= '){';\n\t\t\t\t$contents = str_replace($matches[0][$k], trim($this->_code($code)), $contents);\n\t\t\t}\n\t\t}\n\t\t// if & for & elseif parsing\n\t\tif (preg_match_all(\"/\\{(if|elseif|for|while) (.+)\\}/sU\", $contents, $matches)) {\n\t\t\tforeach ($matches[1] as $k=>$v) {\n\t\t\t\tif ($v==\"for\") {\n\t\t\t\t\t$matches[2][$k] = trim($matches[2][$k],\"()\");\n\t\t\t\t}\n\t\t\t\t$code = $v.\"(\".$this->_split_exp($matches[2][$k]).\"){\";\n\t\t\t\tif ($v==\"elseif\") {\n\t\t\t\t\t$code = \"}\".$code;\n\t\t\t\t}\n\t\t\t\t$contents = str_replace($matches[0][$k], $this->_code($code), $contents);\n\t\t\t}\n\t\t}\n\t\t// eval & eval_literal parsing\n\t\tif (preg_match_all(\"/\\{(eval|eval_literal) (.+)\\}/sU\", $contents, $matches)) {\n\t\t\tforeach ($matches[1] as $k=>$type) {\n\t\t\t\t$code = rtrim(trim($matches[2][$k]),';');\n\t\t\t\tif ($type==\"eval\") {\n\t\t\t\t\t$code = $this->_split_exp($code);\n\t\t\t\t}\n\t\t\t\t$code .= \";\";\n\t\t\t\t$contents = str_replace($matches[0][$k], $this->_code($code), $contents);\n\t\t\t}\n\t\t}\n\t\t$contents = str_replace(\"{else}\", $this->_code(\"}else{\"), $contents);\n\t\t$contents = str_replace(array(\"{/foreach}\",\"{/while}\",\"{/for}\",\"{/if}\"), trim($this->_code(\"}\")), $contents);\n\t\treturn $contents;\n\t}",
"function get_cfg_var ($option) {}",
"function _convertConfigVar($str) \n {\n $mods = explode('|', $str);\n $var = array_shift($mods);\n $var = substr($var,1,-1); // strip #'s\n $mods = implode('|',$mods);\n if (strlen($mods)) {\n $mods = \"<!-- UNSUPPORTED MODIFIERS: $mods -->\";\n }\n return '{configVars.'.$var .'}' . $mods;\n }",
"private function parseConfig(){\n return $this->parser('config');\n }",
"function _evaluateSetExpression($tag) {\n # or error out if necessary\n \n # Get the expression from the tag \n $expression = join(\" \", array_slice($tag, 2));\n \n # If the expression is a variable in the template variables then return it\n if (array_key_exists($expression, $this->_templateVariables)) { return $this->_templateVariables[$expression]; }\n \n # If the expression isn't blank then continue otherwise error out\n if ($expression != \"\") {\n # If the expression is joining values together then return the joined string\n if (is_integer(strpos($expression, \":=\"))) {\n # Break the expression apart into the seperate pieces that will be joined together\n $expressionArray = explode(\":=\", $expression);\n \n # Loop through the individual expression items of the expression and act accordingly on each one\n foreach($expressionArray as $expressionItemIndex => $expressionItem) {\n if (array_key_exists(trim($expressionItem), $this->_templateVariables)) {\n $expressionArray[$expressionItemIndex] = $this->_templateVariables[trim($expressionItem)];\n } else {\n $expressionArray[$expressionItemIndex] = str_replace(\"\\\"\", \"\", trim($expressionItem));\n }\n }\n \n # Join the expression items back together and return the result\n return join(\"\", $expressionArray); \n \n # If the expression is a string literal then return the string literal\n } elseif (($expression[0] == \"\\\"\") && ($expression[strlen($expression)-1] == \"\\\"\")) {\n return substr($expression, 1, -1);\n } else {\n # The expression must be a mathematical expression\n\n # Pad special characters with spaces so that we can get to the values later\n $characterArray = array(\"(\", \")\", \"*\", \"/\", \"+\", \"-\", \"%\");\n foreach($characterArray as $character) {\n $expression = str_replace($character, \" $character \", $expression);\n }\n \n # Separate the expression into individual expression items \n $expressionArray = explode(\" \", $expression);\n\n # Initialize the expression that will evaluated by the eval function\n $evalExpression = \"\";\n \n # Loop through the individual expression items of the expression and act accordingly on each one\n foreach($expressionArray as $expressionItem) {\n if (array_key_exists($expressionItem, $this->_templateVariables)) {\n # If the expression item is a template variable then append the value\n # of the variable to the eval expression\n $evalExpression .= $this->_templateVariables[$expressionItem] . \" \";\n } elseif ($expressionItem == $tag[1]) {\n # If the expression item is the same name as the tag\n # then initialize a template variable with the name of\n # the expression item and append the initialized value to the\n # eval expression \n $this->_templateVariables[$expressionItem] = 0;\n $evalExpression .= \"0 \";\n } else {\n # The expression item is static and can be appended to the eval expression\n $evalExpression .= \"$expressionItem \";\n }\n }\n \n # Try to eval the expression and return the result. Error out if the expression\n # can not be evalulated \n eval(\"\\$returnValue = ($evalExpression);\");\n if (is_null($returnValue) || $returnValue==\"\") {\n return \"SyntaxError, Invalid set expression $evalExpression\";\n } else {\n return $returnValue;\n }\n }\n } else {\n # The expression is blank so error out\n return \"SyntaxError, Invalid set expression $expression\";\n }\n }",
"public function testParseWithConfig()\n {\n $path = 'uploads/image-filters(300x300-rotate(90)-negative).jpg';\n $return = $this->generator->parse($path, $this->config);\n $this->assertArrayHasKey('path', $return);\n $this->assertArrayHasKey('filters', $return);\n $this->assertEquals('uploads/image.jpg', $return['path']);\n $this->assertEquals($this->filters, $return['filters']);\n }",
"#[@config(key = 'value')]\n public function keyValuePair() { }",
"protected function expressionparser($expression)\r\n\t{\r\n\t $expression.=\" \";\r\n\t $con = \"\";\r\n\t for($z=0;$z<=strlen($expression)-1;$z++)\r\n\t {\r\n\t $m = substr($expression,$z,1);\r\n\t if($m==\"(\")\r\n\t {\r\n\t $t = \"functions\";\r\n\t $b=1;\r\n\t } \r\n\t if(in_array($m,$this->operations))\r\n\t {\r\n\t if(is_numeric($con))\r\n\t {$t = \"numbers\";}\r\n\t elseif(is_string(substr($con,0,1)))\r\n\t {$t=\"variables\";}\r\n\t else\r\n\t {$t = \"entities\";}\r\n\t $b=1;\r\n\t } \r\n\t if($b==1)\r\n\t {\r\n\t if($con)\r\n\t {\r\n\t if($t==\"variables\"){$s[$con]=$con;}\r\n\t if($t==\"functions\" && !in_array($con,$this->securefunctions)){$this->adderror(\"$con is an insecure function\");return(0);}\r\n\t $con=\"\"; \r\n\t }\r\n\t $b=0;\r\n\t }\r\n\t else\r\n\t {\r\n\t $con .= $m;\r\n\t }\r\n\t }\r\n\t return($s);\r\n\t}",
"function LDAP_getValueFromConfigLine($line)\n{\n\t$value = preg_replace(\"/\\\\\\$servers->setValue\\('[^']*','[^']*',[']?/\", '', $line);\n\n\t// Remove unwanted parts around the value\n\t$value = str_replace ('array(\\'' , '' , $value);\n\t$value = str_replace ('\\'))' , '' , $value);\n\t$value = str_replace ('\\')' , '' , $value);\n\t$value = str_replace (')' , '' , $value);\n\t$value = trim($value);\n\n\treturn($value);\n}",
"private function _loadPHP($source) {\n\t\t// test that we have access to the file\n\t\tif(!file_exists($source)) {\n\t\t\tthrow new Exception(\"Unable to access requested config file {$source}\");\n\t\t}\n\t \t\n\t \t// load the file\n\t\t$data\t\t\t\t\t\t= file_get_contents($source);\n\t\t// need to strip any opening/closing PHP delimitors off, or eval fails\n\t\t$data\t\t\t\t\t\t= str_replace(array('<?php', '<?', '?>'), array('', '', ''), $data);\n\t\t\n\t\t// look for all defined variables in the file\n\t\t$matches\t\t\t\t\t= array();\n\t\t$names\t\t\t\t\t\t= '/(\\$[a-zA-Z_][0-9A-Za-z_]*)[ \\t]*=/';\n\t\t$ret\t\t\t\t\t\t= preg_match_all($names, $data, $matches);\n\n\t\t// make them local so that we can access them\n\t\teval($data);\n\t\t\n\t\t// loop through all the variables found\n\t\tforeach($matches[1] as $v) {\n\t\t\t// get the name of the variable\n\t\t\t$ref\t\t\t\t\t= substr($v, 1);\n\t\t\t// make usre it's not null, and set it\n\t\t\tif(isset($$ref) && !is_null($$ref)) {\n\t\t\t\t$this->conf[$ref]=$$ref;\n\t\t\t}\n\t\t}\n\t}",
"private function parseCode($str) \n\t{\n\t\tpreg_match_all(\"/{(.*?)}/\",$str,$args);\n\t\tforeach($args[1] as $code) \n\t\t{\n\t\t\t// Document data\n\t\t\tif(strlen($code) && $code{0}=='$') \n\t\t\t{\n\t\t\t\t$str = str_replace('{'.\"$code\".'}',$this->get(substr($code,1)),$str);\n\t\t\t}\n\t\t\t// Functions and global variables\n\t\t\telseif(substr($code,0,5) == 'exec:') \n\t\t\t{\n\t\t\t\t$code = substr($code,5);\n\t\t\t\tif(strlen($code) && $code{0} == '$')\n\t\t\t\t{\n\t\t\t\t\teval(\"global $code;\");\n\t\t\t\t}\n\t\t\t\tif(strlen($code) && $code{0} != '$') \n\t\t\t\t{\n\t\t\t\t\tif(!defined($code) && !preg_match(\"/^(.*)\\((.*)\\)$/\",$code))\n\t\t\t\t\t{\n\t\t\t\t\t\t$code = \"null\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\teval(\"\\$replace = $code;\");\n\t\t\t\t$str = str_replace('{'.\"exec:$code\".'}',$this->parseCode($replace),$str);\n\t\t\t}\n\t\t\telseif(substr($code,0,8) == 'include:') \n\t\t\t{\n\t\t\t\t$code = substr($code,8);\n\t\t\t\teval(\"\\$file = $code;\");\n\t\t\t\tif(file_exists( $this->getPath($file) )) \n\t\t\t\t{\n\t\t\t\t\t$this->parseTemplate(file( $this->getPath($file)));\n\t\t\t\t}\n\t\t\t\t$str = str_replace('{'.\"include:$code\".'}','',$str);\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}",
"public function ParseLanguageVariables(){\n\t\tpreg_match_all('#\\{\\$lang\\.([^}]*)\\}#is', $this->TemplateData, $matches);\n\n\t\tforeach($matches[1] as $regexKey=>$value){\n\t\t\t$value = $this->Tpl2PhpVars($value, $this->GetLangFunction.'(', ')');\n\t\t\t$this->TemplateData = str_replace($matches[0][$regexKey], '<?php echo '.$value.'; ?>', $this->TemplateData);\n\t\t}\n\t}",
"protected function parseExpression($expression) {\n\t\t// Check for URI operators\n\t\t$operator = '';\n\n\t\tif (isset(self::$operatorHash[$expression[0]])) {\n\t\t\t$operator = $expression[0];\n\t\t\t$expression = substr($expression, 1);\n\t\t}\n\n\t\t$values = explode(',', $expression);\n\t\tforeach ($values as &$value) {\n\t\t\t$value = trim($value);\n\t\t\t$varspec = array();\n\t\t\t$substrPos = strpos($value, ':');\n\t\t\tif ($substrPos) {\n\t\t\t\t$varspec['value'] = substr($value, 0, $substrPos);\n\t\t\t\t$varspec['modifier'] = ':';\n\t\t\t\t$varspec['position'] = (int) substr($value, $substrPos + 1);\n\t\t\t} elseif (substr($value, -1) == '*') {\n\t\t\t\t$varspec['modifier'] = '*';\n\t\t\t\t$varspec['value'] = substr($value, 0, -1);\n\t\t\t} else {\n\t\t\t\t$varspec['value'] = (string) $value;\n\t\t\t\t$varspec['modifier'] = '';\n\t\t\t}\n\t\t\t$value = $varspec;\n\t\t}\n\n\t\treturn array(\n\t\t\t'operator' => $operator,\n\t\t\t'values' => $values\n\t\t);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns crypt type used to encrypt password | public function return_crypt_type () {
if(CRYPT_SHA512 == 1) { return 'CRYPT_SHA512'; }
elseif(CRYPT_SHA256 == 1) { return 'CRYPT_SHA256'; }
elseif(CRYPT_BLOWFISH == 1) { return 'CRYPT_BLOWFISH'; }
elseif(CRYPT_MD5 == 1) { return 'CRYPT_MD5'; }
else { return "No crypt types supported"; }
} | [
"public function getEncryptionType() {\r\n\t\treturn $this->_config['passwordtype'];\r\n\t}",
"private function detect_crypt_type () {\n if(CRYPT_SHA512 == 1) { return '$6$rounds=3000$'; }\n elseif(CRYPT_SHA256 == 1) { return '$5$rounds=3000$'; }\n elseif(CRYPT_BLOWFISH == 1) { return '$2y$'.str_pad(rand(4,31),2,0, STR_PAD_LEFT).'$'; }\n elseif(CRYPT_MD5 == 1) { return '$5$rounds=3000$'; }\n else { $this->Result->show(\"danger\", _(\"No crypt types supported\"), true); }\n }",
"function getPasswordType();",
"function getCryptKey($type = 'CRYPT_STD_DES') {\n /*--------------------------------------------------------------------------\n | CRYPT_STD_DES - Standard DES-based hash with a two character salt from the \n | alphabet \"./0-9A-Za-z\". Using invalid characters in the salt will cause \n | crypt() to fail.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_STD_DES == 1 && $type == 'CRYPT_STD_DES') {\n return crypt('HCL6QGsKwDMN2','HC');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_EXT_DES - Extended DES-based hash. The \"salt\" is a 9-character \n | string consisting of an underscore followed by 4 bytes of iteration count \n | and 4 bytes of salt. These are encoded as printable characters, 6 bits \n | per character, least significant character first. The values 0 to 63 are \n | encoded as \"./0-9A-Za-z\". Using invalid characters in the salt will cause \n crypt() to fail.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_EXT_DES == 1 && $type == 'CRYPT_EXT_DES') {\n return crypt('_a...HCig8tp30mPhjfQ','_a ... HCig');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_MD5 - MD5 hashing with a twelve character salt starting with $1$\n |---------------------------------------------------------------------------\n */\n if (CRYPT_MD5 == 1 && $type == 'CRYPT_MD5') {\n return crypt('$1$HCigmW9T$VoHVZfkndAEVxjEOMKNO90','$1$HCigmW9T$');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_BLOWFISH - Blowfish hashing with a salt as follows: \"$2a$\", \"$2x$\" \n | or \"$2y$\", a two digit cost parameter, \"$\", and 22 characters from the \n | alphabet \"./0-9A-Za-z\". Using characters outside of this range in the salt \n | will cause crypt() to return a zero-length string. The two digit cost \n | parameter is the base-2 logarithm of the iteration count for the underlying \n | Blowfish-based hashing algorithmeter and must be in range 04-31, values \n | outside this range will cause crypt() to fail. Versions of PHP before \n | 5.3.7 only support \"$2a$\" as the salt prefix: PHP 5.3.7 introduced the \n | new prefixes to fix a security weakness in the Blowfish implementation. \n | Please refer to » this document for full details of the security fix, \n | but to summarise, developers targeting only PHP 5.3.7 and later should \n | use \"$2y$\" in preference to \"$2a$\".\n |---------------------------------------------------------------------------\n */\n if (CRYPT_BLOWFISH == 1 && $type == 'CRYPT_BLOWFISH') {\n return crypt('$2y$06$HCigmW9Tnoaw.aIzOEobLOVDWnTgG2QAC5Eu/5DIOAeGlEVq0Q.2O','$2y$0$HCigmW9Tnoaw.aIzOEobLX$');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_SHA256 - SHA-256 hash with a sixteen character salt prefixed with \n | $5$. If the salt string starts with 'rounds=<N>$', the numeric value \n | of N is used to indicate how many times the hashing loop should \n | be executed, much like the cost parameter on Blowfish. The default \n | number of rounds is 5000, there is a minimum of 1000 and a maximum of \n | 999,999,999. Any selection of N outside this range will be truncated \n | to the nearest limit.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_SHA256 == 1 && $type == 'CRYPT_SHA256') {\n return crypt('$5$rounds=34319$HCigmW9Tnoaw.aIz$YKQXJttdJxXCNBJEGW82I8Hyhz5ztG3A67P3XlpNpvA','$5$rounds=34319$HCigmW9Tnoaw.aIz$');\n }\n\n /*--------------------------------------------------------------------------\n | CRYPT_SHA512 - SHA-512 hash with a sixteen character salt prefixed with \n | $6$. If the salt string starts with 'rounds=<N>$', the numeric value of N \n | is used to indicate how many times the hashing loop should be executed, \n | much like the cost parameter on Blowfish. The default number of rounds \n | is 5000, there is a minimum of 1000 and a maximum of 999,999,999. Any \n | selection of N outside this range will be truncated to the nearest limit.\n |---------------------------------------------------------------------------\n */\n if (CRYPT_SHA512 == 1 && $type == 'CRYPT_SHA512') {\n return crypt('$6$rounds=34319$HCigmW9Tnoaw.aIz$G4kCr.3sQfC2Bm7.TQHufQ3bBtqUYYPrZuLbnG2YvgVp4TiHLcOdFQT174ng1VTHRxLlINSE8pQqSlWab3xgZ/','$6$rounds=34319$HCigmW9Tnoaw.aIz$');\n }\n}",
"function func_get_crypt_type($str) {\n\t\n\t$encryption_types = array(\"B\",\"C\",\"N\");\n\n\t$s = substr($str, 0, 1);\n\n\tif (!in_array((string)$s, $encryption_types))\n\t\t$s = false;\n\n\treturn $s;\n}",
"function get_enc_type($user_password) {\n\tif (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\tdebug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t# Capture the stuff in the { } to determine if this is crypt, md5, etc.\n\t$enc_type = null;\n\n\tif (preg_match('/{([^}]+)}/',$user_password,$enc_type))\n\t\t$enc_type = strtolower($enc_type[1]);\n\telse\n\t\treturn null;\n\n\t# Handle crypt types\n\tif (strcasecmp($enc_type,'crypt') == 0) {\n\n\t\t# No need to check for standard crypt, because enc_type is already equal to 'crypt'.\n\t\tif (preg_match('/{[^}]+}\\\\$1\\\\$+/',$user_password))\n\t\t\t$enc_type = 'md5crypt';\n\n\t\telseif (preg_match('/{[^}]+}\\\\$2+/',$user_password))\n\t\t\t$enc_type = 'blowfish';\n\n\t\telseif (preg_match('/{[^}]+}_+/',$user_password))\n\t\t\t$enc_type = 'ext_des';\n\t}\n\n\treturn $enc_type;\n}",
"function get_enc_type( $user_password ) {\n\t/* Capture the stuff in the { } to determine if this is crypt, md5, etc. */\n\t$enc_type = null;\n\n\tif( preg_match( \"/{([^}]+)}/\", $user_password, $enc_type) )\n\t\t$enc_type = strtolower( $enc_type[1] );\n\telse\n\t\treturn null;\n\n\t/* handle crypt types */\n\tif( strcasecmp( $enc_type, 'crypt') == 0 ) {\n\n\t\tif( preg_match( \"/{[^}]+}\\\\$1\\\\$+/\", $user_password) ) {\n\t\t\t$enc_type = \"md5crypt\";\n\n\t\t} elseif ( preg_match( \"/{[^}]+}\\\\$2+/\", $user_password) ) {\n\t\t\t$enc_type = \"blowfish\";\n\n\t\t} elseif ( preg_match( \"/{[^}]+}_+/\", $user_password) ) {\n\t\t\t$enc_type = \"ext_des\";\n\t\t}\n\n\t\t/*\n\t\t * No need to check for standard crypt, \n\t\t * because enc_type is already equal to 'crypt'.\n\t\t */\n\t}\n\treturn $enc_type;\n}",
"function encriptarPassword($password){\n return crypt($password);\n}",
"public function getEncryptionType()\n {\n return $this->encryption_type;\n }",
"public function getCryptKey(): string;",
"private function cryptPassword($pass) {\n //hasher le mot de passe\n //https://www.php.net/manual/fr/function.openssl-encrypt\n \n return openssl_encrypt($pass, \"AES-128-ECB\", SECRETKEY);\n }",
"protected function crypt()\n {\n return $this->app()->crypt();\n }",
"static function hash_password($password_clear, $encodage_type)\n {\n $encodage_type = strtolower($encodage_type);\n switch ($encodage_type) {\n case 'crypt':\n $crypted_password = '{CRYPT}' . crypt($password_clear, self::random_salt(2));\n break;\n case 'ext_des':\n /* Extended DES crypt. see OpenBSD crypt man page */\n if (!defined('CRYPT_EXT_DES') || CRYPT_EXT_DES == 0) {\n /* Your system crypt library does not support extended DES encryption */\n return false;\n }\n $crypted_password = '{CRYPT}' . crypt($password_clear, '_' . self::random_salt(8));\n break;\n case 'md5crypt':\n if (!defined('CRYPT_MD5') || CRYPT_MD5 == 0) {\n /* Your system crypt library does not support md5crypt encryption */\n return false;\n }\n $crypted_password = '{CRYPT}' . crypt($password_clear, '$1$' . self::random_salt(9));\n break;\n case 'blowfish':\n if (!defined('CRYPT_BLOWFISH') || CRYPT_BLOWFISH == 0) {\n /* Your system crypt library does not support blowfish encryption */\n return false;\n }\n /* Hardcoded to second blowfish version and set number of rounds */\n $crypted_password = '{CRYPT}' . crypt($password_clear, '$2a$12$' . self::random_salt(13));\n break;\n case 'md5':\n $crypted_password = '{MD5}' . base64_encode(pack('H*', md5($password_clear)));\n break;\n case 'sha':\n if (function_exists('sha1')) {\n /* Use PHP 4.3.0+ sha1 function, if it is available */\n $crypted_password = '{SHA}' . base64_encode(pack('H*', sha1($password_clear)));\n } else if (function_exists('mhash')) {\n $crypted_password = '{SHA}' . base64_encode(mhash(MHASH_SHA1, $password_clear));\n } else {\n /* Your PHP install does not have the mhash() function */\n return false;\n }\n break;\n case 'ssha':\n if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) {\n mt_srand((double) microtime() * 1000000 );\n $salt = mhash_keygen_s2k(MHASH_SHA1, $password_clear, substr(pack('h*', md5(mt_rand())), 0, 8), 4);\n $crypted_password = '{SSHA}' . base64_encode(mhash(MHASH_SHA1, $password_clear . $salt) . $salt);\n } else {\n /* Your PHP install does not have the mhash() function */\n return false;\n }\n break;\n case 'smd5':\n if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) {\n mt_srand((double) microtime() * 1000000 );\n $salt = mhash_keygen_s2k(MHASH_MD5, $password_clear, substr(pack('h*', md5(mt_rand())), 0, 8), 4);\n $crypted_password = '{SMD5}' . base64_encode(mhash(MHASH_MD5, $password_clear . $salt) . $salt);\n } else {\n /* Your PHP install does not have the mhash() function */\n return false;\n }\n break;\n case 'samba':\n if (function_exists('hash')) {\n $crypted_password = hash('md4', rcube_charset::convert($password_clear, RCUBE_CHARSET, 'UTF-16LE'));\n $crypted_password = strtoupper($crypted_password);\n } else {\n /* Your PHP install does not have the hash() function */\n return false;\n }\n break;\n case 'ad':\n $crypted_password = rcube_charset::convert('\"' . $password_clear . '\"', RCUBE_CHARSET, 'UTF-16LE');\n break;\n case 'clear':\n default:\n $crypted_password = $password_clear;\n }\n\n return $crypted_password;\n }",
"function crypt_password($info, $encdata = false)\t{ \n\tif (!info) return false;\n\t$strength = \"08\";\n\t# If encrypted data is passed, check it against input ($info) \n\tif ($encdata) { \n\t\treturn ( substr($encdata, 0, 60) == crypt($info, \"$2a$\" . $strength . \"$\" . substr($encdata, 60)) );\n\t\t\n\t} else { \n\t\t# Make a salt and hash it with input, and add salt to end \n\t\t$salt = \"\"; \n\t\tfor ($i = 0; $i < 22; $i++) { \n\t\t\t$salt .= substr(\"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\", mt_rand(0, 63), 1);\n\t\t} \n\t\t# Return 82 char string (60 char hash + 22 char salt) \n\t\treturn crypt($info, \"$2a$\".$strength.\"$\".$salt).$salt; \n\t} \n}",
"public function getEncryptionType()\n\t{\n\t\treturn $this->_formEncryptionType;\n\t}",
"public static function cryptPassword($password) {\n return md5(Login::PASSWORD_SALT.$password);\n }",
"function cryptPasswordDeCrypt($cifer, $key)\r\n{\r\n return base64_decode($cifer);\r\n}",
"function mcrypt_get_cipher_name () {}",
"function ldap_crypt ($passwd) {\n global $ldap;\n\n if ($ldap['crypt_function'] === 'unicodePwd') {\n // install php-mbstring!\n return mb_convert_encoding(\"\\\"{$passwd}\\\"\", \"UTF-16LE\", \"UTF-8\");\n }\n else if ($ldap['crypt_function'] === 'SSHA/SHA1') {\n // Source: LDAP Account Manager\n $salt = generateSalt(4);\n return '{SSHA}' . base64_encode(hex2bin(sha1($passwd . $salt)) . $salt);\n }\n else {\n $salt = '$6$' . substr(base64_encode(random_bytes(16)), 0, 16);\n return '{CRYPT}' . crypt($passwd, $salt);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test case for orgApacheSlingDistributionPackagingImplExporterAgentDistributio . | public function testOrgApacheSlingDistributionPackagingImplExporterAgentDistributio() {
} | [
"public function testOrgApacheSlingDistributionPackagingImplExporterAgentDistributio()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testOrgApacheSlingDistributionPackagingImplImporterRepositoryDistri() {\n\n }",
"public function testOrgApacheSlingDistributionPackagingImplImporterLocalDistributio() {\n\n }",
"public function testOrgApacheSlingDistributionResourcesImplDistributionServiceResour() {\n\n }",
"public function testOrgApacheSlingDistributionAgentImplForwardDistributionAgentFacto()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testComAdobeGraniteDistributionCoreImplDistributionToReplicationEven() {\n\n }",
"public function testOrgApacheSlingDistributionAgentImplPrivilegeDistributionRequestA() {\n\n }",
"public function testComAdobeGraniteDistributionCoreImplReplicationDistributionTrans() {\n\n }",
"public function testDistributionCreate()\n {\n }",
"public function testOrgApacheSlingDistributionTriggerImplScheduledDistributionTrigge() {\n\n }",
"public function testOrgApacheSlingDistributionPackagingImplImporterLocalDistributio()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testOrgApacheSlingDistributionTriggerImplJcrEventDistributionTrigger() {\n\n }",
"public function testOrgApacheSlingDistributionAgentImplReverseDistributionAgentFacto()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testExportDistribution()\n {\n $exportservice = new ExportService($this->em, $this->container);\n $exportableTable = $this->em->getRepository(DistributionData::class)->findAll();\n\n $filename = $exportservice->export($exportableTable, 'actual', 'csv');\n $path = getcwd() . '/' . $filename;\n\n $this->assertEquals($filename, 'actual.csv');\n $this->assertFileExists($path);\n $this->assertFileIsReadable($path);\n\n unlink($path);\n }",
"public function testDistributionUpdate()\n {\n }",
"public function testOrgApacheSlingDistributionTriggerImplResourceEventDistributionTr() {\n\n }",
"public function testDistributionShow()\n {\n }",
"public function testServeAgent()\n {\n }",
"public function testExport()\n {\n $installer = app()->instance()->make('platform_acl_installer');\n\n if ($installer instanceof BaseInstaller) {\n $installer->export();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Searches clients by name and code, can be used for autocomplete | public function findClientsByNameAndCode($name = '', $code = '', $auto_complete = false)
{
/* @var $clients self[] */
$c = new CDbCriteria();
$result = array();
if(!empty($name))
{
$words = explode(' ',$name,2);
if(count($words) > 1)
{
$c -> addCondition("(name LIKE '%".$words[0]."%' AND surname LIKE '%".$words[1]."%') OR (company_name LIKE '%".$name."%')");
}
else
{
$c -> addCondition("name LIKE '%".$name."%' OR surname LIKE '%".$name."%' OR company_name LIKE '%".$name."%'");
}
}
if(!empty($code))
{
$c -> addCondition("personal_code LIKE '%".$code."%' OR company_code LIKE '%".$code."%'");
}
$clients = Clients::model()->findAll($c);
if(!empty($clients))
{
if(!$auto_complete)
{
$result = $clients;
}
else
{
foreach($clients as $client)
{
if(empty($code))
{
$result[] = array('id' => $client->id, 'label' => $client->type == 1 ? $client->company_name : $client->name.' '.$client->surname);
}
else
{
$result[] = array('id' => $client->id, 'label' => $client->type == 1 ? $client->company_code : $client->personal_code);
}
}
}
}
return $result;
} | [
"public function searchClientName_get(){\n $keyword = $this->get('keyword');\n $result = $this->person_model->searchForClient($keyword); \n if ($result) {\n $this->response($result, 200);\n\n exit;\n }\n }",
"function search_client_by_name($username){\n $sql_bus=\"SELECT * FROM usuario NATURAL JOIN cliente WHERE usuario.username LIKE '%$username%';\";\n $result=$GLOBALS['conne']->query($sql_bus);\n if($result->num_rows>0){\n return $result->fetch_assoc();\n }else{\n return null;\n }\n }",
"public function get_autocomplete()\n {\n $data['result'] = $this->json_response($this->json_status['error']);\n \n if ($this->is_ajax()) {\n $term = $this->input->get('term', TRUE);\n $user_id = $this->input->get('user_id', TRUE);\n \n $this->object_model->db->like(array(\n 'name' => $term\n ));\n \n if ($user_id)\n $this->object_model->db->where(array(\n 'user_id' => $user_id\n ));\n \n $clients = $this->object_model->get(false, \"id, name as label, name as value\");\n \n if (! $clients) {\n $clients[] = array(\n 'id' => 0,\n 'value' => lang(\"no_record_found\")\n );\n }\n \n $data['result'] = json_encode($clients);\n }\n \n $this->template('/ajax', $data, TRUE);\n }",
"public function onAutoComplete($client);",
"public function searchCustomers($name);",
"public function search($key)\n {\n $key = rtrim($key);\n $clients = User::client()->findByName($key)->paginate(10);\n return success_data(compact('clients'));\n }",
"public static function getClientList($searchTerm, $searchOptions) {\n\n if ($searchTerm != \"\") {\n $conn = new PDO(DB_DSN, DB_USERNAME, DB_PASSWORD);\n\n $sql = \"SELECT * FROM Clienti WHERE \";\n\n $options = array();\n\n if (in_array(\"ragioneSociale\", $searchOptions)) {\n $options[] = \"DESCR1 like concat('%', :searchTerm, '%') OR DESCR2 like concat('%', :searchTerm, '%')\";\n }\n if (in_array(\"codiceCliente\", $searchOptions)) {\n $options[] = \"CODICE like concat('%', :searchTerm, '%')\";\n }\n if (in_array(\"partitaIva\", $searchOptions)) {\n $options[] = \"PARIVA like concat('%', :searchTerm, '%')\";\n }\n if (in_array(\"comune\", $searchOptions)) {\n $options[] = \"COMUNE like concat('%', :searchTerm, '%')\";\n }\n if (count($options) < 1) {\n $options[] = \"DESCR1 like concat('%', :searchTerm, '%') OR DESCR2 like concat('%', :searchTerm, '%')\";\n }\n\n if (count($options) > 1) {\n $andOr = \"OR\";\n }\n else {\n $andOr = \"\";\n }\n \n $sql .= implode(\" {$andOr} \", $options) . \" ORDER BY PROGFATIVA+PROGFATIVAP DESC LIMIT 50\";\n $st = $conn->prepare($sql);\n\n $st->bindValue(\":searchTerm\", $searchTerm, PDO::PARAM_STR);\n $st->execute();\n $list = array();\n\n while ($row = $st->fetch()) {\n $list[] = new Client($row);\n }\n\n $conn = null;\n return json_encode($list);\n }\n }",
"public function findClient($name) {\n\t\t$name = strtolower($name);\n\n\t\t//Try to match by username first\n\t\tforeach ($this->connections as $conn) {\n\t\t\t$client = $this->resolveClient($conn);\n\t\t\t//Don't let us perform stuff on hidden clients\n\t\t\tif (!$client->getVisible())\n\t\t\t\tcontinue;\n\t\t\tif (strtolower($client->getUsername()) === $name) {\n\t\t\t\treturn $client;\n\t\t\t}\n\t\t}\n\t\t//If that fails, try by display name\n\t\tforeach ($this->connections as $conn) {\n\t\t\t$client = $this->resolveClient($conn);\n\t\t\t//Don't let us perform stuff on hidden clients\n\t\t\tif (!$client->getVisible())\n\t\t\t\tcontinue;\n\t\t\tif (strtolower($client->getDisplayName()) === $name) {\n\t\t\t\treturn $client;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function clientDetailByName() {\n\t\ttry {\n\n\t\t\t$name = Request::input('client_name');\n\n\t\t\t$client = ConnectContentClient::clientExists(\\Auth::User()->station->id, $name);\n\n\t\t\tif (!$client) {\n\t\t\t\tthrow new \\Exception('Client not found.');\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => $client->getJSONArrayListForClientDetail()));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"public static function json_search_customers()\n {\n }",
"public function cloud_autocomplete() {\n if (!empty($_REQUEST['term'])) {\n $search_for = sanitize_text_field($_REQUEST['term']);\n \n $params = array(\n 'orb_cloud_lib_data' => array(\n 'cmd' => 'item.list',\n 'query' => $search_for,\n )\n );\n\n $req_res = $this->call($this->api_url, $params);\n wp_send_json($req_res->is_success() ? $req_res->data('result') : $req_res->to_array());\n }\n }",
"public function search($key)\n {\n $clients = User::client()->findByName($key)->paginate(10);\n return success_data(compact('clients'));\n }",
"public function autocomplete()\n {\n $query = $this->buildSearchQuery();\n\n $params = [\n 'index' => 'catalogs',\n '_source' => [\n 'model_id',\n 'slug'\n ],\n 'body' => $query\n ];\n $response = $this->client->search($params);\n \n return $this->sendSuccess(\n 'Autocomplete retrieved successfully.',\n [\n 'data' => $this->parseResults($response)\n ]\n );\n }",
"public function search(){\n $search = Input::get ( 'search' );\n $clients = Client::where('name','LIKE','%'.$search.'%')->orWhere('email','LIKE','%'.$search.'%')->paginate(7);\n if(count($clients) > 0)\n return view('clients/index-client',compact('clients'))->withQuery ( $search );\n else return view ('clients/index-client',compact('clients'))->with('failure_message','No Details found. Try to search again !');\n\n }",
"public function actionAutocomplete() {\n $q = strtolower($_GET[\"term\"]);\n if (!$q)\n return;\n\n $user = User::model()->findByPk(user()->id);\n $contacts = $user->contactIds;\n\n $result = array();\n\n if (isset($_GET['conv-id'])) {\n\n $conv_id = $_GET['conv-id'];\n if (!is_int($conv_id = (int) $conv_id))\n continue;\n\n $conv = Mailbox::conversation($conv_id);\n \n if (!$conv)\n continue;\n \n $senders = $conv->replyTo(user()->id);\n foreach ($senders as $k => $sender) {\n\n $label = GxcHelpers::getDisplayName($k, true, true);\n\n if (strpos(strtolower($label), $q) !== false) {\n array_push($result, array(\"id\" => $k, \"label\" => $label));\n }\n }\n }\n\n foreach ($contacts as $k => $contact_id) {\n $label = GxcHelpers::getDisplayName($contact_id, true, true);\n if (strpos(strtolower($label), $q) !== false) {\n array_push($result, array(\"id\" => $contact_id, \"label\" => $label));\n }\n\n if (count($result) > 11)\n break;\n }\n\n echo json_encode(array_unique($result));\n }",
"public function getClientsByCompanyName($company_name = null, $client_type_id = null) {\n\n\t\tif(is_array($company_name)) {\n\t\t\tforeach($company_name as $key=>$val) {\n\t\t\t\t$company_name[$key] = str_replace('\\'', '\\\\\\'', $val);\n\t\t\t}\n\t\t} else {\n\t\t\t$company_name = str_replace('\\'', '\\\\\\'', $company_name);\n\t\t}\n\n\t\t$clients = array();\n\t\t$filter = '';\n\t\t$filter .= !is_null($company_name) ? ' AND `company_name` IN(' . (is_array($company_name) ? '\\'' . implode(',\\'',$company_name) . '\\'' : '\\'' . $company_name . '\\'') . ')' : null;\n\t\t$filter .= !is_null($client_type_id) ? ' AND `client_type_id` IN(' . $client_type_id . ')' : null;\n\n\t\t$query = sprintf('\n\t\t\tSELECT *\n\t\t\tFROM `%1$s`.`client`\n\t\t\tWHERE 1 %2$s\n\t\t\tORDER BY client.company_name;\n\t\t',\n\t\t\tDB_PREFIX.'core',\n\t\t\t//$this->db->escape_string($filter)\n\t\t\t$filter\n\t\t);\n\n\t\tif($result = $this->db->query($query)) {\n\t\t\twhile($row = $result->fetch_object()) {\n\t\t\t\t$clients[] = $row;\n\t\t\t}\n\t\t\t$result->close();\n\t\t}\n\t\t\n\t\treturn $clients;\n\t}",
"public static function autocomplete($text) {\r\n\r\n\t\t\t$dbConn = DatabaseConnection::getConnection();\r\n\r\n\t\t\t$stmt = $dbConn->prepareStatement('\r\n\t\t\t\t\tSELECT userID, CONCAT(firstname, \" \", lastname) AS name\r\n\t\t\t\t\t\tFROM ndoorse_member m\r\n\t\t\t\t\t\t\tLEFT OUTER JOIN ndoorse_connection rc\r\n\t\t\t\t\t\t\t\tON(m.userID = rc.requesterID AND rc.connectionStatus = 1 AND rc.respondentID = :userID)\r\n\t\t\t\t\t\t\tLEFT OUTER JOIN ndoorse_connection dc\r\n\t\t\t\t\t\t\t\tON(m.userID = dc.respondentID AND dc.connectionStatus = 1 AND dc.requesterID = :userID)\r\n\t\t\t\t\t\tWHERE (firstname LIKE :name\r\n\t\t\t\t\t\t\tOR lastname LIKE :name\r\n\t\t\t\t\t\t\tOR CONCAT(firstname, \" \", lastname) LIKE :name)');\r\n\t\t\t$stmt->bindParameter('name', $text . '%');\r\n\t\t\t$stmt->bindParameter('userID', $_SESSION['user']->getID());\r\n\t\t\t$result = $stmt->execute();\r\n\r\n\t\t\tif($result instanceof Resultset) {\r\n\t\t\t\treturn $result->getResultsetAsArray();\r\n\t\t\t}\r\n\t\t\treturn array();\r\n\r\n\t\t}",
"public function get_clientByFilter()\n\t{\n\t\t$this->kode_client \t\t= $this->input->post('kode_client');\n\n\t\t$this->db->select('client');\n\t\t$this->db->from('client');\n\t\t$this->db->where('kode', $this->kode_client);\n\t\t$query = $this->db->get();\n\t\treturn $query->row();\n\t}",
"function uet_json_search_customers() {\n\tob_start();\n\n\tcheck_ajax_referer( 'search-customers', 'security' );\n\n\t$term = wc_clean( stripslashes( $_GET['term'] ) );\n\n\tif ( empty( $term ) ) {\n\t\tdie();\n\t}\n\n\t$found_customers = array();\n\n\tadd_action( 'pre_user_query', array( __CLASS__, 'uet_json_search_customer_name' ) );\n\n\t$customers_query = new WP_User_Query( apply_filters( 'uet_json_search_customers_query', array(\n\t\t'fields' => 'all',\n\t\t'orderby' => 'display_name',\n\t\t'search' => '*' . $term . '*',\n\t\t'search_columns' => array( 'ID', 'user_login', 'user_email', 'user_nicename' )\n\t) ) );\n\n\tremove_action( 'pre_user_query', array( __CLASS__, 'uet_json_search_customer_name' ) );\n\n\t$customers = $customers_query->get_results();\n\n\tif ( $customers ) {\n\t\tforeach ( $customers as $customer ) {\n\t\t\t$found_customers[ $customer->ID ] = $customer->display_name . ' (#' . $customer->ID . ' – ' . sanitize_email( $customer->user_email ) . ')';\n\t\t}\n\t}\n\n\twp_send_json( $found_customers );\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Verwijdert een kamerboeking object | public function verwijderKamer() {
$id = $this->input->get('id');
$this->load->model('kamerBoeking_model');
$this->kamerBoeking_model->delete($id);
echo 0;
} | [
"public function verwijderBoeking() {\n $id = $this->input->get('id');\n $this->load->model('boeking_model');\n $this->boeking_model->delete($id);\n\n echo 0;\n }",
"function verwijderSjabloon($onderwerp){\n $this->db->where('onderwerp', $onderwerp);\n $this->db->delete('Sjabloon');\n }",
"public function isVerwijderd( )\r\n {\r\n return false;\r\n }",
"public function delete()\r\n\t{\r\n\t\t$sql = 'DELETE FROM '.static::$_table.' WHERE id=\"'.$this->_obj_id.'\"';\r\n\t\tself::db()->delete($sql);\r\n\t}",
"function admin_afbeelding_verwijderen($afbeelding_id)\n {\n $afbeelding = $this->Product->Productafbeelding->read(null, $afbeelding_id);\n if($this->Product->Productafbeelding->delete($afbeelding_id))\n {\n if($this->Product->verwijderBestand($afbeelding['Productafbeelding']['bestandsnaam']))\n {\n $this->Session->setFlash(\"De afbeelding is verwijderd\", \"flash_succes\");\n }\n else\n {\n $this->Session->setFlash(\"De afbeelding is verwijderd uit de database, maar niet van de server\", \"flash_error\");\n }\n }\n else\n {\n $this->Session->setFlash(\"De afbeelding kon niet worden verwijderd\", \"flash_error\");\n }\n \n $this->redirect('/admin/producten/bewerken/' . $afbeelding['Productafbeelding']['product_id'] . '#tab_afbeeldingen');\n }",
"public function removeObject()\n {\n $sql = 'DELETE FROM {sql:tableName} WHERE {sql:primaryKey} = {primaryValue}';\n $this->db->query(Strings::prepareSql($sql, array(\n 'tableName' => $this->table,\n 'primaryKey' => $this->primaryKey[0],\n 'primaryValue' => $this->id\n )));\n\n $this->resetCache();\n }",
"public function verwijderBestelling($BestelID) {\n BestellingDAO::deleteBestelling($BestelID);\n BestelRegelDAO::deleteBestelRegel($BestelID);\n }",
"public function deleteIrRemout(){\n }",
"public function delete()\r\n {\r\n $db = Loader::db();\r\n $db->delete('btShsGalleriaImages', array('bID' => $this->bID));\r\n $db->delete('btShsGalleriaVideos', array('bID' => $this->bID));\r\n parent::delete();\r\n }",
"public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }",
"function verwijderen($id){\n $functieGebruiker = new stdClass();\n $functieGebruiker->eindTijd = date(\"Y-m-d H:i:s\");\n\n $this->db->where('id', $id);\n if(!$this->db->update('functieGebruiker', $functieGebruiker)){\n return false;\n }\n return true;\n }",
"public function delete() {\r\n $this->db->delete(\"objects\", $this->db->quoteInto(\"o_id = ?\", $this->model->getO_id() ));\r\n }",
"public function verwijderAction()\n\t\t{\n\t\t\t$this->requireUserType(array(CT_User::Directie));\n\n\t\t\t$id = $this->_getParam('id');\n\n\t\t\t$emailtemplates = new CT_Db_Emailtemplates();\n\n\t\t\t$selectQuery = $emailtemplates->select();\n\n\t\t\t$selectQuery->where('volgnummer = ?', $id);\n $selectQuery->where('volgnummer NOT IN (SELECT emailtemplate FROM klanten)');\n\n\t\t\t$stmt = $emailtemplates->getAdapter()->query($selectQuery);\n\t\t\t$records = $stmt->fetchAll();\n\t\t\n\t\t\tif(count($record) == 1) {\n\t\t\t\t$emailtemplates->delete($emailtemplates->getAdapter()->quoteInto('volgnummer = ?', $id));\n\t\t\t\t$this->_redirect('/emailtemplate');\n\t\t\t} else {\n\t\t\t\t$this->showErrorAndExit('Het is niet mogelijk in gebruik zijnde templates te verwijderen.');\n\t\t\t}\n\t\t}",
"public function remove() {\n $modx =& $this->modx;\n $objClass = $this->getClass();\n /* Class ID Key, Name Key => Name Value Pair */\n $idKey = $this->dbClassIDKey;\n $name = $this->getName();\n $nameKey = $this->getNameField();\n $id = null;\n\n\n /* See if the object exists */\n $obj = $modx->getObject($objClass, array($nameKey => $name));\n if ($obj) {\n $obj->remove();\n $temp = $this->modx->setLogLevel(modX::LOG_LEVEL_INFO);\n $this->helpers->sendLog(modX::LOG_LEVEL_INFO, ' ' .\n $this->modx->lexicon('mc_removed')\n . ' '. $objClass . ': ' . $name);\n $this->modx->setLogLevel($temp);\n } else {\n $this->helpers->sendLog(modX::LOG_LEVEL_INFO,\n '[Object Adapter] ' .\n $this->modx->lexicon('mc_class_file_nf')\n . ' ' . $objClass . ': ' . $name);\n }\n }",
"public function delete(){\n\t\t$this->teachers_model->delete();\n\t}",
"public function deleteUpdate ()\n {\n $this->checkInvalid();\n\n $url = sprintf(\"%s/%d.json\", self::apiEndpoint(), $this->getId());\n self::sendDelete($url);\n\n $this->deletedObject = true;\n }",
"public function delete()\n\t{\n\t\t$this->deletefriend();\n\t}",
"public function destroyRek() {\n $pic = $this->rekname;\n $this->delete(); // and cascade deleting from pivot table\n\n // delete keywords from kwords table which don't exist in pivot table\n $allKwords = Kword::all()->pluck('id');\n $pivotKwords = DB::table('kword_reklama')->pluck('kword_id');\n $deleteKwords = $allKwords->diff($pivotKwords);\n Kword::destroy($deleteKwords->all());\n\n $restReklama = self::all()->pluck('rekname')->all();\n if (!in_array($pic, $restReklama)) { // if deleted Rekname does not exist in Reklama table\n $file_name = public_path() . '/img/' . $pic . '.jpg';\n if(file_exists($file_name)){unlink($file_name);}\n $file_name = public_path() . '/img/' . $pic . 's.jpg';\n if(file_exists($file_name)){unlink($file_name);}\n }\n }",
"public function delete()\n {\n $this->refereeOrm->delete();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Operation deleteZoneTagWithHttpInfo Delete a tag for a zone. | public function deleteZoneTagWithHttpInfo($zone_id, $zone_tag)
{
$returnType = '';
$request = $this->deleteZoneTagRequest($zone_id, $zone_tag);
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 deleteZoneWithHttpInfo($zone_id)\n {\n // verify the required parameter 'zone_id' is set\n if ($zone_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $zone_id when calling deleteZone');\n }\n // parse inputs\n $resourcePath = \"/zone/{zoneId}\";\n $httpBody = '';\n $queryParams = [];\n $headerParams = [];\n $formParams = [];\n $_header_accept = $this->apiClient->selectHeaderAccept(['application/json', 'application/xml']);\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(['application/json', 'application/xml']);\n\n // path params\n if ($zone_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"zoneId\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($zone_id),\n $resourcePath\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 // this endpoint requires API key authentication\n $apiKey = $this->apiClient->getApiKeyWithPrefix('ApiKey');\n if (strlen($apiKey) !== 0) {\n $headerParams['ApiKey'] = $apiKey;\n }\n // make the API Call\n try {\n list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(\n $resourcePath,\n 'DELETE',\n $queryParams,\n $httpBody,\n $headerParams,\n '\\BumbalClient\\Model\\ApiResponse',\n '/zone/{zoneId}'\n );\n\n return [$this->apiClient->getSerializer()->deserialize($response, '\\BumbalClient\\Model\\ApiResponse', $httpHeader), $statusCode, $httpHeader];\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\BumbalClient\\Model\\ApiResponse', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n\n throw $e;\n }\n }",
"public function delete($project, $zone, $operation, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'operation' => $operation);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }",
"public function deleting(Zone $zone)\n {\n //\n }",
"public function delete(ZoneInterface $zone);",
"public function deleteZoneTagAsyncWithHttpInfo($zone_id, $zone_tag)\n {\n $returnType = '';\n $request = $this->deleteZoneTagRequest($zone_id, $zone_tag);\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 deleteZoneTag($zone_id, $zone_tag)\n {\n $this->deleteZoneTagWithHttpInfo($zone_id, $zone_tag);\n }",
"public function deleteZoneWithHttpInfo($cloud_pk, $id, $ifc_pk, $project_pk)\n {\n $request = $this->deleteZoneRequest($cloud_pk, $id, $ifc_pk, $project_pk);\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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n 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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $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 static function delete_zone($zone_id)\n {\n }",
"public function deleteZoneByName($zoneName) {\n\t\t\n\t\t$args = array(\n\t\t\n\t\t\t\"zoneName\" => $zoneName,\n\t\t\t\n\t\t);\n\t\t\n\t\ttry {\n\t\t\n\t\t\treturn (array)$response = $this->client->deleteZoneByName($args)->deleteZoneByNameResult;\n\n\t\t} catch (SoapFault $fault) {\n\n\t\t\tthrow new Kohana_Exception($fault->__toString());\n\n\t\t}\n\t\n\t}",
"public function delete($project, $zone, $targetInstance, $optParams = array())\n {\n $params = array('project' => $project, 'zone' => $zone, 'targetInstance' => $targetInstance);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params), \"Google_Service_Compute_Operation\");\n }",
"public function deleteZoneAsyncWithHttpInfo($serverId, $zoneId)\n {\n $returnType = '';\n $request = $this->deleteZoneRequest($serverId, $zoneId);\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 deleteCartLocationTagWithHttpInfo($cart_location_id, $cart_location_tag)\n {\n $returnType = '';\n $request = $this->deleteCartLocationTagRequest($cart_location_id, $cart_location_tag);\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 deleteTag($tag);",
"public function zoneDelete( $zone )\n\t{\n\t\t$result = $this->execute( \"Zone/$zone\", 'DELETE' );\n\t\tif ( 'success' == $result->status )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function DeleteZone($zone_id= '')\n\t{\t\n\n\t\tif( !$this->api_key_account)\n\t\t{\n\t\t\treturn array('status' =>'error' ,'code' =>'api_key_account' ,'msg'=> 'missing acount api key');\n\t\t\tdie();\n\t\t}\n\n\t\tif(!$zone_id)\n\t\t{\n\t\t\treturn array('status' =>'error' ,'code' =>'zone_id' ,'msg'=> 'missing zone id');\n\t\t\tdie();\n\t\t}\n \n\n\t\t$key = $this->api_key_account;\n\t\t$api_url = $this->api_url['zone'].'/pullzone/'. $zone_id;\n\n\t\t$get_header = $this->create_header($key);\n \n\t\t$api_call = $this->run( array('call_method' => 'DELETE', 'api_url' => $api_url,'header' => $get_header , ) );\n\t\t\n\t\t\n\t\tif($api_call['http_code'] !=200 && $api_call['http_code'] !=302)\n\t\t{\n\t\t\t//error message\n\t\t\t$request_array = json_decode(json_encode($api_call['data']));\n\t\t\t$result = array\n\t\t\t(\t\n\t\t\t\t\"status\" => 'error',\n\t\t\t\t\"http_code\"=>$api_call['http_code'],\n\t\t\t\t\"msg\" => json_decode($request_array) , \n\t\t\t);\n\t\t\treturn $result;\n\t\t\tdie();\n\t\t}\t\t \n \t\t\n \t\treturn array(\n\t\t\t'status' => 'success', \n\t\t\t\"msg\" => $api_call,\n \n\t\t);\n \t\t//return $api_call;\n\t\tdie();\n\t}",
"public function deleteItemAccountCodeTagWithHttpInfo($item_account_code_id, $item_account_code_tag)\n {\n $returnType = '';\n $request = $this->deleteItemAccountCodeTagRequest($item_account_code_id, $item_account_code_tag);\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 updateZoneWithHttpInfo($body)\n {\n \n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $body when calling updateZone');\n }\n \n // parse inputs\n $resourcePath = \"/beta/zone\";\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('application/json'));\n \n \n \n \n // default format to json\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n\n \n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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, 'PUT',\n $queryParams, $httpBody,\n $headerParams\n );\n \n return array(null, $statusCode, $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n }\n \n throw $e;\n }\n }",
"public function deleteZoneFile($zone_id, $file_id)\n {\n $this->deleteZoneFileWithHttpInfo($zone_id, $file_id);\n }",
"public function deleteWithHttpInfo($request)\n {\n $request = $this->deleteRequest($request);\n \n $response = $this->callClient($request);\n return [null, $response->getStatusCode(), $response->getHeaders()];\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks that there are no "magic numbers", where a magic number is a numeric literal that is not defined as a constant. The numbers 1, 0, 1, and 2 are not considered to be magic numbers. | function magicNumber($strippedLines, $file) {
$value = (double) $this->getProperty('MagicNumber');
// .001, 1.23, 1.2e-03
$numRE = "/\b(\+|-)?(?<!'|\")[0-9]*\.?[0-9]+(e[+-]?[0-9]+)?\b/"; //'
$constRE = "/\bconst\b|#define/";
// Following RE must be mutually exclusive (no overlap)
$oneRE = "/\b[+-]?1(\.0)?(?!\.)\b/";
$twoRE = "/\b2(\.0)?(?!\.)\b/";
// $zeroRE = "/\b0(\.0+)?(?!\.)\b/";
$zeroRE = "/\b[-+]?0*\.?0+(?:[eE][-+]?0+)?\b/"; // changed 5/1/2017
$countNums = 0;
$countConst = 0;
$countOkNums = 0;
$lineNum = 0;
foreach($strippedLines as $line) {
$lineNum++;
$countMagic = 0;
$countOkNums = 0;
$countConst = preg_match_all($constRE, $line, $matches);
if (0 === $countConst) {
$countOkNums = preg_match_all($oneRE, $line, $matches);
$countOkNums += preg_match_all($twoRE, $line, $matches);
$countOkNums += preg_match_all($zeroRE, $line, $matches);
}
if (0 === $countConst && 0 === $countOkNums) {
$countMagic = preg_match_all($numRE, $line, $matches);
}
if ($countMagic > 0) {
$magicNumList = $matches[0];
foreach ($magicNumList as $num) {
$this->addError("$file:$lineNum: Magic number: $num", $value);
}
}
}
} | [
"public static function HasMagicNumber($data): bool\n {\n return substr($data, 0, strlen(self::$magicNumber)) === self::$magicNumber;\n }",
"function isMagic() {\n $magicArray = array('__construct','__destruct','__call',\n \t\t\t\t\t '__get','__set','__isset','__unset',\n \t\t\t\t\t '__sleep','__wakeup','__toString','__clone');\n return in_array($this->getName(), $magicArray);\n }",
"public function checkMagicConst(string $name) : bool {\n if(!$this->validate_magic_constants){\n return true;\n }\n $original_name = $name;\n if($name instanceof SandboxedString){\n $name = strval($name);\n }\n if(!$name){\n $this->validationError('Sandboxed code attempted to call unnamed magic constant!', Error::VALID_MAGIC_CONST_ERROR, null, '');\n }\n $name = $this->normalizeMagicConst($name);\n if(is_callable($this->validation['magic_constant'])){\n return call_user_func_array($this->validation['magic_constant'], [$name, $this]);\n }\n if(!isset($this->definitions['magic_constants'][$name])){\n if(count($this->whitelist['magic_constants'])){\n if(!isset($this->whitelist['magic_constants'][$name])){\n $this->validationError(\"Sandboxed code attempted to call non-whitelisted magic constant: $original_name\", Error::WHITELIST_MAGIC_CONST_ERROR, null, $original_name);\n }\n } else if(count($this->blacklist['magic_constants'])){\n if(isset($this->blacklist['magic_constants'][$name])){\n $this->validationError(\"Sandboxed code attempted to call blacklisted magic constant: $original_name\", Error::BLACKLIST_MAGIC_CONST_ERROR, null, $original_name);\n }\n } else {\n $this->validationError(\"Sandboxed code attempted to call invalid magic constant: $original_name\", Error::VALID_MAGIC_CONST_ERROR, null, $original_name);\n }\n }\n return true;\n }",
"public function isMagic()\n {\n return strpos($this->getName(), '__') === 0;\n }",
"static function check_number($token)\n\t{\n\t\tif ($token === _ZERO || preg_match('/^[1-9][0-9_]*(e\\+?[0-9]*)?$/i', $token)) {\n\t\t\treturn _BASE_DECIMAL;\n\t\t}\n\n\t\tif ($token[0] === _ZERO) {\n\t\t\tif ($token[1] === _BASE_HEX) {\n\t\t\t\treturn preg_match('/^0x[0-9a-f][0-9a-f_]*$/i', $token) ? _BASE_HEX : null;\n\t\t\t}\n\t\t\telseif ($token[1] === _BASE_BINARY) {\n\t\t\t\treturn preg_match('/^0b[01][01_]*$/', $token) ? _BASE_BINARY : null;\n\t\t\t}\n\t\t\telseif ($token[1] === _BASE_OCTAL) {\n\t\t\t\treturn preg_match('/^0o[0-7][0-7_]*$/', $token) ? _BASE_OCTAL : null;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function isBlacklistedMagicConst(string $name) : bool {\n $name = $this->normalizeMagicConst($name);\n return isset($this->blacklist['magic_constants'][$name]);\n }",
"public function invalidManInt(): array\n {\n $cases = $this->invalidOptInt();\n $cases[] = ['value' => null];\n\n return $cases;\n }",
"public function testCheckMatrixInvalid()\n {\n $numArray = NumPHP::ones(3);\n $this->assertFalse(Helper::isMatrix($numArray));\n }",
"public function testWarningsErrnoIsIntegerAndNotEmpty(): void\n {\n $value = $this->get_reflection_property_value('warnings')[0];\n\n $this->assertIsInt($value['errno']);\n $this->assertNotEmpty($value['errno']);\n }",
"public function testAllFieldsRequiredValuesInContentTypesAreNotIncorrect() {\n $content_types = array_keys($this->contentTypes['test']);\n foreach ($content_types as $type) {\n $fields = array_keys($this->contentTypes['test'][$type]['fields']);\n foreach ($fields as $field) {\n $required = rand();\n try {\n $this->assertNotEquals(\n $required,\n $this->contentTypes['system'][$type]['fields'][$field]['required'],\n \"Failed asserting {$type}:{$field} required value is not wrong.\"\n );\n }\n catch (Exception $e) {\n $this->handleAssertException($e);\n }\n }\n }\n // Verify if all fields required value in content types passed the test.\n $this->checkAllAssertionsPassedWholeTest();\n }",
"private function checkNumbersOnly(): void\n {\n $this->passwordScore['calculatedData']['numbersOnly']['value'] = 0;\n $this->passwordScore['calculatedData']['numbersOnly']['count'] = 'no';\n $this->passwordScore['calculatedData']['numbersOnly']['displayName'] = 'Numbers Only';\n\n if (is_numeric($this->password)) {\n $this->passwordScore['calculatedData']['numbersOnly']['value'] = -10;\n $this->passwordScore['calculatedData']['numbersOnly']['count'] = 'yes';\n }\n }",
"protected function ensureAllNumericValues() {\n\t\t$this->ensureNumericValue(array(\n\t\t\tself::SPORTID,\n\t\t\tself::TIMESTAMP,\n\t\t\tself::IS_PUBLIC,\n\t\t\tself::IS_TRACK,\n\t\t\tself::TIME_IN_SECONDS,\n\t\t\tself::USE_VO2MAX\n\t\t));\n\t}",
"public function testShouldInvalidateNonNumericalValues() {\n $data = ['number_1' => 'test'];\n\n $rule = ['/number_([0-9]+)/i' => 'numerical'];\n $this->validator->setRequest($data)->setRules($rule);\n $this->assertFalse($this->validator->run());\n }",
"private function isPureDigit()\n {\n return ctype_digit($this->limit);\n }",
"function get_non_constant_constrained_flags() {\n $flags = array();\n\n for ($i=0; $i<count($this->content); $i++) {\n $hc = $this->get_rhc($i);\n $flags[$i] = \n ($hc->constant == null);\n };\n\n return $flags;\n }",
"protected function ensureAllNumericValues() {\n\t\t$this->ensureNumericValue(array(\n\t\t\tself::INPUT,\n\t\t\tself::MAX_KM,\n\t\t\tself::MAX_TIME\n\t\t));\n\t}",
"protected function checkAllIntegers()\n {\n $foundNonInt = false;\n\n $args = func_get_args();\n\n foreach ($args as $arg) {\n if (!is_int($arg)) {\n $foundNonInt = true;\n break;\n }\n }\n\n return !$foundNonInt;\n }",
"private function dataProvider__nonNumericValues(): array\n {\n return [\n [\"0x539\"],\n [\"not numeric\"],\n [array()],\n [[]],\n [null],\n [true],\n [false],\n [new stdClass],\n [''],\n [\"0b10100111001\"],\n [function() {\n return 123;\n }],\n ];\n }",
"function is_not_numeric($var) {\n return ! is_numeric($var);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Opens new group in WHERE statement | abstract protected function beginWhereGroup(); | [
"function opengroup ($group) {\n\t\t\n\t\t$this->group = $group;\n\t\t$this->openedGroup = true;\n\t\t\n\t}",
"function new_group()\r\n\t{\r\n\t\t\r\n\t}",
"private function _createGroupQuery()\n\t{\n\t\treturn craft()->db->createCommand()\n\t\t\t->select('id, fieldId, name, sortOrder')\n\t\t\t->from('neogroups')\n\t\t\t->order('sortOrder');\n\t}",
"protected function pushGroup()\n {\n if( $this->group ) {\n $this->parts[] = 'GROUP BY';\n $this->parts[] = $this->quoteIdentifierIfNotExpression($this->group);\n }\n }",
"protected function setGroup() {\r\n //var_dump($this->sql);\r\n if( $this->sqlGroupBy ) {\r\n var_dump($this->sql);\r\n $this->sql .= ' GROUP BY ' . $this->sqlGroupBy;\r\n }\r\n //var_dump($this->sql);\r\n }",
"private function _createGroupQuery()\n\t{\n\t\treturn craft()->db->createCommand()\n\t\t\t->select('id, name')\n\t\t\t->from('fieldgroups')\n\t\t\t->order('name');\n\t}",
"function block_openshare_groupingset($recordset,$ogid){\r\n\t\r\n\t\tforeach ($recordset as $key => $value) {\r\n\t\t\t//print \"key (id): \".$key.\" value(status): \".$value.\" <br/>\";\r\n\t\t\t$opengrouped = new object();\r\n\t\t\t$opengrouped->timemodifed = time();\r\n\t\t\tif ($value > 1) {\r\n\t\t\t\t$opengrouped->groupmembersonly = 0;\r\n\t\t\t\t$opengrouped->groupingid = 0;\r\n\t\t\t\t//print \"Module \".$key.\" removed from Closed Grouping. \";\r\n\t\t\t} else if (($value==1)) {\r\n\t\t\t\t$opengrouped->groupmembersonly = 1;\r\n\t\t\t\t$opengrouped->groupingid = $ogid;\r\n\t\t\t\t//print \"Module \".$key.\" added to Closed Grouping. \";\r\n\t\t\t}\r\n\t\t\t//make sure this module \r\n\t\t\t//add to date object and update record\r\n\t\t\t$opengrouped->id = $key;\r\n\t\t\tupdate_record(\"course_modules\", $opengrouped);\r\n\t\t}\r\n\t\treset($recordset);\r\n\t}",
"protected function SCGroupRecord_forLink() {\n\t$rc = $this->SCGroupTable()->SpawnRecordset();\n\t$rc->SetKeyValue($this->SCGroupID());\n\treturn $rc;\n }",
"public function query() {\n $this->ensureMyTable();\n $current_workspace = $this->workspaceManager->getActiveWorkspace();\n $workspace_id = $current_workspace->id();\n $this->query->addWhere($this->options['group'], (new Condition('OR'))\n ->condition('source_workspace', $workspace_id)\n ->condition('target_workspace', $workspace_id));\n }",
"public function insert_group()\n {\n $sql = \"INSERT INTO pefs_database.pef_group(grp_date,grp_position_group) \n VALUES (?,?)\";\n $this->db->query(\n $sql,\n array($this->grp_date, $this->grp_position_group)\n );\n }",
"protected function _groupCondition()\r\n\t{\r\n\t\t$this->_Informationsystem_Items\r\n\t\t\t->queryBuilder()\r\n\t\t\t->where('informationsystem_items.informationsystem_group_id', '=', intval($this->group));\r\n\r\n\t\treturn $this;\r\n\t}",
"public function where_end_group()\n\t{\n\t\tif (NULL !== $this->_where_group) {\n\t\t\t$where = new stdClass();\n\t\t\t$where->operator = $this->_where_group_condition;\n\t\t\t$where->group = $this->_where_group;\n\t\t\t$this->_where[] = $where;\n\n\t\t\t$this->_where_group = NULL;\n\t\t\t$this->_where_group_condition = NULL;\n\t\t}\n\t\treturn ($this);\n\t}",
"public function filterGroup()\n\t{\n\t\t// open group\n\t\t$this->filter_stack[] = $this->filters;\n\t\t$this->filter_stack[] = 'and';\n\n\t\t$this->filters = array();\n\t\treturn $this;\n\t}",
"public function group_end()\n\t{\n\t\t$this->qb_where_group_started = FALSE;\n\t\t$where = array(\n\t\t\t'condition' => str_repeat(' ', $this->qb_where_group_count--).')',\n\t\t\t'escape' => FALSE\n\t\t);\n\n\t\t$this->qb_where[] = $where;\n\t\tif ($this->qb_caching)\n\t\t{\n\t\t\t$this->qb_cache_where[] = $where;\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected function addCriterionGroup(ullSearchCritierionGroup $newCriteriaGroup)\n {\n $this->criterionGroups[] = $newCriteriaGroup;\n }",
"function check_for_new_groups() {\n gd_connect_db();\n $query = db_select('groups', 'g')->fields('g');\n $query->condition('g.drupal_added', 0, '=');\n $newGroups = $query->execute()->fetchAllAssoc('group_id');\n if (!empty($newGroups)) {\n // only rebuild menu's if yours have changed\n $query = db_select('users_groups', 'ug')->fields('ug');\n $query->condition('ug.user_id', $this->GDid, '=');\n $query->condition('ug.group_id', array_keys($newGroups), 'IN');\n $ownGroups = $query->execute()->fetchAllAssoc('group_id');\n db_set_active();\n if (!empty($ownGroups)) {\n // rebuild menu\n menu_rebuild();\n }\n }\n db_set_active();\n }",
"function prepare_sql_addgroupby($sqlquery)\n\t{\n\t\tlog_debug(\"sql_query\", \"Executing prepare_sql_addgroupby($sqlquery)\");\n\n\t\t$this->sql_structure[\"groupby\"][] = $sqlquery;\n\t}",
"private function applyGroupBy() {\n if (!count($this->groupByStatements)) {\n return;\n }\n\n $this->query .= ' group by '.implode(',', $this->groupByStatements);\n }",
"public function group()\n\t{\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Plugin Name: WP Journalize Classic/Web Font Toggle Plugin URI: Description: Changes journal article font and adds toggle widget Version: 0.1 Author: Benjamin J. Balter Author URI: | function journalize_font_toggle_activate() {
$options = get_option('journalize');
$options['font_toggle'] = true;
update_option('journalize', $options);
} | [
"function twentynineteen_switch_theme() {}",
"function wp_note(){\r\n $wp_note = get_option('wp_note');\r\n if($wp_note=='1'){\r\n if ( !defined('WP_CONTENT_URL') ) define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');\r\n $plugin_url = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__));\r\n echo '<link rel=\"stylesheet\" href=\"'.$plugin_url.'/style.css\"'.' type=\"text/css\" media=\"screen\" />';\r\n }\r\n}",
"function bezahlcodewidget_styles() \n{ \n?> \n<!-- BezahlCode.de-Generator --> \n<script src=https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js></script>\n<script src=\"<?php echo WP_PLUGIN_URL; ?>/bezahlcode-generator/qr.js\" type=\"text/javascript\"></script>\n<script src=\"<?php echo WP_PLUGIN_URL; ?>/bezahlcode-generator/dhtmlgoodies.js\" type=\"text/javascript\"></script>\n<script src=\"<?php echo WP_PLUGIN_URL; ?>/bezahlcode-generator/bezahlcode.js\" type=\"text/javascript\"></script>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"<?php echo WP_PLUGIN_URL; ?>/bezahlcode-generator/styles.css\" media=\"screen\" /> \n<!-- /BezahlCode.de-Generator --> \n<?php\n}",
"function twentysixteen_switch_theme() {}",
"function sport_2014_ctools_plugin_post_alter(&$plugin, &$info) {\n if (($info['type'] == 'layouts') && ($plugin['module'] == 'panopoly_theme')) {\n if (strpos($plugin['theme'], 'radix_') === FALSE) {\n $plugin['theme'] = 'radix_' . $plugin['theme'];\n unset($plugin['css']);\n }\n }\n}",
"function widget_japanesewotdwidget_init() \r\n{\r\n\tif ( !function_exists('register_sidebar_widget') )\r\n\t{\r\n\t\treturn;\r\n\t}\r\n\t\t\r\n\tfunction widget_japanesewotdwidget($args) \r\n {\r\n\t\textract($args);\r\n\t\t\t\r\n\t\techo $before_widget;\r\n\t\techo $before_title .\"Japanese Word of the Day\". $after_title;\r\n\r\n\t\t$wotd_code = \"<script src='http://www.hitsalive.com/japanese_wotd/japanese.php?link=WP' language='javascript' type='text/javascript'></script>\";\r\n \r\n\t\techo '<div style=\"margin-top:5px;text-align:left;\">'.$wotd_code.'</div>';\r\n\t\techo $after_widget;\r\n\t}\r\n\r\n\t\r\n\tfunction widget_japanesewotdwidget_control() \r\n {\r\n\t\techo '<p style=\"text-align:left;\">Brought to you by <b>Declan Software</b> - Language Learning Software for serious students.</p>';\r\n\t}\r\n\r\n\tregister_widget_control(array('Japanese Word of the Day', 'widgets'), 'widget_japanesewotdwidget_control', 200, 200);\r\n\r\n\tregister_sidebar_widget(array('Japanese Word of the Day', 'widgets'), 'widget_japanesewotdwidget');\r\n}",
"function wp_ajax_edit_theme_plugin_file()\n{\n}",
"function spost_theme_setup(){\r\n\tload_plugin_textdomain( 'spost', false, NEXUS_FRAMEWK_URL . '/languages/');\r\n}",
"function add_default_js() {\n?>\n<!--[if lt IE 8]>\n<script type=\"text/javascript\" src=\"<?php echo WFIM_PLUGIN_URL . 'js/web-font-manager-ie67-fix.js'; ?>\"></script>\n<![endif]-->\n<?php\n\t}",
"function install_theme_information() {}",
"function customizer_custom_css() {\r\n\t?>\r\n\t\t<style>\r\n\t\t.change-theme {\r\n\t\t\tdisplay: none !important;\r\n\t\t}\r\n\t\t</style>\r\n\t<?php\r\n\t}",
"function WDObirthdaystyle(){\r\n\r\n$pluginurl = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),\"\",plugin_basename(__FILE__));\r\necho '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$pluginurl.'WDObirthdaystyle.css\">';\r\n}",
"function face_box_2() {\r\n add_filter(\"plugin_action_links_$plugin\", array(&$this, 'link'));\r\n load_plugin_textdomain($this->_folder, false, $this->_folder); \r\n \r\n if (!function_exists('register_sidebar_widgetss') || !function_exists('register_widgetss_controlss'))\r\n return;\r\n register_sidebar_widgetss($this->_name, array(&$this, \"widgetss\"));\r\n register_widgetss_controlss($this->_name, array(&$this, \"controlss\"), $this->_width, $this->_height);\r\n }",
"function wordstrap_settings_stylesheets_section_text() { ?>\n <p><?php _e( 'Here you can change your stylesheet variables and recompile the stylesheets.' ); ?></p>\n<?php }",
"function wp_ajax_edit_theme_plugin_file()\n {\n }",
"function tb_longwave_header_options_callback() {\n\techo '<p>Settings for things visible in the Head of the theme.</p>';\n}",
"function hueman_xili_flags_customize () {\n\tremove_theme_support ( 'custom_xili_flag' ); // default created in setup above of child theme (%2$s)\n\t$args = array(\n\t\t'en_us'\t=> array(\n\t\t\t'path' => '%2$s/images/flags_2/en_us.png',\n\t\t\t'height'\t\t\t\t=> 24,\n\t\t\t'width'\t\t\t\t\t=> 24\n\t\t\t),\n\t\t'es_es'\t=> array(\n\t\t\t'path' => '%2$s/images/flags_2/es_es.png',\n\t\t\t'height'\t\t\t\t=> 24,\n\t\t\t'width'\t\t\t\t\t=> 24\n\t\t\t),\n\t\t'fr_fr'\t=> array(\n\t\t\t'path' => '%2$s/images/flags_2/fr_fr.png',\n\t\t\t'height'\t\t\t\t=> 24,\n\t\t\t'width'\t\t\t\t\t=> 24\n\t\t\t),\n\t\t'de_de'\t=> array(\n\t\t\t'path' => '%2$s/images/flags_2/de_de.png',\n\t\t\t'height'\t\t\t\t=> 24,\n\t\t\t'width'\t\t\t\t\t=> 24\n\t\t\t),\n\t\t'ja'\t=> array(\n\t\t\t'path' => '%2$s/images/flags_2/ja.png', //wp-content/themes/hueman-xili/images/flags_2/ja.png\n\t\t\t'height'\t\t\t\t=> 24,\n\t\t\t'width'\t\t\t\t\t=> 24\n\t\t\t),\n\t);\n\tadd_theme_support ( 'custom_xili_flag', $args );\n}",
"function autoparts_customizer_action_switch_theme() {\n\t\tif (false) autoparts_customizer_save_css();\n\t}",
"function bigtext() {\n\n\twp_enqueue_script( 'bigtext', plugins_url( 'js/bigtext.js' , __FILE__ ), array( 'jquery' ), null, true );\n\twp_enqueue_script( 'call-bigtext', plugins_url( 'js/call-bigtext.js' , __FILE__ ), array( 'jquery' ), null, true );\n\twp_enqueue_style(\t'bigtext-style', plugins_url( 'css/bigtext-style.css' , __FILE__ ) );\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the public 'cron.task_collection' shared service. | protected function getCron_TaskCollectionService()
{
$this->services['cron.task_collection'] = $instance = new \phpbb\di\service_collection($this);
$instance->add('cron.task.core.prune_all_forums');
$instance->add('cron.task.core.prune_forum');
$instance->add('cron.task.core.prune_shadow_topics');
$instance->add('cron.task.core.prune_notifications');
$instance->add('cron.task.core.queue');
$instance->add('cron.task.core.tidy_cache');
$instance->add('cron.task.core.tidy_database');
$instance->add('cron.task.core.tidy_plupload');
$instance->add('cron.task.core.tidy_search');
$instance->add('cron.task.core.tidy_sessions');
$instance->add('cron.task.core.tidy_warnings');
$instance->add('cron.task.text_reparser.pm_text');
$instance->add('cron.task.text_reparser.poll_option');
$instance->add('cron.task.text_reparser.poll_title');
$instance->add('cron.task.text_reparser.post_text');
$instance->add('cron.task.text_reparser.user_signature');
$instance->add('cron.task.core.update_hashes');
$instance->add('phpbb.autogroups.cron.task.autogroups_check');
$instance->add('phpbb.viglink.cron.task.viglink');
$instance->add('stevotvr.flair.cron.task.main');
return $instance;
} | [
"protected function getCron_TaskCollectionService()\n {\n $this->services['cron.task_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('cron.task.core.prune_all_forums');\n $instance->add('cron.task.core.prune_forum');\n $instance->add('cron.task.core.prune_shadow_topics');\n $instance->add('cron.task.core.prune_notifications');\n $instance->add('cron.task.core.queue');\n $instance->add('cron.task.core.tidy_cache');\n $instance->add('cron.task.core.tidy_database');\n $instance->add('cron.task.core.tidy_plupload');\n $instance->add('cron.task.core.tidy_search');\n $instance->add('cron.task.core.tidy_sessions');\n $instance->add('cron.task.core.tidy_warnings');\n\n return $instance;\n }",
"protected function getCron_TaskCollectionService()\n {\n $this->services['cron.task_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('cron.task.core.prune_all_forums');\n $instance->add('cron.task.core.prune_forum');\n $instance->add('cron.task.core.prune_shadow_topics');\n $instance->add('cron.task.core.prune_notifications');\n $instance->add('cron.task.core.queue');\n $instance->add('cron.task.core.tidy_cache');\n $instance->add('cron.task.core.tidy_database');\n $instance->add('cron.task.core.tidy_plupload');\n $instance->add('cron.task.core.tidy_search');\n $instance->add('cron.task.core.tidy_sessions');\n $instance->add('cron.task.core.tidy_warnings');\n $instance->add('cron.task.text_reparser.pm_text');\n $instance->add('cron.task.text_reparser.poll_option');\n $instance->add('cron.task.text_reparser.poll_title');\n $instance->add('cron.task.text_reparser.post_text');\n $instance->add('cron.task.text_reparser.user_signature');\n $instance->add('cron.task.core.update_hashes');\n $instance->add('phpbb.viglink.cron.task.viglink');\n\n return $instance;\n }",
"public function getCollection()\n {\n if (is_null($this->_taskCollection)) {\n $this->_taskCollection = $this->_getCollection();\n $this->_taskCollection->setCurPage($this->getCurrentPage());\n $this->_taskCollection->setPageSize($this->_dataHelper->getTaskPerPage());\n $this->_taskCollection->setOrder('published_at','asc');\n }\n\n return $this->_taskCollection;\n }",
"protected function getRouting_ResourcesLocator_CollectionService()\n {\n $this->services['routing.resources_locator.collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('routing.resources_locator.default');\n\n return $instance;\n }",
"public function getCronService() {\n\t\t\n \t\tif ( $this->cronService === null ) {\n\t\t\t$this->cronService = new \\momo\\cronservice\\CronService();\n\t\t}\t\n\t\t\t\n \t\treturn $this->cronService;\n \t}",
"protected function getCron_ManagerService()\n {\n return $this->services['cron.manager'] = new \\phpbb\\cron\\manager(${($_ = isset($this->services['cron.task_collection']) ? $this->services['cron.task_collection'] : $this->getCron_TaskCollectionService()) && false ?: '_'}, ${($_ = isset($this->services['routing.helper']) ? $this->services['routing.helper'] : $this->getRouting_HelperService()) && false ?: '_'}, './../', 'php');\n }",
"protected function getCron_ManagerService()\n {\n return $this->services['cron.manager'] = new \\phpbb\\cron\\manager($this->get('cron.task_collection'), './../', 'php');\n }",
"protected function getCron_Task_Core_QueueService()\n {\n $this->services['cron.task.core.queue'] = $instance = new \\phpbb\\cron\\task\\core\\queue('./../', 'php', ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, './../cache/production/');\n\n $instance->set_name('cron.task.core.queue');\n\n return $instance;\n }",
"protected function getCron_Task_Core_QueueService()\n {\n $this->services['cron.task.core.queue'] = $instance = new \\phpbb\\cron\\task\\core\\queue('./../', 'php', $this->get('config'));\n\n $instance->set_name('cron.task.core.queue');\n\n return $instance;\n }",
"protected function getNotification_MethodCollectionService()\n {\n $this->services['notification.method_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('notification.method.board');\n $instance->add('notification.method.email');\n $instance->add('notification.method.jabber');\n\n return $instance;\n }",
"public function getTaskService(): TaskServiceInterface;",
"protected function getOrderSyncCronScheduleCollection() {\n return Mage::getResourceModel(\"cron/schedule_collection\")\n ->addFieldToFilter(\"job_code\", Mage::getModel(\"klevu_search/order_sync\")->getJobCode());\n }",
"protected function getConsole_CommandCollectionService()\n {\n $this->services['console.command_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('console.command.cache.purge');\n $instance->add('console.command.config.delete');\n $instance->add('console.command.config.increment');\n $instance->add('console.command.config.get');\n $instance->add('console.command.config.set');\n $instance->add('console.command.config.set_atomic');\n $instance->add('console.command.cron.list');\n $instance->add('console.command.cron.run');\n $instance->add('console.command.db.list');\n $instance->add('console.command.db.migrate');\n $instance->add('console.command.db.revert');\n $instance->add('console.command.dev.migration_tips');\n $instance->add('console.command.extension.disable');\n $instance->add('console.command.extension.enable');\n $instance->add('console.command.extension.purge');\n $instance->add('console.command.extension.show');\n $instance->add('console.command.fixup.recalculate_email_hash');\n $instance->add('console.command.fixup.update_hashes');\n $instance->add('console.command.fixup.fix_left_right_ids');\n $instance->add('console.command.reparser.list');\n $instance->add('console.command.reparser.reparse');\n $instance->add('console.command.thumbnail.delete');\n $instance->add('console.command.thumbnail.generate');\n $instance->add('console.command.thumbnail.recreate');\n $instance->add('console.command.update.check');\n $instance->add('console.command.user.activate');\n $instance->add('console.command.user.add');\n $instance->add('console.command.user.delete');\n $instance->add('console.command.user.reclean');\n $instance->add('phpbbstudio.nore.command.reparse_nore');\n $instance->add('vse.dbtool.command.db.tool');\n\n return $instance;\n }",
"protected function getNotification_MethodCollectionService()\n {\n $this->services['notification.method_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('notification.method.email');\n $instance->add('notification.method.jabber');\n\n return $instance;\n }",
"public function createTaskService() {\n $googleClient = new Google_Client();\n $clientId = \"101304200027-p6ho99r5sfbra6erlmdicjg24cj2dkh6.apps.googleusercontent.com\";\n $clientSecret = \"6bHrJuJzDXCTdeubHR6_pN9-\";\n $googleClient->setClientId($clientId);\n $googleClient->setClientSecret($clientSecret);\n $googleClient->setRedirectUri(\"http://localhost:8080/auth/\");\n\n // If user is already authenticated\n if (!empty($_SESSION[self::ACCESS_TOKEN])) {\n $currentAccessToken = $_SESSION[self::ACCESS_TOKEN];\n $googleClient->setAccessToken($currentAccessToken);\n }\n\n // Fixing scope to always request for both, to avoid the complication in incremental scopes.\n $googleClient->addScope(array(Google_Service_Tasks::TASKS, Google_Service_Calendar::CALENDAR, 'email'));\n $taskService = new Monsieur_Task_Service($googleClient);\n return $taskService;\n }",
"private static function getCollection()\n {\n $client = static::getClient();\n $collection = $client->getCollection(self::$collection);\n\n return $collection;\n }",
"protected function getMigrator_ToolCollectionService()\n {\n $this->services['migrator.tool_collection'] = $instance = new \\phpbb\\di\\service_collection($this);\n\n $instance->add('migrator.tool.config');\n $instance->add('migrator.tool.config_text');\n $instance->add('migrator.tool.module');\n $instance->add('migrator.tool.permission');\n\n return $instance;\n }",
"public function getEventCollection()\n {\n return $this->getInstance(EventCollection::class);\n }",
"protected function getProductSyncCronScheduleCollection() {\n return Mage::getResourceModel(\"cron/schedule_collection\")\n ->addFieldToFilter(\"job_code\", Mage::getModel(\"klevu_search/product_sync\")->getJobCode());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/the function remove single quote from the string and replace it with two single quotes strString:string to be fixed returns:fixed string | function FixString($strString)
{
$strString = str_replace("'", "''", $strString);
$strString = str_replace("\'", "'", $strString);
return $strString;
} | [
"function replace_quotes($string){\n $string = str_replace(\"'\", \"~\", $string);\n $string = str_replace('\"', \"~\", $string);\n return $string;\n}",
"function smartQuoteString($str) {\n preg_match_all('/(")/', $str, $matches, PREG_OFFSET_CAPTURE);\n if(!empty($matches[0])) {\n \t$count = count($matches[0]);\n \t$isEven = (boolean)!($count % 2);\n \tif($isEven) {\n \t$replaceWith = array('“','”');\n \t$offset = 0;\n foreach($matches[0] as $key => $match) {\n \t $replaceIndex = $key % 2;\n //echo \"\\n<BR>Replace {$match[0]} with {$replaceWith[$replaceIndex]}. Length = \" . strlen($match[0]);\n \t $str = substr_replace($str,$replaceWith[$replaceIndex], $match[1] + $offset, strlen($match[0]));\n \t // as we replace a 6 char entity with a 7 char entity, the positions from the preg_search are off by the difference\n \t $offset += (strlen($replaceWith[$replaceIndex]) - strlen($match[0]));\n \t}\n \t}\n }\n return $str;\n}",
"function FixString($strString)\n\t{\n\t\t$strString = str_replace(\"'\", \"''\", $strString);\n\t\t$strString = str_replace(\"\\'\", \"'\", $strString);\n\t\t\n\t\treturn $strString;\n\t}",
"function sFix($sString)\r\n {\r\n return \"'\".str_replace(\"\\\\\", \"\\\\\\\\\",str_replace(\"'\", \"''\",$sString)).\"'\";\r\n }",
"function convert_smart_quotes($string) {\n $search = array(chr(145), chr(146), chr(147), chr(148), chr(151));\n $replace = array(\"\\'\", \"\\'\", '\\\"', '\\\"', '-');\n return str_replace($search, $replace, $string);\n}",
"function trataApostrofeToBD($str){\n\t\t$result_subst = str_replace(\"\\'\", \"'\", $str);\t\t\t\t\t\t\n\t\t$result_subst = str_replace(\"'\", \"\\'\", $result_subst);\n\t\treturn $result_subst;\n\t}",
"function FixQuotes ($what = \"\")\n{\n $what = preg_replace(\"/'/\", \"''\", $what);\n while (preg_match(\"/\\\\\\\\'/\", $what)) {\n $what = preg_replace(\"/\\\\\\\\'/\", \"'\", $what);\n }\n return $what;\n}",
"function decodequotes($str)\n\t{\n\t\t$singlequotestr=str_replace(\"''\",\"'\",$str);\n\t\t$repdoublequotestr=str_replace('"','\"',$singlequotestr);\n\t\t$repbackslashquotestr=stripslashes($repdoublequotestr);\n\t\treturn $repbackslashquotestr;\n\t}",
"function changesqlquote($str,$rep=\"'\")\r\n{\r\n\treturn str_replace(\"`\", $rep, $str);\r\n}",
"protected function fix($str)\n {\n $str = stripslashes($str);\n $str = str_replace('\"', '\\\"', $str);\n $str = str_replace(\"\\n\", '\\n', $str);\n return $str;\n }",
"private static function _escape_quoted_string($str) {\n $quo = substr($str, 0, 1);\n $str = substr($str, 1, -1);\n if ($quo == '\"') {\n $str = stripcslashes($str);\n } else {\n $str = strtr($str, array(\"\\\\'\" => \"'\", \"\\\\\\\\\" => \"\\\\\"));\n }\n return $str;\n }",
"protected function restore_quotes_in_tags($str)\n\t{\n\t\t$single_quote_marker = '{{SINGLEQUOTE:' . $this->quote_marker . '}}';\n\t\t$double_quote_marker = '{{DOUBLEQUOTE:' . $this->quote_marker . '}}';\n\n\t\treturn str_replace(array($single_quote_marker, $double_quote_marker), array('\\'', '\"'), $str);\n\t}",
"function str_quote_strip($str): string\n {\n return str_replace(['\"', \"'\"], '', $str);\n }",
"function encodequotes($str)\n\t{\n\t\t$singlequotestr=str_replace(\"'\",\"''\",$str);\n\t\t$repdoublequotestr=stripslashes(str_replace('\"','"',$singlequotestr));\n\t\treturn $repdoublequotestr;\n\t}",
"public function requote($string){}",
"function OneTwoQuoteToCode($str) {\n\t$from = array(\"'\", \"\\\"\");\n\t$to = array(\"‘\", \""\");\t\n\treturn str_replace($from, $to, $str);\n}",
"function unQuote($value) {\n\n //Replacing the single and double quotes\n $value = str_replace(array(\"'\", \"\\\"\"), '', $value);\n return $value;\n}",
"function change_mysql_string($string)\n\t{\n\t $temp=\"\";\n\t if($string<>\"\")\n if(strlen($string) > 0)\n {\n \t $temp = str_replace(\"\\\\\", \"\\\\\\\\\", $string);\n\t\t\t\t $temp = str_replace(\"'\", \"\\\\'\", $temp);\n\t\t\t\t $temp = str_replace(\"\\\"\", \"\\\\\\\"\", $temp);\n }\n return $temp;\n\t}",
"function strip_quotes(string $str): string\n {\n return str_replace(['\"', \"'\"], '', $str);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Delete fly images based on attachment IDs. | public function delete_ids( $args, $args_assoc ) {
$ids = array_map( 'trim', explode( ',', $args[0] ) );
if ( empty( $ids ) ) {
WP_CLI::error( esc_html__( 'Please enter valid IDs.', 'fly-images' ) );
}
$fly_images = Core::get_instance();
foreach ( $ids as $id ) {
WP_CLI::line( esc_html__( 'Deleting: ', 'fly-images' ) . $id );
$fly_images->delete_attachment_fly_images( $id );
}
WP_CLI::success( esc_html__( 'The selected fly images have been deleted.', 'fly-images' ) );
} | [
"function envira_gallery_delete_attachment( $attach_id = false ) {\n\n\tif ( false === $attach_id ) {\n\t\treturn;\n\t}\n\n\t$directory = get_attached_file( $attach_id );\n\n\tif ( empty( $directory ) || ! file_exists( $directory ) ) {\n\t\treturn;\n\t}\n\n\t$basename = wp_basename( $directory );\n\t$extension = pathinfo( $directory, PATHINFO_EXTENSION );\n\t$basename_without_extension = str_replace( '.' . $extension, '', $basename );\n\t$path = str_replace( $basename, '', $directory );\n\t$mask = $path . $basename_without_extension . '-*_c.' . $extension; // delete the crop files Envira can generate.\n\n\tif ( empty( $basename ) || empty( $extension ) ) {\n\t\treturn;\n\t}\n\n\tarray_map( 'unlink', glob( $mask ) ); // @codingStandardsIgnoreLine\n\n}",
"private static function delete_attachments( $resume_id ) {\n\t\t$attachments = get_attached_media( '', $resume_id );\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\twp_delete_attachment( $attachment->ID, true );\n\t\t}\n\t}",
"public function deleteImages() {\r\n \r\n // Delete all fullsize images for this article\r\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\r\n if ( !unlink( $filename ) ) trigger_error( \"Couldn't delete image file.\", E_USER_ERROR );\r\n }\r\n \r\n // Delete all thumbnail images for this article\r\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\r\n if ( !unlink( $filename ) ) trigger_error( \"Couldn't delete thumbnail file.\", E_USER_ERROR );\r\n }\r\n \r\n // Remove the image filename extension from the object\r\n $this->imagez = \"\";\r\n }",
"public function deleteAttachment() {\t\t \r\n\t\t$attachmentQuery = \"SELECT filename FROM attachments WHERE post_id='\" . $this->post_id . \"'\";\r\n\t\t$result = $this->dbaccess->run_query($attachmentQuery);\r\n\t\twhile($line = $result->fetchObject('Attachment'))\r\n\t\t{\r\n\t\t\t$attachment[] = $line;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($attachment as $atch)\r\n\t\t{\r\n\t\t\tif (file_exists('uploadedfiles/'.$atch->getFilename()))\r\n\t\t\t{\r\n\t\t\t\tunlink('uploadedfiles/'.$atch->getFilename());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$deleteQuery = \"DELETE FROM attachments WHERE post_id='\" . $this->post_id . \"'\";\r\n\t\t$this->dbaccess->run_query($deleteQuery);\r\n\t}",
"protected function _deleteAttachments()\n {\n $this->getModelFromCache('XenForo_Model_Attachment')\n ->deleteAttachmentsFromContentIds(\n $this->getContentType(),\n array($this->getId())\n );\n }",
"function deleteAttachments()\n {\n $attachments = mapi_message_getattachmenttable($this->message);\n $attachTable = mapi_table_queryallrows($attachments, Array(PR_ATTACH_NUM, PR_ATTACHMENT_HIDDEN));\n\n foreach($attachTable as $attachRow)\n {\n if(isset($attachRow[PR_ATTACHMENT_HIDDEN]) && $attachRow[PR_ATTACHMENT_HIDDEN]) {\n mapi_message_deleteattach($this->message, $attachRow[PR_ATTACH_NUM]);\n }\n }\n }",
"public function deleteImages($images = NULL);",
"public function deleteFiles()\n {\n image($this)->deleteFiles();\n }",
"public function delete() {\n foreach ($this->attachments()->get() as $attachment) {\n $attachment->remove();\n }\n return parent::delete();\n }",
"public function removeImages(int $id): void;",
"function deleteAttachments() {\n $request = HTTPRequest::instance();\n if ($request->isPost() && $request->exist('attachments_to_delete')) {\n $args = $request->get('attachments_to_delete');\n $deleteStatus = true;\n $um = UserManager::instance();\n $user = $um->getCurrentUser();\n foreach($args as $id) {\n $valid = new Valid_UInt('repo_id');\n $valid->required();\n if($valid->validate($id)) {\n $wa = new PHPWikiAttachment();\n $wa->initWithId($id);\n if ($wa->validate() && $wa->gid == $_REQUEST['group_id'] && $wa->isAutorized($user->getId())) {\n if(!$wa->deleteAttachment()) {\n $deleteStatus = false;\n }\n } else {\n $deleteStatus = false;\n }\n } else {\n $deleteStatus = false;\n }\n }\n if ($deleteStatus) {\n $GLOBALS['Response']->addFeedback('info', $GLOBALS['Language']->getText('plugin_phpwiki_actions_wikiserviceadmin','delete_attachment_success'));\n } else {\n $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_phpwiki_actions_wikiserviceadmin','delete_attachment_failure'));\n }\n }\n }",
"public function remove_existing_attachments() {//Removes Attchment for current post id\n global $post;\n $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );\n //Get current attachment\n $attachments = get_posts($args);\n if ($attachments) {\n foreach ( $attachments as $attachment ) {\n wp_delete_attachment($attachment->ID);\n }\n }\n }",
"public function deleteImages() {\n if ($this->university_logo)\n unlink(Yii::getAlias('@universityImages') . \"/\" . $this->university_logo);\n if ($this->university_id_template)\n unlink(Yii::getAlias('@universityImages') . \"/\" . $this->university_id_template);\n if ($this->university_graphic)\n unlink(Yii::getAlias('@universityImages') . \"/\" . $this->university_graphic);\n }",
"public function deleteReferences()\n {\n $keys = array(\"bp_tal_id\",\"design_brief_id\",\"design_brief_references_id\",\"attachment_path\");\n\n $data = check_api_keys($keys,$this->mydata);\n\n $res = $this->model->delete_reference_image($data);\n \n if($res)\n respond_success_to_api(\"success\");\n else\n respond_error_to_api(\"error\", \"try after some time.\"); \n\n }",
"public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }",
"function delete_attachments($post_id) {\r\n\t$args = array(\r\n\t\t'post_type' => 'attachment',\r\n\t\t'numberposts' => -1,\r\n\t\t'post_status' => null,\r\n\t\t'post_parent' => $post_id\r\n\t);\r\n\t$attachments = get_posts($args);\r\n\t\r\n\tif ($attachments) {\r\n\t\tforeach($attachments as $attachment) {\r\n\t\t\twp_delete_attachment($attachment->ID, true);\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n}",
"static public function delete_images($image_ids)\n\t{\n\t\tglobal $db, $table_prefix;\n\n\t\t$image_ids = self::cast_mixed_int2array($image_ids);\n\n\t\t$sql = 'DELETE FROM ' . $table_prefix . 'gallery_reports\n\t\t\tWHERE ' . $db->sql_in_set('report_image_id', $image_ids);\n\t\t$result = $db->sql_query($sql);\n\t}",
"public function delete_images() {\n if ($this->request->is('post')) {\n $data = $this->request->data;\n $id = $data['id'];\n $this->Image->deleteImages($id);\n $this->redirect(array('controller'=>'users', 'action'=>'user_dashboard'));\n }\n }",
"function px_delete_attachment( $url ) {\r\n global $wpdb;\r\n\r\n // We need to get the image's meta ID.\r\n $query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($url) . \"' AND post_type = 'attachment'\";\r\n $results = $wpdb->get_results($query);\r\n\r\n // And delete it\r\n foreach ( $results as $row ) {\r\n wp_delete_attachment( $row->ID );\r\n }\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Gracefully Stop a SQLMAP Scan, identified by user level task ID Returns true on success, false otherwise $taskid = your user level task id to stop scan for | public function stopScan($taskid) {
$json = json_decode(file_get_contents($this->api . "scan/" . $taskid . "/stop"), true);
if($json['success'] == 1) {
return true;
}
return false;
} | [
"public function killScan($taskid) {\n $json = json_decode(file_get_contents($this->api . \"scan/\" . $taskid . \"/kill\"), true);\n if($json['success'] == 1) {\n return true;\n }\n return false;\n }",
"public function killScan($taskid) {\n $json = json_decode(file_get_contents($this->api . \"scan/\" . $taskid . \"/kill\"), true);\n if($json['success'] == 1) {\n return true;\n }\n return false;\n }",
"public function stopQuery();",
"public function stopQuery(): void;",
"public function stopQuery() {\n\t}",
"public function stopTask()\n\t{\n\t\t// Check that the user is logged in\n\t\tif (User::isGuest())\n\t\t{\n\t\t\t$this->loginTask();\n\t\t\treturn;\n\t\t}\n\n\t\t// Incoming\n\t\t$sess = Request::getString('sess', '');\n\t\t$rtrn = base64_decode(Request::getString('return', '', 'method', 'base64'));\n\n\t\t$rediect = $this->config->get('stopRedirect', 'index.php?option=com_members&task=myaccount');\n\n\t\t// Ensure we have a session\n\t\tif (!$sess)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url($redirect)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Double-check that the user owns this session.\n\t\t$mwdb = \\Components\\Tools\\Helpers\\Utils::getMWDBO();\n\n\t\t$ms = new \\Components\\Tools\\Tables\\Session($mwdb);\n\t\tif ($this->config->get('access-admin-session'))\n\t\t{\n\t\t\t$ms->load($sess);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ms->load($sess, User::get('username'));\n\t\t}\n\n\t\t// Did we get a result form the database?\n\t\tif (!$ms->username)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url($rediect)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// Get plugins\n\t\tPlugin::import('mw', $ms->appname);\n\n\t\t// Trigger any events that need to be called before session stop\n\t\tEvent::trigger('mw.onBeforeSessionStop', array($ms->appname));\n\n\t\t// Stop the session\n\t\t$status = $this->middleware(\"stop $sess\", $output);\n\t\tif ($status == 0)\n\t\t{\n\t\t\techo '<p>Stopping ' . $sess . '<br />';\n\t\t\tif (is_array($output))\n\t\t\t{\n\t\t\t\tforeach ($output as $line)\n\t\t\t\t{\n\t\t\t\t\techo $line . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (is_string($output))\n\t\t\t{\n\t\t\t\techo $output . \"\\n\";\n\t\t\t}\n\t\t\techo '</p>'.\"\\n\";\n\t\t}\n\n\t\t// Trigger any events that need to be called after session stop\n\t\tEvent::trigger('mw.onAfterSessionStop', array($ms->appname));\n\n\t\t// Log activity\n\t\tEvent::trigger('system.logActivity', [\n\t\t\t'activity' => [\n\t\t\t\t'action' => 'deleted',\n\t\t\t\t'scope' => 'tool.session',\n\t\t\t\t'scope_id' => $sess,\n\t\t\t\t'description' => Lang::txt('COM_TOOLS_ACTIVITY_SESSION_DELETED', $sess),\n\t\t\t\t'details' => array(\n\t\t\t\t\t'tool' => $ms->appname\n\t\t\t\t)\n\t\t\t],\n\t\t\t'recipients' => array(\n\t\t\t\t['user', User::get('id')]\n\t\t\t)\n\t\t]);\n\n\t\t// Take us back to the main page...\n\t\tif ($rtrn)\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\t$rtrn\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url($rediect)\n\t\t\t);\n\t\t}\n\t}",
"public function stopQuery(){}",
"public function stopTracking()\n {\n global $db;\n\n $time = time();\n\n\n $sql = $db->Query('SELECT start_timestamp FROM {effort} WHERE user_id='.$this->_userId.' AND task_id='.$this->_task_id.' AND end_timestamp IS NULL;');\n $result = $db->FetchRow($sql);\n $start_time = $result[0];\n $effort = $time - $start_time;\n\n $sql = $db->Query(\"UPDATE {effort} SET end_timestamp = \".$time.\",effort = \".$effort.\" WHERE user_id=\".$this->_userId.\" AND task_id=\".$this->_task_id.\" AND end_timestamp IS NULL;\");\n }",
"public function stop(){\n if($this->_id) $this->times[$this->_id] += microtime(true) - $this->_start;\n $this->_id = null;\n }",
"public function stopQuery()\n {\n }",
"public function stop();",
"public function stopWork()\n {\n return false;\n }",
"public function cancelTracking()\n {\n global $db;\n\n $db->Query('DELETE FROM {effort} WHERE user_id='.$this->_userId.' AND task_id='.$this->_task_id.' AND end_timestamp IS NULL;');\n\n }",
"public function actionStop($mailbox_id)\n\t{\n\t}",
"function stopAllTasks() {\n\t\tglobal $sql;\n\n\t\t$working_tasks = $this->select('id')->where(array(\"status\" => 'working', \"user_id\"=> $_SESSION['user_id']))->get('col');\n\t\t$task_update_count = 0;\n\t\tforeach ($working_tasks as $task_id) {\n\t\t\t$current_duration_id = $this->getCurrentDuration($task_id);\n\t\t\tif($current_duration_id) $sql->update(\"Duration\", array('to_time' => 'NOW()'), \"WHERE id=$current_duration_id\");\n\t\t\t$task_update_count += $this->newRow($task_id)->set(array('status' => 'paused', 'completed_on'=>'NOW()'))\n\t\t\t\t\t\t\t\t\t\t->where(array(\"status\" => 'working', \"user_id\" => $_SESSION['user_id']))->save();\n\t\t}\n\t\treturn $task_update_count;\n\t}",
"function stopTransmissionTransfer($hash) {\n\tglobal $cfg;\n\trequire_once('inc/classes/Transmission.class.php');\n\t$rpc = Transmission::getInstance();\n\n\tif ( isValidTransmissionTransfer($cfg['uid'],$hash) ) {\n\t\t$transmissionId = getTransmissionTransferIdByHash($hash);\n\t\t$response = $rpc->stop($transmissionId);\n\t\tif ( $response['result'] != \"success\" ) rpc_error(\"Stop failed\", \"\", \"\", $response['result']);\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function stop_timer(){\n\t\t$res = stop_timer();\t\n\t\tif($res){\t\n\t\t\techo 'success';\n\t\t}else{\n\t\t\techo 'error';\n\t\t}\n\t\tdie;\n\t}",
"public function stop(){}",
"public function timer_stop() {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the total calories burnt | public function setTotalCalories($val){
$this->totalCalories = $val;
return $this;
} | [
"public function setCalories($value)\n {\n $this->calories = $value;\n }",
"private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }",
"private function setTotal()\n {\n if($this->taxIncluded){\n $this->total = $this->subtotal;\n }else{\n $this->total = $this->subtotal + $this->tax;\n } \n }",
"private function setRefundTotal()\n {\n $organiserTaxRate = $this->organiserTaxRate;\n $currency = $this->currency;\n\n /**\n * Subtotal = (Ticket price + Organiser Fee)\n * Tax Amount = Subtotal * Tax rate\n * Refund Amount = Subtotal + Tax Amount\n */\n $this->refundAmount = new Money($this->attendees->map(function(Attendee $attendee) use ($organiserTaxRate, $currency) {\n $ticketPrice = new Money($attendee->ticket->price, $currency);\n $organiserFee = new Money($attendee->event->getOrganiserFee($ticketPrice), $currency);\n $subTotal = $ticketPrice->add($organiserFee);\n Log::debug(sprintf(\"Ticket Price: %s\", $ticketPrice->display()));\n Log::debug(sprintf(\"Ticket Organiser Fee: %s\", $organiserFee->display()));\n Log::debug(sprintf(\"Ticket Tax: %s\", $subTotal->multiply($organiserTaxRate)->display()));\n return $subTotal->add($subTotal->multiply($organiserTaxRate));\n })->reduce(function($carry, $singleTicketWithTax) use ($currency) {\n $refundTotal = (new Money($carry, $currency));\n return $refundTotal->add($singleTicketWithTax)->format();\n }), $currency);\n\n Log::debug(sprintf(\"Requested Refund should include Tax: %s\", $this->refundAmount->display()));\n }",
"public function updateTotal() {\n //get the scans for this user\n $scans = $this->scans();\n //create running total\n $newTotal = 0; \n //for each scan, add the total pups and virus to the total\n foreach ($scans as $scan) {\n $newTotal += $scan->pups + $scan->troj_mal;\n }\n //sets and saves the new total for this user\n $this->total = $newTotal;\n $this->save();\n }",
"public function setTotalDue($totalDue);",
"public function setCalories($val){\n $this->calories = $val;\n return $this;\n }",
"public function setRemainingDownloads($total);",
"public function recalculateAdjustmentsTotal(): void;",
"private function calculateTotal()\n\t{\n\t\t$this->shots += $this->attackerShipType->getCount();\n\t\t$this->power += $this->getNormalPower();\n\n\t\tif (USE_RF)\n\t\t\t$this->calculateRf();\n\n\t\t\\log_var('$this->shots',$this->shots);\n\t}",
"function _update_total()\n\t\t{\n\t\t$this->itemcount = 0;\n\t\t$this->total = 0;\n\t\tif(sizeof($this->items > 0))\n\t\t\t{\n\t\t\tforeach($this->items as $item)\n\t\t\t\t{\n\t\t\t\t$this->total = $this->total + ($this->itemprices[$item] * $this->itemqtys[$item]);\n\n\t\t\t\t// TOTAL ITEMS IN CART (ORIGINAL wfCart COUNTED TOTAL NUMBER OF LINE ITEMS)\n\t\t\t\t$this->itemcount += $this->itemqtys[$item];\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function calculBankroll() {\n $bankroll = $this->getCurrentBankroll();\n $betsTest = $this->betTestRepository->findBy(array('bankroll' => $bankroll->getId()));\n\n $startBankroll = $bankroll->getStartBankroll();\n foreach($betsTest as $betTest) {\n if($betTest->getResultBet() != null) {\n $startBankroll -= $betTest->getMise();\n $startBankroll += $betTest->getGain();\n }\n else {\n $startBankroll -= $betTest->getMise();\n }\n }\n\n $bankroll->setCurrentBankroll($startBankroll);\n\n $this->em->persist($bankroll);\n $this->em->flush();\n }",
"public function recalculateTotal()\n\t{\t\t\n\t\t$summary = $this->summary();\t\t\n\t\t$this->total = $summary['total'];\n\t}",
"public function setBaseTotalDue($baseTotalDue);",
"public function recalculateTotal()\n {\n $this->setTotal($this->getSubTotal() + $this->getHubFee());\n }",
"public function updateTotal()\n {\n if ($this->conditionsMet() && $this->result instanceof ResultInterface) {\n $total = $this->result->process($this);\n } else {\n $total = $this->currencyService->getZeroMoney();\n }\n \n $this->total = $total;\n\n $this->saveState();\n\n $this->eventService->dispatch(\n Events::TOTAL_UPDATED,\n new TotalUpdatedEvent($this)\n );\n }",
"public function changeTotalItems($amount);",
"private function updateTotal() : void\n {\n $this->playerScore += $this->player->score();\n $this->computerScore += $this->computer->score();\n $this->roundFinished = true;\n }",
"function setBalance(){\n foreach($this->_withdrawals as $withdrawal){\n $this->_balance = $this->_balance - $withdrawal;\n }\n\n foreach($this->_deposits as $deposit){\n $this->_deposits = $this->_deposits + $deposit;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets new key prefix. | public function setKeyPrefix(string $prefix)
{
$this->keyPrefix = $prefix;
} | [
"public function setKeyPrefix($var)\n {\n GPBUtil::checkString($var, True);\n $this->key_prefix = $var;\n\n return $this;\n }",
"public function setKeyPrefix($prefix)\n\t{\n\t\t$this->_redisKeyPrefix = $prefix;\n\t}",
"static function setPrefix($key, $prefix) {\n self::$prefixes[$key] = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $mode = array_key_exists($prefix, $this->prefixMap) ? $this->prefixMap[$prefix] : '';\n\n if ($mode != '') {\n $this->setMode(\"+{$mode}\");\n }\n }",
"public function setPrefix( $prefix );",
"public function setPrefix ($prefix)\n {\n $this->prefix = \"\";\n if (strlen($prefix) > 0)\n {\n $this->prefix = trim($prefix).\"_\";\n }\n }",
"public function setUniquePrefix($prefix) {}",
"protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }",
"private function _addKeyPrefix($key)\n {\n if (!empty($this->settings['prefix'])\n && strpos($key, $this->settings['prefix']) !== 0\n ) {\n $key = $this->settings['prefix'] . $key;\n }\n return $key;\n }",
"public function setApiKeyPrefix($apiKeyIdentifier, $prefix);",
"public function prefixKeys($prefix);",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = trim($prefix);\n\t}",
"public function setPrefix($prefix) {\n\t\t$this->primaryCache->setPrefix($prefix);\n\t\t$this->secondaryCache->setPrefix($prefix);\n\t}",
"public function setReplaceKeyPrefixWith($value)\n {\n return $this->set('ReplaceKeyPrefixWith', $value);\n }",
"public function setPrefix()\n {\n static::$PREFIX = 'og:';\n }",
"protected function setPrefix($prefix) {\n if (is_array($prefix)) {\n $this->prefixes = $prefix + ['default' => ''];\n }\n else {\n $this->prefixes = ['default' => $prefix];\n }\n\n [$start_quote, $end_quote] = $this->identifierQuotes;\n // Set up variables for use in prefixTables(). Replace table-specific\n // prefixes first.\n $this->prefixSearch = [];\n $this->prefixReplace = [];\n foreach ($this->prefixes as $key => $val) {\n if ($key != 'default') {\n $this->prefixSearch[] = '{' . $key . '}';\n // $val can point to another database like 'database.users'. In this\n // instance we need to quote the identifiers correctly.\n $val = str_replace('.', $end_quote . '.' . $start_quote, $val);\n $this->prefixReplace[] = $start_quote . $val . $key . $end_quote;\n }\n }\n // Then replace remaining tables with the default prefix.\n $this->prefixSearch[] = '{';\n // $this->prefixes['default'] can point to another database like\n // 'other_db.'. In this instance we need to quote the identifiers correctly.\n // For example, \"other_db\".\"PREFIX_table_name\".\n $this->prefixReplace[] = $start_quote . str_replace('.', $end_quote . '.' . $start_quote, $this->prefixes['default']);\n $this->prefixSearch[] = '}';\n $this->prefixReplace[] = $end_quote;\n\n // Set up a map of prefixed => un-prefixed tables.\n foreach ($this->prefixes as $table_name => $prefix) {\n if ($table_name !== 'default') {\n $this->unprefixedTablesMap[$prefix . $table_name] = $table_name;\n }\n }\n }",
"public function setPrefix($prefix) {\n\t\tif ($prefix == $this->prefix) return;\n\t\t\n\t\t$this->prefix = $prefix;\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\tprefix = '\".escapeString($prefix).\"'\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t}",
"function setPrefix($letter, $count=1) {\n $prev = $this->idPrefix;\n $this->idPrefix = strtoupper(substr($letter,0,$count));\n return $prev;\n }",
"public function setNamePrefix($prefix)\n {\n $this->setOption('namePrefix', strval($prefix));\n return $this;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
test for partial signatures (P2WSHoverP2SH) using 762 inputs | public function testP2WSHOverP2SH1of2Keys762Inputs() {
$prepare_transaction_response = json_decode(file_get_contents(__DIR__ . "/Data/json/prepare_transaction_response_P2WSH-over-P2SH_1of2_762inputs.json"), false);
$create_and_sign_transaction_response = json_decode(file_get_contents(__DIR__ . "/Data/json/create_and_sign_transaction_response_P2WSH-over-P2SH_1of2_762inputs.json"), true);
$response = $this->blockio->create_and_sign_transaction($prepare_transaction_response);
$this->assertEquals($create_and_sign_transaction_response, $response);
} | [
"function secp256k1_schnorrsig_verify_batch($context, $scratch, array $pubkeys, array $msg32s, array $sigs, int $numsigs): int {}",
"public function isSignatureMatch();",
"public function testP2WSHOverP2SH1of2Keys253Inputs() {\n\n $prepare_transaction_response = json_decode(file_get_contents(__DIR__ . \"/Data/json/prepare_transaction_response_P2WSH-over-P2SH_1of2_253inputs.json\"), false);\n $create_and_sign_transaction_response = json_decode(file_get_contents(__DIR__ . \"/Data/json/create_and_sign_transaction_response_P2WSH-over-P2SH_1of2_253inputs.json\"), true);\n\n $response = $this->blockio->create_and_sign_transaction($prepare_transaction_response);\n $this->assertEquals($create_and_sign_transaction_response, $response);\n \n }",
"public function verify_signature() {\n\n\t}",
"private function validateSignature()\n {\n\n // Get kid from header\n $kid = getClaim(\"kid\", $this->head);\n\n // Get public key\n $key_data = $this->endpointHandler->getJwksUriData();\n\n // Extract e and n from the public key\n $e_regex = '/\"kid\":\\W*\"' . $kid . '.*\"e\":\\W*\"([^\"]+)/';\n $e_array = array();\n preg_match($e_regex, $key_data, $e_array);\n\n $n_regex = '/\"kid\":\\W*\"' . $kid . '.*\"n\":\\W*\"([^\"]+)/';\n $n_array = array();\n preg_match($n_regex, $key_data, $n_array);\n\n // 'e' and 'n' are base64 URL encoded, change to just base64 encoding\n $e = $this->convert_base64url_to_base64($e_array[1]);\n $n = $this->convert_base64url_to_base64($n_array[1]);\n\n // Convert RSA(e,n) format to PEM format\n $rsa = new Crypt_RSA();\n $rsa->setPublicKey('<RSAKeyValue>\n\t\t\t<Modulus>' . $n . '</Modulus>\n\t\t\t<Exponent>' . $e . '</Exponent>\n\t\t\t</RSAKeyValue>');\n $public_key = $rsa->getPublicKey();\n\n // Verify Signature\n $to_verify_data = $this->id_token_array[0] . \".\" . $this->id_token_array[1];\n $to_verify_sig = base64_decode($this->convert_base64url_to_base64(($this->id_token_array[2])));\n $verified = openssl_verify($to_verify_data, $to_verify_sig, $public_key, OPENSSL_ALGO_SHA256);\n\n\n return $verified;\n }",
"public function testP2WSHOverP2SH1of2Keys252Inputs() {\n\n $prepare_transaction_response = json_decode(file_get_contents(__DIR__ . \"/Data/json/prepare_transaction_response_P2WSH-over-P2SH_1of2_252inputs.json\"), false);\n $create_and_sign_transaction_response = json_decode(file_get_contents(__DIR__ . \"/Data/json/create_and_sign_transaction_response_P2WSH-over-P2SH_1of2_252inputs.json\"), true);\n\n $response = $this->blockio->create_and_sign_transaction($prepare_transaction_response);\n $this->assertEquals($create_and_sign_transaction_response, $response);\n \n }",
"public function validateSignature($orig,$key, $sig);",
"function verifySignature(){\n $config = new ConfigReader();\n $cloudmailinConfig = $config->getAddonConfig('CLOUDMAILIN');\n \n $provided = $_POST['signature'];\n $params = $_POST;\n unset($params['signature']);\n ksort($params);\n $str = implode('', array_values($params));\n $signature = md5($str . $cloudmailinConfig['CLOUDMAILIN_SECRET']);\n return $provided == $signature;\n}",
"private function checkSignature()\n\t{\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\tlog_message('debug', $signature);\n\t\tlog_message('debug', $timestamp);\n\t\tlog_message('debug', $nonce);\n\t\tlog_message('debug', $token);\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\tsort($tmpArr);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\tlog_message('debug', $tmpStr);\n\n\t\tif( $tmpStr == $signature ){\n\t\t\tlog_message('debug', 'return true');\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function test_expected_callback_signature_generates_hash() {\n $this->resetAfterTest();\n\n $tscallback = new plagiarism_turnitinsim_callback( new plagiarism_turnitinsim_request() );\n $hash = $tscallback->expected_callback_signature('{\"any\": \"string\",\"but\": \"usually\", \"raw\": \"json\"}');\n\n handle_deprecation::assertregex($this, \"/[0-9a-f]{64}/i\", $hash);\n }",
"function _uc_paybox_verif_sign() {\n $q = preg_replace(\"/q=[^&]+&/\", \"\", $_SERVER['QUERY_STRING']);\n $pos = strrpos($q, '&');\n $data = substr($q, 0, $pos);\n $pos = strpos($q, '=', $pos) + 1;\n $sig = substr($q, $pos);\n $sig = base64_decode(urldecode($sig));\n $key = openssl_pkey_get_public(file_get_contents(drupal_get_path('module', 'uc_paybox') . '/pubkey.pem'));\n return openssl_verify($data, $sig, $key);\n}",
"public function testParseP2WPKH()\n {\n $hex = '00'; // segwit version\n $hex .= '14'; // 20\n $hex .= '536523b38a207338740797cd03c3312e81408d53'; // pubkey hash\n\n $script = new ScriptPubKey(hex2bin($hex));\n\n $this->assertTrue($script->isPayToWitnessPubKeyHash());\n $this->assertEquals($script->getOutputAddress(), 'bc1q2djj8vu2ypensaq8jlxs8se396q5pr2n3sa2wn');\n }",
"function verify_message($log, $headers, $body, $webhook_secret) {\n\n $hmac_message = $headers['Twitch-Eventsub-Message-Id'] . $headers['Twitch-Eventsub-Message-Timestamp'] . rtrim($body);\n $signature = hash_hmac('sha256',$hmac_message, $webhook_secret);\n $actual_signature = 'sha256=' . $signature;\n\n $exepcted_signature = $headers['Twitch-Eventsub-Message-Signature'];\n\n $is_valid = $actual_signature == $exepcted_signature;\n\n $log->info(\"verify_message: is_valid=$is_valid actual_sginature=$actual_signature expected_signature=$exepcted_signature\");\n\n return $is_valid;\n}",
"abstract protected function validateSignature(string $signature, string $payload): bool;",
"function yourls_check_signature() {\n if( !isset( $_REQUEST['signature'] ) OR empty( $_REQUEST['signature'] ) )\n return false;\n\n\t// Check signature against all possible users\n global $yourls_user_passwords;\n\tforeach( $yourls_user_passwords as $valid_user => $valid_password ) {\n\t\tif ( yourls_auth_signature( $valid_user ) === $_REQUEST['signature'] ) {\n\t\t\tyourls_set_user( $valid_user );\n\t\t\treturn true;\n\t\t}\n\t}\n\n // Signature doesn't match known user\n\treturn false;\n}",
"function yourls_check_signature() {\n if( !isset( $_REQUEST['signature'] ) OR empty( $_REQUEST['signature'] ) )\n return false;\n \n\t// Check signature against all possible users\n global $yourls_user_passwords;\n\tforeach( $yourls_user_passwords as $valid_user => $valid_password ) {\n\t\tif ( yourls_auth_signature( $valid_user ) == $_REQUEST['signature'] ) {\n\t\t\tyourls_set_user( $valid_user );\n\t\t\treturn true;\n\t\t}\n\t}\n \n // Signature doesn't match known user\n\treturn false;\n}",
"function verify_signature($data, $public_key_data, $signature) {\n \n $pubkeyid = openssl_get_publickey($public_key_data);\n $status = openssl_verify($data, base64_decode($signature), $pubkeyid, \"sha512\");\n openssl_free_key($pubkeyid);\n\n return $status;\n}",
"public function testSignatureUisGet()\n {\n }",
"public function validSignature() {\n $configuration = $this->getPaymentGateway()->getPlugin()->getConfiguration();\n $message = $this->contents->timestamp . $this->contents->id;\n $calculatedSignature = hash_hmac('sha256', $message, $configuration['webhook_key']);\n return $calculatedSignature == $this->contents->signature;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get permission between two resources | public function getPermission($fromResource, $toResource, $perm); | [
"public abstract function getPermissions();",
"public function permissions(){\n $this->requestUrl = self::$_graph_url.$this->userId.'/permissions';\n return $this->sendRequest(self::REQUEST_METHOD_GET);\n }",
"public function getPermission($name);",
"function resourcesByPermission($permission){\n if($this->id == Config::get('laracancan.super_admin',0)){\n return Resource::all();\n }\n $roles = $this->roles;\n $resourses = array();\n foreach($roles as $role){\n $roleResources = $role->resourcesByPermission($permission);\n $resourses = array_merge($resourses, $roleResources?$roleResources:array());\n }\n $resourses = array_unique($resourses);\n return $resourses;\n\n }",
"public function uac_permissions();",
"public function getRights();",
"public function getResourceIds()\n {\n $ids = array(\n 'allowed' => null,\n 'allowed_ids' => array(),\n 'excluded_ids' => array(),\n );\n\n if ($this->isSuperuser()) {\n return $this->end( array(\n 'allowed' => true,\n 'allowed_ids' => array(),\n 'excluded_ids' => array(),\n ));\n }\n\n $userPermissions = $this->getUserPermissions();\n\n foreach ($this->permissionsForChecking as $permission => $resourceIds) {\n $tempPermission = array(\n 'allowed' => $userPermissions[$permission]['allowed'],\n 'allowed_ids' => ($userPermissions[$permission]['allowed_ids'] === null)? array() : $userPermissions[$permission]['allowed_ids'],\n 'excluded_ids' => ($userPermissions[$permission]['excluded_ids'] === null)? array() : $userPermissions[$permission]['excluded_ids']\n );\n\n $ids['allowed'] = ($ids['allowed'] === null)? $tempPermission['allowed'] : $ids['allowed'] || $tempPermission['allowed'];\n $ids['allowed_ids'] = array_unique(array_merge($tempPermission['allowed_ids'], $ids['allowed_ids']));\n $ids['excluded_ids'] = array_unique(array_merge($tempPermission['excluded_ids'], $ids['excluded_ids']));\n }\n\n return $this->end($ids);\n }",
"function get_resource_custom_access($resource)\n {\n $sql = '';\n if(checkperm('E'))\n {\n // Restrict to this group and children groups only.\n global $usergroup, $usergroupparent;\n\n $sql = \"WHERE g.parent = '{$usergroup}' OR g.ref = '{$usergroup}' OR g.ref = '{$usergroupparent}'\";\n }\n\n $resource_custom_access = sql_query(\"\n SELECT g.ref,\n g.name,\n g.permissions,\n c.access\n FROM usergroup AS g\n LEFT OUTER JOIN resource_custom_access AS c ON g.ref = c.usergroup AND c.resource = '{$resource}'\n $sql\n GROUP BY g.ref\n ORDER BY (g.permissions LIKE '%v%') DESC, g.name\n \");\n\n for($n = 0; $n < count($resource_custom_access); $n++)\n {\n $resource_custom_access[$n]['name'] = lang_or_i18n_get_translated($resource_custom_access[$n]['name'], 'usergroup-');\n }\n\n return $resource_custom_access;\n }",
"public abstract function getRequiredRights();",
"public function getPermissions(Roleable $resource = null);",
"public function getAccessResources() {\n //in this case we can change the rights without loggin out\n return $this->getTable()->getAccessResources(); \n }",
"function md_the_admin_api_permissions() {\n\n // Call the permissions class\n $permissions = (new MidrubBaseClassesRest\\Permissions);\n\n // Return app's permissions\n return $permissions->load_permissions();\n \n }",
"public function getPermissions(): array;",
"abstract protected function getTarget(): HasPermissionsInterface;",
"public function getPerm()\n {\n return $this->hasOne(AuthPermission::className(), ['id' => 'perm_id']);\n }",
"protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }",
"public function &getPermissions() {\n if (!isset(self::$permissions[$this->userid])) {\n $sp = new Serializer('Permission');\n if ($this->userid == 1) {\n $permissions = $sp->loadCollection(array());\n }\n else {\n $permissions = array();\n // Get permissions directly granted to this user.\n $userperms = $sp->loadCollection(array('scope' => 'user', 'scopeid' => $this->userid));\n $permissions = &array_merge($permissions, $userperms);\n // Get permissions granted to user's accounts. Compute exchanges.\n $sau = new Serializer('AccountUser');\n $useraccounts = $sau->loadCollection(array('user' => $this->userid));\n foreach ($useraccounts as $useraccount) {\n $accountperms = $sp->loadCollection(array('scope' => 'account', 'scopeid' => $useraccount->account));\n $permissions = &array_merge($permissions, $accountperms);\n\n }\n // Compute exchanges.\n $exchanges = array();\n $sla = new Serializer('LocalAccount');\n foreach ($useraccounts as $useraccount) {\n $account = $sla->load($useraccount->account);\n if (!in_array($account->exchange, $exchanges)) {\n $exchanges[] = $account->exchange;\n }\n }\n // Get permissions granted to user's accounts exchanges.\n foreach ($exchanges as $exchange) {\n $exchangeperms = $sp->loadCollection(array('scope' => 'exchange', 'scopeid' => $exchange));\n $permissions = &array_merge($permissions, $exchangeperms);\n }\n // Get global permissions.\n $globalperms = $sp->loadCollection(array('scope' => 'global'));\n $permissions = &array_merge($permissions, $globalperms);\n }\n // Set the static variable.\n self::$permissions[$this->userid] = &$permissions;\n }\n return self::$permissions[$this->userid];\n }",
"public function checkReadPermission();",
"function permissionsFor($member);"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns item into an xml segment | function write_item( $item ) {
global $CFG;
// initial string;
$expout = "";
// add comment
$expout .= "\n\n<!-- item: $item->id -->
<div class='item'>\n";
//
if ($item){
// DEBUG
// echo "<br />\n";
// print_r($item);
$code = $item->code_item;
$description_item = $item->description_item;
$ref_referentiel = $item->ref_referentiel;
$ref_competence = $item->ref_competence;
$type_item = $item->type_item;
$poids_item = $item->poids_item;
$empreinte_item = $item->empreinte_item;
$num_item = $item->num_item;
$expout .= " <ul>\n";
$expout .= " <li><b>".get_string('code','referentiel')."</b> : ".stripslashes($code)."</li>\n";
$expout .= " <li><b>".get_string('description_item','referentiel')."</b> : ".stripslashes($description_item)."</li>\n";
// $expout .= " <li><b>".get_string('ref_referentiel','referentiel')."</b> : $ref_referentiel</li>\n";
// $expout .= " <li><b>".get_string('ref_competence','referentiel')."</b> : $ref_competence</li>\n";
$expout .= " <li><b>".get_string('type_item','referentiel')."</b> : ".stripslashes($type_item)."</li>\n";
$expout .= " <li><b>".get_string('poids_item','referentiel')."</b> : $poids_item</li>\n";
$expout .= " <li><b>".get_string('empreinte_item','referentiel')."</b> : $empreinte_item</li>\n";
$expout .= " <li><b>".get_string('num_item','referentiel')."</b> : $num_item</li>\n";
$expout .= " </ul>\n";
}
$expout .= "</div>\n";
return $expout;
} | [
"function write_item( $item ) {\r\n global $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n // $expout .= \"\\n\\n<!-- item: $item->id -->\\n\";\r\n\t\t//\r\n\t\tif ($item){\r\n\t\t\t// DEBUG\r\n\t\t\t// echo \"<br />\\n\";\r\n\t\t\t// print_r($item);\r\n\t\t\t$id = $this->writeraw( $item->id );\r\n $code = $this->writeraw( trim($item->code_item));\r\n $description_item = $this->writetext(trim($item->description_item));\r\n $ref_referentiel = $this->writeraw( $item->ref_referentiel);\r\n $ref_competence = $this->writeraw( $item->ref_competence);\r\n\t\t\t$type_item = $this->writeraw( trim($item->type_item));\r\n\t\t\t$poids_item = $this->writeraw( $item->poids_item);\r\n\t\t\t$empreinte_item = $this->writeraw( $item->empreinte_item);\r\n\t\t\t$num_item = $this->writeraw( $item->num_item);\r\n $expout .= \" <item>\\n\";\r\n\t\t\t// $expout .= \" <id>$id</id>\\n\";\r\n\t\t\t$expout .= \" <code>$code</code>\\n\";\r\n $expout .= \" <description_item>\\n$description_item</description_item>\\n\";\r\n // $expout .= \" <ref_referentiel>$ref_referentiel</ref_referentiel>\\n\";\r\n // $expout .= \" <ref_competence>$ref_competence</ref_competence>\\n\";\r\n $expout .= \" <type_item>$type_item</type_item>\\n\";\r\n $expout .= \" <poids_item>$poids_item</poids_item>\\n\";\r\n $expout .= \" <empreinte_item>$empreinte_item</empreinte_item>\\n\";\r\n $expout .= \" <num_item>$num_item</num_item>\\n\";\r\n\t\t\t$expout .= \" </item>\\n\\n\";\r\n }\r\n return $expout;\r\n }",
"function item_start($item)\n{\n return '\n <item> \n <guid>'.$item['id'].'</guid>\n <title>'.$item['title'].'</title>\n <pubDate>'.date(DATE_ATOM,$item['created']).'</pubDate>\n <link ref=\"'.$item['url'].'\" />\n <description>Reddit '.$subreddit.' win7 theme</description>\n ';\n \n}",
"public function asXML(){\t\t\n\t\t$dom = new \\DOMDocument(\"1.0\", \"UTF-8\"); // Create new DOM document.\n\t\t\n\t\t//create \"ITEM\" element\n\t\t$item = $dom->createElement(\"item\");\n\t\t$item_node = $dom->appendChild($item); //add ITEM element to XML node\n\t\t\n\t\t//Required elements\n\t\t\n\t\t//title\n\t\t$item_node->appendChild($dom->createElement(\"title\", htmlspecialchars($this->title)));\n\t\t\n\t\t//link\n\t\t$item_node->appendChild($dom->createElement(\"link\", htmlspecialchars($this->link)));\n\t\t\n\t\t//description\n\t\tif(isset($this->cdata) && $this->cdata === true){\n\t\t\t$element = $dom->createElement(\"description\");\n\t\t\t$element->appendChild($dom->createCDATASection($this->description));\n\t\t\t$item_node->appendChild($element);\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$item_node->appendChild($dom->createElement(\"description\", htmlspecialchars($this->description)));\n\t\t}\n\t\t\n\t\t//Optional elements\n\t\t\n\t\t//author\n\t\tif(isset($this->author)){\n\t\t\t$item_node->appendChild($dom->createElement(\"author\", htmlspecialchars($this->author)));\n\t\t}\n\t\t\n\t\t//category\n\t\tif(!empty($this->categories) && is_array($this->categories)){\n\t\t\tforeach($this->categories as $category){\n\t\t\t\t$element = $dom->createElement(\"category\", htmlspecialchars($category[0]));\t\t\t\t\n\t\t\t\tif(isset($category[1])){\n\t\t\t\t\t$element->setAttribute('domain', htmlspecialchars($category[1]));\n\t\t\t\t}\n\t\t\t\t$item_node->appendChild($element);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//comments\n\t\tif(isset($this->comments))\n\t\t{\n\t\t\t$item_node->appendChild($dom->createElement(\"author\", htmlspecialchars($this->comments)));\n\t\t}\n\t\t\n\t\t//enclosure\n\t\tif (is_array($this->enclosure) && (count($this->enclosure) == 3)) {\n\t\t\t$element = $dom->createElement('enclosure');\n\t\t\t$element->setAttribute('url', htmlspecialchars($this->enclosure['url']));\n\t\t\t$element->setAttribute('type', htmlspecialchars($this->enclosure['type']));\t\t\n\t\t\tif ($this->enclosure['length']) {\n\t\t\t\t$element->setAttribute('length', htmlspecialchars($this->enclosure['length']));\n\t\t\t}\n\t\t\t$item_node->appendChild($element);\n\t\t}\n\t\t\n\t\t//guid\n\t\tif ($this->guid) {\n\t\t\t$element = $dom->createElement(\"guid\", htmlspecialchars($this->guid));\n\t\t\tif (isset($this->isPermalink)) {\n\t\t\t\t$element->setAttribute('isPermaLink', ($this->isPermalink == false ? 'false' : 'true'));\n\t\t\t}\n\t\t\t$item_node->appendChild($element);\n\t\t}\n\t\t\n\t\t//pubDate\n\t\tif(!empty($this->pubDate)){\n\t\t\t$item_node->appendChild($dom->createElement(\"pubDate\", date(DATE_RSS, $this->pubDate)));\n\t\t}\n\t\t\n\t\treturn $dom->saveXML();\n\t}",
"protected function getItemXml($item)\n {\n return '\n <item>\n <title>' . utf8_encode(killhtml($item['news_title'])) . '</title>\n <link>' . utf8_encode(url('comments', array('id' => $item['news_id']), true)) . '</link>\n <pubDate>' . utf8_encode(date('r', $item['news_date'])) . '</pubDate>\n <description><![CDATA[' . utf8_encode($item['parsed_text']) . ']]></description>\n <guid>' . utf8_encode(url('comments', array('id' => $item['news_id']), true)) . '</guid>\n </item>';\n }",
"protected function getItemXml($item)\n {\n global $FD;\n\n return '\n <url>\n <loc>' . utf8_encode($FD->cfg('virtualhost') . $item['url']) . '</loc>\n ' . (isset($item['lastmod']) ? '<lastmod>' . utf8_encode($item['lastmod']) . '</lastmod>' : '') . '\n </url>';\n }",
"function write_item( $item ) {\r\n global $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n $expout .= \"\\n\\n<!-- item: $item->id -->\r\n<div class='item'>\\n\";\r\n\t\t// \r\n\t\tif ($item){\r\n\t\t\t// DEBUG\r\n\t\t\t// echo \"<br />\\n\";\r\n\t\t\t// print_r($item);\r\n $code = $item->code_item;\r\n $description_item = $item->description_item;\r\n $ref_referentiel = $item->ref_referentiel;\r\n $ref_competence = $item->ref_competence;\r\n\t\t\t$type_item = $item->type_item;\r\n\t\t\t$poids_item = $item->poids_item;\r\n\t\t\t$num_item = $item->num_item;\r\n $expout .= \" <ul>\\n\";\r\n\t\t\t$expout .= \" <li><b>\".get_string('code','referentiel').\"</b> : $code</li>\\n\"; \r\n $expout .= \" <li><b>\".get_string('description_item','referentiel').\"</b> : $description_item</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('ref_referentiel','referentiel').\"</b> : $ref_referentiel</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('ref_competence','referentiel').\"</b> : $ref_competence</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('type_item','referentiel').\"</b> : $type_item</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('poids_item','referentiel').\"</b> : $poids_item</li>\\n\";\r\n $expout .= \" <li><b>\".get_string('num_item','referentiel').\"</b> : $num_item</li>\\n\";\t\t\t\r\n\t\t\t$expout .= \" </ul>\\n\"; \r\n }\r\n\t\t$expout .= \"</div>\\n\";\r\n return $expout;\r\n }",
"public function addItem(){\n\t\t$item = '';\n\t\t$item .='\n\t\t<item>\n\t\t\t\t<title><![CDATA['.$this->itemTitle.']]></title>\n\t\t\t\t<link><![CDATA['.$this->itemLink.']]></link>\n\t\t\t\t<guid isPermaLink=\"true\">'.$this->itemLink.'</guid>\n\t\t\t\t<description><![CDATA['.substr($this->itemDescription, 0,300).'...'.']]></description>\n\t\t\t\t<pubDate><![CDATA['.$this->itemDate.' -0300]]></pubDate>\n\t\t\t\t<category><![CDATA['.$this->itemCategory.']]></category>\n\t\t\t\t<content:encoded><![CDATA['.$this->itemDescription.']]></content:encoded>\n\t\t\t\t';\n\t\tforeach ($this->itemImg as $img) {\n\t\t\t$imgInfo = getimagesize($img);\n\t\t\t$item .= '<enclosure url=\"'.$img.'\" length=\"'.$this->getRemoteFileSize($img).'\" type=\"'.image_type_to_mime_type($imgInfo[2]).'\" />'.\"\\n\";\n\t\t}\t\t\t\t\n\t\t$item .= '\n\t\t</item>\n\t\t';\n\t\t$this->item[] = $item;\n\t}",
"public function toXML();",
"public function formatGoogleProductsXml($items) {\r\n\t\t$this->ci->load->model('inventory/modifier_model');\r\n\t\t$this->ci->load->model('inventory/material_model');\r\n\t\t$this->ci->load->model('utils/lookup_list_model');\r\n\t\t\r\n\t\t$major_classes = $this->ci->lookup_list_model->getMajorClasses();\r\n\t\t\r\n\t\t$rss = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>' . \"\\n\";\r\n\t\t$rss .= '<rss version=\"2.0\"';\r\n\t\t$rss .= ' xmlns:g=\"http://base.google.com/ns/1.0\" xmlns:c=\"http://base.google.com/ns/1.0\" >' . \"\\n\";\r\n\t\t\t$rss .= \"\\t\" . '<channel>' . \"\\n\";\r\n\t\t\t\t$rss .= \"\\t\\t\" . '<title>Google API Online Items</title>' . \"\\n\";\r\n\t\t\t\t$rss .= \"\\t\\t\" . '<link>http://www.langantiques.com</link>' . \"\\n\";\r\n\t\t\t\t$rss .= \"\\t\\t\" . '<description>Lang Antique Estate and Antique Jewelry</description>' . \"\\n\";\r\n\t\t\t\t\r\n\t\t\t\tforeach($items as $item) {\r\n\t\t\t\t\t$rss .= \"\\t\\t\" . '<item>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<title>' . htmlspecialchars($item['item_name']) . '</title>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<link>http://www.langantiques.com/products/item/' . $item['item_number'] . '</link>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<description>' . htmlspecialchars($item['item_description']) . '</description>' . \"\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tforeach($item['image_array']['external_images'] as $image) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:image_link>http://www.langantiques.com' . $image['image_location'] . '</g:image_link>' . \"\\n\";\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:price>' . $item['item_price'] . '</g:price>' . \"\\n\";\r\n\t\t\t\t\t\tif($item['api_new_condition'] == 1) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:condition>used</g:condition>' . \"\\n\";\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:condition>new</g:condition>' . \"\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($item['item_size'] != null) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<c:ring_size type=\"string\">' . $item['item_size'] . '</c:ring_size>' . \"\\n\";\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t$material_data = $this->ci->material_model->getAppliedMaterials($item['item_id']);\r\n\t\t\t\t\t\tforeach($material_data as $material) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:material>' . htmlspecialchars($material['material_name']) . '</g:material>' . \"\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//List Modifiers (search terms)\r\n\t\t\t\t\t\t$modifier_data = $this->ci->modifier_model->getAppliedModifiers($item['item_id']);\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:product_type> Clothing & Accessories > Jewelry > ' . htmlspecialchars($major_classes[$item['mjr_class_id']]['major_class_name']) . '</g:product_type>' . \"\\n\";\r\n\t\t\t\t\t\tforeach($modifier_data as $modifier) {\r\n\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:product_type> Clothing & Accessories > Jewelry > ' . htmlspecialchars($modifier['modifier_name']) . '</g:product_type>' . \"\\n\";\r\n\t\t\t\t\t\t\tif($modifier['modifier_id'] == 5) {\r\n\t\t\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:occasion>Engagement</g:occasion>' . \"\\n\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:quantity>' . $item['item_quantity'] . '</g:quantity>' . \"\\n\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//List payment types\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>Cash</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>Check</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>Visa</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>MasterCard</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:payment_accepted>AmericanExpress</g:payment_accepted>' . \"\\n\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$rss .= \"\\t\\t\\t\" . '<g:id>' . $item['item_number'] . '</g:id>' . \"\\n\";\r\n\t\t\t\t\t$rss .= \"\\t\\t\" . '</item>' . \"\\n\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$rss .= \"\\t\" . '</channel>' . \"\\n\";\r\n\t\t$rss .= '</rss>' . \"\\n\";\t\t\r\n\t\t\r\n\t\treturn $rss; //string\t\r\n\t}",
"protected function composeItems()\n {\n $result = \"<publish node='\" . XML::quote($this->getNode()) . \"'>\";\n\n foreach ($this->getItems() as $key => $item) {\n // we must set parent XML nodes for collection\n if ($key == 0) {\n $result .= $item->getOuterStartTag();\n }\n $result .= $item->toString();\n // close collection tags\n if (($key + 1) == count($this->getItems())) {\n $result .= $item->getOuterEndTag();\n }\n }\n return $result . '</publish>';\n }",
"function export_xml($xmldata) {\r\n\r\n $output_xml[] = android_xml_start();\r\n $output_xml[] = android_xml_comments(\"Menu Item Categories\");\r\n $output_xml[] = android_xml_stringarray_start(\"categories\");\r\n $output_xml[] = join(PHP_EOL, array_map(\r\n 'android_xml_cdata', $xmldata['catdex']));\r\n $output_xml[] = android_xml_stringarray_end();\r\n\r\n foreach($xmldata['category'] as $cat) {\r\n\r\n $output_xml[] = \"\";\r\n $output_xml[] = \"\";\r\n\r\n // comments\r\n $output_xml[] = android_xml_comments($cat['name']);\r\n\r\n // items\r\n $output_xml[] = android_xml_stringarray_start($cat['items_name']);\r\n $output_xml[] = join(PHP_EOL, array_map('android_xml_cdata',\r\n $cat['items']));\r\n $output_xml[] = android_xml_stringarray_end();\r\n\r\n // details\r\n $output_xml[] = android_xml_stringarray_start($cat['details_name']);\r\n $output_xml[] = join(PHP_EOL, array_map('android_xml_cdata',\r\n $cat['details']));\r\n $output_xml[] = android_xml_stringarray_end();\r\n }\r\n\r\n $output_xml[] = android_xml_end();\r\n\r\n return join(PHP_EOL, $output_xml);\r\n}",
"function _formatArticle( $article )\r\n {\r\n $xml = \"<item>\\n\";\r\n $xml .= '<title>'.$this->_safeXML( $article['title'] ).\"</title>\\n\";\r\n $xml .= '<link>'.$this->_safeXML( $article['link'] ).\"</link>\\n\";\r\n $xml .= '<guid isPermaLink=\"true\">'.$this->_safeXML( $article['link'] ).\"</guid>\\n\";\r\n $xml .= '<pubDate>'.$this->_RFC822DateFormat( $article['date'] ).\"</pubDate>\\n\";\r\n if( array_key_exists( 'commenturl', $article ) )\r\n {\r\n $xml .= '<comments>'.$this->_safeXML( $article['commenturl'] ).\"</comments>\\n\";\r\n }\r\n if( array_key_exists( 'topic', $article ) )\r\n {\r\n $topic = $article['topic'];\r\n if( is_array( $topic ))\r\n {\r\n foreach( $topic as $subject )\r\n {\r\n $xml .= '<dc:subject>'.$this->_safeXML( $subject ).\"</dc:subject>\\n\";\r\n }\r\n }\r\n else\r\n {\r\n $xml .= '<dc:subject>'.$this->_safeXML( $topic ).\"</dc:subject>\\n\";\r\n }\r\n }\r\n if( array_key_exists( 'summary', $article ) )\r\n {\r\n if( strlen( $article['summary'] ) > 0 )\r\n {\r\n $xml .= '<description>'.$this->_safeXML( $article['summary'] ).\"</description>\\n\";\r\n }\r\n }\r\n if( isset($article['extensions']) && is_array($article['extensions']) )\r\n {\r\n foreach( $article['extensions'] as $extensionTag )\r\n {\r\n $xml .= \"$extensionTag\\n\";\r\n }\r\n }\r\n $xml .= \"</item>\\n\";\r\n return $xml;\r\n }",
"private function endItem()\r\n\t{\r\n\t\tif($this->version == self::RSS2 || $this->version == self::RSS1)\r\n\t\t{\r\n\t\t\techo '</item>' . PHP_EOL; \r\n\t\t} \r\n\t\telse if($this->version == self::ATOM)\r\n\t\t{\r\n\t\t\techo \"</entry>\" . PHP_EOL;\r\n\t\t}\r\n\t}",
"private function outputAtomItem(FeedUtilityItem $item) {\n\t\techo \" <entry>\\n\";\n\t\techo \" <title type=\\\"text\\\">\" . $this->cdata($item->title) . \"</title>\\n\";\n\t\techo \" <link href=\\\"\" . $item->url . \"\\\" rel=\\\"alternate\\\" title=\\\"\" . h($item->title) . \"\\\" />\\n\";\n\t\techo \" <id>\" . $this->getRFC3987IRI($item->title, $item->url, $item->updatedOn) . \"</id>\\n\";\n\t\techo \" <updated>\" . $this->getIso8601Time($item->updatedOn) . \"</updated>\\n\";\n\t\techo \" <published>\" . $this->getIso8601Time($item->updatedOn) . \"</published>\\n\";\n\t\techo \" <content type=\\\"html\\\">\" . $this->cdata($item->html) . \"</content>\\n\";\n\t\techo \" </entry>\\n \\n\";\n\t}",
"function render2xml(){\r\n \t$retVal='<'.utf8_encode($this->TagName);\r\n\t\tforeach ($this->arrAttrib as $key => $value) {\r\n\t \t$retVal.= ' '.utf8_encode($key).'=\"'.utf8_encode($value).'\"';\r\n\t\t}\r\n\t\t$retVal.= '>';\r\n \tfor ($i=0;$i<$this->getNumberOfChilds();$i++){\r\n \t\t$tmp=$this->getChild($i);\r\n \t\t$retVal.=$tmp->render2xml();\r\n \t}\r\n \t$retVal.='</'.utf8_encode($this->TagName).'>';\r\n return $retVal;\r\n }",
"abstract public function toXML();",
"public function toXml()\n {\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <collection>\n <totalRecords>' . $this->getSize() . '</totalRecords>\n <items>';\n\n foreach ($this as $item) {\n $xml .= $item->toXml();\n }\n $xml .= '</items>\n </collection>';\n return $xml;\n }",
"public function toXml()\n\t\t{\n\t\t\t$xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t<collection>\n\t\t\t\t<totalRecords>'.$this->getSize().'</totalRecords>\n\t\t\t\t<items>';\n\t\t\tforeach ($this->getItems() as $_item)\n\t\t\t{\n\t\t\t\t$xml .= $_item->toXml();\n\t\t\t}\n\t\t\t$xml .= '</items>\n\t\t\t\t</collection>';\n\t\t\treturn $xml;\n\t\t}",
"protected function writeItemContainer()\n {\n $itemTable = get_db()->getTable('Item');\n if ($writer = $this->writer) {\n $writer->startElement('itemContainer');\n $limit = 10;\n $page = 0;\n while (count($items = $itemTable->findBy(array(), $limit, $page)) > 0) {\n foreach ($items as $item) {\n $itemOutput = new Export_OmekaXmlItem($item, 'item');\n $rawItemXml = $itemOutput->getXML();\n $writer->writeRaw($rawItemXml);\n release_object($item);\n }\n $writer->flush();\n $page++;\n }\n $writer->endElement();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if user has added a profile image. | public function hasImage() {
return $this->user->icontime !== null;
} | [
"public function hasProfilePicture()\n {\n return !is_null($this->profilePicture);\n }",
"protected function userPictureEnabled() {\n $field_definitions = $this->entityFieldManager->getFieldDefinitions('user', 'user');\n return isset($field_definitions['user_picture']);\n }",
"function avatar_exists($user = null)\n {\n return Membership::avatarExists($user);\n }",
"function checking_profile_item_photo( $id ) {\n global $cbphoto;\n if ( $cbphoto->photo_exists( $id ) ) {\n if ( userid() != $cbphoto->get_photo_owner( $id ) ) {\n e( lang('Unable to set photo as profile item') );\n return false;\n }\n return true;\n } else {\n e( lang('Photo does not exists') );\n return false;\n }\n}",
"public function hasAvatar()\n\t{\n\t\treturn $this->getAvatarQuery()->exists();\n\t}",
"public function hasPhoto()\n {\n return $this->photo !== \"user.png\";\n }",
"function isExistProfile_picture($uid=false,$group_id=false){\n\t\n\tif(!$group_id)\n\t\t$file=user_profile_pic(uid($uid));\n\telse\n\t\t$file = group_logo_path($group_id);\n\n\tif(!file_exists($file)){\n\t\treturn false;\n\t}\n\treturn true;\n}",
"public function hasAvatar()\n {\n if ($this->avatar) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasImage();",
"public function hasAvatar()\n {\n return $this->avatar !== null;\n }",
"public function isValidProfile()\n {\n $id = (int) $this->_request->getParam('id');\n $profileRowData = $this->getUploadedFileRowData($id);\n if (!empty($profileRowData)) {\n return true;\n }\n return false;\n }",
"function any_avatar_uploaded( $userid ) {\r\n $avatars = retrieve_avatars( $userid );\r\n $avat_nums = count( $avatars );\r\n if ( $avat_nums == 0 ) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }",
"function emi_user_has_avatar( $user_id=false ) {\n\tif( !$user_id ){\n\t\t$user_id = bp_loggedin_user_id();\n\t}\n\n\tif ( bp_core_fetch_avatar( array( 'item_id' => $user_id, 'no_grav' => true,'html'=> false ) ) != bp_core_avatar_default( 'local' ) )\n\t\treturn true;\n\treturn false;\n}",
"public function HasAvatar(){\n\t\tif(!(GameUtil::HasAvatar($this->session->userdata['userAccount']['User_ID']))){\n\t\t\tredirect(\"Load/Character_Selection\");\n\t\t} else {\n\t\t\t$query = array(\n\t\t\t\t'User_ID' => $this->session->userdata['userAccount']['User_ID']\n\t\t\t);\n\t\t\t$Userdata = $this->UserData_m->GetData(\"account\",$query);\n\t\t\t$this->session->set_userdata('Avatar',$Userdata[0]->Avatar);\n\n\t\t\t//checks if the current value of \n\t\t\t$Userdata = $this->UserData_m->GetData(\"profile\",$query);\n\t\t\t$this->session->set_userdata(\"Agent\",$Userdata[0]->Agent);\n\t\t\tif($this->session->userdata(\"Agent\")==\"yes\"){\n\t\t\t\t$this->session->set_userdata(\"Current Agent Avatar\", \"none\");\n\t\t\t\t$this->session->set_userdata('Streak', 0);\n\t\t\t}\n\t\t\t\n\t\t\tredirect(\"Level_Selection\");\n\t\t}\n\t}",
"public function hasAvatar()\n {\n return is_file($this->getAvatarPathAttribute());\n }",
"public function hasAvatar()\n {\n return (bool) $this->avatar();\n }",
"public function getHasImage();",
"function hasBlipfoto()\n {\n if (!\\Idno\\Core\\site()->session()->currentUser()) {\n return false;\n }\n if (!empty(\\Idno\\Core\\site()->session()->currentUser()->blipfoto)) {\n if (is_array(\\Idno\\Core\\site()->session()->currentUser()->blipfoto)) {\n $accounts = 0;\n foreach(\\Idno\\Core\\site()->session()->currentUser()->blipfoto as $username => $value) {\n if ($username != 'user_token') {\n $accounts++;\n }\n }\n if ($accounts > 0) {\n return true;\n }\n }\n return true;\n }\n\n return false;\n }",
"public function hasImage()\n {\n return !empty($this->image) && file_exists($this->getImagePath());\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
/ Get opportunity list | public function opportunity_list (Request $request) {
$opportunities = Opportunity::all();
return response()->json(array(
'success' => true,
'payload' => $opportunities
));
} | [
"function get_opportunities()\n\t{\n\t\t// First, get the list of IDs.\n\t\t$query = \"SELECT opportunity_id as id from accounts_opportunities where account_id='$this->id' AND deleted=0\";\n\n\t\treturn $this->build_related_list($query, new Opportunity());\n\t}",
"public function getOpportunities()\n\t{\n\t\treturn Opportunities::model()->findAll('ios_id=:iosid', array(':iosid' => $this->id));\n\t}",
"public static function getOpportunities() {\n $opportunities = array();\n $response = HttpClient::get(\"/Zapier/GetOpportunities\");\n foreach ($response as $item) {\n $opportunities[] = new Opportunity($item);\n }\n return $opportunities;\n }",
"public function opportunities()\n {\n\n return view('opportunity.opportunity-list');\n }",
"public function getOpportunities() {\n\t\treturn $this->opportunities;\n\t}",
"public function getCriteriaListAction()\n {\n $competenceList = $this->competenceRepository->findBy([\n 'isApplicable' => 1\n ]);\n $this->listViewFactory->setViewFactory(CompetenceViewFactory::class);\n return $this->viewHandler->handle(View::create($this->listViewFactory->create($competenceList)));\n }",
"public function getOpportunities(): array\n {\n $opportunities = [];\n $result = $this->collectPaginatedResults('opportunities');\n\n foreach ($result as $opportunityData)\n {\n $opportunities[] = new CapsuleOpportunity($opportunityData);\n }\n\n return $opportunities;\n }",
"function GetMyOpportunities($count)\n\t{\n\t\t$result = $this->sendRequest(\"GetMyOpportunities\", array(\"Count\"=>$count));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"function get_organizations_list()\n {\n return \\App\\Organization::where('id', '>', 1)->lists('name', 'id')->all();\n\n }",
"public function listOngoingAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $travels = $em->getRepository('TWMSiteBundle:Travel\\Travel\\Travel')->findOngoingTravels();\n\n return [\n 'travels' => $travels\n ];\n }",
"public function getObjectList() {}",
"public function listAction() {\n\t\t$this->view->assign('value', $this->arrayService->flatten($this->meetingRepository->findAllowed(), 'list'));\n\t}",
"public function getEntityList();",
"function getOrganismsList();",
"public function fetchAppointmentList();",
"public function linkOppList() {\n\t\t// uses user_id to determine if user has editing privieges or not.\n\n\t\t$list = [];\n\t\tforeach ($this->opp_list as $id => $opp_row){\n\t\t\t$line = $button = '';\n\n\t\t\t$list[] = \"<a href='/opp-manager.php?id=$id'>${opp_row['title']}</a> \";\n\n\t\t\t#u\\echor($_SESSION,'session'); exit;\n\n\t\t}\n\n\t\t#u\\echor($list,'list'); exit;\n\t\treturn $list;\n\t}",
"public function getRelatedOpportunities()\n {\n $results = array();\n $query = \"select * from quotes_opportunities where quote_id = ? and deleted = 0\";\n $stmt = $this->db->getConnection()->executeQuery($query, array($this->id));\n while ($row = $stmt->fetch()) {\n $results[] = $row;\n }\n return $results;\n }",
"public function association_list()\n {\n return $this->db->query(\"SELECT org_name, org_id FROM public.entity_org o \n \t\t\t\t\t\t\tWHERE o.org_type = 2 \n \t\t\t\t\t\t\tAND o.deleted_flag = 'f' \")->result_array();\n }",
"public function getOrganisations(){\n return CHtml::listData(Organisation::model()->findAll(),'id','name');\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Devuelve el valor correspondiente a cedula | public function getCedula(){
return $this->cedula;
} | [
"public function getCedula()\n {\n return $this->cedula;\n }",
"public function getValorCausa()\n\t{\n\t\treturn $this->valor_causa;\n\t}",
"public function getValorCalculado() {\n return $this->nValor; \n }",
"public function valordelospasajesplus();",
"public function getNuCedula()\n {\n return $this->nu_cedula;\n }",
"public function getValorSolicitado();",
"public function getValor_factura() {\r\n return $this->valor_factura;\r\n }",
"function getValor()\n {\n return $this->valor;\n }",
"public function getAsistenciaValue()\n {\n return $this->asistenciaValue;\n }",
"public function getCollabValideur() {\n return $this->collabValideur;\n }",
"public function getValor()\n {\n return $this->valor;\n }",
"public function getCodAula()\n {\n return $this->CodAula;\n }",
"function corregir_valores()\n\t{\n\t}",
"public function getCodAula() {\n return $this->CodAula;\n }",
"function valor($ident){\n return \"$('#$ident').val()\";\n }",
"public function getValoracion()\r\n {\r\n return $this->valoracion;\r\n }",
"abstract public function getValor($campo);",
"public function getCod_factura()\n {\n return $this->cod_factura;\n }",
"public function conveteValor($litros){\n \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transfer insurance to cash | public function transferInsurance(): bool {
if ($this->insurance == 0) {
return false;
}
$this->cash = $this->insurance;
$this->insurance = 0;
return true;
} | [
"private function sellTrasactionAddsMoney(){\n\n }",
"private function acceptCash($receipt)\n\t{\n\t}",
"function _send_money($money_amount,$source_bank_account,$destination_bank_account){\n\t}",
"function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"public function applyCash()\n\t{\n\t\t$apply_amount = input_empty($this->input->post('apply_amount'),FALSE,'4001');\n\t\t$apply['amount'] = sprintf(\"%.2f\", $apply_amount);\n\t\tif($apply['amount'] <= 0)\n\t\t{\n\t\t\tresponse_msg('4001');\n\t\t}\n\n\t\t$innInfo = $this->model->get_inn_info_by_inn_id($this->token['inn_id']);\n\t\tif (!$innInfo)\n\t\t{\n\t\t\tresponse_msg('1018');\n\t\t}\n\t\tif (($innInfo['account']-$innInfo['withdrawing']) < $apply_amount)\n\t\t{\n\t\t\tresponse_msg('1022');\n\t\t}\n\n\t\t$apply['user_id'] = $this->token['user_id'];\n\t\t$apply['inn_id'] = $this->token['inn_id'];\n\t\t\n\t\t$this->_LoadModel('finance');\n\t\t$rs = $this->finance_model->inn_apply_cashout($apply);\n\t\tif(!$rs)\n\t\t{\n\t\t\tresponse_msg('5001');\n\t\t}\n\t\tresponse_msg('1');\n\t}",
"public function actionPayment() {\n \n //$this->createCustomerAccount(); //create customer\n //$this->updateCustomerAccount(); //pass id which should be updated and data (two arguments)\n //$this->getCustomerAccount();\n //$this->searchCustomerAccount(); //incomplete\n //$this->createCcaccount();\n //$this->updateCcaccount();\n\n \n //$this->doEscrowTransaction(); \n $this->doTransaction(); \n //$this->doEscrowTransactionFromVault();\n }",
"public function transfer($fromAccountId, $toAccountId, $amount);",
"public function chargeToAccount(){\r\n $uuid = $this->_operator->getAccountsInterface()->getUser()->getUUID();\r\n $ic = count($this->_line_items);\r\n $total = 0.00;\r\n for($i=0;$i<$ic;$i++){\r\n $total += $this->_line_items[$i]->getPrice();\r\n }\r\n\r\n $query = $this->_mysqli->prepare(\"UPDATE `client_info` SET `balance`=`balance`+?, `transaction_count`=`transaction_count`+1 WHERE `uuid`=?\");\r\n $query->bind_param(\"di\", $total, $uuid);\r\n $query->execute();\r\n $query->store_result();\r\n if($this->_mysqli->affected_rows != 1){\r\n header(\"tsastatus: 500\");\r\n exit(json_encode(array(\"type\"=>1, \"message\"=>\"Unable to charge account! Transaction NOT completed. \" . $this->_mysqli->affected_rows, \"time\"=>8000)));\r\n }\r\n $query->close();\r\n\r\n $op_id = $this->_operator->getOperator()->getopID();$zero = 0; $emptyString = \"\";\r\n $query = $this->_mysqli->prepare(\"INSERT INTO `trans_completed` VALUES(?,?,?,?,?,?,?)\");\r\n $query->bind_param(\"iiisdis\", $this->_session_id, $op_id, $uuid, $this->_line_item_id_string, $total, $zero, $emptyString);\r\n $query->execute();\r\n $query->store_result();\r\n if($this->_mysqli->affected_rows != 1){\r\n header(\"tsastatus: 500\");\r\n exit(json_encode(array(\"type\"=>1, \"message\"=>\"Unable to close transaction, but Account WAS charged succesfully.\", \"time\"=>8000)));\r\n }\r\n $query->close();\r\n//TODO: report discrepency\r\n\r\n $query = $this->_mysqli->prepare(\"DELETE FROM `trans_sessions` WHERE `id`=? LIMIT 1\");\r\n $query->bind_param(\"i\", $this->_session_id);\r\n $query->execute();\r\n $query->store_result();\r\n if($this->_mysqli->affected_rows != 1){\r\n header(\"tsastatus: 500\");\r\n exit(json_encode(array(\"type\"=>1, \"message\"=>\"Unable to close transaction, but Account WAS charged succesfully.\", \"time\"=>8000)));\r\n }\r\n $query->close();\r\n//TODO: report discrepency\r\n $this->_operator->registerNewTransactionSession();\r\n }",
"public function rtwBalanceTransfer($rtwAmount){\n \t \t// return $amount;\n $transferComission = 2*$rtwAmount/100; //generate 2% blance transfer comission\n $rtwAmountWithComission = $rtwAmount + $transferComission;\n\n \t \tif($rtwAmountWithComission){\n \t \t\t$roiRecord = Account::where('user_id', Auth::id())->first();\n \t \t\tif( $rtwAmountWithComission < $roiRecord->roi_balance ){\n \n \t \t\t\t$newRoiBalanceAfterDeduct = $roiRecord->roi_balance - $rtwAmountWithComission;\n \t \t\t\tAccount::where('user_id', Auth::id())->update(['roi_balance' => $newRoiBalanceAfterDeduct]);\n\n $tnx_id = 'r2w_'.rand(1,99999999);\n \t \t\t\tTransaction::insert(\n \t\t\t\t\t\t[\n \t\t\t\t\t\t'tnx_id' => $tnx_id,\n \t\t\t\t\t\t'amount' => $rtwAmount, //here is a question\n \t\t\t\t\t\t'sign' => '-',\n \t\t\t\t\t\t'purpose' => 7,\n 'proce_fee' => $transferComission,\n \t\t\t\t\t\t'date' => Carbon::now(), \n \t\t\t\t\t\t'user_id' => Auth::id(),\n \t\t\t\t\t\t]);\n\n \t\t\t\t\t$preBalance = $roiRecord->balance;\n \t\t\t\t\t$newBalanceAfterRoiAdded = $preBalance + $rtwAmount;\n \n \t \t\t\tAccount::where('user_id', Auth::id())->update(['balance' => $newBalanceAfterRoiAdded]);\n \t \t\t\tTransaction::insert(\n \t\t\t\t\t\t[\n \t\t\t\t\t\t'tnx_id' => 'r2w_'.rand(1,99999999),\n \t\t\t\t\t\t'amount' => $rtwAmount,\n \t\t\t\t\t\t'sign' => '+',\n \t\t\t\t\t\t'purpose' => 7,\n \t\t\t\t\t\t'date' => Carbon::now(), \n \t\t\t\t\t\t'user_id' => Auth::id()\n \t\t\t\t\t\t]);\n\n $tnx = Crypt::encrypt($tnx_id);\n \n return redirect()->route('user.transfer.confirm', $tnx);\n \t \t\t}\n \t \t\telse\n \t \t\t{\t\n \t \t\t\treturn redirect()->back()->with('message','You do not have sufficient balance');\n \t \t\t}\n \t \t}\n \t \telse\n \t \t{\n \t \t\t\treturn redirect()->back()->with('message','Request could not processd');\n \t \t}\n }",
"public function cash_2wallet(){\n\t\t\n\t\t$this->load->helper('string'); \n $user_info \t\t= $this->session->userdata('logged_user');\n $user_id \t\t= $user_info['user_id'];\n\t\t$role\t\t = $user_info['role']; //'wallet';\n\t\t$account_no = singleDbTableRow($user_id)->account_no; \n\t\t$rolename = singleDbTableRow($user_id)->rolename; \n\t\t$conv_type = $this->input->post('conv_type');\n\t\t\n\t\tif ( $conv_type == 'wallet')\n\t\t{\t\t\t\n\t\t $debit\t\t\t= \t$this->input->post('cash');\t\n\t\t\t\t$credit = '0';\n\t\t\t\t$amount\t\t\t= $debit + $credit;\n\t\t\t\t$pay_type = '66'; //Cash to Wallet Conversions\n\t\t\t\t$points_mode = 'wallet';\n\t\t}else{\t\t\n\t\t\t\t$debit = '0';\n\t\t\t\t$credit\t\t\t= \t$this->input->post('cash');\t\n\t\t\t\t$amount\t\t\t= $debit + $credit;\t\n\t\t\t\t$pay_type = '65';\t //Wallet to Cash Conversions \t\n\t\t\t\t$points_mode = 'cash';\n\n\t\t}\n //set all data for inserting into database\n $data1 = [\n 'user_id' \t\t=> $user_id, \n\t\t\t'account_no' \t=> $account_no,\n 'rolename' \t\t => $rolename,\n 'pay_type' \t\t=> $pay_type ,\n\t\t\t'credit' \t\t=> $credit,\n\t\t\t'debit' \t\t=> $debit,\n\t\t\t'amount' \t\t=> $amount,\t\n\t\t\t'points_mode' \t\t\t=> $points_mode,\n\t\t\t'used'\t\t\t\t\t=> 'yes',\n\t\t\t'tranx_id'\t\t\t\t=> $this->input->post('tranx_id'),\t\t\n 'created_at' => time(),\n 'modified_at' => time()\n ];\n\n $query1 = $this->db->insert('accounts', $data1);\n\n\t $today = date(\"Y/m/d\");\n //set all data for inserting into database\n $data2 = [\n 'user_id' \t\t=> $user_id,\n 'invoice_id ' \t\t\t=> 'test123',\n 'credit' \t\t=> $credit,\n\t\t\t'debit' \t\t=> $debit,\n\t\t\t'amount' \t\t=> $amount,\t\n\t\t\t'points_mode' => 'wallet',\n 'count' \t\t=> 'no',\t\t\t\t\t\t\n 'start_date' \t=> $today,\t\t\t\t\t\n\t\t\t'pay_type'\t\t\t\t=> $pay_type,\n\t\t\t'remarks' \t\t=> $this->input->post('tranx_id'),\t\n\t\t\t'challan'\t\t\t\t=> 'test image', //$photoName,\t\t\t\n 'created_at' => time(),\n 'modified_at' => time()\n ];\n\n $query2 = $this->db->insert('ledger', $data2);\n\n \n\n if($query1)\n {\n create_activity('Added '.$data1['invoice_id'].' accounts'); //create an activity\n return true;\n }\n return false;\n\n }",
"public function moneyAreTransferred();",
"public function credit();",
"function add_bank_transfer($from_account, $to_account, $date_, $amount, $ref, $memo_, $charge = 0, $target_amount = 0)\n{\n global $Refs, $SysPrefs;\n\n begin_transaction();\n $args = func_get_args();\n if (count($args) < 8)\n $args[] = 0;\n $args = (object) array_combine(array(\n 'from_account',\n 'to_account',\n 'date_',\n 'amount',\n 'ref',\n 'memo_',\n 'charge',\n 'target_amount'\n ), $args);\n $args->trans_no = 0;\n hook_db_prewrite($args, ST_BANKTRANSFER);\n\n $trans_type = ST_BANKTRANSFER;\n\n $currency = get_bank_account_currency($from_account);\n\n $trans_no = get_next_trans_no($trans_type);\n\n $fromact = get_bank_account($from_account);\n $toact = get_bank_account($to_account);\n $person_id = _(\"From\") . \" \" . $fromact['bank_account_name'] . \" \" . _(\"To\") . \" \" . $toact['bank_account_name'];\n\n $from_gl_account = get_bank_gl_account($from_account);\n $to_gl_account = get_bank_gl_account($to_account);\n\n $exchanged = false;\n $total = 0;\n // do the source account postings\n $total += add_gl_trans($trans_type, $trans_no, $date_, $from_gl_account, 0, 0, $person_id, - ($amount + $charge), $currency);\n\n add_bank_trans($trans_type, $trans_no, $from_account, $ref, $date_, - ($amount + $charge), PT_MISC, $person_id, $currency, \"Cannot insert a source bank transaction\");\n if ($SysPrefs->auto_currency_revaluation()) {\n $trans_no1 = get_next_trans_no(ST_JOURNAL);\n if (add_exchange_variation($trans_no1, $date_, $from_account, $from_gl_account, $currency, PT_MISC, $person_id))\n $exchanged = true;\n }\n if ($charge != 0) {\n /* Now Debit bank charge account with charges */\n $charge_act = get_company_pref('bank_charge_act');\n $total += add_gl_trans($trans_type, $trans_no, $date_, $charge_act, 0, 0, $person_id, $charge, $currency);\n }\n\n // provide backward compatibility for extension modules (target amount can be not passed)\n $to_currency = $target_amount ? $toact['bank_curr_code'] : $currency;\n $to_amount = $target_amount ? $target_amount : $amount;\n\n // do the destination account postings\n $total += add_gl_trans($trans_type, $trans_no, $date_, $to_gl_account, 0, 0, $person_id, $to_amount, $to_currency);\n\n /* Post a balance post if $total != 0 */\n if ($currency == $to_currency)\n add_gl_balance($trans_type, $trans_no, $date_, - $total);\n else // in this case those are exchange variances between bank and home rates\n add_gl_trans($trans_type, $trans_no, $date_, get_company_pref('exchange_diff_act'), 0, 0, _(\"Exchange Variance\"), - $total);\n\n add_bank_trans($trans_type, $trans_no, $to_account, $ref, $date_, $to_amount, PT_MISC, $person_id, $to_currency, \"Cannot insert a destination bank transaction\");\n\n if ($SysPrefs->auto_currency_revaluation()) {\n $currency = get_bank_account_currency($to_account);\n\n if (add_exchange_variation($trans_no1, $date_, $to_account, $to_gl_account, $currency, PT_MISC, $person_id))\n $exchanged = true;\n }\n if ($exchanged == true) {\n $ref1 = $Refs->get_next(ST_JOURNAL);\n $Refs->save(ST_JOURNAL, $trans_no1, $ref1);\n add_audit_trail(ST_JOURNAL, $trans_no1, $date_);\n }\n add_comments($trans_type, $trans_no, $date_, $memo_);\n\n $Refs->save($trans_type, $trans_no, $ref);\n add_audit_trail($trans_type, $trans_no, $date_);\n\n $args->trans_no = $trans_no;\n hook_db_postwrite($args, ST_BANKTRANSFER);\n commit_transaction();\n\n return $trans_no;\n}",
"function transferSaldo($aantal, $ontvangerEmail, $beschrijving, $email) {\n // Maak verbinding met de databases.\n $db = DBconnection::getConnection();\n\n checkconnection($db);\n\n // sql voor afschrijven overgemaakte bedrag.\n $sqlVerzender = \"UPDATE wallets SET saldo = saldo - $aantal WHERE idUser = (SELECT idUser FROM users WHERE email = '\".$email.\"')\";\n\n // sql voor toevoegen overgemaakte bedrag.\n $sqlOntvanger = \"UPDATE wallets SET saldo = saldo + $aantal WHERE idUser = (SELECT idUser FROM users WHERE email = '\". $ontvangerEmail .\"')\";\n\n // Voer alle queries uit.\n // Eerst het saldo afschrijven.\n if ($db->query($sqlVerzender)) {\n // Ten tweede het saldo bij de ontvanger er bij schrijven.\n if ($db->query($sqlOntvanger)) {\n // Ten derde de transactie noteren.\n $emailArray = [$email, $ontvangerEmail];\n // Als de transactie is geregistreed dan doorwijzen naar het dashboard\n if (transactionAdd($beschrijving, $aantal, $emailArray)) {\n header(\"Location: dashboard.php\");\n } else {\n print_r(\"Transactie notatie mislukt\");\n }\n } else {\n var_dump(\"Error: \" . $sqlOntvanger . \"<br>\" . $db->error);\n }\n } else {\n var_dump(\"Error: \" . $sqlVerzender . \"<br>\" . $db->error);\n }\n}",
"function take_cash($amount)\n{\n\tglobal $db_name,$user;\n\tif ($user['login_id'] != ADMIN_ID) {\n\t\tdbn(\"update ${db_name}_users set cash = cash - '$amount' where login_id = '$user[login_id]'\");\n\t\t$user['cash'] -= $amount;\n\t}\n}",
"function add_bank_transfer($from_account, $to_account, $date_,\n\t$amount, $ref, $memo_, $charge=0, $target_amount=0)\n{\n\tglobal $Refs, $SysPrefs;\n\t\n\tbegin_transaction();\n\t$args = func_get_args(); if (count($args) < 8) $args[] = 0;\n\t$args = (object)array_combine(array('from_account', 'to_account', 'date_', 'amount',\n\t\t'ref', 'memo_', 'charge', 'target_amount'), $args);\n\t$args->trans_no = 0;\n\thook_db_prewrite($args, ST_BANKTRANSFER);\n\n\t$trans_type = ST_BANKTRANSFER;\n\n\t$currency = get_bank_account_currency($from_account);\n\n\t$trans_no = get_next_trans_no($trans_type);\n\t\n $fromact = get_bank_account($from_account);\n $toact = get_bank_account($to_account);\n $person_id = _(\"From\").\" \".$fromact['bank_account_name'].\" \"._(\"To\").\" \".$toact['bank_account_name'];\n\n\t$from_gl_account = get_bank_gl_account($from_account);\n\t$to_gl_account = get_bank_gl_account($to_account);\n\t\n\t$exchanged = false;\n\t$total = 0;\n\t// do the source account postings\n $total += add_gl_trans($trans_type, $trans_no, $date_, $from_gl_account, 0, 0, $person_id,\n\t\t-($amount + $charge), $currency);\n\n add_bank_trans($trans_type, $trans_no, $from_account, $ref,\n\t\t$date_, -($amount + $charge),\n\t\tPT_MISC, $person_id, $currency,\n\t\t\"Cannot insert a source bank transaction\");\n\tif ($SysPrefs->auto_currency_revaluation())\n\t{\n\t\t$trans_no1 = get_next_trans_no(ST_JOURNAL);\n\t\tif (add_exchange_variation($trans_no1, $date_, $from_account, $from_gl_account, \n\t\t\t$currency, PT_MISC, $person_id))\n\t\t\t$exchanged = true;\n\t}\n\tif ($charge != 0)\n\t{\n\t\t/* Now Debit bank charge account with charges */\n\t\t$charge_act = get_company_pref('bank_charge_act');\n\t\t$total += add_gl_trans($trans_type, $trans_no, $date_,\n\t\t\t$charge_act, 0, 0, $person_id, $charge, $currency);\n\t}\n\n\t// provide backward compatibility for extension modules (target amount can be not passed)\n\t$to_currency = $target_amount ? $toact['bank_curr_code'] : $currency;\n\t$to_amount = $target_amount ? $target_amount : $amount;\n\n\t// do the destination account postings\n\t$total += add_gl_trans($trans_type, $trans_no, $date_, $to_gl_account, 0, 0, $person_id,\n\t\t$to_amount, $to_currency);\n\t\t\n\t/*Post a balance post if $total != 0 */\n\tif ($currency == $to_currency)\n\t\tadd_gl_balance($trans_type, $trans_no, $date_, -$total);\n\telse\t// in this case those are exchange variances between bank and home rates\n\t \tadd_gl_trans($trans_type, $trans_no, $date_, get_company_pref('exchange_diff_act'),\n\t \t\t0, 0, _(\"Exchange Variance\"), -$total);\n\t\n\tadd_bank_trans($trans_type, $trans_no, $to_account, $ref,\n\t\t$date_, $to_amount, PT_MISC, $person_id,\n\t\t$to_currency, \"Cannot insert a destination bank transaction\");\n\n\tif ($SysPrefs->auto_currency_revaluation())\n\t{\n\t\t$currency = get_bank_account_currency($to_account);\n\t\n\t\tif (add_exchange_variation($trans_no1, $date_, $to_account, $to_gl_account,\t\n\t\t\t$currency, PT_MISC, $person_id))\n\t\t\t$exchanged = true;\n\t}\n\tif ($exchanged == true)\n\t{\n\t\t$ref1 = $Refs->get_next(ST_JOURNAL);\n\t\t$Refs->save(ST_JOURNAL, $trans_no1, $ref1);\n\t\tadd_audit_trail(ST_JOURNAL, $trans_no1, $date_);\n\t}\n\tadd_comments($trans_type, $trans_no, $date_, $memo_);\n\n\t$Refs->save($trans_type, $trans_no, $ref);\n\tadd_audit_trail($trans_type, $trans_no, $date_);\n\n\t$args->trans_no = $trans_no;\n\thook_db_postwrite($args, ST_BANKTRANSFER);\n\tcommit_transaction();\n\n\treturn $trans_no;\n}",
"private function putCredit(){\n\n }",
"public function confirmStpPurchase(){\n $payment = array('stp_transact_status'=>Input::get('merchantAccount'),\n 'date'=>Input::get('date'),\n 'amount'=>Input::get('amount'), //actual amount transferred to account\n 'member'=>Input::get('member'),\n 'item_id'=>Input::get('item_id'),\n 'email'=>Input::get('email'),\n 'memo'=>Input::get('memo'),\n 'tr_id'=>Input::get('tr_id'),\n 'receiver'=>Input::get('user1'),\n 'provider'=>Input::get('user2'));\n \n print_r($payment);\n //transaction verification and authentication scheme\n $secondary_password = 'Creationfox7!';\n $secondary_password = md5($secondary_password.'s+E_a*'); //encryption for db\n $hash_received = MD5($_POST['tr_id'].\":\".MD5($secondary_password).\":\".$_POST['amount'].\"\n :\".$_POST['merchantAccount'].\":\".$_POST['payerAccount']);\n\n if ($hash_received == $_POST['hash']) {\n // valid payment\n $transaction = new IcePayTransaction();\n $transaction->user_id = Auth::user()->id;\n $transaction->tid = $payment['tr_id']; //transaction id or transaction bordereaux\n $transaction->sender_email = Auth::user()->email;//$payer['email']; //sender's email\n $transaction->receiver_email = $payment['receiver']; //receiver's email or number\n $transaction->type = 'STP to '.$payment['provider'];\n $transaction->status = 'pending';//$transaction_json['related_resources'][0]['sale']['state'];\n $transaction->amount = $payment['amount']; //total amount deducted and transferred\n $transaction->currency = '';\n $transaction->save();\n Mail::send(['html'=>'emails.auth.transactionemail'], array('tdate' => $payment['date'],\n 'tid' => $payment['tr_id'],\n 'sender_email'=>Auth::user()->email,\n 'sender_number'=>Auth::user()->number,\n 'receiver_email'=>'TEST',\n 'receiver_number'=>$payment['receiver'],\n 'status'=>'PENDING',\n 'amount'=>$payment['amount'],\n 'charge'=>'0.0 USD',\n 'total'=>$payment['amount'].' ',\n 'mode'=>'STP to '.$payment['provider'])\n , function($message) use ($email, $username){\n\t\t \t\t\t$message->to($email, $username)->subject('Transaction Receipt');\n\t\t\t \t});\n return Redirect::route('dashboard')\n \t ->with('alertMessage', 'STP Transaction successful');\n }\n else {\n // invalid payment; the payment has been altered\n return Redirect::route('dashboard')\n \t ->with('alertError', 'Invalid Payment. The payment may have been altered. Please try again');\n }\n }",
"function account_deposit_withdraw(){\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if audio device has been initialized successfully | public static function isDeviceReady(): void
{
} | [
"function IsAudioDeviceReady(): bool { return false; }",
"function IsAudioStreamReady(\\raylib\\AudioStream $stream): bool { return false; }",
"function IsSoundReady(\\raylib\\Sound $sound): bool { return false; }",
"public function hasAudio(): bool\n {\n return $this->audio()->count() > 0;\n }",
"function IsMusicReady(\\raylib\\Music $music): bool { return false; }",
"function InitAudioDevice(): void { }",
"public function hasAudio(): bool\n {\n return $this->recordingProperties->hasAudio();\n }",
"public function isAudio()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return false;\r\n }",
"public function hasDevice()\n {\n return $this->get(self::DEVICE) !== null;\n }",
"protected function isAudio()\n {\n return app('ffmpeg-driver')->open($this->media->getPath()) instanceof Audio;\n }",
"function eis_device_init() {\n\tglobal $eis_conf,$eis_dev_conf,$eis_dev_status;\n\t// put specific device initialization code here\n\t// in case of error, return eis_error(your_error,your_error_msg)\n\t// device status will be saved after this call\n\n\treturn true;\n}",
"public function isAudio() {return $this->major == 2 || $this->major == 4;}",
"public function is_initialized()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $file = new File(self::FILE_INITIALIZED);\n\n // TODO: remove file_exists check on old path in version 7\n if ($file->exists() || file_exists('/var/clearos/samba/initialized_directory'))\n return TRUE;\n else\n return FALSE;\n }",
"public function isAudio() {\n return false;\n }",
"public static function test(){\n if (self::$_prepared){\n if (self::$_verbose) echo \"Leon.lib is initialized.\\n\";\n return true;\n }\n else{\n if (self::$_verbose) echo \"Leon.lib is not prepared for usage!\\nCall: Init::prepare()\\n\";\n return false;\n }\n }",
"public function testDeviceIsInitializedOnIdentifyConstruction()\n {\n $this->assertInstanceOf(Device::class, $this->identify->device());\n }",
"public static function initDevice(): void\n {\n }",
"public function IsMediaAvailable() {\n\t\t// Check if there is a medium inserted.\n\t\tif (FALSE === $this->hasUdevProperty(\"ID_CDROM_MEDIA\"))\n\t\t\treturn FALSE;\n\t\t$property = $this->getUdevProperty(\"ID_CDROM_MEDIA\");\n\t\tif (\"1\" !== $property)\n\t\t\treturn FALSE;\n\t\t// Note, there are problems with USB network/modem dongles that have\n\t\t// CDROM support for driver installation. The CDROM part is identified,\n\t\t// and the above code is TRUE which indicates an inserted media, but\n\t\t// blkid will fail with an error accessing the device. To prevent this\n\t\t// we need to filter such devices. To do so we expect that for a CDROM,\n\t\t// DVD or other optical media device the ID_CDROM_MEDIA_SESSION_COUNT\n\t\t// identifier must exist.\n\t\t//\n\t\t// Empty CD:\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_CD_R=1\n\t\t// ID_CDROM_MEDIA_STATE=blank\n\t\t// ID_CDROM_MEDIA_SESSION_NEXT=1\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=1\n\t\t//\n\t\t// Audio-only CD:\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_CD_R=1\n\t\t// ID_CDROM_MEDIA_STATE=complete\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=1\n\t\t//\n\t\t// Mixed audio/data CD:\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_CD=1\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=2\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=13\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=12\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT_DATA=1\n\t\t// ID_CDROM_MEDIA_SESSION_LAST_OFFSET=444508160\n\t\t//\n\t\t// Data-only CD:\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_CD=1\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT_DATA=1\n\t\t//\n\t\t// 3 sessions data CD:\n\t\t// ID_CDROM_MEDIA_CD_R=1\n\t\t// ID_CDROM_MEDIA_STATE=complete\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=3\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=3\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT_DATA=3\n\t\t// ID_CDROM_MEDIA_SESSION_LAST_OFFSET=39329792\n\t\t//\n\t\t// Video CD (iso9660):\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_CD_R=1\n\t\t// ID_CDROM_MEDIA_STATE=complete\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=2\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT_DATA=2\n\t\t//\n\t\t// Empty DVD:\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_DVD_R=1\n\t\t// ID_CDROM_MEDIA_STATE=blank\n\t\t// ID_CDROM_MEDIA_SESSION_NEXT=1\n\t\t// ID_CDROM_MEDIA_SESSION_COUNT=1\n\t\t// ID_CDROM_MEDIA_TRACK_COUNT=1\n\t\t//\n\t\t// Huawei 3G modem:\n\t\t// ID_CDROM=1\n\t\t// ID_CDROM_CD=1\n\t\t// ID_CDROM_MEDIA=1\n\t\t// ID_CDROM_MEDIA_CD=1\n\t\t//\n\t\t// Found at https://bugzilla.kernel.org/show_bug.cgi?id=15757#c4.\n\t\treturn $this->hasUdevProperty(\"ID_CDROM_MEDIA_SESSION_COUNT\");\n\t}",
"public function testIsAudio() {\n\t\t$this->assertFalse($this->object->isAudio());\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the model instance is publishable or not. | public function isPublishable(): bool
{
return in_array(__TRAIT__, class_uses_recursive(get_called_class()));
} | [
"public function isPublishable();",
"public function isPublishable()\r\n\t{\r\n\t \treturn $this->isSelf();\r\n\t}",
"public function isPublishable(){\n return ( ! $this->isDeleted()) && $this->isContentReady();\n }",
"public function canPublish() {\n\t\treturn $this->canEdit();\n\t}",
"public function isPublished()\n {\n return $this->object()->isPublished();\n }",
"public function getIsPublished()\n {\n return $this->getOwner()->published !== null;\n }",
"public function canPublishPermission()\n {\n }",
"public function isPublished()\r\n {\r\n if (1 != $this->published) {\r\n return false;\r\n }\r\n\r\n // Check if media type is published.\r\n $table = FactoryTable::getInstance('Type');\r\n $table->load($this->type_id);\r\n if (1 != $table->published) {\r\n return false;\r\n }\r\n\r\n // Check if media category is published.\r\n $table = FactoryTable::getInstance('Category');\r\n $table->load($this->category_id);\r\n if (1 != $table->published) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"function LPH_IsPublishing(){\n\t\treturn LivePubHelper::is_publishing();\n\t}",
"public function getShouldBePublished() : bool\n {\n return $this->getProperty()->shouldBePublished;\n }",
"public function isPublished() {}",
"public function isPublished()\n {\n return $this->access !== LibBaseDomainBehaviorPrivatable::ADMIN;\n }",
"public function is_publish() {\n\t\t\treturn apply_filters( 'learn-press/' . $this->_post_type . '/is-publish',\n\t\t\t\tget_post_status( $this->get_id() ) === 'publish' );\n\t\t}",
"public function isPublished()\n\t{\n\t\treturn $this->getPostStatus() == 'publish';\n\t}",
"public function canPublishFilter()\n {\n return $this->canFilter();\n }",
"public function hasIsPublisher()\n {\n return $this->is_publisher !== null;\n }",
"public function isPublished()\n\t{\n\t\treturn $this->published_at != null;\n\t}",
"public function isPublished()\n {\n return (null !== $this->publishDate);\n }",
"public function isPublished() {\n\n\t\t// get dates\n\t\t$now = $this->app->date->create()->toSQL();\n\t\t$null = $this->app->database->getNullDate();\n\n\t\treturn $this->state == 1\n\t\t\t\t&& ($this->publish_up == $null || $this->publish_up <= $now)\n\t\t\t\t&& ($this->publish_down == $null || $this->publish_down >= $now);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the names of all controls in the container | public function getControlNames(); | [
"public function getAllControls();",
"protected function getAllControls()\n\t\t{\n\t\t\t$controls = $this->findAll(function($e) {\n\t\t\t\treturn $e instanceof \\red\\web\\ui\\controls\\IControl;\n\t\t\t});\n\t\t\treturn $controls;\n\t\t}",
"public function getControls()\n\t{\n\t\t$this->ensureChildControls();\n\t\treturn $this->_container->getControls();\n\t}",
"public function getControls()\n {\n return $this->controls;\n }",
"public static function getControls() : array\n {\n return array_values(array_unique(static::$controls));\n }",
"public function getControls()\n {\n return $this->controls;\n }",
"public function getTabPageNames()\n {\n return $this->getChildren()->getTypedControlNames(true, \"TabPage\");\n }",
"private function getControlsWithName($name)\n {\n $trigControls = array();\n $controls = &$this->form->currentControls;\n if (isset($controls[$name])) {\n $trigControls[] = $controls[$name];\n } else {\n foreach ($controls as $control) {\n if ($control->attribs['name'] == $name) {\n $trigControls[] = $control;\n }\n }\n }\n return $trigControls;\n }",
"public function listContainerNames()\n {\n if ($this->contentContainerNames === null) {\n $this->listContentContainers();\n }\n\n return $this->contentContainerNames;\n }",
"public function getFormElemNames()\n\t{\n\t\t$names = array();\n\t\tforeach ($this->getFormElems() as $elem)\n\t\t{\n\t\t\t$name = $elem->getAttribute('name');\n\t\t\tif (!empty($name))\n\t\t\t\t$names[] = $name;\n\t\t}\n\t\treturn $names;\n\t}",
"public function getSubFormNames()\n\t{\n\t\treturn array_keys($this->getSubForms());\n\t}",
"public function userform_get_root_elements_name() {\n $elementnames = array($this->itemname);\n\n return $elementnames;\n }",
"public function getElementNames()\n {\n return array_keys($this->getElements());\n }",
"public function getUiElementNames()\n {\n if (array_key_exists(\"uiElementNames\", $this->_propDict)) {\n return $this->_propDict[\"uiElementNames\"];\n } else {\n return null;\n }\n }",
"public function userform_get_root_elements_name() {\n $elementnames = array();\n $elementnames[] = $this->itemname.'_group';\n\n return $elementnames;\n }",
"public function getNameElements() {\n return $this->nameFormElements;\n }",
"abstract public function getClassNamesForContainer();",
"public function getControlContainer()\n {\n return $this->getComponent(static::CONTROL_CONTAINER_ID);\n }",
"public function userform_get_root_elements_name() {\n $elementnames = array($this->itemname.'_group');\n\n return $elementnames;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Analyze passing the an argument of type $argument_type to the ith parameter of the (possibly variadic) method $method, for a call made from the line $lineno. | public static function analyzeParameter(CodeBase $code_base, Context $context, FunctionInterface $method, UnionType $argument_type, int $lineno, int $i, $argument_node, ?Node $node): void
{
// Expand it to include all parent types up the chain
try {
$argument_type_resolved = $argument_type->withStaticResolvedInContext($context);
$argument_type_expanded_resolved = $argument_type_resolved->asExpandedTypes($code_base);
} catch (RecursionDepthException $_) {
return;
}
// Check the method to see if it has the correct
// parameter types. If not, keep hunting through
// alternates of the method until we find one that
// takes the correct types
$alternate_parameter = null;
$alternate_parameter_type = null; // TODO: Properly merge "possibly undefined" union types - without this, undefined is inferred instead of possibly undefined
foreach ($method->alternateGenerator($code_base) as $alternate_method) {
// Get the parameter associated with this argument
$candidate_alternate_parameter = $alternate_method->getParameterForCaller($i);
if (\is_null($candidate_alternate_parameter)) {
continue;
}
if ($alternate_parameter && $node) {
// If another function was already checked which had the right number of alternate parameters, don't bother allowing checks with param
$arglist = $node->kind === ast\AST_ARG_LIST ? $node : ($node->children['args'] ?? null);
if ($arglist) {
$argcount = \count($arglist->children);
// Make sure we have enough arguments
if ($argcount < $alternate_method->getNumberOfRequiredParameters() && !self::isUnpack($arglist->children)) {
continue;
}
}
}
$alternate_parameter = $candidate_alternate_parameter;
$alternate_parameter_type = $alternate_parameter->getNonVariadicUnionType()->withStaticResolvedInFunctionLike($alternate_method);
// See if the argument can be cast to the parameter.
// TODO: In order for intersection types to work (e.g. casting ArrayObject to ArrayAccess&Countable),
// the codebase must be passed into canCastToUnionType (instead of expanding types), because ArrayAccess|Countable is not a type that casts to ArrayAccess&Countable
//
// TODO: Stop expanding the argument type
if ($argument_type_resolved->canCastToUnionType($alternate_parameter_type, $code_base)) {
if ($alternate_parameter_type->hasRealTypeSet() && $argument_type->hasRealTypeSet()) {
$real_parameter_type = $alternate_parameter_type->getRealUnionType();
$real_argument_type = $argument_type->getRealUnionType();
$real_argument_type_resolved = $real_argument_type->withStaticResolvedInContext($context);
if (!$real_argument_type_resolved->canCastToDeclaredType($code_base, $context, $real_parameter_type)) {
$real_argument_type_resolved_nonnull = $real_argument_type_resolved->nonNullableClone();
if ($real_argument_type_resolved_nonnull->isEmpty() ||
!$real_argument_type_resolved_nonnull->canCastToDeclaredType($code_base, $context, $real_parameter_type)) {
// We know that the inferred real types don't match with the strict_types setting of the caller
// (e.g. null -> any non-null type)
// Try checking any other alternates, and emit PhanTypeMismatchArgumentReal if that fails.
//
// Don't emit PhanTypeMismatchArgumentReal if the only reason that they failed was due to nullability of individual types,
// e.g. allow ?array -> iterable
continue;
}
}
}
if (Config::get_strict_param_checking() && $argument_type->typeCount() > 1) {
self::analyzeParameterStrict($code_base, $context, $method, $argument_node, $argument_type, $alternate_parameter, $alternate_parameter_type, $lineno, $i);
}
if ($alternate_parameter->shouldWarnIfProvided()) {
self::maybeWarnProvidingUnusedParameter($code_base, $context, $lineno, $method, $alternate_parameter, $i);
}
return;
}
}
if (!($alternate_parameter instanceof Parameter)) {
return; // skip type check - is this possible?
}
if (!isset($alternate_parameter_type)) {
throw new AssertionError('Impossible - should be set if $alternate_parameter is set');
}
if ($alternate_parameter->shouldWarnIfProvided()) {
self::maybeWarnProvidingUnusedParameter($code_base, $context, $lineno, $method, $alternate_parameter, $i);
}
if ($alternate_parameter->isPassByReference() && $alternate_parameter->getReferenceType() === Parameter::REFERENCE_WRITE_ONLY) {
return;
}
if ($alternate_parameter_type->hasTemplateTypeRecursive()) {
// Don't worry about **unresolved** template types.
// We resolve them if possible in ContextNode->getMethod()
//
// TODO: Warn about the type without the templates?
return;
}
// FIXME: This may be obsolete after changing canCastToDeclaredType
if ($alternate_parameter_type->hasTemplateParameterTypes()) {
// TODO: Make the check for templates recursive
$argument_type_expanded_templates = $argument_type->asExpandedTypesPreservingTemplate($code_base);
if ($argument_type_expanded_templates->canCastToUnionType($alternate_parameter_type, $code_base)) {
// - can cast MyClass<\stdClass> to MyClass<mixed>
// - can cast Some<\stdClass> to Option<\stdClass>
// - cannot cast Some<\SomeOtherClass> to Option<\stdClass>
return;
}
// echo "Debug: $argument_type $argument_type_expanded_templates cannot cast to $parameter_type\n";
}
if ($method->isPHPInternal()) {
// If we are not in strict mode and we accept a string parameter
// and the argument we are passing has a __toString method then it is ok
if (!$context->isStrictTypes() && $alternate_parameter_type->hasNonNullStringType()) {
try {
foreach ($argument_type_resolved->asClassList($code_base, $context) as $clazz) {
if ($clazz->hasMethodWithName($code_base, "__toString", true)) {
return;
}
}
} catch (CodeBaseException $_) {
// Swallow "Cannot find class", go on to emit issue
}
}
}
// Check suppressions and emit the issue
self::warnInvalidArgumentType($code_base, $context, $method, $alternate_parameter, $alternate_parameter_type, $argument_node, $argument_type, $argument_type->asExpandedTypes($code_base), $argument_type_expanded_resolved, $lineno, $i);
} | [
"private function analyzeMethodWithArgumentTypes(\n Node $argument_list_node,\n FunctionInterface $method\n ): void {\n $method = $this->findDefiningMethod($method);\n $original_method_scope = $method->getInternalScope();\n $method->setInternalScope(clone $original_method_scope);\n $method_context = $method->getContext();\n\n try {\n // Even though we don't modify the parameter list, we still need to know the types\n // -- as an optimization, we don't run quick mode again if the types didn't change?\n $parameter_list = \\array_map(static function (Parameter $parameter): Parameter {\n return $parameter->cloneAsNonVariadic();\n }, $method->getParameterList());\n\n // always resolve all arguments outside of quick mode to detect undefined variables, other problems in call arguments.\n // Fixes https://github.com/phan/phan/issues/583\n $argument_types = [];\n foreach ($argument_list_node->children as $i => $argument) {\n // Determine the type of the argument at position $i\n $argument_types[$i] = UnionTypeVisitor::unionTypeFromNode(\n $this->code_base,\n $this->context,\n $argument,\n true\n )->withStaticResolvedInContext($this->context)->eraseRealTypeSetRecursively();\n }\n\n foreach ($parameter_list as $i => $parameter_clone) {\n $argument = $argument_list_node->children[$i] ?? null;\n\n if ($argument === null\n && $parameter_clone->hasDefaultValue()\n ) {\n $parameter_type = $parameter_clone->getDefaultValueType()->withRealTypeSet($parameter_clone->getNonVariadicUnionType()->getRealTypeSet());\n if ($parameter_type->isType(NullType::instance(false))) {\n // Treat a parameter default of null the same way as passing null to that parameter\n // (Add null to the list of possibilities)\n $parameter_clone->addUnionType($parameter_type);\n } else {\n // For other types (E.g. string), just replace the union type.\n $parameter_clone->setUnionType($parameter_type);\n }\n }\n\n // Add the parameter to the scope\n // TODO: asNonVariadic()?\n $method->getInternalScope()->addVariable(\n $parameter_clone\n );\n\n // If there's no parameter at that offset, we may be in\n // a ParamTooMany situation. That is caught elsewhere.\n if ($argument === null) {\n continue;\n }\n\n // If there's a declared type for the parameter,\n // then don't bother overriding the type to analyze the function/method body (unless the parameter is pass-by-reference)\n // Note that $parameter_clone was converted to a non-variadic clone, so the getNonVariadicUnionType returns an array.\n if (!$parameter_clone->hasEmptyNonVariadicType() && !$parameter_clone->isPassByReference()) {\n continue;\n }\n\n $this->updateParameterTypeByArgument(\n $method,\n $parameter_clone,\n $argument,\n $argument_types,\n $parameter_list,\n $i\n );\n }\n foreach ($parameter_list as $parameter_clone) {\n if ($parameter_clone->isVariadic()) {\n // We're using this parameter clone to analyze the **inside** of the method, it's never seen on the outside.\n // Convert it immediately.\n // TODO: Add tests of variadic references, fix those if necessary.\n $method->getInternalScope()->addVariable(\n $parameter_clone->cloneAsNonVariadic()\n );\n }\n }\n\n // Now that we know something about the parameters used\n // to call the method, we can reanalyze the method with\n // the types of the parameter\n $method->analyzeWithNewParams($method_context, $this->code_base, $parameter_list);\n } finally {\n $method->setInternalScope($original_method_scope);\n }\n }",
"protected function runArgumentMethods()\n\t{\n\t\tforeach ($this->args AS $type => $values)\n\t\t{\n\t\t\tforeach ($values AS $k => $v)\n\t\t\t{\n\t\t\t\t$v = is_numeric($k) ? $v : $k;\n\t\t\t\t$method = substr($type,0,-1) . ucfirst(strtolower($v));\n\t\t\t\t\n\t\t\t\tif (method_exists($this, $method))\n\t\t\t\t{\n\t\t\t\t\tcall_user_func(array($this, $method));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function analyzeCallableWithArgumentTypes(\n array $argument_types,\n FunctionInterface $method,\n array $arguments = [],\n bool $erase_old_return_type = false\n ): void {\n $method = $this->findDefiningMethod($method);\n if (!$method->needsRecursiveAnalysis()) {\n return;\n }\n\n // Don't re-analyze recursive methods. That doesn't go well.\n if ($this->context->isInFunctionLikeScope()\n && $method->getFQSEN() === $this->context->getFunctionLikeFQSEN()\n ) {\n return;\n }\n foreach ($argument_types as $i => $type) {\n $argument_types[$i] = $type->withStaticResolvedInContext($this->context);\n }\n\n $original_method_scope = $method->getInternalScope();\n $method->setInternalScope(clone $original_method_scope);\n try {\n // Even though we don't modify the parameter list, we still need to know the types\n // -- as an optimization, we don't run quick mode again if the types didn't change?\n $parameter_list = \\array_map(static function (Parameter $parameter): Parameter {\n return clone $parameter;\n }, $method->getParameterList());\n\n foreach ($parameter_list as $i => $parameter_clone) {\n if (!isset($argument_types[$i]) && $parameter_clone->hasDefaultValue()) {\n $parameter_type = $parameter_clone->getDefaultValueType()->withRealTypeSet($parameter_clone->getNonVariadicUnionType()->getRealTypeSet());\n if ($parameter_type->isType(NullType::instance(false))) {\n // Treat a parameter default of null the same way as passing null to that parameter\n // (Add null to the list of possibilities)\n $parameter_clone->addUnionType($parameter_type);\n } else {\n // For other types (E.g. string), just replace the union type.\n $parameter_clone->setUnionType($parameter_type);\n }\n }\n\n // Add the parameter to the scope\n $method->getInternalScope()->addVariable(\n $parameter_clone->asNonVariadic()\n );\n\n // If there's no parameter at that offset, we may be in\n // a ParamTooMany situation. That is caught elsewhere.\n if (!isset($argument_types[$i])\n || !$parameter_clone->hasEmptyNonVariadicType()\n ) {\n continue;\n }\n\n $this->updateParameterTypeByArgument(\n $method,\n $parameter_clone,\n $arguments[$i] ?? null,\n $argument_types,\n $parameter_list,\n $i\n );\n }\n foreach ($parameter_list as $parameter_clone) {\n if ($parameter_clone->isVariadic()) {\n // We're using this parameter clone to analyze the **inside** of the method, it's never seen on the outside.\n // Convert it immediately.\n // TODO: Add tests of variadic references, fix those if necessary.\n $method->getInternalScope()->addVariable(\n $parameter_clone->cloneAsNonVariadic()\n );\n }\n }\n\n // Now that we know something about the parameters used\n // to call the method, we can reanalyze the method with\n // the types of the parameter\n if ($erase_old_return_type) {\n $method->setUnionType($method->getOriginalReturnType());\n }\n $method->analyzeWithNewParams($method->getContext(), $this->code_base, $parameter_list);\n } finally {\n $method->setInternalScope($original_method_scope);\n }\n }",
"public function getMethodArgument($argumentName);",
"private function is_argument($line) {\n\t\treturn preg_match('/^' . $this->argument . '/', $line);\n\t}",
"private static function checkArgument($methodName, $arg, $expectedType, \n\t\t$index=1,$isArray=false){\n\t\t$actType=strtolower(gettype($methodName));\n\t\tif ( $actType != \"string\" ){\n\t\t\tthrow new \\InvalidArgumentException(\"Argument number 1 of the \".\n\t\t\t\t\"`ClassHelper::checkAllArguments` method should be an instance of string. \".\n\t\t\t\t$actType.\" given.\");\n\t\t}\n\t\t$actType=strtolower(gettype($expectedType));\n\t\tif( $actType != \"string\" ){\n\t\t\tthrow new \\InvalidArgumentException(\"Argument number 3 of the \".\n\t\t\t\t\"`ClassHelper::checkAllArguments` method should be an instance of string. \".\n\t\t\t\t$actType.\" given.\");\n\t\t}\n\t\t$actType=strtolower(gettype($index));\n\t\tif( $actType != \"integer\" ){\n\t\t\tthrow new \\InvalidArgumentException(\"Argument number 4 of the \".\n\t\t\t\t\"`ClassHelper::checkAllArguments` method should be an instance of integer. \".\n\t\t\t\t$actType.\" given.\");\n\t\t}\n\n\t\t\n\t\t$typeArray=explode(\"|\",$expectedType);\n\t\t$typeMatch=false;\n\t\t$actType=strtolower(gettype($arg));\n\n\t\t// If the expected type for this item is 'efg|array|abc', and the actual type \n\t\t// is an array, then ensure that it is an array of 'efg|abc' type elements.\n\t\t//\n\t\t// If the expected type is simply 'array', then it is allowed to be an \n\t\t// array of anything. Therefore, don't check the elements.\n\t\t//\n\t\t// If the array is empty, don't check any of its elements.\n\t\tif ( $actType == 'array' AND $expectedType != 'array' AND count($arg)>0 ){\n\t\t\t$expectedElementType=\"\";\n\t\t\tforeach ( $typeArray as $type ){\n\t\t\t\tif ( $type != 'array' ){\n\t\t\t\t\t$expectedElementType = ($expectedElementType==\"\") ? $type : $expectedElementType . '|' . $type;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$expectedElementTypeArray=array();\n\t\t\tforeach ( $arg as $key=>$argElement ){\n\t\t\t\t$expectedElementTypeArray[$key]=$expectedElementType;\n\t\t\t}\n\t\t\tself::checkAllArguments($methodName,$arg,$expectedElementTypeArray,true);\n\t\t}\n\n\t\tforeach ( $typeArray as $type ){\n\t\t\t// jih: if ( ! is_type( $type ) and `jih: 2:`;\n\t\t\tif ( $actType==$type || $type==\"mixed\" ){ \n\t\t\t\t$typeMatch=true;\n\t\t\t} elseif ( ! $typeMatch ) {\n\t\t\t\t$interfaceArray=explode(\"&\",$type);\n\t\t\t\t$typeMatch = true;\n\t\t\t\tforeach ( $interfaceArray as $interface ){\n\t\t\t\t\t// jih: 2: if ( ! is_interface( $interface )) error;\n\t\t\t\t\tif ( ! $arg instanceof $interface ){\n\t\t\t\t\t\t$typeMatch=false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $typeMatch ){\n\t\t\tif( $isArray ){\n\t\t\t\t$errorString=\"Argument number \".$index.\" of the `\".$methodName.\"` method should be an array of \".$expectedType.\". An array with element \".$actType.\" given\";\n\t\t\t}else{\n\t\t\t\t$errorString=\"Argument number \".$index.\" of the `\".$methodName.\"` method should be an instance of \".$expectedType.\". \".$actType.\" given\";\n\t\t\t}\n\n\t\t\tif( $actType==\"object\" ) {\n\t\t\t\t$errorString=$errorString.\" which implements \".print_r( class_implements($arg), true );\n\t\t\t}else{\n\t\t\t\t$errorString=$errorString.\".\";\n\t\t\t}\n\t\t\t$errorString=$errorString.\"\\narg = \".var_export($arg,true);\n\t\t\t throw new \\InvalidArgumentException( $errorString );\n\t\t}\n\n\t}",
"static function GENERATE_CPP_JSARG_TYPE_CHECK($type, $argIndex, $methodName, $justReturnConditionBlock = false) {\n $gaurd = '';\n switch($type)\n {\n case 'int':\n case 'ofScaleMode':\n case 'ofAspectRatioMode':\n case 'ofAlignHorz':\n case 'ofAlignVert':\n $gaurd = 'args['.$argIndex.']->IsInt32()';\n break;\n case 'size_t':\n $gaurd = 'args['.$argIndex.']->IsUint32()';\n break;\n case 'ofPoint':\n case 'ofVec3f':\n case 'const ofVec3f &':\n case '::ofVec3f':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'ofVec3f');\n break;\n case 'const ofVec2f &':\n case 'ofVec2f':\n case '::ofVec2f':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'ofVec2f');\n break;\n case 'const ofVec4f &':\n case 'ofVec4f':\n case '::ofVec4f':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'ofVec4f');\n break;\n case '::ofRectangle':\n case 'const ofRectangle &':\n case 'ofRectangle':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'ofRectangle');\n break;\n case '::ofMatrix4x4':\n case 'ofMatrix4x4':\n case 'const ofMatrix4x4 &':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'ofMatrix4x4');\n break;\n case 'const ofQuaternion &':\n case 'ofQuaternion':\n case '::ofQuaternion':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'ofQuaternion');\n break;\n case 'float const * const':\n $gaurd = self::NOFX_INTERNAL_TYPE_CHECK($argIndex, 'floatPtr');\n break;\n case 'float':\n case 'double':\n $gaurd = 'args['.$argIndex.']->IsNumber()';\n break;\n default:\n throw new Exception('Arg guard can\\'t be generated. Type is: ['.$type.']');\n break;\n }\n if ($justReturnConditionBlock) {\n return \"({$gaurd})\";\n }\n $msg = Messages::Format(Messages::CPP_JSARG_TYPE_CHECK_FAILED, array(\n 'index' => $argIndex,\n 'method' => $methodName,\n 'type' => $type,\n ));\n $tmpl = <<<TPL\nif(!({$gaurd})) {\n NanThrowTypeError(\"{$msg}\");\n}\n\nTPL;\n return $tmpl;\n }",
"public function getMethodArgument($name);",
"protected function initializeCommandMethodArguments()\n {\n $this->arguments->removeAll();\n $methodParameters = $this->commandManager->getCommandMethodParameters(get_class($this), $this->commandMethodName);\n\n foreach ($methodParameters as $parameterName => $parameterInfo) {\n $dataType = null;\n if (isset($parameterInfo['type'])) {\n $dataType = $parameterInfo['type'];\n } elseif ($parameterInfo['array']) {\n $dataType = 'array';\n }\n if ($dataType === null) {\n throw new InvalidArgumentTypeException(sprintf('The argument type for parameter $%s of method %s->%s() could not be detected.', $parameterName, get_class($this), $this->commandMethodName), 1306755296);\n }\n $defaultValue = (isset($parameterInfo['defaultValue']) ? $parameterInfo['defaultValue'] : null);\n $this->arguments->addNewArgument($parameterName, $dataType, ($parameterInfo['optional'] === false), $defaultValue);\n }\n }",
"public function addMethodArgument($argument)\n {\n $this->methodArguments[] = $argument;\n }",
"public function scoreArguments(array $arguments) {}",
"public static function check(/** string $type [, string $type [, string $... ]] **/) {\n\t\t$args = func_get_args();\n\t\t$trace = debug_backtrace();\n\t\t$fn = $trace[1];\n\t\t$stop = (count($fn['args']) > count($args)) ? count($args) : count($fn['args']);\n\t\t$i = 0;\n\t\tdo {\n\t\t\tif (($args[$i] != \"mixed\") && (gettype($fn['args'][$i]) != self::$aliases[$args[$i]])) {\n\t\t\t\tthrow new InvalidArgumentException(sprintf(\"Invalid type. Given %s as %s\", gettype($fn['args'][$i]), self::$aliases[$args[$i]]));\n\t\t\t}\n\t\t\t$i++;\n\t\t} while ($i < $stop);\n\t}",
"public function scoreArgument($argument) {}",
"public static function checkAllArguments($methodName, $argArray, $expectedTypeArray);",
"function pfay_log_params($method, $args) {\n list($class, $func) = explode('::', $method);\n $reflMethod = new ReflectionMethod($class, $func);\n foreach ($reflMethod->getParameters() as $param) {\n pfay_log($func . \" param \" . $param->getName(), $args[$param->getPosition()]);\n }\n}",
"protected function PassArguments(ReflectionFunctionAbstract $_callable, array $_args): array {\n\n // index that used to iterate through $_parameters array\n //$i = 0;\n \n $inject = function(ReflectionParameter $_parameter) use (&$_args) {\n \n $param_name = $_parameter->getName();\n\n // resolve when the paramether's name is specified in $_args\n if (array_key_exists($param_name, $_args)) {\n \n if ($_args[$param_name] === null && $_parameter->allowsNull()) {\n $ret = $_args[$param_name];\n\n unset($_args[$param_name]);\n\n return $ret;\n }\n\n $param_type = $_parameter->getType();\n\n //var_dump($_args[$key]);\n if (is_null($param_type)) {\n\n $ret = $_args[$param_name];\n\n unset($_args[$param_name]);\n\n return $ret;\n }\n\n // because ReflectionType::getType() return 'int'\n // and gettype() return 'integer' of type int\n // so we have to convert the result to 'integer' when the parameter's type is int\n $param_type_name = $param_type->getName() === 'int' ? 'integer' : $param_type->getName();\n $argument_type_name = gettype($_args[$param_name]);\n\n if ($param_type_name == $argument_type_name) {\n\n $ret = $_args[$param_name];\n \n unset($_args[$param_name]);\n\n return $ret;\n }\n\n // when parameter's type and argument's type is not the same\n // and argument's type is not object\n // pass null for this parameter\n if ($argument_type_name !== 'object') {\n\n return null;\n }\n \n // when the parameter is not buitin type,\n // Then check if the parameter's class\n // and the argument's class is the same\n $param_class = $_parameter->getClass()->getName();\n $reflection = new ReflectionObject($_args[$param_name]);\n $argument_class = $reflection->getName();\n\n if ($param_class === $argument_class) {\n \n $ret = $_args[$param_name];\n \n unset($_args[$param_name]);\n\n return $ret;\n }\n }\n };\n\n $parameters = $_callable->getParameters();\n\n return array_map($inject , $parameters);\n }",
"public function incrementArgumentPosition()\n {\n $this->argument++;\n }",
"private final function call_user_func_args($method, array $arguments, $validate_input = false) {\n // Make sure the $method actually exists\n if (!method_exists($this, $method)) {\n throw new ParameterException($method . ' is not defined.');\n }\n\n // validate arguments\n foreach ($arguments as $argument_name => $argument_value) {\n if (empty($argument_name) or is_numeric($argument_name)) {\n throw new ParameterException('$Arguments cannot have numeric offsets.');\n }\n if (!preg_match('~^[a-z\\_][a-zA-Z0-9\\_]*$~', $argument_name)) {\n throw new ParameterException('$Arguments contains illegal character offsets. Was given \"' . $argument_name . '\"');\n }\n }\n\n $reflector = new \\ReflectionMethod(get_class($this), $method);\n\n // No arguments, and no required arguments\n $required_parameter_count = $reflector->getNumberOfRequiredParameters();\n if (empty($arguments) && $required_parameter_count == 0) {\n return $this->$method();\n }\n\n // Arguments, but no method arguments\n $parameter_count = $reflector->getNumberOfParameters();\n if (!$parameter_count) {\n return $this->$method();\n }\n\n // Prepare the $Parameters\n $parameters = array();\n foreach ($reflector->getParameters() as $param) {\n $lower_name = strtolower($name = $param->getName());\n $argument = ($available = array_key_exists($name, $arguments)) ? $arguments[$name] : null;\n $default = ($is_default = $param->isDefaultValueAvailable()) ? $param->getDefaultValue() : null;\n $parameters[$lower_name] = array('Name' => $name, 'Offset' => $param->getPosition(), 'Optional' => $param->isOptional(), 'Nullable' => $param->allowsNull(), 'Reference' => $param->isPassedByReference(), 'Array' => $param->isArray(), 'Defaultable' => $is_default, 'Default' => $default, 'Available' => $available, 'Provided' => $available ? $argument : $default,);\n }\n\n // Pop pointless nulls (from the last to the first)\n end($parameters);\n while ($param = current($parameters)) {\n if (!$param['Nullable'] or !$param['Optional'] or !is_null($param['Provided'])) {\n break;\n }\n array_pop($parameters); // Pop trailing null optional nullable arguments\n prev($parameters); // Move one back\n }\n\n // Prepare the final $Arguments\n $arguments = array();\n foreach ($parameters as $name => $param) {\n if ($validate_input) {\n if (is_null($param['Provided']) and !$param['Nullable']) {\n throw new ParameterException(\"Argument '{$name}' does not accept NULL.\");\n }\n if ($param['Array'] and !is_array($param['Provided'])) {\n if (!$param['Nullable'] and is_null($param['Provided'])) {\n throw new ParameterException(\"Argument '{$name}' should be an array.\");\n }\n }\n if (!$param['Available'] and !$param['Optional'] and !$param['Defaultable']) {\n throw new ParameterException(\"Argument '{$name}' is required.\");\n }\n }\n // Store this in the final $Arguments array\n $arguments[] = $param['Provided'];\n }\n // Invoke the actual function\n return $reflector->invokeArgs($this, $arguments);\n }",
"#[@test]\n public function getArgumentTypeForObject() {\n $params= XPClass::forName('net.xp_framework.unittest.rest.server.mock.MockArgs')\n ->newInstance()->getClass()->getMethod('methodWithAnotherArgument')->getParameters();\n $this->args->addArgument('another', $params[0]);\n \n $this->assertEquals(XPClass::forName('lang.Object'), $this->args->getArgumentType('another'));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Retorna o objeto do bairro | public function getBairroObj()
{
return \Endereco\Model\Bairro::findOneByPk($this->getIdBairro());
} | [
"public function getBairro()\n {\n return $this->bairro;\n }",
"public function getBairro()\n\t{\n\t\treturn $this->bairro;\n\t}",
"public function getBarrio()\n {\n return $this->barrio;\n }",
"public function getPlateuObj()\n {\n return (new Recorder(Plateau::$address,Plateau::$maxLength))->get();\n }",
"public function getBairro() {\n return $this->sBairro;\n }",
"public function construct()\n {\n return $this->object;\n }",
"public function getAsObject()\n {\n $this->asObject = true;\n\n return $this->get();\n }",
"public function getObra()\n {\n return $this->hasOne(Obra::className(), ['id' => 'Obra_id']);\n }",
"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 getRotina() {\n return new $this->entity();\n }",
"public function obra()\n {\n return $this->hasOne('App\\Obra', 'id', 'id_obra');\n \n }",
"private function getObject() {\n return $this->object;\n }",
"public function createBenzCar()\n {\n return new BenzBusinessCar();\n }",
"public function getLibro()\n {\n return $this->hasOne(Libro::className(), ['id' => 'libro_id']);\n }",
"public function getObjetivo(){\n return $this->objetivo;\n }",
"public function getBoleta()\r\n {\r\n return $this->Boleta;\r\n }",
"public function getLogradouroBairro() {\n return $this->oLogradouroBairro;\n }",
"public function getBloqueado()\n {\n return $this->bloqueado;\n }",
"public function toObject(): object {\n\t\t\treturn $this->objectResponse();\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Link to prev List View Returns a link to the previous list view page | function tribe_get_listview_prev_link( $term = null ) {
$link = tribe_get_listview_dir_link( 'prev', $term );
return apply_filters( 'tribe_get_listview_prev_link', $link, $term );
} | [
"protected function previousPageAction()\n {\n $this->previousPage();\n return $this->renderForm('list');\n }",
"private function prev() {\n if ($this->currentPage > 1) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage - 1) . '\"><</a></li>';\n }\n }",
"public function prev_link()\n\t{\n\t\treturn $this->link_to_page($this->get_cur_page() - 1);\n\t}",
"function getPrev()\n {\n if ($this->page > 1) \n {\n $screen = $this->page - 1;\n $go = $this->url.\"&screen=\".$screen;\n return '<a href=\"'.$go.'\"><b><</b></a> ';\n }\n }",
"function prev_page_link()\n \t{\n \t\t$uri = $this->uri->copy();\n \t\t$uri->query->set_value('page',$this->current_page-1);\n \t\t\n \t\treturn $uri->build();\n \t}",
"public function getPreviousLink()\n {\n return $this->getLink('previous');\n }",
"function prev()\n\t{\n\t\t$page=($this->page==1)?1:$this->page-1;\n\t\tif ($this->page==1) {\n\t\t\t//$prev=$this->getParameter('open_tag').'<a class=\"'.$this->getParameter('class').'\"'.'title=\"'.$this->getParameter('title_previous').'\">'.$this->getParameter('text_prev').\"</a>\".$this->getParameter('close_tag');\n\t\t\t$prev='';\n\t\t} else {\n\t\t\t$prev=$this->getParameter('open_tag').'<a class=\"'.$this->getParameter('class').'\"'.'title=\"'.$this->getParameter('title_previous').'\"'.\"href='\".$this->url.\"$page'>\".$this->getParameter('text_prev').\"</a>\".$this->getParameter('close_tag');\n\t\t\n\t\t}\n\t\treturn $prev;\n\t}",
"public function getPreviousPage();",
"public function prevUrl()\n {\n $prev = $this->current() - 1;\n return ($prev > 0 && $prev < $this->pages()) ? $this->parseUrl($prev) : \"\";\n }",
"function previousNext()\r\n\t{\r\n\t\tif($this->getPrevious())\r\n\t\t{\r\n\t\t\techo \"<a href=\\\"\" . $this->getPageName() . \"?\".$this->request.\"page=\" . $this->getPrevious() . \"\\\">Previous</a> \";\r\n\t\t}\r\n\t\t\r\n\t\t$links = $this->getLinkArr();\r\n\t\tforeach($links as $link)\r\n\t\t{\r\n\t\t\tif($link == $this->getCurrent()) {\r\n\t\t\t\techo \" $link \";\r\n\t\t\t} \r\n\t\t\telse { \r\n\t\t\t\techo \"<a href=\\\"\" . $this->getPageName() . \"?\".$this->request.\"page=$link\\\">\" . $link . \"</a> \";\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t\tif($this->getNext())\r\n\t \t{\r\n\t \t\techo \"<a href=\\\"\" . $this->getPageName() . \"?\".$this->request.\"page=\" . $this->getNext() . \"\\\">Next</a> \";\r\n\t \t}\r\n\t}",
"function previousNext()\n\t\t\t\t{\n\t\t\t\t\tif($this->getPrevious())\n\t\t \t{\n\t\t\t echo \"<a href=\\\"\" . $this->getPageName() . \"?page=\" . $this->getPrevious() . \"\\\">Previous</a> \";\n\t\t\t }\n\t\t\t\t\t\t$links = $this->getLinkArr();\n\t\t\t foreach($links as $link)\n\t \t{\n\t\t \tif($link == $this->getCurrent())\n\t\t\t\t\t {\n\t\t\t\t\t echo \" $link \";\n\t\t\t\t\t } else { echo \"<a href=\\\"\" . $this->getPageName() . \"?page=$link\\\">\" . $link . \"</a> \";\n\t\t\t\t\t }\n\t\t\t } \n\t\t\t\tif($this->getNext())\n\t\t\t {\n\t\t \t echo \"<a href=\\\"\" . $this->getPageName() . \"?page=\" . $this->getNext() . \"\\\">Next</a> \";\n\t\t \t}\n\t\t }",
"public function setUrlPrevious ();",
"public function getPreviousUrl() {\n return $this->get(self::PREVIOUS);\n }",
"public function previousPage()\n {\n if ($this->page > 1) {\n $this->page = $this->page - 1;\n }\n }",
"protected function previousPageURI()\n\t{\n\t\treturn ($this->getNeighborURI(\"prev\"));\n\t}",
"public function prevChapter() {\n\t\t// link to the previous chapter\n\t\t$prevChapterLink = $this->page->parent->url;\n\t\tif(($this->arrKey-1) != -1)\n\t\t{\n\t\t\t// previous chapter object\n\t\t\t$prevChapter = $this->wire(\"pages\")->get(\"template=wm_chapters, parent=/manga/{$this->page->parent->name}/, name=\" . $this->chapters[$this->arrKey-1]);\n\t\t\t// previous chapter last image link\n\t\t\t$prevChapterImageCount = $prevChapter->wm_chapter_images->count;\n\t\t\t$prevChapterLink = $prevChapter->url . ($prevChapterImageCount);\n\t\t}\n\t\treturn $prevChapterLink;\n\t}",
"public function get_prev_url() {\n\t\t$current = $this->get_current_step();\n\t\t$steps = $this->get_step_keys();\n\t\t$at = array_search( $current, $steps );\n\t\tif ( $at > 0 ) {\n\t\t\t$at --;\n\t\t}\n\n\t\treturn add_query_arg( 'step', $steps[ $at ], admin_url( $this->_base_url ) );\n\t}",
"public function previousUrl()\n {\n return $this->get('_previous.url');\n }",
"public static function prev() {\n $prev = static::num_saved_urls() - 2;\n return static::url($prev);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The default/fallback Image object or absolute URL to be used in the 'og:image' open graph tag. | public function getDefaultOGImage()
{
// We don't want to use the SilverStripe logo, so let's use a favicon if available.
return (file_exists(BASE_PATH . '/apple-touch-icon.png'))
? Director::absoluteURL('apple-touch-icon.png', true)
: false;
} | [
"public function getOgImage()\n {\n if ($ogImage = $this->getPropertyTranslated('og_ref_image')) {\n return $ogImage;\n }\n\n if ($ogImage = $this->getPropertyTranslated('og_image')) {\n return MediaLibrary::instance()->getPathUrl($ogImage);\n }\n\n return $this->getSiteImageFromSettings();\n }",
"public function getOGImageURL()\n {\n /** =========================================\n * @var OpenGraphSiteConfigExtension $siteConfig\n * ========================================*/\n\n $siteConfig = SiteConfig::current_site_config();\n\n if ($this->owner->OGImage() && $this->owner->OGImage()->exists()) {\n return $this->owner->OGImage()->Fit(1200, 630)->AbsoluteURL;\n } elseif ($firstImage = $this->owner->getFirstImage()) {\n return Controller::join_links(Director::absoluteBaseURL(), $firstImage);\n } elseif ($siteConfig->DefaultOpenGraphImage() && $siteConfig->DefaultOpenGraphImage()->exists()) {\n return $siteConfig->DefaultOpenGraphImage()->Fit(1200, 630)->AbsoluteURL;\n }\n\n return '';\n }",
"private function get_default_image() {\n\t\tif ( count( $this->images ) === 0 && WPSEO_Options::get( 'og_default_image', '' ) !== '' ) {\n\t\t\t$this->add_image( WPSEO_Options::get( 'og_default_image' ) );\n\t\t}\n\t}",
"public function getDefaultImageUrl()\r\n {\r\n return $this->getViewFileUrl('Mageplaza_Blog::media/images/mageplaza-logo-default.png');\r\n }",
"function getDefaultImageUrl()\n\t{\n\t\treturn $this->getViewFileUrl('Mageplaza_Blog::media/images/Mageplaza-logo.png');\n\t}",
"function default_single_og_image( $media, $post_id, $args ) {\n\tif ( $media ) {\n\t\treturn $media;\n\t}\n\n\tif ( has_site_icon() ) {\n\t\t$image_url = get_site_icon_url();\n\t} else if ( has_header_image() ) {\n\t\t$image_url = get_header_image();\n\t} else {\n\t\t$image_url = default_og_image();\n\t}\n\n\treturn array( array(\n\t\t'type' => 'image',\n\t\t'from' => 'custom_fallback',\n\t\t'src' => esc_url( $image_url ),\n\t\t'href' => get_permalink( $post_id ),\n\t) );\n}",
"public static function getDefaultImageUrl() {\n return APP_PLUGIN_URL . 'assets/images/default-image.jpg';\n }",
"function get_meta_image($url_image_facebook = False)\n{\n if ($url_image_facebook) {\n return '<meta property=\"og:image\" content=\"' . $url_image_facebook . '\" />';\n }\n $default_url = base_url().\"uploads/resize/pagina_producto/visualizador/default.jpg\";\n return '<meta property=\"og:image\" content=\"' . $default_url . '\" />';\n}",
"public function getImage()\n {\n return $this->getTag('og.image');\n }",
"public function getDefaultImage()\n {\n return $this->defaultImage;\n }",
"public function getDefaultImage()\n {\n return $this->sDefaultImage;\n }",
"public function getDefaultImage()\n\t{\n\t\treturn $this->default_image;\n\t}",
"function default_og_image() {\n\treturn 'https://s.w.org/images/backgrounds/wordpress-bg-medblue.png';\n}",
"public function defaultPhoto()\n {\n if ($this->photos()->count()) {\n return $this->photos->first()->image;\n }\n\n return '';\n }",
"public function getDefaultImage();",
"public function getDefaultImage(): ?string\n {\n return $this->defaultImage;\n }",
"public static function defaultMetaImage()\n {\n $page = Grav::instance()['admin']->page(true);\n $meta_image = null;\n\n if (!empty($page->value('media.image'))) {\n $images = $page->media()->images();\n $first_image = array_shift($images);\n $meta_image = basename($first_image->url());\n }\n\n return $meta_image;\n }",
"public function wpseo_opengraph_image( $url ) {\n\t\tglobal $post;\n\n\t\tif ( ! isset( $post ) ) {\n\t\t\treturn $url;\n\t\t}\n\t\t\n\t\tif ( is_singular( 'aiovg_videos' ) ) {\n\t\t\t$image = get_post_meta( $post->ID, '_yoast_wpseo_opengraph-image', true );\n\n\t\t\tif ( empty( $image ) ) {\n\t\t\t\t$image_url = get_post_meta( $post->ID, 'image', true );\n\t\t\t\t$image_id = get_post_meta( $post->ID, 'image_id', true );\n\n\t\t\t\t$image = aiovg_get_image_url( $image_id, 'large', $image_url );\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! empty( $image ) && 'placeholder-image.png' != basename( $image ) ) {\n\t\t\t\t$url = $image;\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\t$page_settings = get_option( 'aiovg_page_settings' );\n\n\t\t\tif ( $post->ID == $page_settings['category'] ) {\t\t\t\n\t\t\t\tif ( $slug = get_query_var( 'aiovg_category' ) ) {\n\t\t\t\t\t$term = get_term_by( 'slug', $slug, 'aiovg_categories' );\n\t\t\t\t\t$meta = get_option( 'wpseo_taxonomy_meta' );\n\t\t\t\t\t$image = '';\n\n\t\t\t\t\tif ( array_key_exists( 'aiovg_categories', $meta ) ) { // Get custom share image from Yoast\n\t\t\t\t\t\tif ( array_key_exists( $term->term_id, $meta['aiovg_categories'] ) ) {\n\t\t\t\t\t\t\tif ( array_key_exists( 'wpseo_opengraph-image', $meta['aiovg_categories'][ $term->term_id ] ) ) {\n\t\t\t\t\t\t\t\t$image = $meta['aiovg_categories'][ $term->term_id ]['wpseo_opengraph-image'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( empty( $image ) ) {\n\t\t\t\t\t\t$image_id = get_term_meta( $term->term_id, 'image_id', true );\n\t\t\t\t\t\t$image = aiovg_get_image_url( $image_id, 'large', $url );\n\t\t\t\t\t}\n\n\t\t\t\t\t$url = $image;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t// Return\n\t\treturn $url;\n\t}",
"public function DefaultImageLink()\n {\n if ($this->DefaultProductImageID) {\n $defaultImage = $this->DefaultProductImage();\n if ($defaultImage && $defaultImage->exists()) {\n return $defaultImage->Link();\n }\n }\n\n return 'ecommerce/images/productPlaceHolderThumbnail.gif';\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.