query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Insert given block $id after $target.
public function insertAfterBlock ($target, $id, $options=[]){ $this->layout->set($id, $options); $this->layout->afterBlockResolve($target, function ($ev, Layout $layout) use($target, $id) { $layout->resolve($id); }); $this->layout->afterBlockRender($target, function ($ev, Layout $layout) use($target, $id) { $block = $layout->registry->get($target); if ($block) { $block->body = $block->body.$layout->getContent($id); } else { // @todo issue warning } $parent = $layout->registry->getParent($target); if ($parent) { $parent->registerDisplayedBlockAfter($target, $id, true); $block = $layout->registry->get($id); if ($block) { $block->setParentRenderBlock($parent->id); } } else { // @todo issue warning } }); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertBeforeBlock ($beforeTarget, $id, $options=[]){\n $this->layout->set($id, $options);\n $this->layout->beforeBlockResolve($beforeTarget, function ($ev, Layout $layout) use($beforeTarget, $id) {\n $layout->resolve($id);\n });\n $this->layout->afterBlockRender($beforeTarget, function ($ev, Layout $layout) use($beforeTarget, $id) {\n $block = $layout->registry->get($beforeTarget);\n if ($block) {\n $block->body = $layout->getContent($id).$block->body;\n }\n $parent = $layout->registry->getParent($beforeTarget);\n if ($parent) {\n $parent->registerDisplayedBlockAfter($beforeTarget, $id, true);\n $block = $layout->registry->get($id);\n if ($block) {\n $block->setParentRenderBlock($parent->id);\n }\n }\n });\n return $this;\n }", "public function add($user, $target) {\r\n $this->requireAuthentication();\r\n \r\n return $this->makeRequest('put', \"/users/{$user}/blocks/{$target}\");\r\n }", "public function insertAfter ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class() === 'XDTNodeList') $target[0]->parentNode->insertBefore($node, $target[0]->nextSibling);\r\n\t\t\t\telse $target->parentNode->insertBefore($node, $target->nextSibling); \r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function insert_as_last_child($target)\n {\n $target = $this->parent_from($target, $this->primary_column);\n return $this->insert($target, $this->right_column, 0, 1);\n }", "public function insertAfter($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->rightAttribute} + 1, 0, $runValidation, $attributes);\n }", "public function parseInsertion(string $target, array $params);", "public function insert_as_next_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->right_column, 1, 0);\n }", "public function moveAfter($target) {\n return $this->moveNode($target, $target->{$this->rightAttribute} + 1, 0);\n }", "protected function registerAfterAdvice($id, $target, $macro, $sortOrder = 10)\n {\n $this->app['aspect']->after($id, $target, $macro, $sortOrder);\n }", "protected function moveNext($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_shift($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 0);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($a_id, $target_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t// only if current page is not \"deleted\"\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$this->current_page++;\n\t\t\t}\n\t\t}\n\t}", "public function insertAsLastChildOf(Doctrine_Record $dest);", "public function insert_as_first_child($target)\n {\n $target = $this->parent_from($target);\n return $this->insert($target, $this->left_column, 1, 1);\n }", "public function moveAfter($target)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif($owner->getIsNewRecord())\n\t\t\tthrow new CException(Yii::t('yiiext','The node should not be new record.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isDescendantOf($owner))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be descendant.'));\n\n\t\tif($target->isRoot())\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be root.'));\n\n\t\tif($this->hasManyRoots && $owner->{$this->rootAttribute}!==$target->{$this->rootAttribute})\n\t\t\treturn $this->moveBetweenTrees($target,$target->{$this->rightAttribute}+1,$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t\telse\n\t\t\treturn $this->moveNode($target->{$this->rightAttribute}+1,$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t}", "public function add_content($target,$content)\n \t{\n \t\t$this->content[$target][]=$content;\n \t}", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "public function moveBlock(Block $block, Block $targetBlock, string $placeholder, int $position): void\n {\n $query = $this->connection->createQueryBuilder();\n\n $query\n ->update('ngbm_block')\n ->set('position', ':position')\n ->set('parent_id', ':parent_id')\n ->set('placeholder', ':placeholder')\n ->where(\n $query->expr()->eq('id', ':id')\n )\n ->setParameter('id', $block->id, Type::INTEGER)\n ->setParameter('position', $position, Type::INTEGER)\n ->setParameter('parent_id', $targetBlock->id, Type::INTEGER)\n ->setParameter('placeholder', $placeholder, Type::STRING);\n\n $this->applyStatusCondition($query, $block->status);\n\n $query->execute();\n\n $depthDifference = $block->depth - ($targetBlock->depth + 1);\n\n $query = $this->connection->createQueryBuilder();\n\n $query\n ->update('ngbm_block')\n ->set('layout_id', ':layout_id')\n ->set('depth', 'depth - :depth_difference')\n ->set('path', 'replace(path, :old_path, :new_path)')\n ->where(\n $query->expr()->like('path', ':path')\n )\n ->setParameter('layout_id', $targetBlock->layoutId, Type::INTEGER)\n ->setParameter('depth_difference', $depthDifference, Type::INTEGER)\n ->setParameter('old_path', $block->path, Type::STRING)\n ->setParameter('new_path', $targetBlock->path . $block->id . '/', Type::STRING)\n ->setParameter('path', $block->path . '%', Type::STRING);\n\n $this->applyStatusCondition($query, $block->status);\n\n $query->execute();\n }", "public function insert($sessionTarget);", "protected function registerAroundAdvice($id, $target, $macro, $sortOrder = 10)\n {\n $this->app['aspect']->around($id, $target, $macro, $sortOrder);\n }", "public function insertAsNextSiblingOf(Doctrine_Record $dest);", "public function insertAfter($target,$runValidation=true,$attributes=null)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif(!$owner->getIsNewRecord())\n\t\t\tthrow new CDbException(Yii::t('yiiext','The node cannot be inserted because it is not new.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isRoot())\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be root.'));\n\n\t\tif($runValidation && !$owner->validate())\n\t\t\treturn false;\n\n\t\tif($this->hasManyRoots)\n\t\t\t$owner->{$this->rootAttribute}=$target->{$this->rootAttribute};\n\n\t\t$owner->{$this->levelAttribute}=$target->{$this->levelAttribute};\n\t\t$key=$target->{$this->rightAttribute}+1;\n\n\t\treturn $this->addNode($key,$attributes);\n\t}", "public function moveAsLast($target)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif($owner->getIsNewRecord())\n\t\t\tthrow new CException(Yii::t('yiiext','The node should not be new record.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isDescendantOf($owner))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be descendant.'));\n\n\t\tif($this->hasManyRoots && $owner->{$this->rootAttribute}!==$target->{$this->rootAttribute})\n\t\t\treturn $this->moveBetweenTrees($target,$target->{$this->rightAttribute},$target->{$this->levelAttribute}-$owner->{$this->levelAttribute}+1);\n\t\telse\n\t\t\treturn $this->moveNode($target->{$this->rightAttribute},$target->{$this->levelAttribute}-$owner->{$this->levelAttribute}+1);\n\t}", "public function moveAsLast($target) {\n return $this->moveNode($target, $target->{$this->rightAttribute}, 1);\n }", "public function add_block_from_stack($end_offset = \\null)\n {\n }", "private function insert_target_grade()\r\n {\r\n global $DB;\r\n $params = $this->get_params();\r\n $this->id = $DB->insert_record('block_bcgt_target_grades', $params);\r\n }", "public function insertAfter($idElementRef, $tagNewElement, $idNewElement) {\n\n\t\t$this->response->insertAfter($idElementRef, $tagNewElement, $idNewElement);\n\t}", "public function addInsertBlocks() {\n foreach ($this->_explodedBody as $key => $paragraph) {\n if (isset($this->_inserts[$key])) {\n $this->_body = str_replace($paragraph . '</p>', $paragraph . $this->_explodeTag . $this->_inserts[$key], $this->_body);\n }\n else {\n $this->_body = str_replace($paragraph . '</p>', $paragraph . $this->_explodeTag, $this->_body);\n }\n }\n\n $this->_insertedBody = $this->_body;\n\n }", "public function after_insert() {}", "public function move_to_last_child($target)\n {\n $target = $this->parent_from($target, $this->primary_column);\n return $this->move($target, FALSE, 0, 1, TRUE);\n }", "public function replicate($target, $id = null)\n {\n if (is_null($id)) {\n $id = HTTP_Session2::id();\n }\n\n // Check if table row already exists\n $query = sprintf(\"SELECT COUNT(id) FROM %s WHERE id = %s\",\n $target,\n $this->_db->quoteSmart(md5($id)));\n $result = $this->_db->getOne($query);\n if (DB::isError($result)) {\n new DB_Error($result->code, PEAR_ERROR_DIE);\n return false;\n }\n\n // Insert new row into target table\n if (0 == intval($result)) {\n $query = \"INSERT INTO $target SELECT * FROM\";\n $query .= \" \" . $this->options['table'];\n $query .= \" WHERE id = \" . $this->_db->quoteSmart(md5($id));\n } else {\n // Update existing row\n $query = \"UPDATE $target dst,\";\n $query .= \" \" . $this->options['table'];\n $query .= \" src SET dst.expiry = src.expiry,\";\n $query .= \" dst.data = src.data\";\n $query .= \" WHERE dst.id = src.id\";\n $query .= \" AND src.id = \" . $this->_db->quoteSmart(md5($id));\n }\n\n $result = $this->_db->query($query);\n if (DB::isError($result)) {\n new DB_Error($result->code, PEAR_ERROR_DIE);\n return false;\n }\n\n return true;\n }", "function insertQuestionblock($questionblock_id) \n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.title, svy_qblk.show_questiontext, svy_qblk.show_blocktitle,\".\n\t\t\t\" svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst, svy_svy_qst\".\n\t\t\t\" WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi\".\n\t\t\t\" AND svy_svy_qst.question_fi = svy_qblk_qst.question_fi\".\n\t\t\t\" AND svy_qblk.questionblock_id = %s\".\n\t\t\t\" ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($questionblock_id)\n\t\t);\n\t\t$questions = array();\n\t\t$show_questiontext = 0;\n\t\t$show_blocktitle = 0;\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$duplicate_id = $this->duplicateQuestionForSurvey($row[\"question_fi\"]);\n\t\t\tarray_push($questions, $duplicate_id);\n\t\t\t$title = $row[\"title\"];\n\t\t\t$show_questiontext = $row[\"show_questiontext\"];\n\t\t\t$show_blocktitle = $row[\"show_blocktitle\"];\n\t\t}\n\t\t$this->createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions);\n\t}" ]
[ "0.6122838", "0.5998077", "0.5956537", "0.593856", "0.585453", "0.5811107", "0.5688809", "0.5471552", "0.54665357", "0.5428693", "0.53672606", "0.53312707", "0.52666485", "0.5226337", "0.5209901", "0.5179317", "0.51652014", "0.5132075", "0.50668764", "0.50602645", "0.5059369", "0.5050791", "0.5043782", "0.5042574", "0.50410503", "0.5024873", "0.49466723", "0.49209306", "0.4905004", "0.48840472" ]
0.8031932
0
Insert given block $id before $target.
public function insertBeforeBlock ($beforeTarget, $id, $options=[]){ $this->layout->set($id, $options); $this->layout->beforeBlockResolve($beforeTarget, function ($ev, Layout $layout) use($beforeTarget, $id) { $layout->resolve($id); }); $this->layout->afterBlockRender($beforeTarget, function ($ev, Layout $layout) use($beforeTarget, $id) { $block = $layout->registry->get($beforeTarget); if ($block) { $block->body = $layout->getContent($id).$block->body; } $parent = $layout->registry->getParent($beforeTarget); if ($parent) { $parent->registerDisplayedBlockAfter($beforeTarget, $id, true); $block = $layout->registry->get($id); if ($block) { $block->setParentRenderBlock($parent->id); } } }); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insertAfterBlock ($target, $id, $options=[]){\n $this->layout->set($id, $options);\n $this->layout->afterBlockResolve($target, function ($ev, Layout $layout) use($target, $id) {\n $layout->resolve($id);\n });\n $this->layout->afterBlockRender($target, function ($ev, Layout $layout) use($target, $id) {\n $block = $layout->registry->get($target);\n if ($block) {\n $block->body = $block->body.$layout->getContent($id);\n } else {\n // @todo issue warning\n }\n $parent = $layout->registry->getParent($target);\n if ($parent) {\n $parent->registerDisplayedBlockAfter($target, $id, true);\n $block = $layout->registry->get($id);\n if ($block) {\n $block->setParentRenderBlock($parent->id);\n }\n } else {\n // @todo issue warning\n }\n });\n return $this;\n }", "public function insertBefore ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class() === 'XDTNodeList') $target[0]->parentNode->insertBefore($node, $target[0]);\r\n\t\t\t\telse $target->parentNode->insertBefore($node, $target);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function parseInsertion(string $target, array $params);", "public function insertBefore($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->leftAttribute}, 0, $runValidation, $attributes);\n }", "public function insert_as_first_child($target)\n {\n $target = $this->parent_from($target);\n return $this->insert($target, $this->left_column, 1, 1);\n }", "public function moveBefore($target) {\n return $this->moveNode($target, $target->{$this->leftAttribute}, 0);\n }", "public function insert_as_prev_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->left_column, 0, 0);\n }", "public function insert_as_next_sibling($target)\n {\n $target = $this->parent_from($target, $this->parent_column);\n return $this->insert($target, $this->right_column, 1, 0);\n }", "public function add($user, $target) {\r\n $this->requireAuthentication();\r\n \r\n return $this->makeRequest('put', \"/users/{$user}/blocks/{$target}\");\r\n }", "protected function registerBeforeAdvice($id, $target, $macro, $sortOrder = 10)\n {\n $this->app['aspect']->before($id, $target, $macro, $sortOrder);\n }", "public function moveBefore($target)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif($owner->getIsNewRecord())\n\t\t\tthrow new CException(Yii::t('yiiext','The node should not be new record.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isDescendantOf($owner))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be descendant.'));\n\n\t\tif($target->isRoot())\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be root.'));\n\n\t\tif($this->hasManyRoots && $owner->{$this->rootAttribute}!==$target->{$this->rootAttribute})\n\t\t\treturn $this->moveBetweenTrees($target,$target->{$this->leftAttribute},$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t\telse\n\t\t\treturn $this->moveNode($target->{$this->leftAttribute},$target->{$this->levelAttribute}-$owner->{$this->levelAttribute});\n\t}", "public function prependTo ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target))\r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class($target) === 'XDTNodeList' OR is_array($target)) \r\n\t\t\t\t\tforeach ($target as $t) $t->insertBefore($node, $t->firstChild);\r\n\t\t\t\telse $target->insertBefore($node, $target->firstChild);\r\n\t\t\t\t\r\n\t\treturn $this;\r\n\t}", "public function insertQuestionBlock($a_block_id)\n\t{\n\t\t$new_ids = array();\n\t\t$question_ids = $this->object->getQuestionblockQuestionIds($a_block_id);\n\t\tforeach($question_ids as $qid)\n\t\t{\n\t\t\t$new_ids[] = $this->appendNewQuestionToSurvey($qid, true, true);\n\t\t}\n\t\t\n\t\tif(sizeof($new_ids))\n\t\t{\n\t\t\t$this->object->loadQuestionsFromDb();\n\t\t\t\n\t\t\t$pos = $_REQUEST[\"pgov_pos\"];\n\t\t\n\t\t\t// a[fter]/b[efore] on same page\n\t\t\tif(substr($pos, -1) != \"c\")\n\t\t\t{\n\t\t\t\t// block handling\n\t\t\t\t$current = $this->object->getSurveyPages();\n\t\t\t\t$current = $current[$this->current_page-1];\n\t\t\t\tif(sizeof($current) == 1)\n\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// as questions are moved to first block question\n\t\t\t\t\t// always use existing as first\n\t\t\t\t\t// the new question is moved later on (see below)\n\t\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t\tarray((int)$pos)+$new_ids);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$block_id = array_pop($current);\n\t\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t\tforeach($new_ids as $qid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->object->addQuestionToBlock($qid, $block_id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// c: as new page (from toolbar/pool)\n\t\t\telse\n\t\t\t{\n\t\t\t\t// re-create block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\t\t\t\t$new_ids);\n\t\t\t\t\n\t\t\t\t// after given question\n\t\t\t\tif((int)$pos)\n\t\t\t\t{\n\t\t\t\t\t$pos = (int)$pos.\"a\";\n\t\t\t\t}\n\t\t\t\t// at the beginning\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$first = $this->object->getSurveyPages();\n\t\t\t\t\t$first = $first[0];\n\t\t\t\t\t$first = array_shift($first);\n\t\t\t\t\t$pos = $first[\"question_id\"].\"b\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move to target position\n\t\t\t$this->object->moveQuestions($new_ids, (int)$pos,\n\t\t\t\t((substr($pos, -1) == \"a\") ? 1 : 0));\t\t\t\n\t\t}\n\t}", "public function insert($sessionTarget);", "public function element_move_before($id, $id_target, $inherit_childs = true) {\n global $db;\n\n $source = $this->element_read($id);\n $target = $this->element_read($id_target);\n if ((!$target) || $this->element_is_child($id_target, $id)) {\n $this->error = \"ERR_INVALID_TARGET\";\n return false;\n }\n $target_parent = $this->element_read($target[\"PARENT\"]);\n if (!empty($target_parent[\"KAT_TABLE\"]) && ($source[\"KAT_TABLE\"] != $target_parent[\"KAT_TABLE\"]) &&\n \t\t($target[\"PARENT\"] != $this->tree_get_parent())) {\n $this->error = \"ERR_TABLE_MISMATCH\";\n return false;\n }\n\n $new = array(\n \t\"ID_KAT\" => $id,\n \t\"PARENT\" => $target_parent[\"ID_KAT\"],\n \t\"ORDER_FIELD\" => ($target[\"ORDER_FIELD\"]-1)\n );\n if ($this->updateid = $db->update($this->table, $new)) {\n unset($this->cache_nodes[$this->updateid]);\n if (!$inherit_childs) {\n // Kind-Elemente eine Ebene aufwärts verschieben\n $db->querynow(\"UPDATE `\".$this->table.\"` SET PARENT=\".$source[\"PARENT\"].\", ORDER_FIELD=\".$source[\"ORDER_FIELD\"].\"\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$source[\"ID_KAT\"]);\n } else {\n $this->undo_add_action(\"MOVE\", $id, $target_parent[\"ID_KAT\"], $source[\"PARENT\"]);\n }\n $this->reload = true;\n return true;\n } else {\n $this->error = \"ERR_INSERT_FAILED\";\n return false;\n }\n }", "public function insert_as_last_child($target)\n {\n $target = $this->parent_from($target, $this->primary_column);\n return $this->insert($target, $this->right_column, 0, 1);\n }", "protected function movePrevious($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page-2];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_pop($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 1);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($target_id, $a_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t$this->current_page--;\n\t\t}\n\t}", "public function insertAfter ($target) { \r\n\t\t\r\n\t\tif ($target = $this->process($target)) \r\n\t\t\tforeach ($this as $node) \r\n\t\t\t\tif (get_class() === 'XDTNodeList') $target[0]->parentNode->insertBefore($node, $target[0]->nextSibling);\r\n\t\t\t\telse $target->parentNode->insertBefore($node, $target->nextSibling); \r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function insertAfter($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->rightAttribute} + 1, 0, $runValidation, $attributes);\n }", "public function prependTo($target,$runValidation=true,$attributes=null)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif(!$owner->getIsNewRecord())\n\t\t\tthrow new CDbException(Yii::t('yiiext','The node cannot be inserted because it is not new.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($runValidation && !$owner->validate())\n\t\t\treturn false;\n\n\t\tif($this->hasManyRoots)\n\t\t\t$owner->{$this->rootAttribute}=$target->{$this->rootAttribute};\n\n\t\t$owner->{$this->levelAttribute}=$target->{$this->levelAttribute}+1;\n\t\t$key=$target->{$this->leftAttribute}+1;\n\n\t\treturn $this->addNode($key,$attributes);\n\t}", "public function insertChildBeforeSibling(CategoryTreeNodeInterface $child, $nextSiblingId);", "public function moveBlock(Block $block, Block $targetBlock, string $placeholder, int $position): void\n {\n $query = $this->connection->createQueryBuilder();\n\n $query\n ->update('ngbm_block')\n ->set('position', ':position')\n ->set('parent_id', ':parent_id')\n ->set('placeholder', ':placeholder')\n ->where(\n $query->expr()->eq('id', ':id')\n )\n ->setParameter('id', $block->id, Type::INTEGER)\n ->setParameter('position', $position, Type::INTEGER)\n ->setParameter('parent_id', $targetBlock->id, Type::INTEGER)\n ->setParameter('placeholder', $placeholder, Type::STRING);\n\n $this->applyStatusCondition($query, $block->status);\n\n $query->execute();\n\n $depthDifference = $block->depth - ($targetBlock->depth + 1);\n\n $query = $this->connection->createQueryBuilder();\n\n $query\n ->update('ngbm_block')\n ->set('layout_id', ':layout_id')\n ->set('depth', 'depth - :depth_difference')\n ->set('path', 'replace(path, :old_path, :new_path)')\n ->where(\n $query->expr()->like('path', ':path')\n )\n ->setParameter('layout_id', $targetBlock->layoutId, Type::INTEGER)\n ->setParameter('depth_difference', $depthDifference, Type::INTEGER)\n ->setParameter('old_path', $block->path, Type::STRING)\n ->setParameter('new_path', $targetBlock->path . $block->id . '/', Type::STRING)\n ->setParameter('path', $block->path . '%', Type::STRING);\n\n $this->applyStatusCondition($query, $block->status);\n\n $query->execute();\n }", "public function insertAsFirstChildOf(Doctrine_Record $dest);", "public function insertBefore($target,$runValidation=true,$attributes=null)\n\t{\n\t\t$owner=$this->getOwner();\n\n\t\tif(!$owner->getIsNewRecord())\n\t\t\tthrow new CDbException(Yii::t('yiiext','The node cannot be inserted because it is not new.'));\n\n\t\tif($owner->equals($target))\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be self.'));\n\n\t\tif($target->isRoot())\n\t\t\tthrow new CException(Yii::t('yiiext','The target node should not be root.'));\n\n\t\tif($runValidation && !$owner->validate())\n\t\t\treturn false;\n\n\t\tif($this->hasManyRoots)\n\t\t\t$owner->{$this->rootAttribute}=$target->{$this->rootAttribute};\n\n\t\t$owner->{$this->levelAttribute}=$target->{$this->levelAttribute};\n\t\t$key=$target->{$this->leftAttribute};\n\n\t\treturn $this->addNode($key,$attributes);\n\t}", "protected function moveNext($a_id)\n\t{\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\t\t$target = $pages[$this->current_page];\n\t\tif(sizeof($target))\n\t\t{\n\t\t\t$target_id = $target;\n\t\t\t$target_id = array_shift($target_id);\n\t\t\t$target_block_id = $target_id[\"questionblock_id\"];\n\t\t\t$target_id = $target_id[\"question_id\"];\n\n\t\t\t// nothing to do if no block\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$block_id = $source;\n\t\t\t\t$block_id = array_shift($block_id);\n\t\t\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\t\t\t// source pages block is obsolete\n\t\t\t\tif(sizeof($source) == 2)\n\t\t\t\t{\n\t\t\t\t\t// delete block\n\t\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// remove question from block\n\t\t\t\t\t$this->object->removeQuestionFromBlock($a_id, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// move source question to target\n\t\t\t$this->object->moveQuestions(array($a_id), $target_id, 0);\n\n\t\t\t// new page has no block yet\n\t\t\tif(sizeof($target) < 2)\n\t\t\t{\n\t\t\t\t// create block and move target question and source into block\n\t\t\t\t$this->object->createQuestionblock($this->getAutoBlockTitle(), true, false,\n\t\t\t\t\tarray($a_id, $target_id));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// add source question to block\n\t\t\t\t$this->object->addQuestionToBlock($a_id, $target_block_id);\n\t\t\t}\n\n\t\t\t// only if current page is not \"deleted\"\n\t\t\tif(sizeof($source) > 1)\n\t\t\t{\n\t\t\t\t$this->current_page++;\n\t\t\t}\n\t\t}\n\t}", "public function insertAsPrevSiblingOf(Doctrine_Record $dest);", "protected function registerAroundAdvice($id, $target, $macro, $sortOrder = 10)\n {\n $this->app['aspect']->around($id, $target, $macro, $sortOrder);\n }", "function addItemAtBeginOf(&$target, $item){\n\t\t\t\t\n\t\t\t\tif($target != \"\" && (is_array($item) || $item !== \"\")){\n\t\t\t\t $target = arrayMerge($item, $target);\n\t\t\t\t}\n\t\t\t}", "public function prependTo($target, $runValidation=true, $attributes=null) {\n return $this->addNode($target, $target->{$this->leftAttribute} + 1, 1, $runValidation, $attributes);\n }", "public function insertBefore (DOMNode $newnode , $refnode = null) {}" ]
[ "0.72835696", "0.619182", "0.5970821", "0.59299946", "0.59293926", "0.56704956", "0.56358546", "0.56205475", "0.5582418", "0.5540327", "0.5468629", "0.53650683", "0.5363491", "0.53501904", "0.5336499", "0.53161293", "0.52821857", "0.52744657", "0.52545947", "0.52440816", "0.5191147", "0.5179694", "0.5171945", "0.5139232", "0.5138901", "0.51193494", "0.5104006", "0.50813943", "0.5071169", "0.5063755" ]
0.7175697
1
Return an array of services.
public function getServices(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getServices(): array\n {\n return static::$services;\n }", "public function getServices();", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function getServices()\n {\n return $this->services;\n }", "public function services()\n {\n return $this->belongstomany(Service::class);\n }", "protected function getServices()\n {\n return $this->services;\n }", "public function findServices(): array;", "public function getServices() {\n return $this->services;\n }", "public function getServices() {\n return $this->services;\n }", "public function &getServices(): array {\n return $this->services;\n }", "public function getServices() {\n\n return $this->services;\n\n }", "public function services(): array\n {\n return \\array_merge(\n \\array_keys($this->_services),\n \\array_keys($this->aliases)\n );\n }", "private function get_services() {\n\t\treturn [\n\t\t\tServices\\Language_Loader::class,\n\t\t\tServices\\Setup_Database::class,\n\t\t\tServices\\Scripts_And_Templates::class,\n\t\t\tServices\\Admin_Pages::class,\n\t\t\tServices\\Setup_Settings_Page::class,\n\t\t\tServices\\Loggers_Loader::class,\n\t\t\tServices\\Dropins_Loader::class,\n\t\t\tServices\\Setup_Log_Filters::class,\n\t\t\tServices\\Setup_Pause_Resume_Actions::class,\n\t\t\tServices\\Setup_Purge_DB_Cron::class,\n\t\t\tServices\\API::class,\n\t\t\tServices\\Dashboard_Widget::class,\n\t\t\tServices\\Network_Menu_Items::class,\n\t\t\tServices\\Plugin_List_Link::class,\n\t\t];\n\t}", "public static function get_services()\n {\n $ServicesObj = new Services();\n $Services = array();\n try {\n $stmt = $ServicesObj->read();\n $count = $stmt->rowCount();\n if ($count > 0) {\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n extract($row);\n $p = (object) array(\n \"ServiceID\" => (int) $ServiceID,\n \"ServiceName\" => $ServiceName,\n );\n\n array_push($Services, $p);\n }\n }\n return $Services;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public static function get_services()\n {\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\CustomPostType::class,\n Base\\CustomMetaBox::class,\n Base\\Shortcode::class,\n Base\\Cron::class,\n ];\n }", "public static function get_services(): array\n {\n return [\n Base\\SettingsLinks::class,\n Pages\\Admin::class,\n Base\\Enqueue::class,\n CPT\\EmailCpt::class,\n ];\n }", "public function getServices()\r\n {\r\n if (is_null($this->_services)) {\r\n if ($this->getConfig('auto')) {\r\n $this->_services = array();\r\n $config = Mage::app()->getConfig();\r\n foreach (array('cache', 'full_page_cache', 'fpc') as $cacheType) {\r\n $node = $config->getXpath('global/' . $cacheType . '[1]');\r\n if (isset($node[0]->backend) && in_array((string)$node[0]->backend, array(\r\n 'Cm_Cache_Backend_Redis',\r\n 'Mage_Cache_Backend_Redis'\r\n ))) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__(str_replace('_', ' ', uc_words($cacheType))),\r\n $node[0]->backend_options->server,\r\n $node[0]->backend_options->port,\r\n $node[0]->backend_options->password,\r\n $node[0]->backend_options->database\r\n );\r\n }\r\n }\r\n // get session\r\n $node = $config->getXpath('global/redis_session');\r\n if ($node) {\r\n $this->_services[] = $this->_buildServiceArray(\r\n $this->__('Session'),\r\n $node[0]->host,\r\n $node[0]->port,\r\n $node[0]->password,\r\n $node[0]->db\r\n );\r\n }\r\n } else {\r\n $this->_services = unserialize($this->getConfig('manual'));\r\n }\r\n }\r\n return $this->_services;\r\n }", "public static function get_services() {\n return [ \n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class,\n Base\\JsObjectsManager::class,\n Base\\ShortCodesManager::class\n ];\n }", "public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }", "public function getServices()\n {\n return $this->pantonoServices;\n }", "public function servicesArray()\n {\n return [\n self::PAINTING,\n self::TIRE,\n self::BODY_WORK,\n self::TO,\n self::WASHING,\n ];\n }", "public static function get_services()\n {\n return [\n Pages\\Dashboard::class,\n Base\\Enqueue::class,\n Base\\SettingsLink::class,\n Base\\CustomPostTypeController::class,\n ];\n }", "public function getDeclaredServices(): array\n {\n return [\n // Service id, optional class name, tag\n ['best_it_contentful.markdown.twig_extension', MarkdownExtension::class, 'twig.extension'],\n ['best_it_contentful.contentful.twig_extension', ContentfulExtension::class, 'twig.extension'],\n ['best_it_contentful.delivery.cache.reset_service', CacheResetService::class],\n ['best_it_contentful.delivery.client', ClientDecorator::class],\n ['best_it_contentful.markdown.parser', MarkdownParser::class],\n ['best_it_contentful.delivery.response_parser.default', SimpleResponseParser::class]\n ];\n }", "public static function get_services()\n {\n\n //підключаємо всі необхідні класи для активації через масив\n return [\n Pages\\Admin::class,\n Base\\Enqueue::class,\n Base\\SettingsLinks::class\n ];\n }", "public function listAllAvailableServices()\n {\n\t\t$data = $this->call(array(), \"GET\", \"sensors/services/available.json\");\n\t\t$data = $data->{'services'};\n\t\t$serviceArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$serviceArray->append(new Service($data[$i], $this));\n\t\t}\n\t\treturn $serviceArray;\n }", "public function getServices() {\n $serviceNames = $this->getServiceNames($this->serviceFolderPaths);\n $ret = $ret1 = array();\n// require_once AMFPHP_ROOTPATH.'Plugins/AmfphpDiscovery/CReflection.php';\n foreach ($serviceNames as $serviceName) {\n/* $methods = array();\n $objC = new CReflection(APP_PATH.'/app/controllers/'.$serviceName.'.php');\n $objComment = $objC->getDocComment();\n $arrMethod = $objC->getMethods();\n foreach ($arrMethod as $objMethods)\n {\n $methodComment = $objMethods->getDocComment();\n $parsedMethodComment = $this->parseMethodComment($methodComment);\n $arrParamenter = $objMethods->getParameters();\n foreach ($arrParamenter as $Paramenter)\n {\n $parameterInfo = new AmfphpDiscovery_ParameterDescriptor($Paramenter, '');\n $parameters[] = $parameterInfo;\n }\n $methods[$objMethods->_name] = new AmfphpDiscovery_MethodDescriptor($objMethods->_name, $parameters, $methodComment, $parsedMethodComment['return']);\n }\n\n $ret[$serviceName] = new AmfphpDiscovery_ServiceDescriptor($serviceName, $methods, $objComment); */\n $ret1[] = array('label'=>$serviceName,'date'=>'');\n }\n// var_dump($ret);exit();\n //note : filtering must be done at the end, as for example excluding a Vo class needed by another creates issues\n foreach ($ret as $serviceName => $serviceObj) {\n foreach (self::$excludePaths as $excludePath) {\n if (strpos($serviceName, $excludePath) !== false) {\n unset($ret[$serviceName]);\n break;\n }\n }\n }\n return $ret1;\n }", "public function getDeferredServices(): array\n {\n return $this->deferredServices;\n }", "protected function getServices() {\n\t\treturn [\n\t\t\tMessagesService::class,\n\t\t];\n\t}", "public function getServices(string $type): array\n {\n return $this->services[$type] ?? [];\n }" ]
[ "0.8545805", "0.8473749", "0.82858324", "0.82858324", "0.82858324", "0.82527", "0.82202506", "0.8206234", "0.8202", "0.8202", "0.8172218", "0.81468475", "0.81380796", "0.80998296", "0.8094448", "0.8055901", "0.8043465", "0.7907757", "0.7870094", "0.7823053", "0.78099114", "0.77889246", "0.7718695", "0.77028286", "0.76037663", "0.74844396", "0.7424039", "0.74211514", "0.7394546", "0.73597413" ]
0.8554304
0
Factory for latitude element
public static function getLatitude() { $element = new Lib_Form_Element_Location_Angle_Latitude(); return $element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function latitude();", "public function getLat();", "public function get_latitude()\n {\n }", "public function get_latitude()\n {\n }", "public function __construct($lat)\r\n {\r\n $this->_lat = $lat;\r\n }", "public function getLatitude(): float;", "public function setLatitude($value)\n {\n $this->latitude = $value;\n\n return $this;\n }", "public function getLatitude()\n {\n if (! isset($this->latitude)) {\n $this->latitude = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getLatitudeQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->get('Latitude');\n }", "public function setLatitude($value)\n {\n return $this->set('Latitude', $value);\n }", "public function setLatitude($value)\n {\n return $this->set('Latitude', $value);\n }", "public function setLatitude($value)\n {\n return $this->set('Latitude', $value);\n }", "public function setLatitude($value)\n {\n return $this->set('Latitude', $value);\n }", "public static function preRenderLatitudeField(array $element) {\n $element['#attributes']['type'] = 'text';\n Element::setAttributes($element, [\n 'id',\n 'name',\n 'value',\n 'size',\n 'maxlength',\n 'placeholder',\n ]);\n static::setAttributes($element, ['form-text']);\n\n return $element;\n }", "public function getLatitude(){\r\n\t\treturn $this->latitude;\r\n\t}", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLat()\n {\n $value = $this->get(self::LAT);\n return $value === null ? (double)$value : $value;\n }", "abstract public function longitude();", "public function setLatitude($latitude)\n {\n $this->latitude = $latitude;\n\n return $this;\n }", "public function setLat($value)\n {\n return $this->set(self::LAT, $value);\n }", "public function setLat($value)\n {\n return $this->set(self::LAT, $value);\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function getLatitude()\n {\n return $this->latitude;\n }", "public function GetLatitude()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_center_lat;\n }" ]
[ "0.74209243", "0.68726623", "0.65430665", "0.65428853", "0.6269292", "0.6192432", "0.6070432", "0.60351795", "0.60193914", "0.5994152", "0.5994152", "0.5994152", "0.59904516", "0.5985785", "0.59775925", "0.5977136", "0.5904754", "0.58949745", "0.58822596", "0.58098316", "0.58098316", "0.57823217", "0.57823217", "0.57823217", "0.57823217", "0.57823217", "0.57823217", "0.57823217", "0.57823217", "0.5780239" ]
0.75437814
1
Factory for zoom element
public static function getZoom() { $element = new Lib_Form_Element_Location_Zoom(); return $element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function zoom() {\n\t}", "public function withZoomFactor(ZoomFactor $zoom);", "public function setZoom($value) {\n\t}", "public function setZoomControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof ZoomControl)) {\n $this->zoomControl = $args[0];\n $this->mapOptions['zoomControl'] = true;\n } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {\n if ($this->zoomControl === null) {\n $this->zoomControl = new ZoomControl();\n }\n\n $this->zoomControl->setControlPosition($args[0]);\n $this->zoomControl->setZoomControlStyle($args[1]);\n\n $this->mapOptions['zoomControl'] = true;\n } elseif (!isset($args[0])) {\n $this->zoomControl = null;\n\n if (isset($this->mapOptions['zoomControl'])) {\n unset($this->mapOptions['zoomControl']);\n }\n } else {\n throw MapException::invalidZoomControl();\n }\n }", "public function setZoom($value) {\n $this->settings['zoom'] = $value;\n // Return for chaining\n return $this;\n }", "public function getZoomControl()\n {\n return $this->zoomControl;\n }", "public function setZoom($zoom) \n {\n $this->zoom = $zoom;\n }", "private function buildZoom() {\n return '&zoom=' . $this->mappingOptions->zoom;\n }", "public function withoutZoomFactor();", "public function setZoom($nom){\n\t\t$zoom = (int) $zoom;\n\t\t// On vérifie ensuite si ce nombre est bien strictement positif.\n\t\tif ($zoom > 0){\n\t\t\t// Si c'est le cas, c'est tout bon, on assigne la valeur à l'attribut correspondant.\n\t\t\t$this->_zoom = $zoom;\n\t\t}\n\t}", "public function zoomPrint() {\n\t}", "public function Zoom($c) {\r\n parent::ZoomScroll($c);\r\n }", "public function getImageZoom() {\n\t\treturn $this->imageZoom;\n\t}", "public function getActZoomPic()\n {\n return 1;\n }", "public function setZoomPrint($value) {\n\t}", "public function scale() { }", "public function zoomin($source, $dest, Array $option)\n {\n $image_obj = $this->_getInstance('montage');\n $source = $this->_getSource($source);\n return $image_obj->zoomin($source, $dest, $option);\n }", "public function __construct( $data = array() )\n {\n $this->update( $data );\n $this->ZoomAPI = API::getInstance();\n }", "public function getCloudZoomMode()\n {\n return \\XLite\\Core\\Config::getInstance()->Layout->cloud_zoom_mode ?: \\XLite\\View\\FormField\\Select\\CloudZoomMode::MODE_INSIDE;\n }", "public function getCloudZoomSettings()\n {\n $modulName = Mage::app()->getRequest()->getModuleName();\n $store = Mage::app()->getStore();\n if ($modulName == 'quickview') {\n $pageType = '_quickview';\n } else {\n $pageType = '';\n }\n\n $settings = array(\n 'zoomWidth' => (int)Mage::getStoreConfig('quickview/cloudzoom/zoom_width' . $pageType, $store),\n 'zoomHeight' => (int)Mage::getStoreConfig('quickview/cloudzoom/zoom_height' . $pageType, $store),\n 'position' => Mage::getStoreConfig('quickview/cloudzoom/position' . $pageType, $store),\n 'adjustX' => (int)Mage::getStoreConfig('quickview/cloudzoom/adjust_x' . $pageType, $store),\n 'adjustY' => (int)Mage::getStoreConfig('quickview/cloudzoom/adjust_y' . $pageType, $store),\n 'tint' => Mage::getStoreConfig('quickview/cloudzoom/tint', $store),\n 'softFocus' => (int)Mage::getStoreConfig('quickview/cloudzoom/soft_focus', $store),\n 'smoothMove' => (int)Mage::getStoreConfig('quickview/cloudzoom/smooth_move', $store),\n 'showTitle' => (int)Mage::getStoreConfig('quickview/cloudzoom/show_title', $store),\n 'tintOpacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/cloudzoom/tint_opacity', $store)),\n 'lensOpacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/cloudzoom/lens_opacity', $store)),\n 'titleOpacity' => (float)str_replace(',', '.', Mage::getStoreConfig('quickview/cloudzoom/title_opacity', $store))\n );\n if (!$settings['position']) {\n $settings['position'] = Mage::getStoreConfig('quickview/cloudzoom' . $pageType . '/position_element', $store);\n }\n\n $settings = $this->checkDefaultCloudZoomSettings($settings);\n return $settings;\n }", "public function getZoomOptions()\n {\n return ArrayLib::valuekey(range(1, 20));\n }", "public function testZoomControlStyles()\n {\n $this->assertEquals(ZoomControlStyle::getZoomControlStyles(), array(\n ZoomControlStyle::DEFAULT_,\n ZoomControlStyle::LARGE,\n ZoomControlStyle::SMALL\n ));\n }", "function setInitialZoom($initial_zoom) {\n if (!(intval($initial_zoom) > 0))\n throw new Error(create_invalid_value_message($initial_zoom, \"initial_zoom\", \"html-to-pdf\", \"Must be a positive integer number.\", \"set_initial_zoom\"), 470);\n \n $this->fields['initial_zoom'] = $initial_zoom;\n return $this;\n }", "public function setScaleControl()\n {\n $args = func_get_args();\n\n if (isset($args[0]) && ($args[0] instanceof ScaleControl)) {\n $this->scaleControl = $args[0];\n $this->mapOptions['scaleControl'] = true;\n } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {\n if ($this->scaleControl === null) {\n $this->scaleControl = new ScaleControl();\n }\n\n $this->scaleControl->setControlPosition($args[0]);\n $this->scaleControl->setScaleControlStyle($args[1]);\n\n $this->mapOptions['scaleControl'] = true;\n } elseif (!isset($args[0])) {\n $this->scaleControl = null;\n\n if (isset($this->mapOptions['scaleControl'])) {\n unset($this->mapOptions['scaleControl']);\n }\n } else {\n throw MapException::invalidScaleControl();\n }\n }", "public function getMarkerFactory();", "public function isZoomable()\n {\n return $this->zoomable;\n }", "public function setCloudZoomMode($mode)\n {\n $mode = in_array($mode, $this->getAllowedCloudZoomModes()) ? $mode : \\XLite\\View\\FormField\\Select\\CloudZoomMode::MODE_INSIDE;\n\n \\XLite\\Core\\Database::getRepo('XLite\\Model\\Config')->createOption(\n array(\n 'category' => 'Layout',\n 'name' => 'cloud_zoom_mode',\n 'value' => $mode,\n )\n );\n\n return $this;\n }", "function setInitialZoomType($initial_zoom_type) {\n if (!preg_match(\"/(?i)^(fit-width|fit-height|fit-page)$/\", $initial_zoom_type))\n throw new Error(create_invalid_value_message($initial_zoom_type, \"initial_zoom_type\", \"html-to-pdf\", \"Allowed values are fit-width, fit-height, fit-page.\", \"set_initial_zoom_type\"), 470);\n \n $this->fields['initial_zoom_type'] = $initial_zoom_type;\n return $this;\n }", "public function zoomAction(Request $request,$slug) {\n \n \n $repid = 'CoreAdminBundle:adminlistedesregles';\n $rep2 = $this->getDoctrine()->getRepository($repid);\n $dernierAcces2 = $rep2->findBy(Array('id'=>\"=\".$slug));\n $dernierAcces2 = $rep2->find($slug);\n \n $regle = $this->extraireRegles($dernierAcces2);\n \n \n if (is_null($regle) ) {\n $regle = Array(0=>Array('nom'=>\"AUCUNE REGLE CORRESPOND A ID \".\"=\".$slug.\" Dans \".$repid,'status'=>\"LISTE VIDE\",'incluscrit'=>\"\",'inclusregle'=>\"\",'id'=>\"\"));\n }\n else {\n if (array_key_exists(0, $regle)) {\n \n }\n else {\n $regle = Array(0=>Array('nom'=>\"AUCUNE REGLE CORRESPOND A ID \".\"=\".$slug.\" Dans \".$repid,'status'=>\"LISTE VIDE\",'incluscrit'=>\"\",'inclusregle'=>\"\",'id'=>\"\"));\n \n }\n \n }\n // $irmsecurity a été injecté à l'instanciation de la class\n $auth = $this->irmsecurity->getIRMSecurityStatus();\n \n $auth = $auth.$this->irmsecurity->getCapabilities(1,\"YAML\");\n return $this->render('CoreAdminBundle:Default:zoom.html.twig', array('auth' => $auth,'id' => $slug,'rq'=>$request->getBaseUrl(),'regles'=>$regle));\n \n }", "public function zoomRect($r) {\r\n $this->x0 = $r->getLeft();\r\n $this->y0 = $r->getTop();\r\n $this->x1 = $r->getRight();\r\n $this->y1 = $r->getBottom();\r\n $this->calcZoomPoints();\r\n }" ]
[ "0.6895346", "0.6477751", "0.6240417", "0.6199307", "0.61519223", "0.5948865", "0.58420247", "0.5725698", "0.5606518", "0.55294526", "0.5332833", "0.5328538", "0.5313203", "0.5194862", "0.5133661", "0.5058262", "0.50443584", "0.49868488", "0.49411896", "0.49311587", "0.49228477", "0.4904868", "0.490115", "0.4875855", "0.48696518", "0.48566917", "0.48558593", "0.4850959", "0.48486745", "0.48422557" ]
0.747505
1
Factory for yaw element
public static function getYaw() { $element = new Lib_Form_Element_Location_Angle_Yaw(); return $element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getPitch()\n {\n $element = new Lib_Form_Element_Location_Angle_Pitch();\n return $element;\n }", "public static function getPitch()\n {\n $element = new Lib_Form_Element_Location_Angle_Pitch();\n return $element;\n }", "public function rotation(float $roll = 0, float $pitch = 0, float $yaw = 0): EntityInterface;", "public function getRotation() {}", "public function getRotation() {}", "abstract protected function initRotues();", "private function get_offset() {\n\t\treturn ( (time() - $this->skew) % ($this->lifetime + $this->skew) );\n\t}", "public static function ZW(): VatRate\n {\n return self::fromCode('ZW');\n }", "function create() {\n Comparrot::create();\n}", "public function rotate()\n {\n // not possible in php?\n }", "public function __construct($rotation)\n {\n $this->rotation = $rotation;\n }", "function d3jspie_generateur_autoriser(){}", "function getDecorator($type, $element, $position, $default);", "public static function getLatitude()\n {\n $element = new Lib_Form_Element_Location_Angle_Latitude();\n return $element;\n }", "public static function getLatitude()\n {\n $element = new Lib_Form_Element_Location_Angle_Latitude();\n return $element;\n }", "public function getOrientation()\n {\n $result = array();\n\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ORIENTATION, $payload);\n\n $payload = unpack('v1roll/v1pitch/v1yaw', $data);\n\n $result['roll'] = IPConnection::fixUnpackedInt16($payload['roll']);\n $result['pitch'] = IPConnection::fixUnpackedInt16($payload['pitch']);\n $result['yaw'] = IPConnection::fixUnpackedInt16($payload['yaw']);\n\n return $result;\n }", "public function getZ() {}", "public function rotateLeft(): Orientation\n {\n return new North();\n }", "public function __construct($_age = NULL,$_race = NULL,$_ethnicity = NULL,$_gender = NULL,$_hairColor = NULL,$_eyeColor = NULL,$_height = NULL,$_weight = NULL,$_skinTone = NULL,$_buildType = NULL,$_identifyingMarks = NULL,$_shoeSize = NULL,$_correctiveLenses = NULL)\n {\n MicrobiltWsdlClass::__construct(array('Age'=>$_age,'Race'=>$_race,'Ethnicity'=>$_ethnicity,'Gender'=>$_gender,'HairColor'=>$_hairColor,'EyeColor'=>$_eyeColor,'Height'=>$_height,'Weight'=>$_weight,'SkinTone'=>$_skinTone,'BuildType'=>$_buildType,'IdentifyingMarks'=>$_identifyingMarks,'ShoeSize'=>$_shoeSize,'CorrectiveLenses'=>$_correctiveLenses),false);\n }", "public function rotateBy($rotation) {}", "static public function generate($region) {\n\t\t$authenticator = new Authenticator($region);\n\t\t$authenticator->initialize();\n\t\treturn $authenticator;\n\t}", "function Attribute_Provider($public_key_certificate,$private_key,$notBefore,$notOnOrAfter,$rsadsa,$acsURI,\n $assertionTemplate)\n {\n $this->public_key_certificate=$public_key_certificate;\n $this->private_key=$private_key;\n $this->notBefore=$notBefore;\n $this->notOnOrAfter=$notOnOrAfter;\n $this->rsadsa=$rsadsa;\n $this->acsURI=$acsURI;\n $this->assertionTemplate=$assertionTemplate;\n }", "public function getOrientation();", "public function setRotation($rotation) {}", "public function setRotation($rotation) {}", "function create_Brittonian_object(){\n return new clsRace(\n \"Brittonian\",\n array(1 =>'Citizen', 'Soldier', 'Pikemen', 'Crossbowmen', 'Knight', 'Rogue'),\n array(2 => 100, 200, 900, 500, 500),\n array(2 => 1, 2, 0, 3, 0),\n array(2 => 0, 0, 4, 1, 0),\n 1008\n );\n}", "public function get_name()\n {\n return 'tilt';\n }", "public static function deg270()\n {\n return static::createWithDegree(Degree::DEG_270);\n }", "public function __construct(Templater $templater, array $token);", "public function getAngle()\n {\n return $this->angle;\n }" ]
[ "0.5865664", "0.5865664", "0.5455798", "0.52979374", "0.5297914", "0.49167404", "0.47630802", "0.4608474", "0.45746073", "0.44602305", "0.437359", "0.4358086", "0.43561172", "0.42919478", "0.42919478", "0.42662618", "0.424432", "0.42413345", "0.42394114", "0.42288628", "0.41705894", "0.41377223", "0.41154212", "0.41142488", "0.4109576", "0.4097308", "0.40939716", "0.409144", "0.4048147", "0.40436333" ]
0.7410582
1
Factory for pitch element
public static function getPitch() { $element = new Lib_Form_Element_Location_Angle_Pitch(); return $element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPitch($var)\n {\n GPBUtil::checkDouble($var);\n $this->pitch = $var;\n\n return $this;\n }", "public function getPitch()\n {\n return $this->pitch;\n }", "public function isFixedPitch() {}", "public static function PER_TITLE_TEMPLATE_FIXED_RESOLUTION_AND_BITRATE()\n {\n return new StreamMode(self::PER_TITLE_TEMPLATE_FIXED_RESOLUTION_AND_BITRATE);\n }", "public static function getYaw()\n {\n $element = new Lib_Form_Element_Location_Angle_Yaw();\n return $element;\n }", "public static function getYaw()\n {\n $element = new Lib_Form_Element_Location_Angle_Yaw();\n return $element;\n }", "public function getIndex()\n\t{\n\t\treturn View::make('pitch')->with('pitch', $this->pitch);\n\t}", "public function getOrientationPeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ORIENTATION_PERIOD, $payload);\n\n $payload = unpack('V1period', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['period']);\n }", "public function presenter()\n {\n\n return AudioPresenter::class;\n }", "public function create()\n\t{ \n\t\t# Return if just the countoff is needed\n\t\tif ($this->countoff<2) return;\n\t\t\n\t\t# Add a note on and note off for each beat in the click track\n\t\tfor($i=0; $i<$this->beatsTotal; $i++) { \n\t\t\t$vol = (($i%$this->timeSig)==0) ? 127 : 70;\n\t\t\t$this->addEvent(0,153,37,$vol);\n\t\t\t$this->addEvent($this->ticksPerBeat,153,37,0);\n\t\t}\n\t}", "public function __construct($instrument=1, $time_signature=\"4/4\", $time_increment=16, $tempo=120, $volume=100) { $this->instrument = $instrument;\n $this->time_signature = $time_signature;\n $this->time_increment = $time_increment;\n $this->tempo = $tempo;\n $this->volume = $volume;\n }", "public function withParameters(): PersisterInterface;", "public function getWave()\n {\n return $this->get(self::_WAVE);\n }", "public function getRotation() {}", "public function getRotation() {}", "public function __construct($length,$strength){ \n\t\t\t$this->_generateOTP($length,$strength);\n\t\t}", "public function __construct()\n {\n if ($this->_name == null) {\n $name = array();\n preg_match('/^(Doctrine_Record_Generator_Pollable_)?(.*)$/', get_class($this), $name);\n $this->_name = $name[2];\n }\n }", "public static function NPUE(): VatRate\n {\n return self::fromCode('NPUE');\n }", "public function getAudioBitRate() {}", "function __construct($width = 440, $height = 220){\n\t\t$this -> setDimensions($width, $height);\n\t\t$this -> setProperty('cht','t');\n\t}", "public function wktGenerateMultipoint();", "function PI($h) \n\t{\n\t//Femme = Taille(cm) - 100 - [Taille(cm) - 150] / 2 \n\t//Homme = Taille(cm) - 100 - [Taille(cm) - 150] / 4\n\t//âge de supérieur à 18 ans ;taille entre 140 et 220 cm (55 à 87 inch)\n\t//Poids idéal = 50 + [Taille(cm) - 150]/4 + [Age(an) - 20]/4\n\t$PI =$h-100-($h-150)/4 .\"kg\" ;\n\treturn $PI;\n\t}", "private static function getElementInstance(string $element): Element\n {\n switch ($element) {\n case \"0\":\n case \"Fire\":\n return new Fire();\n case \"1\":\n case \"Water\":\n return new Water();\n case \"2\":\n case \"Corruption\":\n return new Corruption();\n case \"3\":\n case \"Earth\":\n return new Earth();\n case \"4\":\n case \"Wind\":\n return new Wind();\n case \"5\":\n case \"Physical\":\n return new Physical();\n default:\n echo \"invalid element\";\n die;\n }\n }", "public function getAudioSampleRate() {}", "public static function NP(): VatRate\n {\n return self::fromCode('NP');\n }", "public static function factory($element)\n {\n // If class is the same as object being `factory'ised`, just return it.\n if (is_object($element) && get_class($element) == get_called_class()) {\n return $element;\n }\n \n $object = new static();\n if (is_array($element) || $element instanceof \\stdClass) {\n self::setObjectProperties($object, $element);\n }\n\n return $object;\n }", "public function __construct()\n {\n if (1 == func_num_args()) {\n $this->payFrequency = func_get_arg(0);\n }\n }", "public function getQuaternionPeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_QUATERNION_PERIOD, $payload);\n\n $payload = unpack('V1period', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['period']);\n }", "public function getPTS() {}", "public function sinProvider() {\n return [\n ['1', '0.84147098480790', 14],\n ['123.123', '-0.56537391969733569', 17],\n ['15000000000', '0.69170450164193502844', 20]\n ];\n }" ]
[ "0.6282948", "0.62495756", "0.57025963", "0.4707126", "0.44642088", "0.44642088", "0.4435667", "0.44162688", "0.44123766", "0.44120726", "0.43990508", "0.42864943", "0.4281105", "0.4275681", "0.42736807", "0.42550054", "0.42541358", "0.42514467", "0.42454562", "0.42281085", "0.42178178", "0.4199851", "0.419947", "0.41702127", "0.41684368", "0.41639748", "0.4163255", "0.41570622", "0.41490716", "0.41156018" ]
0.75069624
1
return key from array $dupmodper is an array, $val is an array values
function getkey($dupmodper,$val) { foreach($dupmodper as $key => $product) { foreach($product as $keyd => $pro) { if($pro==$val) { return $keyd; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkdupmodval($arr1,$val,$out,$numrot)\n {\n $flagfirst=\"true\";\n $flagsecond=\"true\";\n\n for($i=1;$i<=$numrot;$i++)\n {\n $array1='';\n\n $array1=$arr1.\",\".$i;\n\n if($out[$array1][0]==$val OR $out[$array1][1]==$val) // first array 1,2 get 1\n {\n $flagfirst=\"false\";\n break;\n }\n }\n\n\n\n if($flagfirst==\"false\")\n {\n return \"false\";\n }\n else \n {\n return \"true\";\n } \n }", "function key(){ \r\n\t return key($this->array); \r\n\t }", "public function key()\n {\n return key($this->values);\n }", "function array_get_key_val($value, $heystack) {\r\n if (is_array($heystack)) {\r\n foreach ($heystack as $k => $v) {\r\n if ($v == $value) {\r\n return $k;\r\n } elseif (is_array($v)) {\r\n return array_get_key_val($value, $v);\r\n }\r\n }\r\n return -1;\r\n }\r\n return -1;\r\n}", "function getKeyByValue($arr,$value) {\n\t $n=-1;\n\t foreach ($arr as $aKey=>$aItem) {\n\t\t $n++;\n\t\t //if (!isset($akey)) $aKey=$n;\n\t\t if (!is_array($aItem)) {\n\t\t\t if ($Item==$value) return $aKey;\n\t\t } else {\n\t\t\t if ($aItem[$value['key']]==$value['value']) {\n\t\t\t\t return $aKey;\n\t\t\t }\n\t\t }\n\t }\n }", "protected function get_first_array_item( $val ) {\n\t\tif ( $val && is_array( $val ) ) {\n\t\t\treturn $val[0];\n\t\t}\n\t\treturn $val;\n\t}", "public function key() {\n\t\treturn key($this->_value);\n\t}", "protected function getMappingKey($array) {\n return key(array_filter($array));\n }", "protected function key()\n {\n $value = $this->keyVal();\n return key($value);\n }", "public function key() {\n\t\treturn key($this->array);\n\t}", "public function key()\n {\n return key($this->array);\n }", "public function key()\n {\n return key($this->array);\n }", "function duplication2(Array $array) {\n if (empty($array)) {\n return FALSE;\n }\n foreach ($array as $key => $val) {\n if ($key != $val) {\n // not in 0 ~ n-1\n if (!isset($array[ $val ])) {\n return FALSE;\n }\n if ($val == $array[ $val ]) {\n return $val;\n } else {\n $tmp = $array[ $val ];\n $array[ $val ] = $val;\n $array[ $key ] = $tmp;\n }\n }\n }\n\n return 'no duplicate numbers.';\n}", "function first_index_arr($arr)\n {\n foreach ($arr as $k => $v) return $k;\n }", "private function arrayPair($key, $val): string\n {\n $key_str = is_int($key) ? $key : $this->quoted($key);\n\n $val_str = $this->arrayValue($val);\n\n return sprintf('%s => %s', $key_str, $val_str);\n }", "private function dedup( $arr ) {\n\t\tif ( empty( $arr ) ) {\n\t\t\treturn null;\n\t\t}\n\t\t$deduped = array();\n\t\tforeach ( $arr as $val ) {\n\t\t\t$deduped[ $val ] = true;\n\t\t}\n\n\t\treturn array_keys( $deduped );\n\t}", "public function key(){\n return key($this->items);\n }", "public function key(){\n return key($this->items);\n }", "protected function arrayKey() {\n\t\tif ( !empty($this->array[$this->indent]) ) {\n\t\t\t$this->array_index[$this->indent]++;\n\t\t\t$this->key($this->array_index[$this->indent]);\n\t\t}\n\t}", "public function key(){\n\t\treturn (is_array($this->data) ? key($this->data) : null);\n\t}", "function filterKeyDef(array $def)\n {\n // PostgreSQL doesn't like prefix lengths specified on keys...?\n foreach ($def as $i => $item)\n {\n if (is_array($item)) {\n $def[$i] = $item[0];\n }\n }\n return $def;\n }", "function duplication(Array $array) {\n if (empty($array)) {\n return FALSE;\n }\n $tmp = $array;\n foreach ($array as $key => $val) {\n unset($tmp[ $key ]);\n if (in_array($val, $tmp)) {\n return $val;\n }\n }\n\n return 'no duplicate numbers.';\n}", "function getKeyIndex($matchVal, $funcName)\n {\n $key = -1;\n if ($this->regxFlag=='true') {\n //For appended with '_'//\n if (in_array(\n $matchVal.'*',\n $this->functionData['function']\n )) {\n /* Check for pattern in function array */\n $key = array_search(\n $matchVal.'*',\n $this->functionData['function']\n );\n }\n } else {\n if (in_array($funcName, $this->functionData['function'])) {\n /* Check for name in function array */\n $key = array_search(\n $funcName,\n $this->functionData['function']\n );\n }\n }\n return $key;\n }", "function get_val_array($arr){\n\t$new = array();\n\tif(!empty($arr)){\n\tforeach($arr as $key=>$val){\n\t\t$new[$key] = $key;\n\t}\n\t}\n\treturn $new;\n}", "static function first_available_key($array){\n\t\tif(!is_array($array)){\n\t\t\treturn 0;\n\t\t}\n\t\t$key = 0;\n\t\tksort($array);\n\t\tforeach($array as $k=>$v){\n\t\t\tif($k != $key){\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t\t$key++;\n\t\t}\n\t\treturn $key;\n\t}", "public function key()\n {\n return $this->aliases[$this->position];\n }", "protected function toKey(array $value) {\n $key = '';\n ksort($value);\n foreach ($value as $i => $v) {\n if ($v instanceof FieldItemListInterface) {\n $v = $v->first();\n if ($v) {\n $v = $v->getValue();\n }\n else {\n $v = 'e';\n }\n }\n if (is_array($v)) {\n $v = hash('md5', json_encode($v));\n }\n if ($v instanceof FieldceptionFieldStorageDefinition) {\n $v = $v->getKey();\n }\n if ($v instanceof FieldConfigInterface) {\n $v = $v->id();\n }\n if ($v instanceof FieldStorageDefinitionInterface) {\n $v = $v->getName();\n }\n if ($v instanceof ContentEntityInterface) {\n $i = 'entity';\n $v = $v->getEntityTypeId() . '--' . $v->id() . '--' . $v->getRevisionId();\n }\n if (empty($v) && $v !== 0) {\n $v = '0';\n }\n $v = $i . ':' . $v;\n $v = empty($key) ? $v : '--' . $v;\n $key .= strtolower(preg_replace('/[^\\da-z\\-\\:]/i', '', $v));\n }\n return md5($key);\n }", "public function key()\n\t\t{\n\t\t\treturn key($this->source);\n\t\t}", "public function key()\n {\n return key($this->_items);\n }", "function SyncNameWithIndex($array)\n{\n\t$final_array = array();\n\n\tif(is_array($array))\n\t{\n\t\tforeach ($array as $key => $value) {\n\t\t\t$final_array[] = $key;\n\t\t}\n\t\treturn $final_array;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}" ]
[ "0.57781434", "0.565092", "0.54245055", "0.5341402", "0.5294565", "0.52659744", "0.52405083", "0.52304256", "0.51900876", "0.5170495", "0.5148409", "0.5148409", "0.5139063", "0.51377743", "0.51029915", "0.50272", "0.50239426", "0.50239426", "0.501781", "0.498051", "0.49765763", "0.49407476", "0.49122682", "0.49060923", "0.48839426", "0.48731673", "0.48713765", "0.48518285", "0.4851712", "0.48464796" ]
0.8026075
0
Lists all Aduan models.
public function actionIndex() { $searchModel = new AduanSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return alunos::all();\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index(){\n return $this->model->all();\n }", "public function index()\n {\n return $this->model->all();\n }", "public function index() {\n $data['manufacturers'] = Manufacturer::getManufacturers();\n return view('models.models')->with($data);\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public function index(){\n\n return Matapelajaran::all();\n\n }", "public function index()\n {\n return Asistencia::all();\n }", "public function actionIndex()\n {\n $searchModel = new AktaBadanSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return Model::all();\n }", "public function getModels();", "public function getModels();", "public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}", "public function models()\n {\n $this->_display('models');\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function index()\n {\n return Accessories::all();\n }", "public function index()\n {\n return Mahasiswa::all();\n }", "public function index()\n {\n return response()->json(ModelsArugula::all());\n }", "public function index()\n {\n return $this->showList(ObjectMuseum::where('deleted','=',ObjectMuseum::ACTIVE)->get());\n }", "public function index()\n {\n return AlokasiKelas::all();\n }", "public function listar() {\n $alunos = Aluno::all();\n // Invocar a view passando os dados\n return view('alunos.listar')->with('alunos',$alunos);\n\n }", "function findAll(){\n $autor = new Autor();\n return $autor->findAll();\n }", "public function GetAll()\n {\n return $this->model->all();\n }", "public function index()\n {\n $this->allowedAdminAction();\n\n return $this->showAll(Organizador::all());\n }", "public function index()\n {\n //\n $aduans=Aduan::all()->toArray();\n return view ('aduan.index', compact('aduans'));\n }", "public function index()\n {\n $alunos = Alunos::all();\n return view('alunos/list', ['alunos' => $alunos]);\n }", "public function index()\n {\n return Admins::all();\n }", "public function index()\n {\n $departamentos = Department::all();\n return $this->showAll($departamentos);\n }", "public function index()\n {\n $title = trans('app.all_ads');\n $ads = Ad::with('city', 'country', 'state')->whereStatus('1')->orderBy('id', 'desc')->paginate(20);\n\n return view('admin.all_ads', compact('title', 'ads'));\n }" ]
[ "0.69506145", "0.6660783", "0.6575569", "0.65560204", "0.6529977", "0.64454526", "0.64379543", "0.63589925", "0.63365895", "0.6330718", "0.63300276", "0.6290233", "0.6290233", "0.6280876", "0.62726367", "0.62690115", "0.6267467", "0.62508184", "0.6248572", "0.62256753", "0.6203932", "0.6179227", "0.6172738", "0.61586595", "0.61475366", "0.6133457", "0.61269176", "0.61254287", "0.6124837", "0.61166525" ]
0.70658875
0
Creates a new Aduan model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Aduan(); $modelAction = new AduanAction(); if ($model->load(Yii::$app->request->post())) { $model->progress_id = 30; $model->created_at = new Expression('NOW()'); $model->updated_at = new Expression('NOW()'); $random = Yii::$app->security->generateRandomString(); $model->token = $random; $code = rand(1000,9999); $model->email_code = $code; if($model->save()){ Yii::$app->session->addFlash('success', "Aduan telah berjaya dihantar."); if(!$model->upload()){ Yii::$app->session->addFlash('error', "Fail lampiran gagal dimuatnaik"); } return $this->redirect(['index']); }else{ $model->flashError(); } } return $this->render('create', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new AktaBadan();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->register = $this->generateRegister(\"register\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->id, 'akta_badan_jenis_id' => $model->akta_badan_jenis_id]);\n } else {\n $not = Notaris::find()->where(['id'=>Yii::$app->user->identity->notaris_id])->one();\n $kelurahan = Kelurahan::find()->where(['id'=>$not->kelurahan_id])->one();\n $kecamatan = Kecamatan::find()->where(['id'=>$kelurahan->kecamatan])->one();\n $kabupaten = Kabupaten::find()->where(['id'=>$kecamatan->kabupaten])->one();\n\n //$model->kelurahan_id = $kelurahan->id;\n //$model->kecamatan_id = $kelurahan->kecamatan_id;\n $model->kabupaten_id = $kecamatan->kabupaten_id;\n $model->provinsi_id = $kabupaten->provinsi_id;\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new SAAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['SAAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new JenisPelayanan();\n\n if ($model->load(Yii::$app->request->post()) && $model->simpan()) {\n return $this->redirect(['view', 'id' => $model->id_halaman]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n return view(\"aduan.create\");\n }", "public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n /*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n \n if (Yii::$app->request->post() && $model->validate()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new RJAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['RJAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate() {\n $model = new Aviso;\n if (isset($_POST['Aviso'])) {\n $model->attributes = $_POST['Aviso'];\n #$nombre = $model->titulo;\n $fecha = Aviso::model()->getFechaRegistro();\n $model->fecha_publicacion = $fecha->readColumn(0);\n $adjuntos = $_FILES;\n $temp=$adjuntos['adjunto']['tmp_name'];\n if ($model->save()) {\n if (count($adjuntos['adjunto']['name']) > 0) { \n $this->guardarAdjuntos($adjuntos['adjunto']['name'], $model,$temp);\n }\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n {\n $model = new TaKegiatan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Pelanggaran();\r\n $trans = Yii::$app->db->beginTransaction();\r\n\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->save()) {\r\n $check = $this->checkDetailPoint($model, 'create');\r\n \r\n if( isset($check['failed']) ){\r\n $trans->rollBack();\r\n Yii::$app->session->setFlash('error', $check['failed'] );\r\n return $this->redirect(['index']);\r\n }\r\n\r\n $trans->commit();\r\n Yii::$app->session->setFlash('success','Pelanggaran berhasil ditambahkan.');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n\t{\n\t\t$model=new Barangmasuk;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Ddiet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Loan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKInfoPasienLamaV;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKInfoPasienLamaV']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKInfoPasienLamaV'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pendaftaran_id));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Apresentacao();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Advert();\n $advertPriceModel = new AdvertPrice();\n $advertAddressModel = new AdvertAddress();\n\n $models_loaded = false;\n if ($model->load(Yii::$app->request->post())\n && $advertPriceModel->load(Yii::$app->request->post())\n && $advertAddressModel->load(Yii::$app->request->post())\n ) {\n $models_loaded = true;\n }\n\n $model->tutorid = intval(Yii::$app->user->id);\n\n if ($models_loaded && $model->save()) {\n $advertPriceModel->advertid = $model->id;\n $advertAddressModel->advertid = $model->id;\n if ($advertPriceModel->save() && $advertAddressModel->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'advertPriceModel' => $advertPriceModel,\n 'advertAddressModel' => $advertAddressModel\n ]);\n }\n\n } else {\n return $this->render('create', [\n 'model' => $this->fillUserDefaultData($model),\n 'advertPriceModel' => $advertPriceModel,\n 'advertAddressModel' => $advertAddressModel\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Actividad();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new AllocationDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Ora();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ora_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new TaPeriode();\n $pemda = \\common\\models\\TaPemdaUmum::find()->where('ID = (SELECT(MAX(ID)) FROM ta_pemda_umum)')->one();\n $model->ID_Tahun = (\\common\\models\\TaPeriode::find()->select('MAX(ID_Tahun) AS ID_Tahun')->one()['ID_Tahun']) + 1;\n $model->Kd_Prov = $pemda->Kd_Prov;\n $model->Kd_Kab_Kota = $pemda->Kd_Kab_Kota;\n //var_dump($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'ID_Tahun' => $model->ID_Tahun, 'Kd_Prov' => $model->Kd_Prov, 'Kd_Kab_Kota' => $model->Kd_Kab_Kota]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Uprawnienia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'konto_id' => $model->konto_id, 'podkategoria_id' => $model->podkategoria_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n $model = new Barang();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->stok = 0;\n\n if ($model->save()) {\n if (Url::previous('b-create')) {\n $var = Url::previous('b-create');\n Yii::$app->session->remove('b-create');\n Yii::$app->getSession()->setFlash(\n 'success', 'Berhasil menambahkan barang : <b>' . $model->nama\n );\n return $this->redirect($var);\n } else {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $model = new Keranjang;\n //list_barang dipakai untuk menampilkan \n //pilihan semua barang pada form\n $list_barang = Barang::all(); //select & barang\n return view('keranjang.create', compact(\n 'model', 'list_barang'\n ));\n }", "public function actionCreate()\n {\n $model = new MaklumatPelajarPenjaga();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.7383302", "0.73092717", "0.72995526", "0.72545713", "0.7201327", "0.72003156", "0.715731", "0.7155964", "0.71446204", "0.7063768", "0.7033752", "0.69891995", "0.69360983", "0.6909538", "0.68825126", "0.68750364", "0.68749535", "0.6872798", "0.6808623", "0.6788547", "0.6778926", "0.6778177", "0.67665696", "0.6734324", "0.6732602", "0.670684", "0.6704112", "0.6703647", "0.66975874", "0.6695595" ]
0.7430517
0
Count how many assigned licenses have user.
static function countForUserLicense($user_id) { global $DB; $user_id = (int) $user_id; $query = "SELECT COUNT(`glpi_users_softwarelicenses`.`id`) FROM `glpi_users_softwarelicenses` INNER JOIN `glpi_users` ON (`glpi_users_softwarelicenses`.`users_id` = `glpi_users`.`id`) WHERE `glpi_users_softwarelicenses`.`users_id` = '$user_id'"; $result = $DB->query($query); if ($DB->numrows($result) != 0) { return $DB->result($result, 0, 0); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function concurrentUserCount()\n {\n $sql = \"SELECT COUNT(*) FROM (\n SELECT COUNT(*),user_id FROM license_his_user_log \n WHERE login_status = 'S' AND logout_status IS NULL\n GROUP BY user_id HAVING COUNT(*) >= 1) license_table\";\n\n $count = Yii::app()->db->createCommand($sql)->queryScalar();\n return $count;\n }", "function crpLicense_userapi_countitems($args)\n{\n\t// Security check\n\tif (!SecurityUtil :: checkPermission('crpLicense::License', '::', ACCESS_READ))\n\t{\n\t\treturn LogUtil :: registerPermissionError();\n\t}\n\n\t$license= new crpLicense();\n\n\treturn $license->dao->countItems($args['active']);\n}", "public function usersAllowedCount()\n {\n $sql = \"SELECT global_value FROM lgt_license_global_table where global_key = 'concurrent_users'\";\n $allowd_count = Yii::app()->db->createCommand($sql)->queryScalar();\n return $allowd_count;\n }", "private function getCount()\n {\n $bd = Core::getBdd()->getDb();\n $u_insc_c = \"SELECT DISTINCT COUNT(u.id) as c FROM c_user u\";\n $insc = 0 + $bd->query($u_insc_c)->fetchObject()->c;\n return ($insc);\n }", "public function count_portfolio_possible_view_users($condition);", "function get_numusers() {\n global $CFG;\n\n $countsql = \"SELECT COUNT(DISTINCT u.id)\n FROM {$CFG->prefix}grade_grades g RIGHT OUTER JOIN\n {$CFG->prefix}user u ON u.id = g.userid\n LEFT JOIN {$CFG->prefix}role_assignments ra ON u.id = ra.userid\n $this->groupsql\n WHERE ra.roleid in ($this->gradebookroles)\n $this->groupwheresql\n AND ra.contextid \".get_related_contexts_string($this->context);\n return count_records_sql($countsql);\n }", "function getUsersCount() {\n $company_id = $this->getId(); \n \treturn Users::count(\"company_id LIKE $company_id\");\n }", "function count(User $user) {\n $project_users_table = TABLE_PREFIX . 'project_users';\n $users_table = TABLE_PREFIX . 'users';\n return (integer) DB::executeFirstCell(\"SELECT COUNT(user_id) FROM $project_users_table, $users_table WHERE $project_users_table.project_id = ? AND ($project_users_table.user_id = $users_table.id AND $users_table.state >= ?)\", $this->object->getId(), STATE_VISIBLE);\n }", "public function getUsageCount()\n {\n $today = Carbon::now('Asia/Singapore')->toDateTimeString();\n $timezone = new Carbon('Asia/Singapore');\n $last_thirty_days = $timezone->subDays(30);\n\n return count($this->appUserBlurb->where('interaction_type', 'use')->whereBetween('created_at', array($last_thirty_days->toDateTimeString(), $today))->groupBy('app_user_id')->get());\n }", "public function getUsedLicenseCount()\n {\n if (array_key_exists(\"usedLicenseCount\", $this->_propDict)) {\n return $this->_propDict[\"usedLicenseCount\"];\n } else {\n return null;\n }\n }", "public function numUsers(){\n $query = \"SELECT count(*) FROM final_usuario\";\n return $this->con->action($query);\n }", "public function updateUserAgencyCount() {\n\t\t$dummyUserCount = array();\n\t\t$dummyUserCount['dummy_user_count'] = 1;\n $dummyUserCount['agency_size'] = 1;\n\t\n\t\t$conditions = array();\n\t\t$conditions['id'] = $this->id;\n\n\t\t$success = ConnectionFactory::updateTableRowRelativeBasic(\"users\", $dummyUserCount, $conditions);\n\t\tif ($success) {\n\t\t\t$this-> dummy_user_count = $this->dummy_user_count + 1;\n $this-> agency_size = $this-> agency_size + 1;\n\t\t}\n\t\treturn $success;\n\t}", "public function test_user_count()\n {\n $this->assertCount(40, $this->customers, 'There should be 40 users with role customers.');\n $this->assertLessThanOrEqual(10, $this->admins, 'There can only be 10 admin users.');\n }", "public function getCountByUser($user){\n $query = $this->getEntityManager()->createQuery(\n \"\n SELECT count(p.id) AS nbprods\n FROM StoreBackendBundle:Product AS p\n WHERE p.jeweler = :user\n \"\n )->setParameter(':user', $user);\n return $query->getSingleScalarResult();\n }", "public function getUnapprovedCount();", "function countUsers(){\n\t\n\t}", "public function count()\n {\n return $this->db->count_all('us_user');\n }", "public function getTotalLicenseCount()\n {\n if (array_key_exists(\"totalLicenseCount\", $this->_propDict)) {\n return $this->_propDict[\"totalLicenseCount\"];\n } else {\n return null;\n }\n }", "public function countContractors()\n\t{\n\t\t$farmer = \"select id from users_roles where name = 'Contractor' \";\n\t\t$f = DB::query($farmer)->execute()->as_array();\n\t\t$f_id = @$f[0]['id']; \n\t\t\n\t\t//got it, lets proceed\n\t\tif(!is_null($f_id)){\n\t\t\t\n\t\t\t//lets count number of users subscribed to the contractor role\n\t\t\t$pple = \"select count(distinct(user_id)) as tmpvar from users_user_roles\nwhere role_id = $f_id \";\n\n\t\t\t$tmp \t= DB::query($pple)->execute()->as_array();\n\t\t\t$fcount = @$tmp[0]['tmpvar'];\n\t\t\treturn $fcount;\n\t\t}\n\t\treturn 0;\n\t\n\t\t\n\t}", "private function countActiveUsers(): void\n {\n $userIds = [];\n for($i=0; $i <= 11; $i++)\n {\n $userIds[$i] = [];\n }\n\n Order :: where( 'charging_status', OrderStatusEnum :: FINISHED ) -> get()\n -> filter(function($order) {\n return $order -> created_at && $order -> created_at -> year == $this -> year;\n })\n -> each(function($order) use( &$userIds ) {\n array_push($userIds[ $order -> created_at -> month - 1], $order -> user_id); \n });\n\n\n for($i = 0; $i <= 11; $i++)\n {\n $this -> data[ self :: ACTIVE ][$i] = count(array_unique($userIds[$i]));\n }\n }", "public function countUsers()\n\t{\n \treturn $this\n \t->createQueryBuilder('u')\n \t->select('COUNT(u)')\n \t->getQuery()->getSingleScalarResult();\n\t}", "public function getCount($user) {\n $query = $this\n ->createQueryBuilder('t')\n ->leftJoin('t.suite', 's')\n ->leftJoin('s.project', 'p')\n ->leftJoin('p.manager', 'm')\n ->select('count (s)');\n if ($user != NULL) {\n $query->where('p.manager = :id')\n ->orWhere('p.client = :id')\n ->setParameter('id', $user->getId());\n }\n return $query->getQuery()\n ->getSingleScalarResult();\n }", "public function count(){\n return count($this->accounts);\n }", "function countResponsibilities(IUser $user, $only_active = false) {\n $parent_filter = $this->getParentFilter();\n\n if($only_active) {\n $assignments_count = (integer) DB::executeFirstCell(\"SELECT COUNT(*) AS total FROM \" . TABLE_PREFIX . \"project_objects WHERE state >= ? AND project_id = ? AND assignee_id = ?\", STATE_VISIBLE, $this->object->getId(), $user->getId());\n\n if($parent_filter) {\n $assignments_count += (integer) DB::executeFirstCell(\"SELECT COUNT(*) AS total FROM \" . TABLE_PREFIX . \"subtasks WHERE state >= ? AND assignee_id = ? AND ({$parent_filter})\", STATE_VISIBLE, $user->getId());\n } // if\n } else {\n $assignments_count = (integer) DB::executeFirstCell(\"SELECT COUNT(*) AS total FROM \" . TABLE_PREFIX . \"project_objects WHERE state >= ? AND project_id = ? AND assignee_id = ?\", STATE_ARCHIVED, $this->object->getId(), $user->getId());\n\n if($parent_filter) {\n $assignments_count += (integer) DB::executeFirstCell(\"SELECT COUNT(*) AS total FROM \" . TABLE_PREFIX . \"subtasks WHERE state >= ? AND assignee_id = ? AND ({$parent_filter})\", STATE_ARCHIVED, $user->getId());\n } // if\n } // if\n\n return $assignments_count;\n }", "public function countUsers() {\n require('database.php');\n if ($result = $mysqli->query('SELECT Count(Distinct id) as count\n FROM users')) {\n while ($row = $result->fetch_assoc()) {\n echo $row['count'];\n }\n }\n }", "public function getCountUser()\n {\n return $this->users_model->countAll();\n }", "public static function counter_approved(){\n \n global $db;\n \n $query = \"SELECT COUNT(*) FROM users \";\n $query .= \"WHERE (user_role = 'admin') \";\n \n $result = $db->query($query);\n \n $row = $result->fetch_array(MYSQLI_NUM);\n \n return !empty($row) ? $row[0] : false;\n \n }", "public function getCount()\n {\n return $this->appUser->count();\n }", "private function count_operation_rows()\n {\n // $license_rows = $license['rows'];\n\n // $constructse = $this->Header_model->get_data_list('license_constructs', array('status' => 1));\n // $constructse_rows = $constructse['rows'];\n\n // return ($license_rows + $constructse_rows);\n }", "function getEnrollmentCount()\r\n {\r\n $count = $this->DB->database_count('enrollment_requests');\r\n return $count;\r\n }" ]
[ "0.70617545", "0.69851166", "0.6965553", "0.6571353", "0.6450016", "0.6376506", "0.6330127", "0.629282", "0.617731", "0.615203", "0.6140419", "0.61293644", "0.6123362", "0.61186033", "0.6108668", "0.6087049", "0.6077142", "0.6076836", "0.60693324", "0.60511315", "0.6021936", "0.6005218", "0.59921616", "0.5984818", "0.5974343", "0.5968935", "0.5951089", "0.59496707", "0.5935197", "0.59312886" ]
0.6990722
1
Show table wiht linked licenses to user
static function showLicenses(User $user) { global $DB; $ID = $user->getField('id'); echo "<div class='spaced'><table class='tab_cadre_fixehov'>"; $header = "<tr><th>".__('Software')."</th>"; $header .= "<th>".__('Licenses')."</th>"; $header .= "<th>".__('Added')."</th></tr>"; echo $header; $query = "SELECT ul.added, sl.name AS licenses_name, s.name AS software_name, sl.id AS licenses_id, s.id AS software_id FROM glpi_users_softwarelicenses ul JOIN glpi_softwarelicenses sl ON (sl.id = ul.softwarelicenses_id) JOIN glpi_softwares s ON (s.id = sl.softwares_id) WHERE ul.users_id = '$ID' ORDER BY ul.added DESC"; $result = $DB->query($query); if ($DB->numrows($result) > 0) { while ($data = $DB->fetch_assoc($result)) { echo "<tr class='tab_bg_1'>"; echo "<td class='center'><a href='software.form.php?id=".$data['software_id']."'>".$data["software_name"]."</a></td>"; echo "<td class='center'><a href='softwarelicense.form.php?id=".$data['licenses_id']."'>".$data["licenses_name"]."</a></td>"; echo "<td class='center' style='width:20%'>".$data["added"]."</td>"; echo "</tr>"; } } else { echo "<tr class='tab_bg_1'><td class='center' colspan='3'>No results.</td></tr>"; } echo "</table></div>"; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function licensesViewAction(){\n $this->setDialogAction([\n 'id' => 'messages-response',\n 'title' => 'Aktywuj lub przedłuż dostęp do usługi Kryptos',\n ]);\n $request = $this->getRequest();\n \n $LicenseRepository = Application_Service_Utilities::getModel('License');\n $this->view->currentLicenses = $LicenseRepository->manageHistory();\n $this->view->paginator = $LicenseRepository->getAllLicenses();\n }", "function adminView()\n\t{\n\t\t$startnum= (int) FormUtil :: getPassedValue('startnum', isset ($args['startnum']) ? $args['startnum'] : null, 'GET');\n\t\t$active= FormUtil :: getPassedValue('license_status', null);\n\t\t$clear= FormUtil :: getPassedValue('clear');\n\t\tif ($clear)\n\t\t{\n\t\t\t$active= null;\n\t\t}\n\n\t\t// get all module vars\n\t\t$modvars= pnModGetVar('crpLicense');\n\n\t\t// Get all matching pages\n\t\t$items= pnModAPIFunc('crpLicense', 'admin', 'getall', array (\n\t\t\t'startnum' => $startnum,\n\t\t\t'numitems' => $modvars['itemsperpage'],\n\t\t\t'active' => $active,\n\t\t\t'sortOrder' => 'ASC'\n\t\t));\n\n\t\tif (!$items)\n\t\t\t$items= array ();\n\n\t\t$rows= array ();\n\t\tforeach ($items as $key => $item)\n\t\t{\n\t\t\t$options= array ();\n\t\t\tif (SecurityUtil :: checkPermission('crpLicense::License', \"::\", ACCESS_EDIT))\n\t\t\t{\n\t\t\t\t$options[]= array (\n\t\t\t\t\t'url' => pnModURL('crpLicense', 'admin', 'modify', array (\n\t\t\t\t\t\t'id' => $item['id']\n\t\t\t\t\t)),\n\t\t\t\t\t'image' => 'xedit.gif',\n\t\t\t\t\t'title' => _EDIT\n\t\t\t\t);\n\t\t\t\tif (SecurityUtil :: checkPermission('crpLicense::License', \"::\", ACCESS_DELETE))\n\t\t\t\t{\n\t\t\t\t\t$options[]= array (\n\t\t\t\t\t\t'url' => pnModURL('crpLicense', 'admin', 'delete', array (\n\t\t\t\t\t\t\t'id' => $item['id']\n\t\t\t\t\t\t)),\n\t\t\t\t\t\t'image' => '14_layer_deletelayer.gif',\n\t\t\t\t\t\t'title' => _DELETE\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add the calculated menu options to the item array\n\t\t\t$item['options']= $options;\n\t\t\t$rows[]= $item;\n\t\t}\n\n\t\t$pager= array (\n\t\t\t'numitems' => pnModAPIFunc('crpLicense', 'user', 'countitems'),\n\t\t\t'itemsperpage' => $modvars['itemsperpage']\n\t\t);\n\n\t\treturn $this->ui->drawAdminView($rows, $active, $modvars, $pager);\n\t}", "public function fetchExistingLicenses()\n {\n $clientLicense = $this->db->fetchQuery(\n \"SELECT\n TO_CHAR(l.creation_date, 'Dy DD Mon YYYY, HH24:MI') AS creation_date,\n TO_CHAR(l.activation_date, 'Dy DD Mon YYYY, HH24:MI') AS activation_date,\n TO_CHAR(l.expiry_date, 'Dy DD Mon YYYY, HH24:MI') AS expiry_date,\n array_to_json(array_agg(mi.id\n ORDER BY mi.id ASC)) AS modules_installed,\n array_to_json(l.ip_addr) AS ip_addr,\n array_to_json(l.domains) AS domains,\n array_to_json(array_agg(mi.description\n ORDER BY mi.id ASC)) AS modules_names,\n now() BETWEEN activation_date AND expiry_date AS active\n FROM license l\n LEFT JOIN modules_available mi ON mi.id = ANY (l.modules_installed) AND mi.enabled_by_default=0\n WHERE client_id = :clientId\n GROUP BY l.id\n ORDER BY creation_date DESC\n LIMIT 1;\",\n [':clientId' => $_POST['clientId']]\n );\n if ($clientLicense) {\n $clientLicense['modules_installed'] = json_decode($clientLicense['modules_installed'], TRUE);\n $clientLicense['modules_names'] = json_decode($clientLicense['modules_names'], TRUE);\n $clientLicense['ip_addr'] = json_decode($clientLicense['ip_addr'], TRUE);\n $clientLicense['domains'] = json_decode($clientLicense['domains'], TRUE);\n }\n $this->response = [\"license\" => $clientLicense];\n }", "public function senarai_licenses()\n {\n return $this->hasMany(License::class);\n }", "public function index()\n {\n $licenses=License::OrderBy('created_at','ASC')->get();\n return view('back.license.index',compact('licenses'));\n }", "private function selectTable(){\n\t\tView::show(\"user/seleccionaTablas\");\n\t}", "public static function showUserTable() {\n echo \"<table id='users'>\n <tr>\n <th></th>\n <th>Utilisateur</th>\n <th>Mail</th>\n <th>Date de naissance</th>\n <th>Note</th>\n <th>Voitures</th>\n <th>Commentaires</th>\n </tr>\";\n for ($i = 0; $i < count(User::$listOfUsers); $i++ ) {\n echo \"<tr>\";\n echo \"<td>\";\n $iLink = $i + 1;\n echo \"<a href='users.php?user=$iLink'>Voir</a>\";\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getFirstName() . \" \" . User::$listOfUsers[$i]->getLastName();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getEmail();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getBirthDate();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getRate();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getListOfCars();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getListOfComments();\n echo \"</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "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 }", "public function showAllProductLicenses()\n {\n $epi_products = $this->getAllEpiProductsData();\n\n if (empty($epi_products)) {\n return;\n }\n\n ob_start();\n\n $plugin_dir_name = '';\n $inactive_epi_plugins = 0;\n // Get all license views\n foreach ($epi_products as $product_data) {\n $plugin_dir_name = end(explode('/', $product_data['baseFolderDir']));\n if ($product_data['isTheme']) {\n if (wp_get_theme()->name != $product_data['pluginName']) {\n $inactive_epi_plugins++;\n continue;\n }\n } else {\n if (! is_plugin_active($plugin_dir_name.'/'.$product_data['mainFileName'])) {\n $inactive_epi_plugins++;\n continue;\n }\n }\n $this->displayProductLicense($product_data);\n }\n\n if ($inactive_epi_plugins === count($epi_products)) {\n ?>\n <tr>\n <td colspan=\"4\">\n <?php _e('No active plugins found', $this->pluginSlug); ?>\n </td>\n </tr>\n <?php\n }\n $content = ob_get_clean();\n\n echo $content;\n }", "public function index()\n {\n if (Auth::user()->rol=='2' || (Auth::user()->rol=='3' ) ) {\n $bankdata = DB::table('users')\n ->join('bank_data', 'users.id', '=', 'bank_data.user_id')\n ->where('users.id', '=', Auth::user()->id)\n ->get();\n } else {\n $bankdata = DB::table('users')\n ->join('bank_data', 'users.id', '=', 'bank_data.user_id')\n ->get();\n }\n return view('bank_data.index')->with('data',$bankdata);\n }", "public function run()\n\t{\n\t\tDB::table('licenses')->delete();\n\t\t$licenses = array(\n\t\t\t[ 'id' => 1\n\t\t\t, 'acro' => ''\n\t\t\t, 'name' => 'All Rights Reserved'\n\t\t\t, 'url' => ''\n\t\t\t],\n\t\t\t[ 'id' => 2\n\t\t\t, 'acro' => 'CC BY'\n\t\t\t, 'name' => 'Creative Commons Attribution'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 3\n\t\t\t, 'acro' => 'CC BY-SA'\n\t\t\t, 'name' => 'Creative Commons Attribution-ShareAlike'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-sa/4.0'\n\t\t\t],\n\t\t\t[ 'id' => 4\n\t\t\t, 'acro' => 'CC BY-ND'\n\t\t\t, 'name' => 'Creative Commons Attribution-NoDerivs '\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nd/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 5\n\t\t\t, 'acro' => 'CC BY-NC'\n\t\t\t, 'name' => 'Creative Commons Attribution-NonCommercial'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nc/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 6\n\t\t\t, 'acro' => 'CC BY-NC-SA'\n\t\t\t, 'name' => 'Creative Commons Attribution-NonCommercial-ShareAlike'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nc-sa/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 7\n\t\t\t, 'acro' => 'CC BY-NC-ND'\n\t\t\t, 'name' => 'Creative Commons Attribution-NonCommercial-NoDerivs'\n\t\t\t, 'url' => 'http://creativecommons.org/licenses/by-nc-nd/4.0/'\n\t\t\t],\n\t\t\t[ 'id' => 8\n\t\t\t, 'acro' => 'CC0'\n\t\t\t, 'name' => 'Public Domain'\n\t\t\t, 'url' => 'https://creativecommons.org/publicdomain/zero/1.0/'\n\t\t\t],\n\t\t);\n\t\tDB::table('licenses')->insert($licenses);\n\t}", "public function show_usrlist($eltxtusr)\n {\n // load library to cek user session and level\n $this->pageauth->sess_level_auth();\n $this->load->model('pages/m_crud_report');\n $query = $this->m_crud_report->select_usrlist($eltxtusr);\n ?>\n <!-- tampilkan ketika dalam mode print -->\n <div class=\"title\" align=\"center\" style=\"margin-top: 10px;\">\n DAFTAR PENGGUNA (USER)<br/>\n YANG TERDAFTAR DALAM SISTEM\n </div>\n <table id=\"id_tblusr\" class=\"display compact table-hover\" role=\"grid\" aria-describedby=\"example2_info\">\n <thead>\n <tr>\n <th>NAMA USER</th>\n <th>KATA KUNCI</th>\n <th>AKSES</th>\n <th>NAMA LENGKAP</th>\n <th>OTORISASI</th>\n </tr>\n </thead>\n <tbody id=\"id_TbodyRptUsr\">\n <?php\n foreach ($query->result() as $row) {\n echo \" <tr>\";\n echo \" <td>\". $row->username .\"</td>\";\n echo \" <td>\". $row->password .\"</td>\";\n echo \" <td>\". $row->access .\"</td>\";\n echo \" <td>\". $row->fullname .\"</td>\";\n echo \" <td>\". $row->obj_level .\"</td>\";\n echo \" </tr>\";\n }\n ?>\n </tbody>\n </table>\n <?php\n }", "function show_admin_table($table_name) {\n\t\n\tsession_start();\t\t\t\t\t\t// Restore session variables\n\tif ($_SESSION['uid']) {\t\t\t// Only process if a user is logged in\n\t\t\n\t\t$uid = $_SESSION['uid'];\t// Get the uid from the session\n\n\t\t// Get the course id, subject, number and user id\n\t\t$rows = run_query(\"SELECT cid, sub, num, uid FROM $table_name WHERE uid='$uid'\");\n\t\t\n\t\tif ($rows) { // Only process if there are rows\n\t\t\t\n\t\t\t// Hard-code the table header row (ths)\n\t\t\t$ths .= '\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Admin Controls</th>\n\t\t\t\t\t<th>Course ID</th>\n\t\t\t\t\t<th>Subject</th>\n\t\t\t\t\t<th>Number</th>\n\t\t\t\t\t<th>User ID</th>\n\t\t\t\t</tr>';\n\t\t\t\n\t\t\t// Loop for each row and use the cid to create custom URL links for editing and deleting courses\t\n\t\t\twhile($row = $rows->fetch_assoc()) {\n\t\t\t\t$tds .= '\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<a class=\"btn btn-sm btn-warning\" href=\"update_course.php?cid='.$row['cid'].'\">Edit</a>\n\t\t\t\t\t\t\t<a class=\"btn btn-sm btn-danger delete\" id=\"'.$row['cid'].'\">X</a>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>'.$row['cid'].'</td>\n\t\t\t\t\t\t<td>'.$row['sub'].'</td>\n\t\t\t\t\t\t<td>'.$row['num'].'</td>\n\t\t\t\t\t\t<td>'.$row['uid'].'</td>\n\t\t\t\t\t</tr>';\n\t\t\t}\n\t\t\t\n\t\t\t// Slice the header row and table data into a Bootstrap table\n\t\t\t$table = '\n\t\t\t\t<table class=\"table\">\n\t\t\t\t <thead>\n\t\t\t\t \t'.$ths.'\n\t\t\t\t </thead>\n\t\t\t\t <tbody>\n\t\t\t\t \t'.$tds.'\n\t\t\t\t </tbody>\n\t\t\t\t</table>';\t\t\n\t\t\n\t\t\t// Return the table\n\t\t\treturn $table;\t\t\t\n\t\t}\n\t\treturn 'No rows';\n\t}\n\treturn 'Must be logged in';\n}", "public function index()\n\t{\n\t\t$licenses = License::all();\n\n\t\treturn View::make('backend.licenses.index', compact('licenses'));\n\t}", "public function table()\n\t{\n\t\t$sql = '\n\t\t\tselect \n\t\t\t\tid, \n\t\t\t\tname, \n\t\t\t\tenable \n\t\t\tfrom \n\t\t\t\tfile \n\t\t\twhere \n\t\t\t\tuser = ?';\n\n\t\t$results = DB::select($sql, [Auth::id()]);\n\n\t\treturn Datatable::collection(new Collection($results))\n\t\t\t->showColumns('name')\n\t\t\t->addColumn('enable', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/edit&ID=\".$model->id.\"&EN=\".$model->enable).'\">'.$model->enable.'</a>';\n\t\t\t})\n\t\t\t->addColumn('remove', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/delete&ID=\".$model->id).'\"><i class=\"fa fa-times\"></i></a>';\n\t\t\t})\n ->searchColumns('name')\n ->orderColumns('enable', 'name')\n ->make();\n\t}", "public function belongingToUserLicense(UserLicense $account);", "public function fetchLicenseHistory()\n {\n $history = [];\n $query = $this->db->executeQuery(\n \"SELECT\n l.id,\n TO_CHAR(l.creation_date, 'Dy DD Mon YYYY, HH24:MI') AS creation_date,\n TO_CHAR(l.creation_date, 'YYYY-MM-DD HH24:MI:SS') AS creation_date_iso,\n TO_CHAR(l.activation_date, 'Dy DD Mon YYYY, HH24:MI') AS activation_date,\n TO_CHAR(l.activation_date, 'YYYY-MM-DD HH24:MI:SS') AS activation_date_iso,\n TO_CHAR(l.expiry_date, 'Dy DD Mon YYYY, HH24:MI') AS expiry_date,\n TO_CHAR(l.expiry_date, 'YYYY-MM-DD HH24:MI:SS') AS expiry_date_iso,\n array_to_json(l.ip_addr) AS ip_addr,\n array_to_json(l.domains) AS domains,\n array_to_json(array_agg(mi.description\n ORDER BY mi.id ASC)) AS modules_names,\n now() BETWEEN activation_date AND expiry_date AS active\n FROM license l\n LEFT JOIN modules_available mi ON mi.id = ANY (l.modules_installed) AND mi.enabled_by_default=0\n WHERE client_id = :clientId\n GROUP BY l.id\n ORDER BY l.creation_date DESC\",\n [':clientId' => $_POST['clientId']]\n );\n while (($row = $query->fetch()) !== FALSE) {\n $row['modules_names'] = json_decode($row['modules_names'], TRUE);\n $row['ip_addr'] = json_decode($row['ip_addr'], TRUE);\n $row['domains'] = json_decode($row['domains'], TRUE);\n $history[] = $row;\n }\n if (!empty($history)) {\n $history[0]['isLatest'] = TRUE;\n }\n $this->response = [\"licenses\" => $history];\n }", "public function license()\n {\n return $this->belongsTo('CityBoard\\Entities\\License');\n }", "static function countForUserLicense($user_id) {\n global $DB;\n\n $user_id = (int) $user_id;\n\n $query = \"SELECT COUNT(`glpi_users_softwarelicenses`.`id`)\n FROM `glpi_users_softwarelicenses`\n INNER JOIN `glpi_users` ON (`glpi_users_softwarelicenses`.`users_id` = `glpi_users`.`id`)\n WHERE `glpi_users_softwarelicenses`.`users_id` = '$user_id'\";\n\n $result = $DB->query($query);\n\n if ($DB->numrows($result) != 0) {\n return $DB->result($result, 0, 0);\n }\n\n return 0;\n }", "public function index()\n {\n $logued_user = Auth::user();\n if($logued_user->usrc_admin || $logued_user->can('see.dist')){\n if($logued_user->usrc_admin || $logued_user->usrc_super){\n $distributors = Distributor::all();\n }else{\n $distributors = [Distributor::findOrFail($logued_user->usrc_distrib_id)];\n }\n return view('appviews.distributorshow',['distributors'=>$distributors]);\n }else{\n return view('errors.403');\n }\n \n }", "function Avi_list(){\n\t\t\n\t\t//Doctor INNER JOIN with availability for doctor name and his Avialibalility\n\t\t$data = $this->View('users.firstname,users.lastname,availability.id,availability.monday,availability.tuesday,availability.wednesday,availability.thursday,availability.friday,availability.saturday,availability.sunday,availability.date','users',\" LEFT JOIN availability ON users.id = availability.user_id \",'');\n\t\t\n\t\t//if availability is in table\n\t\t if($data){\n\t\t\t\n\t\t // for serial no\t \n\t\t $sno =1;\n\t\t \n\t\t // view all availability from table\n\t\t foreach($data as $value){\n\t\t\t \n\t\techo \t\"<tr>\n\t\t\t<td></td>\n\t\t\t<td>\".$sno++.\"</td>\n <td>\".$value['firstname'].\" \".$value['lastname'].\"</td>\n \n \n\t\t\t<td>\".$value['monday'].\"</td>\n\t\t\t<td>\".$value['tuesday'].\"</td>\n\t\t\t<td>\".$value['wednesday'].\"</td>\n\t\t\t<td>\".$value['thursday'].\"</td>\n\t\t\t<td>\".$value['friday'].\"</td>\n\t\t\t<td>\".$value['saturday'].\"</td>\n\t\t\t<td>\".$value['sunday'].\"</td>\n\t\t\t<td>\".$value['date'].\"</td>\n\t\t\t\n\t\t\t\n <td class='datatable-ct'>\n\t\t\t<a title='Edit' href='Availability?Edit=\".$value['id'].\"'><i class='fa fa-pencil-square-o' aria-hidden='true'></i></a>\n\t\t\t<a title='Edit Picture' href='Availability?Edit-Img=\".$value['id'].\"'><i class='fa fa-picture-o' aria-hidden='true'></i></a>\n\t\t\t<a href='Availability?List=\".$value['id'].\"' title='Delete'><i class='fa fa-trash' aria-hidden='true'></i></a>\n\t\t\t</td>\n </tr>\";\n\t\t\t \n\t\t\t\n\t\t } // Foreach close\n\t \n\t\t } // if close\n\t\t\n\t}", "function the_uds_pricing_table($name = '')\n{\n\techo get_uds_pricing_table($name);\n}", "public function index()\n {\n //\n $status = DB::table('users')\n ->join('cradits', 'users.id', '=', 'cradits.user_id')\n ->select('users.f_name', 'cradits.*')\n ->get();\n return view('admin.credit.list', compact('status'));\n }", "public function run()\n {\n $licenses = [\n [\n 'name' => 'Vergunning POB1703',\n 'description' => 'Vergunning van Justis',\n 'creator_id' => 1,\n 'modifier_id' => 1,\n 'user_id' => 1,\n 'organization_id' => 1,\n 'belongs_to' => 'user_id',\n 'type' => 'Vergunning POB',\n 'number' => '201934435335',\n 'issued_by_organization_id' => 1,\n 'valid_from' => Carbon::now(),\n 'valid_to' => Carbon::now()->addMonths(60),\n 'profile_picture_path' => 'profilepicture/profilepicture'\n ],[\n 'name' => 'Legitimatie Particulier Onderzoeker',\n 'description' => 'De gele pas',\n 'creator_id' => 1,\n 'modifier_id' => 1,\n 'user_id' => 1,\n 'organization_id' => 1,\n 'belongs_to' => 'user_id',\n 'type' => 'Legitimatiebewijs P.O.',\n 'number' => '12424546664',\n 'issued_by_organization_id' => 1,\n 'valid_from' => Carbon::now(),\n 'valid_to' => Carbon::now()->addMonths(36),\n 'profile_picture_path' => 'profilepicture/profilepicture'\n ],[\n 'name' => 'Legitimatie Particulier Onderzoeker',\n 'description' => 'De gele pas',\n 'creator_id' => 1,\n 'modifier_id' => 1,\n 'user_id' => 4,\n 'organization_id' => 1,\n 'belongs_to' => 'user_id',\n 'type' => 'Legitimatiebewijs P.O.',\n 'number' => '646346648',\n 'issued_by_organization_id' => 1,\n 'valid_from' => Carbon::now(),\n 'valid_to' => Carbon::now()->addMonths(12),\n 'profile_picture_path' => 'profilepicture/profilepicture'\n ]\n ];\n foreach($licenses as $license){\n License::create($license);\n }\n }", "public function table()\n\t{\n\t\t$this->datatables->select('experiment_id, user_id_caller, id');\n\t\t$this->datatables->from('caller');\n\n\t\t$this->datatables->edit_column('experiment_id', '$1', 'experiment_get_link_by_id(experiment_id)');\n\t\t$this->datatables->edit_column('user_id_caller', '$1', 'user_get_link_by_id(user_id_caller)');\n\t\t$this->datatables->edit_column('id', '$1', 'caller_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "public static function showUserTableFromDb() {\n $model = new UserModel();\n $users = $model->getUsers();\n\n echo \"<table id='users'>\n <tr>\n <th></th>\n <th>Utilisateur</th>\n <th>Date de création</th>\n <th>Mail</th>\n <th>Date de naissance</th>\n <th>Note</th>\n <th>Voitures</th>\n <th>Commentaires</th>\n </tr>\";\n for ($i = 0; $i < count($users); $i++ ) {\n\n $user = $users[$i];\n array_push(User::$listOfUsers, $user);\n\n echo \"<tr>\";\n echo \"<td>\";\n $iLink = $i + 1;\n echo \"<a href='users.php?user=$iLink'>Voir</a>\";\n echo \"</td>\";\n echo \"<td>\";\n echo $user['firstName'] . \" \" . $user['lastName'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['date'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['email'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['birthDate'];\n echo \"</td>\";\n echo \"<td>\";\n if($user['rate'] === '0') { echo \"Pas de note\"; }\n echo \"</td>\";\n echo \"<td>\";\n echo $user['listOfCars'];\n echo \"</td>\";\n echo \"<td>\";\n echo $user['listOfComments'];\n echo \"</td>\";\n echo \"</tr>\";\n }\n $_SESSION['listOfUsers'] = User::$listOfUsers;\n\n echo \"</table>\";\n }", "public function index()\n {\n return view('licenses.index');\n }", "public function showPartnersTable() {\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM partner\");\r\n\t\techo \"<h3>Partner Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"name\" . \"</td><td>\" . \"company_address\" . \"</td><td>\" . \"contact_phone_number\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['name'] . \"</td><td>\" . $row['company_address'] . \"</td><td>\" . $row['contact_phone_number'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function product_list(Request $request)\n {\n $this->authorize('product.index');\n $cek=User::find(Auth::user()->id) ;\n $roles = $cek->getRoleNames();\n $result = array();\n\n foreach($roles as $inner) {\n $result[] = $inner;\n }\n if (in_array('Super Users',$result) ) {\n $product=ProductModel::all();\n } else {\n $product=ProductModel::where('created_by',Auth::user()->uuid)->orwhere('company_uuid'.Auth::user()->company_uuid);\n }\n\n\n return Datatables::of($product)\n ->addColumn('action', function ($product) {\n return '<a href=\"#edit-'.$product->uuid.'\" class=\"btn btn-xs btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i> Edit</a>';\n })\n ->make(true);\n\n }", "function tableVolby($conn ,$selected_val){\n $sql = \"SELECT strany.nazov as nazov, strany.skratka as skratka, vysledky.kresla as kresla, \n vysledky.koalicia as koalicia\n FROM strany, vysledky, volby WHERE ((strany.id = vysledky.id_strany) \n AND (vysledky.id_volby = volby.id))\n AND(volby.den1 = '$selected_val')\";\n $result = $conn->query($sql);\n\n if ($result->num_rows > 0) {\n echo \"<table id='myTable'>\";\n echo \" \n <tr class=\\\"header\\\">\n <th onclick>Nazov</th> \n <th onclick>Skratka</th> \n <th onclick>Kresla</th>\n <th onclick>Koalicia</th>\n </tr>\";\n // output data of each row\n while($row = $result->fetch_assoc()) {\n writeTableLine2($row);\n }\n echo \"</table><br>\";\n }\n// else {\n// echo \"0 results\";\n// }\n $result->free();\n}" ]
[ "0.6470301", "0.59512675", "0.5898452", "0.58076394", "0.5798497", "0.5766815", "0.57250226", "0.57234275", "0.57055265", "0.56449306", "0.5583922", "0.5566481", "0.5553278", "0.55459774", "0.5538098", "0.55198485", "0.5504716", "0.5499712", "0.54753596", "0.5469555", "0.54670256", "0.54485786", "0.54472035", "0.5442372", "0.54317564", "0.5417048", "0.54133195", "0.5410009", "0.54056066", "0.5389684" ]
0.77051556
0
Merges the current validation results with another results
public function mergeResults(ValidationResults $results) : ValidationResults { foreach ($results->result() as $field => $messages) { foreach ($messages as $message) { $this->addFieldError($message, $field); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function merge($result_to_merge){\n \t// If result to merge is valid do nothing - everything is ok with it, there is no messages\n if($result_to_merge->is_valid()) return;\n\n // Set current result is valid flag.\n $this->set_valid($result_to_merge->is_valid());\n\n // Append messages from result to merge\n $this->messages = $this->messages + $result_to_merge->get_messages();\n }", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * If source and target institute id is available in input decode it and merge with input\n\t\t */\n\t\tif ( $this->has('source_institute_id') ) {\n\t\t\t$input['source_institute_id'] = GeneralHelpers::decode($this->input('source_institute_id'));\n\t\t}\n\n\t\tif ( $this->has('target_institute_id') ) {\n\t\t\t$input['target_institute_id'] = GeneralHelpers::decode($this->input('target_institute_id'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData();\n\t}", "protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}", "private function getResult(): void\n {\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match_count = count($match['matching_filters']);\n if ($match_count === 1) { // Save Matches\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n $this->SearchResult->matches[$n_key] = $match;\n continue;\n } elseif ($match_count > 1) { // Save Indecisive\n $result = [];\n $matching_filters = $match['matching_filters'];\n unset($match['matching_filters']);\n foreach ($matching_filters as $filter) {\n $result[] = $this->getReturnValues($match, $filter['filter_id']);\n }\n $match[$this->config->prefix . 'matching_filters'] = $result;\n $this->SearchResult->indecisive_matches[$n_key] = $match;\n continue;\n }\n }\n // Save no matches\n $this->SearchResult->no_matches[$n_key] = $match;\n }\n }", "public function validate()\n {\n $this->resetResult();\n\n // This CompositeValidator has been disabled in full\n if (!$this->getEnabled()) {\n return $this->result;\n }\n\n foreach ($this->getValidators() as $validator) {\n // validate() will return a ValidationResult, and we will combine this with the result we already have\n $this->getResult()->combineAnd($validator->validate());\n }\n\n return $this->result;\n }", "public function clearBeforeValidate(): ValidationResult\n {\n $this->isValid = true;\n $this->rules = null;\n return $this;\n }", "protected function prepareForValidation()\n {\n $merge = [];\n\n if ($this->valtotal) {\n $merge['valtotal'] = Format::strToFloat($this->valtotal);\n }\n\n $this->merge($merge);\n }", "private function getConjoinedResult(): void\n {\n $tot_match = 0;\n $tot_indecisive = 0;\n $tot_no_match = 0;\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match[$this->config->prefix . 'filter_match_count'] = count($match['matching_filters']);\n } else {\n $match[$this->config->prefix . 'filter_match_count'] = 0;\n }\n if ($match[$this->config->prefix . 'filter_match_count'] === 1) {\n $tot_match++;\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n } elseif ($match[$this->config->prefix . 'filter_match_count'] > 1) {\n unset($match['matching_filters']);\n $tot_indecisive++;\n } else {\n $tot_no_match++;\n }\n $this->SearchResult->matches[$n_key] = $match;\n }\n $this->SearchResult->total_matches = $tot_match;\n $this->SearchResult->total_indecisive_matches = $tot_indecisive;\n $this->SearchResult->total_no_matches = $tot_no_match;\n }", "public function getValidationResult();", "protected function mergeResults($newValues)\n {\n $this->results = array_merge($this->results, $newValues);\n }", "private function PREPARE_VALIDATION_RESULTS()\r\r {\r\r $this->PREPARE_OBJECT_VARIABLE_METHOD(); \r\r $this->READ_FIELDS();\r\r \r\r foreach($this->_ready_fields as $key => $fields)\r\r {\r\r # SET THE ALIAS FOR EACH FIELD\r\r $this->_object[$key]['ALIAS'] = (isset($fields['ALIAS'])) ? $fields['ALIAS'] : $key; \r\r \r\r # IF VALUE IS NOT NULL\r\r if(isset($fields['REQUIRED']) && $this->_object[$key]['VALUE']===''){\r\r $this->_results[$key]['REQUIRED'] = (strlen($fields['REQUIRED']) > 1 ) ? $fields['REQUIRED'] : $this->_object[$key]['ALIAS'].' '.$this->_error['REQUIRED'];\r\r }\r\r \r\r # IF VALUE IS NOT NUMERIC\r\r if( isset($fields['NUMERIC']) && !is_numeric($this->_object[$key]['VALUE']) ){\r\r $this->_results[$key]['NUMERIC'] = (strlen($fields['NUMERIC'])>1 ? $fields['NUMERIC'] :$this->_object[$key]['ALIAS'].' '.$this->_error['NUMERIC']);\r\r }\r\r \r\r # IF VALUE IS A VALID EMAIL\r\r if(isset($fields['EMAIL']) && !$this->checkEmail($this->_object[$key]['VALUE'])){\r\r $this->_results[$key]['EMAIL'] = (strlen($fields['EMAIL'])>1 ? $fields['EMAIL'] :$this->_object[$key]['ALIAS'].' '.$this->_error['EMAIL']);\r\r }\r\r \r\r # IF VALUE HAS A SPECIFIC LENGTH\r\r if(isset($fields['LENGTH'])){\r\r \r\r if(array_key_exists('EQUAL', $fields['LENGTH']) && !(($fields['LENGTH']['EQUAL']) == strlen($this->_object[$key]['VALUE'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR']:$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['EQUAL'].' '.$fields['LENGTH']['EQUAL'].' characters';\r\r }\r\r # GREATER THAN \r\r else if(array_key_exists('GREAT', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE']) > ($fields['LENGTH']['GREAT'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT'].' '.$fields['LENGTH']['GREAT'].' characters';\r\r }\r\r # GREATER THAN EQUAL TO \r\r else if(array_key_exists('GREAT_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])>=($fields['LENGTH']['GREAT_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['GREAT_E'].' '.$fields['LENGTH']['GREAT_E'].' characters';\r\r }\r\r # LESS THAN \r\r else if(array_key_exists('LESS', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<($fields['LENGTH']['LESS'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS'].' '.$fields['LENGTH']['LESS'].' characters';\r\r }\r\r # LESS THAN EQUAL TO \r\r else if(array_key_exists('LESS_E', $fields['LENGTH']) && !(strlen($this->_object[$key]['VALUE'])<=($fields['LENGTH']['LESS_E'])))\r\r {\r\r $this->_results[$key]['LENGTH'] =isset($fields['LENGTH']['ERROR'])? $fields['LENGTH']['ERROR'] :$this->_object[$key]['ALIAS'].' '.$this->_error['LENGTH']['LESS_E'].' '.$fields['LENGTH']['LESS_E'].' characters';\r\r }\r\r }\r\r \r\r # IF A FIELD IS EQUAL TO ANOTHER FIELD \r\r if(isset($fields['COMPARE'])){\r\r \r\r if(is_array($fields['COMPARE']))\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']['WITH']]['VALUE']){ \r\r $this->_results[$key]['COMPARE'] = isset($fields['COMPARE']['ERROR']) ? $fields['COMPARE']['ERROR'] : $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']['WITH']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r } \r\r else\r\r {\r\r if($this->_object[$key]['VALUE']!==$this->_object[$fields['COMPARE']]['VALUE']){\r\r $this->_results[$key]['COMPARE'] = $this->_object[$key]['ALIAS'] .' and '. $this->_ready_fields[$fields['COMPARE']]['ALIAS'].' '. $this->_error['COMPARE'];\r\r }\r\r }\r\r }\r\r \r\r } \r\r }", "public function doMergeStatus()\n {\n $result = new ezcMvcResult();\n $result->variables += mmApp::doMergeStatus( $this->mergeHash );\n return $result;\n }", "public function prepareResults()\n {\n $final_imageset = $this->_imagesets;\n foreach ($this->_imagesets as $run_id => $imageset) {\n if (!$this->_validateOutFiles($imageset['out_images'])) {\n unset($final_imageset[$run_id]);\n break;\n }\n $final_imageset[$run_id]['recordtodb'] = isset($imageset['out_images']['main']);\n// unset ($final_imageset[$run_id]['out_images']);\n foreach ($this->_image->getColours() as $colour) {\n $tmp_colour = $imageset[$colour];\n $final_imageset[$run_id][$colour] = $tmp_colour['colour'];\n $final_imageset[$run_id]['imlev'] = $tmp_colour['levels']['imlev'];\n foreach (['r', 'v'] as $levtype) {\n foreach (['min', 'max'] as $minmax) {\n $minkey = sprintf(\"%s%s_%s\", $minmax, $colour, $levtype);\n $final_imageset[$run_id][$minkey] = $tmp_colour['levels'][$levtype][$minmax];\n }\n }\n }\n $final_imageset[$run_id] = array_merge($final_imageset[$run_id], $this->_commons);\n }\n return $final_imageset;\n }", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * Decode institute and ref_by id and merge to request input\n\t\t */\n\t\tif ( $this->has('institute_id') ) {\n\t\t\t$input['institute_id'] = GeneralHelpers::decode($this->input('institute_id'));\n\t\t}\n\n\t\tif ( $this->has('ref_by') ) {\n\t\t\t$input['ref_by'] = GeneralHelpers::decode($this->get('ref_by'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData(); // TODO: Change the autogenerated stub\n\t}", "private function resetRuleResults() {\n $this->ruleResults = array();\n return $this;\n }", "public function addNoResultsCheck()\n {\n $this->isResultCheck = false;\n return $this;\n }", "public function merge() {}", "private function collectValidateErrors()\n {\n // collect errors from current model\n $this->addModelErrors();\n }", "public function getValidationResult()\n {\n return $this->validationResult;\n }", "public function merge();", "public function clearFailedValidationData()\n {\n FormUtil::clearValidationFailedObjects($this->_objPath);\n }", "private function checkObjectsErrorsOrConfirmations()\n\t{\n\t\tif (!empty(self::$obj_ts_common->errors))\n\t\t\t$this->errors = array_merge($this->errors, self::$obj_ts_common->errors);\n\n\t\tif (!empty(self::$obj_ts_common->confirmations))\n\t\t\t$this->confirmations = array_merge($this->confirmations, self::$obj_ts_common->confirmations);\n\t}", "public function _processResults(){\n $data = array();\n foreach($this->_resultset as $doc){\n\t$fields = array();\n\tforeach($doc as $key => $value){\n $fields[$key] = $value;\n }\n \t$data[] = $fields;\n }\n $processor = new Pas_Solr_SensitiveFields();\n $clean = $processor->cleanData($data, $this->_getRole(), $this->_core);\n return $clean;\n }", "public function validationSummary();", "public function merge(Validation $validation) {\n $this->getValidation()->merge($validation, $this->getName());\n return $this;\n }", "public static function buildValidResult(): ValidationResultVO\n {\n $validationResult = new ValidationResultVO();\n $validationResult->setValid(true);\n return $validationResult;\n }", "function processResults() {\n\n/* ... setup validation on the basic data the form should have provided us; our validation rules vary depending whether */\n/* the game was played or not */\n $this->load->library( 'form_validation' );\n if ($this->input->post( \"notPlayed\" ) != \"notPlayed\") {\n $gamePlayed = true;\n $this->form_validation->set_rules( \"visitScore\", \"Visiting team's score\", \"trim|min_length[1]|max_length[2]|integer|required|callback_positiveIntCheck\" );\n $this->form_validation->set_rules( \"homeScore\", \"Home team's score\", \"trim|min_length[1]|max_length[2]|integer|required|callback_positiveIntCheck\" );\n }\n else {\n $gamePlayed = false;\n $this->form_validation->set_rules( \"reason\", \"Reason\", \"min_length[5]|max_length[256]|required\" );\n }\n\n/* ... validate the form contents */\n if ($this->form_validation->run()) {\n\n/* ... determine what game information we need to save to the database - played game or a rainout */\n if ($gamePlayed) {\n $formData = array( \n \"HomeScore\" => $this->input->post( \"homeScore\" ), \n \"VisitScore\" => $this->input->post( \"visitScore\" ),\n \"Status\" => \"PLAYED\",\n \"Notes\" => NULL,\n );\n }\n else {\n $formData = array( \n \"Status\" => \"RAINOUT\",\n \"Notes\" => $this->input->post( \"reason\" ),\n \"HomeScore\" => NULL, \n \"VisitScore\" => NULL,\n );\n }\n $this->Model_Tournament->saveGameResult( $this->input->post( \"gameID\" ), $formData );\n\n/* ... if the game was played, we need to place the winner and maybe the loser in their next game */\n $nextGame = array();\n if ($gamePlayed && $formData['VisitScore'] != $formData['HomeScore']) {\n $gameDetails = $this->Model_Tournament->getGameDetails( $this->input->post( \"gameID\" ) );\n if ($formData['VisitScore'] > $formData['HomeScore']) {\n $winTeam = $gameDetails['VisitTeamID'];\n $loseTeam = $gameDetails['HomeTeamID'];\n }\n else {\n $winTeam = $gameDetails['HomeTeamID'];\n $loseTeam = $gameDetails['VisitTeamID'];\n }\n $nextGame['Winner'] = $this->Model_Tournament->determineNextGame( $this->input->post( \"gameID\" ), $winTeam, \"WINNER\" );\n $nextGame['Loser'] = $this->Model_Tournament->determineNextGame( $this->input->post( \"gameID\" ), $loseTeam, \"LOSER\" );\n }\n\n/* ... send an email out to the team contacts sharing the game results */\n $this->_emailTeams( $this->input->post( \"gameID\" ), $nextGame );\n\n/* ... a web trick that will popup a window for the user telling them their information was accepted */\n?>\n<script language=\"javascript\">\n alert( \"Game results saved in database. Results email issued.\" );\n window.close();\n</script>\n<?php\n\n/* ... re-display the team's tournament schedule now include this game's results */\n $this->report();\n }\n else {\n\n/* ... determine what data or state from this form submission we need to pass back for the form re-draw; */\n/* ... at this time, we need to know whether this was a played gamed or not, to set the checkbox on the form */\n if ($gamePlayed) {\n $formData = array(\n \"notPlayed\" => FALSE,\n );\n }\n else {\n $formData = array(\n \"notPlayed\" => TRUE,\n );\n }\n \n $this->reportScore( $this->input->post( \"gameID\" ), $formData );\n }\n\n/* ... time to go */\n return;\n }", "public static function applyValidation() {\n foreach (self::$_rules as $rk => $rv) {\n $_element = self::$_rules[$rk];\n if (is_array($_element)) {\n foreach ($_element as $key => $ruleValue) {\n if (!self::$_elements[$rk]['inValid']) {\n $method = \"_\" . $key;\n self::$_inputElement = $rk;\n self::$_elementValue = self::$_values[$rk];\n self::$_validationRule = $key;\n self::$_ruleValue = $ruleValue;\n\n self::$method();\n }\n }\n }\n }\n\n if (count(self::$_response) == 0) {\n return true;\n }\n\n return self::$_response;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function preFinalResult()\n {\n if(!empty($this->recSize) && is_array($this->recSize)) { \n $arr=array_count_values($this->recSize); \n \n foreach($arr as $key=>$value)\n {\n // $very_tught_plus=(isset($result['data'][Evaluate::VERY_TIGHT_PLUS]))\n // ? array_key_exists($key, $result['data'][Evaluate::VERY_TIGHT_PLUS])\n // : false;\n // \n // $baggy_plus=(isset($result['data'][Evaluate::BAGGY_PLUS]))\n // ? array_key_exists($key, $result['data'][Evaluate::BAGGY_PLUS])\n // : false; \n \n $rangeListCount=count($this->useRangeList);\n $lesBy=$rangeListCount-$value;\n if($rangeListCount==$value)\n $this->fullyFittedSizeList[$key]=Evaluate::RECOMENDED;\n elseIf($lesBy==$this->entryNeededNotLessThan){\n $this->semiFittedSizeList[$key]=Evaluate::SEMI_RECOMENDED;\n } \n else\n $this->notFittedSizeList[$key]=Evaluate::NOT_FITTED; \n }\n }\n \n// if(!empty($this->fullyFittedSizeList)) {\n// } \n \n /**\n * Checks if there is a semi or fully recomended size within the finalResult[range]['recomended'] array for each range\n * and removes them from 'recomended' and puts into another key 'semirecomeded';\n */\n foreach($this->finalResult['evaluation'] as $rkey=>$result)\n {\n if(!empty($this->semiFittedSizeList)) {\n foreach($this->semiFittedSizeList as $key=>$fsize)\n {\n if(isset($result['data'][Evaluate::RECOMENDED]) && is_array($result['data'][Evaluate::RECOMENDED])){\n if(array_key_exists($key, $result['data'][Evaluate::RECOMENDED])) {\n $this->finalResult['evaluation'][$rkey]['data'][Evaluate::SEMI_RECOMENDED][$key]=$this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key];\n unset($this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key]);\n }\n } \n }\n } \n \n if(!empty($this->notFittedSizeList))\n {\n /**\n * Removed from recomended every size, that is in recomanded range only on one range formula\n * amongst 3 or more. That is if the difference between the quantity of range formulas and\n * the 'recomended' entries for a given size is more than set in $entryNeededNotLessThan=1, ot is removed\n * from 'recomended' and marked as 'not fitted'\n * \n */\n foreach($this->notFittedSizeList as $key=>$fsize)\n {\n if(isset($result['data'][Evaluate::RECOMENDED]) && is_array($result['data'][Evaluate::RECOMENDED])){\n if(array_key_exists($key, $result['data'][Evaluate::RECOMENDED])) {\n $this->finalResult['evaluation'][$rkey]['data'][Evaluate::NOT_FITTED][$key]=$this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key];\n unset($this->finalResult['evaluation'][$rkey]['data'][Evaluate::RECOMENDED][$key]);\n }\n } \n } \n }\n }\n }" ]
[ "0.6731893", "0.59041816", "0.587736", "0.5832342", "0.5663359", "0.565843", "0.5632467", "0.56121176", "0.560608", "0.55872214", "0.5583743", "0.5525473", "0.5486941", "0.5456027", "0.5331851", "0.5228975", "0.521775", "0.5193049", "0.51674277", "0.513594", "0.5127728", "0.5121044", "0.51180446", "0.5101507", "0.5084914", "0.5068329", "0.50613904", "0.5060991", "0.50540024", "0.5049215" ]
0.7211679
0
Add filtering by profile ids
public function addIdsToFilter($profileIds) { $this->addFieldToFilter('main_table.profile_id', $profileIds); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _addProfileFilters($profile)\n {\n $filters = array();\n // Table prefix\n $tablePrefix = 'main_table.';\n if (Mage::helper('xtcore/utils')->mageVersionCompare(Mage::getVersion(), '1.4.0.1', '<=')) {\n $tablePrefix = '';\n }\n // Filters\n $profileFilterStoreIds = explode(\",\", $profile->getStoreIds());\n if (!empty($profileFilterStoreIds)) {\n $storeIds = array();\n foreach ($profileFilterStoreIds as $storeId) {\n if ($storeId != '0' && $storeId != '') {\n array_push($storeIds, $storeId);\n }\n }\n if (!empty($storeIds)) {\n if ($profile->getEntity() == Xtento_OrderExport_Model_Export::ENTITY_CUSTOMER) {\n $websiteIds = array();\n foreach ($storeIds as $storeId) {\n array_push($websiteIds, Mage::getModel('core/store')->load($storeId)->getWebsiteId());\n }\n $filters[] = array('website_id' => array('in' => $websiteIds));\n } else {\n $filters[] = array($tablePrefix . 'store_id' => array('in' => $storeIds));\n }\n }\n }\n $profileFilterStatus = explode(\",\", $profile->getExportFilterStatus());\n if (!empty($profileFilterStatus)) {\n $statuses = array();\n foreach ($profileFilterStatus as $status) {\n if ($status !== '') {\n array_push($statuses, $status);\n }\n }\n if (!empty($statuses)) {\n if ($profile->getEntity() == Xtento_OrderExport_Model_Export::ENTITY_ORDER) {\n $filters[] = array($tablePrefix . 'status' => array('in' => $statuses));\n } else {\n $filters[] = array($tablePrefix . 'state' => array('in' => $statuses));\n }\n }\n }\n $dateRangeFilter = array();\n $profileFilterDatefrom = $profile->getExportFilterDatefrom();\n if (!empty($profileFilterDatefrom)) {\n $dateRangeFilter['datetime'] = true;\n #$dateRangeFilter['from'] = sprintf('%s 00:00:00', $profileFilterDatefrom);\n $dateRangeFilter['from'] = Mage::helper('xtento_orderexport/date')->convertDate($profileFilterDatefrom)->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n #$dateRangeFilter['to']->add(1, Zend_Date::HOUR);\n }\n $profileFilterDateto = $profile->getExportFilterDateto();\n if (!empty($profileFilterDateto)) {\n $dateRangeFilter['datetime'] = true;\n #$dateRangeFilter['to'] = sprintf('%s 23:59:59', $profileFilterDateto);\n #$dateRangeFilter['to'] = Mage::helper('xtento_orderexport/date')->convertDate($profileFilterDateto, false, true);\n $dateRangeFilter['to'] = Mage::helper('xtento_orderexport/date')->convertDate($profileFilterDateto /*, false, true*/);\n $dateRangeFilter['to']->add('1', Zend_Date::DAY);\n $dateRangeFilter['to'] = $dateRangeFilter['to']->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n }\n $profileFilterCreatedLastXDays = $profile->getData('export_filter_last_x_days');\n if (!empty($profileFilterCreatedLastXDays) || $profileFilterCreatedLastXDays == '0') {\n $profileFilterCreatedLastXDays = intval(preg_replace('/[^0-9]/', '', $profileFilterCreatedLastXDays));\n if ($profileFilterCreatedLastXDays >= 0) {\n /*$dateToday = Mage::app()->getLocale()->date();\n $dateToday->sub($profileFilterCreatedLastXDays, Zend_Date::DAY);\n $dateRangeFilter['date'] = true;\n $dateRangeFilter['from'] = $dateToday->toString('yyyy-MM-dd 00:00:00');*/\n $dateToday = Zend_Date::now();\n $dateToday->sub($profileFilterCreatedLastXDays, Zend_Date::DAY);\n $dateToday->setHour(00);\n $dateToday->setSecond(00);\n $dateToday->setMinute(00);\n $dateToday->setLocale(Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE));\n $dateToday->setTimezone(Mage::getStoreConfig(Mage_Core_Model_Locale::DEFAULT_TIMEZONE)); // Dates are stored in UTC\n $dateRangeFilter['datetime'] = true;\n $dateRangeFilter['from'] = $dateToday->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n }\n }\n $profileFilterOlderThanXMinutes = $profile->getData('export_filter_older_x_minutes');\n if (!empty($profileFilterOlderThanXMinutes)) {\n $profileFilterOlderThanXMinutes = intval(preg_replace('/[^0-9]/', '', $profileFilterOlderThanXMinutes));\n if ($profileFilterOlderThanXMinutes > 0) {\n $dateToday = Zend_Date::now();\n $dateToday->sub($profileFilterOlderThanXMinutes, Zend_Date::MINUTE);\n $dateToday->setLocale(Mage::getStoreConfig(Mage_Core_Model_Locale::XML_PATH_DEFAULT_LOCALE));\n $dateToday->setTimezone(Mage::getStoreConfig(Mage_Core_Model_Locale::DEFAULT_TIMEZONE)); // Dates are stored in UTC\n $dateRangeFilter['datetime'] = true;\n $dateRangeFilter['to'] = $dateToday->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n }\n }\n if (!empty($dateRangeFilter)) {\n if ($profile->getEntity() == Xtento_OrderExport_Model_Export::ENTITY_CUSTOMER) {\n $filters[] = array('created_at' => $dateRangeFilter);\n } else {\n $filters[] = array($tablePrefix . 'created_at' => $dateRangeFilter);\n }\n }\n return $filters;\n }", "public function filterProfiles($pks) {\n \n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n \n // Remove IDs what allready exists in the table of profiles\n $query\n ->select(\"a.id\")\n ->from($db->quoteName(\"#__itpsc_profiles\") . \" AS a\")\n ->where(\"a.id IN (\".implode(\",\", $pks).\")\");\n \n $db->setQuery($query);\n $results = $db->loadColumn();\n \n $pks = array_diff($pks, $results);\n \n return $pks;\n }", "public function filterByPrimaryKeys($keys)\n {\n\n return $this->addUsingAlias(memberProfilePeer::ID, $keys, Criteria::IN);\n }", "public function filterProfiles($profiles, $onlyAudio)\n {\n return array_filter($profiles, function ($elem) use ($onlyAudio) {\n return !$onlyAudio || $elem['audio'];\n });\n }", "function filtering_instructor_custom($qs=false,$object=false){\n \tif($object!='members')//hide for members only\n\t return $qs;\n\t \n\t $args=array('role' => 'Instructor','fields' => 'ID');\n\t $users = new WP_User_Query($args);\n\n\t $included_user = implode(',',$users->results);\n\t //$included_user='1,2,3';//comma separated ids of users whom you want to exclude\n\t \n\t $args=wp_parse_args($qs);\n\t if(!isset($args['scope']) || $args['scope'] != 'instructors')\n\t \treturn $qs;\n\t //check if we are searching or we are listing friends?, do not exclude in this case\n\t if(!empty($args['user_id'])||!empty($args['search_terms']))\n\t return $qs;\n\t \n\t if(!empty($args['include']))\n\t $args['include']=$args['include'].','.$included_user;\n\t else\n\t $args['include']=$included_user;\n\n\n\t $qs=build_query($args);\n\t \n\t return $qs;\n \n}", "function filterCourseUserNotTheme($userdata,$filter) {\n $ret = \"\";\n for($i=0;$i<count($userdata);$i++) {\n $out = $userdata[$i];\n $id = $userdata[$i][\"id\"];\n if (is_array($id)) {\n $id = $id[\"id\"];\n }\n // Adapt 2\n if (in_array($id, $filter)) {\n $ret[] = $out;\n }\n }\n return $ret;\n}", "function ds_get_social_profiles() {\n\n // Return a filterable social profile.\n return apply_filters(\n 'ds_social_profiles',\n array()\n );\n \n}", "protected function filProfileAttribute__($value)\n\t{\n\t\treturn $this->model->whereHas('profiles', function ($query) use ($value) {\n\t\t $query->where('id', '=', $value);\n\t\t});\n\t}", "public function getProfileJoinCriteria() {\n return [\n 'INNER JOIN' => [\n Profile_User::getTable() => [\n 'ON' => [\n Profile_User::getTable() => 'users_id',\n User::getTable() => 'id'\n ]\n ]\n ],\n 'WHERE' => getEntitiesRestrictCriteria(\n Profile_User::getTable(),\n 'entities_id',\n $this->getEntity(),\n true\n )\n ];\n }", "private function getUserIds($filter_name, $filter_values)\n {\n switch ($filter_name) {\n case 'common':\n $list = user_auth_peer::instance()->get_list(['del' => 0], [], ['id ASC']);\n break;\n\n case 'group':\n\n $list = db::get_cols(\n 'SELECT user_id FROM '.groups_members_peer::instance()->get_table_name(\n ).' WHERE group_id IN ('.implode(',', $filter_values).')'\n );\n break;\n\n case 'ppo':\n\n\n $ppo = ppo_peer::instance()->get_item($filter_values[0]);\n $list = ppo_members_peer::instance()->get_members($ppo['id'], false, $ppo);\n break;\n\n case 'status':\n $list = db::get_cols(\n 'SELECT id as user_id FROM '.user_auth_peer::instance()->get_table_name(\n ).' WHERE status IN ('.implode(',', $filter_values).')'\n );\n break;\n\n case 'func':\n\n foreach ($filter_values as $id => $a) {\n $where[] = \"functions && '{\".$a.\"}'\";\n }\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_desktop_peer::instance()->get_table_name().' WHERE '.implode(\n ' OR ',\n $where\n )\n );\n break;\n\n case 'region':\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name().' WHERE region_id IN ('.implode(\n ',',\n $filter_values\n ).')'\n );\n break;\n\n case 'lists':\n\n $list = db::get_cols(\n 'SELECT user_id FROM '.lists_users_peer::instance()->get_table_name().' WHERE list_id IN ('.implode(\n ',',\n $filter_values\n ).') AND type = 0'\n );\n break;\n\n case 'district':\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name().' WHERE city_id IN ('.implode(\n ',',\n $filter_values\n ).')'\n );\n break;\n\n case 'sferas':\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name().' WHERE segment IN ('.implode(\n ',',\n $filter_values\n ).')'\n );\n break;\n\n case 'political_views':\n\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_data_peer::instance()->get_table_name(\n ).' WHERE political_views = '.$filter_values\n );\n break;\n\n case 'targets':\n $i = 0;\n foreach ($filter_values as $fv) {\n $sqladd .= 'admin_target && \\'{'.$fv.'}\\' ';\n if ($i < count($filter_values) - 1) {\n $sqladd .= ' OR ';\n }\n $i++;\n }\n $list = db::get_cols(\n 'SELECT user_id\n FROM user_data WHERE '.$sqladd\n );\n break;\n\n case 'visit':\n $name = 'visit_ts';\n $value = $filter_values;\n $time = time() - abs($value * 24 * 60 * 60);\n if ($value > 0) {\n $where = \"user_id in (SELECT user_id FROM user_sessions WHERE $name > $time)\";\n } elseif ($value < 0) {\n $where = \"user_id in (SELECT user_id FROM user_sessions WHERE $name < $time)\";\n }\n $list = db::get_cols(\n 'SELECT user_id FROM '.user_sessions_peer::instance()->get_table_name().' WHERE '.$where\n );\n break;\n }\n\n\n foreach ($list as $key => $value) {\n $usr = user_auth_peer::instance()->get_item($value);\n if (1 === $usr['del'] || 0 === (int)$usr['active'] || 1 === (int)$usr['offline']) {\n unset($list[$key]);\n }\n }\n\n internal_mailing_peer::instance()->update(\n [\n 'id' => $this->mailing_id,\n 'count' => count($list),\n ]\n );\n\n return $list;\n }", "function check_privacy_filtered($myprofileid,$hisprofileid)\n{\n\t$sql=\"select * from FILTERS where PROFILEID='$hisprofileid'\";\n\t$resultfilter=mysql_query_decide($sql) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sql,\"ShowErrTemplate\");\n\n\tif(mysql_num_rows($resultfilter)>0)\n\t{\n\t\t$filterrow=mysql_fetch_array($resultfilter);\t\t\t\t\t\t\t\n\t\tif($filterrow[\"AGE\"]==\"Y\" || $filterrow[\"MSTATUS\"]==\"Y\" || $filterrow[\"RELIGION\"]==\"Y\" || $filterrow[\"COUNTRY_RES\"]==\"Y\" || $filterrow[\"MTONGUE\"]==\"Y\"|| $filterrow[\"CITY_RES\"]==\"Y\" || $filterrow[\"INCOME\"]==\"Y\" || $filterrow[\"CASTE\"]==\"Y\")\n\t\t{\n\t\t\t$sqlfilter=\"select count(*) from JPROFILE where activatedKey=1 and PROFILEID='$myprofileid'\";\n\n\t\t\t//Sharding Concept added by Lavesh Rawat on table JPARTNER\t\n\t\t\tinclude_once($_SERVER['DOCUMENT_ROOT'].\"/classes/Jpartner.class.php\");\n\t\t\t$jpartnerObj= new Jpartner;\n\t\t\t$mysqlObj=new Mysql;\n\n\t\t\t$myDbName=getProfileDatabaseConnectionName($hisprofileid,'',$mysqlObj);\n\t\t\t$myDb=$mysqlObj->connect(\"$myDbName\");\n\t\t\t$jpartnerObj->setPartnerDetails($hisprofileid,$myDb,$mysqlObj,\"LAGE,HAGE,PARTNER_CASTE,PARTNER_COUNTRYRES,PARTNER_MSTATUS,PARTNER_MTONGUE\");\n\t\t\tif($jpartnerObj->isPartnerProfileExist($myDb,$mysqlObj,$hisprofileid))\n\t\t\t{\n\t\t\t\tif($filterrow[\"AGE\"]==\"Y\" && $jpartnerObj->getLAGE() && $jpartnerObj->getHAGE() )\n\t\t\t\t\t$sqlfilter.= \" AND AGE between \".$jpartnerObj->getLAGE().\" AND \".$jpartnerObj->getHAGE();\n\n\t\t\t\tif($filterrow[\"CASTE \"]==\"Y\" && $jpartnerObj->getPARTNER_CASTE())\n\t\t\t\t{\n\t\t\t\t\t//\t$caste_arr=explode(\"','\",trim($jpartnerObj->getPARTNER_CASTE(),\"'\"));\n\t\t\t\t\t$sqlfilter.=\" and CASTE in (\".$jpartnerObj->getPARTNER_CASTE().\")\";\n\t\t\t\t\t// implode(\"','\",get_all_caste($caste_arr)) . \"')\";\n\t\t\t\t}\t\n\t\t\t\tif($filterrow[\"RELIGION \"]==\"Y\" && $jpartnerObj->getPARTNER_RELIGION())\n\t\t\t\t\t$sqlfilter.=\" AND RELIGION in (\".$jpartnerObj->getPARTNER_RELIGION().\")\";\n\n\t\t\t\tif($filterrow[\"COUNTRY_RES\"]==\"Y\" && $jpartnerObj->getPARTNER_COUNTRYRES())\n\t\t\t\t\t$sqlfilter.=\" AND COUNTRY_RES in (\".$jpartnerObj->getPARTNER_COUNTRYRES().\")\";\n\n\t\t\t\tif($filterrow[\"CITY_RES\"]==\"Y\" && $jpartnerObj->getPARTNER_CITYRES())\n\t\t\t\t\t$sqlfilter.=\" AND CITY_RES in (\".$jpartnerObj->getPARTNER_CITYRES().\")\";\n\n\t\t\t\tif($filterrow[\"MSTATUS\"]==\"Y\" && $jpartnerObj->getPARTNER_MSTATUS())\n\t\t\t\t\t$sqlfilter.=\" and MSTATUS in (\".$jpartnerObj->getPARTNER_MSTATUS().\")\";\n\n\t\t\t\tif($filterrow[\"MTONGUE\"]==\"Y\" && $jpartnerObj->getPARTNER_MTONGUE())\n\t\t\t\t\t$sqlfilter.=\" and MTONGUE in (\".$jpartnerObj->getPARTNER_MTONGUE().\")\";\n\n\t\t\t\tif($filterrow[\"INCOME\"]==\"Y\" && $jpartnerObj->getPARTNER_INCOME())\n\t\t\t\t\t$sqlfilter.=\" and INCOME in (\".$jpartnerObj->getPARTNER_INCOME().\")\";\n\t\t\t}\n\t\t\t$resfil=mysql_query_decide($sqlfilter) or logError(\"Due to a temporary problem your request could not be processed. Please try after a couple of minutes\",$sqlfilter,\"ShowErrTemplate\");\n\t\t\t$finalfilterrow=mysql_fetch_row($resfil);\n\n\t\t\tif($finalfilterrow[0] <= 0)\n\t\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "public static function filterProfiles($name)\n {\n //id: 1, 2, 3 son de admin, seller y company no deben ser borrados\n \treturn UserTypes::whereNotIn('id', [1])\n ->name($name)\n ->simplePaginate(5);\n }", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}", "public static function getAllowedCreateProfiles($idProfile) {\n if (is_numeric($idProfile)) {\n $cprofile = self::getProfileLabel($idProfile);\n } else {\n $cprofile = $idProfile;\n }\n\n $profiles = UserProfileDAO::getUserProfilesFiltered(\n self::listDisalowedViewProfilesFor($cprofile));\n return $profiles;\n }", "public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(memberProfilePeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(memberProfilePeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(memberProfilePeer::ID, $id, $comparison);\n }", "public static function getAllowedEditProfiles($idProfile) {\n if (is_numeric($idProfile)) {\n $cprofile = self::getProfileLabel($idProfile);\n } else {\n $cprofile = $idProfile;\n }\n\n $profiles = UserProfileDAO::getUserProfilesFiltered(\n self::listDisalowedViewProfilesFor($cprofile));\n return $profiles;\n }", "public static function getDetailsProfile(){\n return Profile::find()\n ->joinWith('userService')\n ->joinWith('user')\n ->where(['profile.status' => 10, 'user.status'=> 10])\n ->distinct()->all();\n }", "public function inProfileListFranchise($id) {\n\n $this->db->where('account_id', $id);\n $this->db->where('account_type', 2);\n $profileinfo = $this->db->get('profile')->result();\n return $profileinfo;\n }", "public function getMapAccessControlProfileIds()\t\t{return $this->getFromCustomData(self::CUSTOM_DATA_MAP_ACCESS_CONTROL_PROFILE_IDS, null, array());}", "private function loadFilters() {\n\n // buscando usuários\n $companyId = $this->Session->read('CompanyLoggedIn.Company.id');\n $params = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n 'CompaniesUser.user_id'\n ),\n 'conditions' => array(\n 'CompaniesUser.status' => 'ACTIVE'\n )\n )\n );\n $userIds = $this->Utility->urlRequestToGetData('companies', 'list', $params);\n if (!empty($userIds) && empty($userIds ['status'])) {\n $_SESSION ['addOffer'] ['userIds'] = $userIds;\n\n // conta público alvo\n $this->offerFilters ['target'] = count($userIds);\n\n // busca os filtros\n foreach ($this->offerFilters as $key => $value) {\n if ($key == 'gender') {\n $Paramsgenero = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n \"COUNT(User.id) AS count\",\n \"User.gender AS filter\"\n ),\n 'group' => array(\n \"User.gender\"\n ),\n 'order' => array(\n 'COUNT(User.id)' => 'DESC'\n )\n ),\n 'User' => array()\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $Paramsgenero);\n } else if ($key == 'age_group') {\n // busca faixa etária\n $query = \"SELECT\n\t\t\t\t\t SUM(IF(age < 20,1,0)) AS '{$this->ageGroupRangeKeys['0_20']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 20 AND 29,1,0)) AS '{$this->ageGroupRangeKeys['20_29']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 30 AND 39,1,0)) AS '{$this->ageGroupRangeKeys['30_39']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 40 AND 49,1,0)) AS '{$this->ageGroupRangeKeys['40_49']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 50 AND 59,1,0)) AS '{$this->ageGroupRangeKeys['50_59']}',\n\t\t\t\t\t SUM(IF(age >=60, 1, 0)) AS '{$this->ageGroupRangeKeys['60_120']}',\n\t\t\t\t\t SUM(IF(age IS NULL, 1, 0)) AS '{$this->ageGroupRangeKeys['empty']}'\n\t\t\t\t\t\tFROM (SELECT YEAR(CURDATE())-YEAR(birthday) AS age FROM facebook_profiles) AS derived\";\n\n $filterParams = array(\n 'FacebookProfile' => array(\n 'query' => $query\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'query', $filterParams);\n } else {\n $filterParams = array(\n 'FacebookProfile' => array(\n 'fields' => array(\n \"COUNT(FacebookProfile.{$key}) AS count\",\n \"FacebookProfile.{$key} AS filter\"\n ),\n 'conditions' => array(\n 'FacebookProfile.user_id' => $userIds\n ),\n 'group' => array(\n \"FacebookProfile.{$key}\"\n ),\n 'order' => array(\n \"FacebookProfile.{$key}\" => 'ASC'\n )\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $filterParams);\n }\n if (!empty($filter) && empty($filter ['status'])) {\n $this->offerFilters [$key] = $this->formatOfferFilters($filter);\n }\n }\n return $this->offerFilters;\n } else {\n $this->Session->setFlash('Houve um problema para carregar os filtros. Tente novamente.');\n }\n }", "public function getProfileIds()\n {\n $query = Profile::find()\n ->joinWith(['city' => function (ActiveQuery $query) {\n $query->joinWith(['region']);\n }], false)\n ->where([\n '{{%regions}}.id' => $this->_leader->region_id\n ]);\n\n return $query->column();\n }", "function automap_filter_by_ids(&$obj, $params = null) {\n if(isset($params['filter_by_ids']) && $params['filter_by_ids'] != '') {\n $allowed_ids = array_flip(explode(',', $params['filter_by_ids']));\n automap_filter_tree($allowed_ids, $obj);\n }\n}", "public function filterIds(int ...$ids): self;", "private function loadOfferFilters() {\n\n // buscando usuários\n $companyId = $this->Session->read('CompanyLoggedIn.Company.id');\n $params = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n 'CompaniesUser.user_id'\n ),\n 'conditions' => array(\n 'CompaniesUser.company_id' => $companyId,\n 'CompaniesUser.status' => 'ACTIVE'\n )\n )\n );\n $userIds = $this->Utility->urlRequestToGetData('companies', 'list', $params);\n\n if (!empty($userIds) && empty($userIds ['status'])) {\n $_SESSION ['addOffer'] ['userIds'] = $userIds;\n\n // conta público alvo\n $this->offerFilters ['target'] = count($userIds);\n\n // busca os filtros\n foreach ($this->offerFilters as $key => $value) {\n if ($key == 'gender') {\n $Paramsgenero = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n \"COUNT(User.id) AS count\",\n \"User.gender AS filter\"\n ),\n 'group' => array(\n \"User.gender\"\n ),\n 'conditions' => array(\n 'CompaniesUser.company_id' => $companyId,\n 'CompaniesUser.status' => 'ACTIVE'\n ),\n 'order' => array(\n 'COUNT(User.id)' => 'DESC'\n )\n ),\n 'User' => array()\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $Paramsgenero);\n } else if ($key == 'age_group') {\n // busca faixa etária\n $query = \"SELECT\n\t\t\t\t\t SUM(IF(age < 20,1,0)) AS '{$this->ageGroupRangeKeys['0_20']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 20 AND 29,1,0)) AS '{$this->ageGroupRangeKeys['20_29']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 30 AND 39,1,0)) AS '{$this->ageGroupRangeKeys['30_39']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 40 AND 49,1,0)) AS '{$this->ageGroupRangeKeys['40_49']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 50 AND 59,1,0)) AS '{$this->ageGroupRangeKeys['50_59']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 60 AND 120,1, 0)) AS '{$this->ageGroupRangeKeys['60_120']}',\n\t\t\t\t\t SUM(IF(age >= 121, 1, 0)) AS '{$this->ageGroupRangeKeys['empty']}'\n\t\t\t\t\t\tFROM (SELECT YEAR(CURDATE())-YEAR(birthday) AS age FROM users as a, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompanies_users as b where a.id=b.user_id and b.status='ACTIVE' and b.company_id = {$this->Session->read('CompanyLoggedIn.Company.id')}) AS derived\";\n\n $filterParams = array(\n 'FacebookProfile' => array(\n 'query' => $query\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'query', $filterParams);\n } else {\n $filterParams = array(\n 'FacebookProfile' => array(\n 'fields' => array(\n \"COUNT(FacebookProfile.{$key}) AS count\",\n \"FacebookProfile.{$key} AS filter\"\n ),\n 'conditions' => array(\n 'FacebookProfile.user_id' => $userIds\n ),\n 'group' => array(\n \"FacebookProfile.{$key}\"\n ),\n 'order' => array(\n \"FacebookProfile.{$key}\" => 'ASC'\n )\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $filterParams);\n }\n if (!empty($filter) && empty($filter ['status'])) {\n $this->offerFilters [$key] = $this->formatOfferFilters($filter);\n }\n }\n return $this->offerFilters;\n } else {\n $this->Session->setFlash('Houve um problema para carregar os filtros. Tente novamente.');\n }\n }" ]
[ "0.70045054", "0.6059881", "0.59145576", "0.58513653", "0.5801575", "0.5777886", "0.5754601", "0.57530564", "0.5722057", "0.56824994", "0.56702447", "0.5595527", "0.5585487", "0.5585487", "0.5585487", "0.5585487", "0.5585487", "0.5585487", "0.5585487", "0.55811626", "0.5579246", "0.5577123", "0.5489411", "0.5429057", "0.53788424", "0.5368575", "0.53320676", "0.5323283", "0.5321933", "0.5309457" ]
0.7286731
0
Set current loaded fixture version
public function setLoadedVersion($version = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setNewVersion()\n {\n $difference = '9223372036854775806';\n $rand_percent = bcdiv(mt_rand(), mt_getrandmax(), 12);\n $version = bcmul($difference, $rand_percent, 0);\n $this->owner->setAttribute($this->versionField, $version);\n }", "protected function loadToVersion()\n {\n return $this->loadVersion($this->context['new_source_dir']);\n }", "public function setVersion($version) {}", "public function setVersion($version) {}", "public function fakeVersion();", "protected function assignVersion()\n {\n $this->version = '';\n }", "protected function postFixtureRestore()\n {\n }", "public function testPhpBenchVersion()\n {\n $suiteCollection = new SuiteCollection([\n TestUtil::createSuite([\n 'uuid' => 1,\n ]),\n ]);\n\n $this->persister->persist($suiteCollection);\n $rows = $this->sqlQuery('SELECT * FROM version');\n $this->assertCount(1, $rows);\n $row = current($rows);\n $this->assertEquals(PhpBench::VERSION, $row['phpbench_version']);\n\n $suiteCollection = new SuiteCollection([\n TestUtil::createSuite([\n 'uuid' => 2,\n ]),\n ]);\n $this->persister->persist($suiteCollection);\n $this->assertEquals(1, $this->sqlCount('SELECT * FROM version'));\n }", "protected function assignVersion()\n {\n\n }", "protected function loadFromVersion()\n {\n return $this->loadVersion($this->context['source_dir']);\n }", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($version);", "public function setVersion($value){\n $this->version = $value;\n }", "public function testGetVersion(): void\n {\n $model = OsVersion::load([\n \"version\" => \"version\",\n ], $this->container);\n\n $this->assertSame(\"version\", $model->getVersion());\n }", "public static function getCurrentTypo3Version() {}", "private function setVersion($v){\n\t\t$this->version = $v;\n\t}", "public function testBackupIsRefreshed(): void\n {\n $fixtures = [\n 'Liip\\Acme\\Tests\\App\\DataFixtures\\ORM\\LoadDependentUserData',\n ];\n\n $this->databaseTool->loadFixtures($fixtures);\n\n // Load data from database\n /** @var User $user1 */\n $user1 = $this->userRepository->findOneBy(['id' => 1]);\n\n // Store random data, in order to check it after reloading fixtures.\n $user1Salt = $user1->getSalt();\n\n $dependentFixtureFilePath = static::$kernel->locateResource(\n '@AcmeBundle/DataFixtures/ORM/LoadUserData.php'\n );\n\n $dependentFixtureFilemtime = filemtime($dependentFixtureFilePath);\n\n // The backup service provide the path of the backup file\n $databaseFilePath = $this->sqliteDatabaseBackup->getBackupFilePath();\n\n if (!is_file($databaseFilePath)) {\n $this->fail($databaseFilePath.' is not a file.');\n }\n\n $databaseFilemtime = filemtime($databaseFilePath);\n\n sleep(2);\n\n // Reload the fixtures.\n $this->databaseTool->loadFixtures($fixtures);\n\n // The mtime of the file has not changed.\n $this->assertSame(\n $dependentFixtureFilemtime,\n filemtime($dependentFixtureFilePath),\n 'File modification time of the fixture has been updated.'\n );\n\n // The backup has not been updated.\n $this->assertSame(\n $databaseFilemtime,\n filemtime($databaseFilePath),\n 'File modification time of the backup has been updated.'\n );\n\n $user1 = $this->userRepository->findOneBy(['id' => 1]);\n\n // Check that random data has not been changed, to ensure that backup was created and loaded successfully.\n $this->assertSame($user1Salt, $user1->getSalt());\n\n sleep(2);\n\n // Update the filemtime of the fixture file used as a dependency.\n touch($dependentFixtureFilePath);\n\n $this->databaseTool->loadFixtures($fixtures);\n\n // The mtime of the fixture file has been updated.\n $this->assertGreaterThan(\n $dependentFixtureFilemtime,\n filemtime($dependentFixtureFilePath),\n 'File modification time of the fixture has not been updated.'\n );\n\n // The backup has been refreshed: mtime is greater.\n $this->assertGreaterThan(\n $databaseFilemtime,\n filemtime($databaseFilePath),\n 'File modification time of the backup has not been updated.'\n );\n\n $user1 = $this->userRepository->findOneBy(['id' => 1]);\n\n // Check that random data has been changed, to ensure that backup was not used.\n $this->assertNotSame($user1Salt, $user1->getSalt());\n }", "public function testVersionSetterGetter(): void\n {\n $version = uniqid('v', true);\n $this->component->setVersion($version);\n self::assertSame($version, $this->component->getVersion());\n }", "function setCurrentVersion(&$version) {\n\t\t$this->currentVersion = $version;\n\t}", "protected function postFixtureSetup()\n {\n }", "public function version() {\n $versionsTable = TableRegistry::get('Versions');\n $data = $versionsTable->findAllVersion();\n $this->set('web', $data[0]);\n $this->set('iOS', $data[1]);\n $this->set('android', $data[2]);\n }", "public function setVersion(?string $value): void {\n $this->getBackingStore()->set('version', $value);\n }", "public function setVersion(?string $value): void {\n $this->getBackingStore()->set('version', $value);\n }", "public function getCurrentVersion();", "public function setVersion(string $version);", "public function setVersion(?int $value): void {\n $this->getBackingStore()->set('version', $value);\n }", "protected function versionablePreSave()\n {\n if ($this->versioningEnabled === true) {\n $this->versionableDirtyData = $this->getDirty();\n $this->updating = $this->exists;\n }\n }" ]
[ "0.61856914", "0.5874032", "0.5849761", "0.5849761", "0.57558864", "0.57550806", "0.57294387", "0.57107466", "0.56864387", "0.5643377", "0.5567904", "0.5567904", "0.5567904", "0.5567904", "0.5567904", "0.5526524", "0.54975194", "0.54724044", "0.5419715", "0.5415246", "0.5389296", "0.5367255", "0.5365828", "0.53359526", "0.5317697", "0.5317697", "0.5302777", "0.5280939", "0.524044", "0.5228491" ]
0.670493
1
/ Check if Woocommerce plugin is enabled.
function pacz_woocommerce_enabled() { if ( class_exists( 'woocommerce' ) ) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function woocommerce_enabled()\n{\n\tif(class_exists('Woocommerce'))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public static function Woocommerce_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins );\n }", "static function is_woocommerce_active() {\n\t\treturn class_exists( 'Woocommerce' );\n\t}", "public static function isWoocommerceIntegration() {\n\t\t\treturn class_exists( 'WooCommerce' );\n\t\t}", "function wcwspay_is_woocommerce_active() {\n if ( in_array( \"woocommerce/woocommerce.php\", apply_filters( \"active_plugins\", get_option( \"active_plugins\" ) ) ) ) {\n return true;\n }\n return false;\n}", "function mkdf_re_is_woocommerce_installed() {\n\t\treturn function_exists('is_woocommerce');\n\t}", "function is_woocommerce_activated() {\n\t\treturn class_exists( 'woocommerce' );\n\t}", "function fiorello_mikado_is_woocommerce_installed() {\n\t\treturn function_exists( 'is_woocommerce' );\n\t}", "public static function themecomplete_woocommerce_check_only() {\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\n\t\tif ( is_multisite() ) {\n\t\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\n\t\t}\n\n\t\treturn in_array( 'woocommerce/woocommerce.php', $active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', $active_plugins );\n\t}", "function carousel_slider_is_woocommerce_active() {\n\n\t\tif ( in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins' ) ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( defined( 'WC_VERSION' ) || defined( 'WOOCOMMERCE_VERSION' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function is_woocommerce_activated() {\n return class_exists( 'woocommerce' ) ? true : false;\n}", "function check_environment() {\n if (\n !is_plugin_active('woocommerce/woocommerce.php') and\n current_user_can('activate_plugins')\n ) {\n // Stop activation redirect and show error\n $this->deactivate_plugin();\n wp_die(\n 'Sorry, but this plugin requires the Woocommerce plugin to be installed and active. <br>\n <a href=\"' . admin_url('plugins.php') . '\">&laquo; Return to Plugins</a>'\n );\n }\n }", "public function is_woocommerce_active() {\n\t\t\treturn in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );\n\t\t}", "public function is_woocommerce_active()\n {\n return in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')), true);\n }", "protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }", "public function check_required_plugins(){\n\n\t\tif ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) { ?>\n\n\t\t\t<div id=\"message\" class=\"error\">\n\t\t\t\t<p>BCIT WPD Restrict Purchase expects WooCommerce to be active. This plugin has been deactivated.</p>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\tdeactivate_plugins( '/bcit-wpd-restrict-purchase/bcit-wpd-restrict-purchase.php' );\n\t\t} // if plugin_active WooCommerce\n\n\t}", "public function is_woocommerce_activated(){\n\t\t\t$active_plugins = (array) get_option('active_plugins', array());\n\n\t\t\tif(is_multisite()){\n\t\t\t\t$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));\n\t\t\t}\n\n\t\t\treturn in_array('woocommerce/woocommerce.php', $active_plugins) || array_key_exists('woocommerce/woocommerce.php', $active_plugins);\n\t\t}", "public function using_woocommerce() {\n if ( $this->using_ecommerce() === false )\n return false;\n\n return in_array( 'woocommerce', $this->ecommerce_providers );\n }", "function mkdf_re_mkdf_woocommerce_integration_installed() {\n return defined( 'MIKADO_WOOCOMMERCE_CHECKOUT_INTEGRATION' );\n }", "function wprt_is_woocommerce_shop() {\n\tif ( ! class_exists( 'woocommerce' ) ) {\n\t\treturn false;\n\t} elseif ( is_shop() ) {\n\t\treturn true;\n\t}\n}", "public static function woocommerce_check() {\n\n\t\tif (get_option( 'woocommerce_db_version' ) === FALSE && class_exists('WC_Install')){\n\t\t\tWC_Install::update_db_version();\n\t\t}\n\n\t\tif ( self::themecomplete_woocommerce_check() && ! version_compare( get_option( 'woocommerce_db_version' ), THEMECOMPLETE_EPO_WC_VERSION, '<' ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "function mixtape_qodef_is_woocommerce_shop() {\n\t\treturn function_exists('is_shop') && (is_shop() || is_product());\n\t}", "public function is_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\t$plugins = get_plugins();\n\n\t\treturn ! empty( $plugins[ self::PLUGIN_SLUG ] );\n\t}", "private function is_required_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t$requvired_plugin_list = array(\n\t\t\t'rest-api/plugin.php',\n\t\t\t'butterbean/butterbean.php',\n\t\t);\n\t\tforeach ( $requvired_plugin_list as $plugin ) {\n\t\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private function should_load() {\n\t\treturn class_exists( 'WooCommerce', false );\n\t}", "public function is_enabled() {\n $enabled = file_exists(ABSPATH . '!sak4wp.php');\n return $enabled;\n }", "public function isGlobaleCommerceInstalled()\n {\n return $this->_isExtensionInstalled('Iparcel_GlobaleCommerce');\n }", "function plugin_is_active() {\n\t\treturn class_exists( 'Marketpress' );\n\t}", "function stage_is_shop_active()\n{\n return (bool) defined('WC_ABSPATH');\n}", "public static function isWoocommercePage()\n {\n return ( self::hasWoocommerce() && ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) );\n }" ]
[ "0.86097246", "0.8061898", "0.79279613", "0.78518116", "0.7786144", "0.77810293", "0.7728562", "0.772674", "0.7656062", "0.7560867", "0.7560824", "0.74796635", "0.74720454", "0.74670833", "0.73723966", "0.7365595", "0.73313284", "0.7331207", "0.722258", "0.7222475", "0.71052706", "0.70920825", "0.70556414", "0.70399135", "0.7038892", "0.70083123", "0.6967652", "0.6899458", "0.6886703", "0.68699074" ]
0.838199
1
Output the proceed to checkout button.
function pacz_woocommerce_button_proceed_to_checkout() { $checkout_url = wc_get_checkout_url(); ?> <div class="button-icon-holder alt checkout-button-holder"><a href="<?php echo esc_url($checkout_url); ?>" class="checkout-button"><i class="pacz-icon-shopping-cart"></i><?php esc_html_e( 'Proceed to Checkout', 'classiadspro' ); ?></a></div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentSubmitButtonText()\n\t{\n\t\treturn \"Proceed to 2checkout.com to pay\";\n\t}", "public function back_to_cart_button_on_checkout() {\n\t\t\tif ( is_checkout() && ! is_wc_endpoint_url( 'order-received' ) && astra_get_option( 'checkout-back-to-cart-button' ) ) {\n\n\t\t\t\t$back_to_cart_text = astra_get_option( 'checkout-back-to-cart-button-text' );\n\n\t\t\t\tob_start();\n\t\t\t\t?>\n\t\t\t\t\t<div class=\"ast-back-to-cart\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( wc_get_cart_url() ); ?>\" ><?php echo esc_html( $back_to_cart_text ); ?></a>\n\t\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t\techo wp_kses_post( ob_get_clean() );\n\t\t\t}\n\t\t}", "function cfc_edd_purchase_form_before_submit() { ?>\n\t<p><?php _e('Click on the button below to make your donation', 'cfctranslation'); ?>\t</p>\n<?php }", "private function show_connect_button() {\n\t\t?>\n\t\t<div class=\"text-center wp-core-ui rank-math-ui\" style=\"margin-top: 30px;\">\n\t\t\t<button type=\"submit\" class=\"button button-primary button-animated\" name=\"rank_math_activate\"><?php echo esc_attr__( 'Connect Your Account', 'rank-math' ); ?></button>\n\t\t</div>\n\t\t<?php\n\t}", "public function print_button() {\n\t\tglobal $product;\n\n\t\tswitch ( get_locale() ) {\n\t\t\tcase 'pt_BR':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Número de parcelas',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'es_ES':\n\t\t\tcase 'es_CO':\n\t\t\tcase 'es_CL':\n\t\t\tcase 'es_PE':\n\t\t\tcase 'es_MX':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Meses sin intereses'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Number of installments',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$max_instalments = $this->gateway->fetch_acquirer_max_installments_for_price($product->price);\n\n\t\t$args = apply_filters( 'ebanx_template_args', array(\n\t\t\t\t'cards' => $this->cards,\n\t\t\t\t'cart_total' => $product->price,\n\t\t\t\t'max_installment' => min($this->gateway->configs->settings['credit_card_instalments'], $max_instalments),\n\t\t\t\t'installment_taxes' => $this->instalment_rates,\n\t\t\t\t'label' => __( 'Pay with one click', 'woocommerce-gateway-ebanx' ),\n\t\t\t\t'instalments' => $messages['instalments']\n\t\t\t) );\n\n\t\twc_get_template( 'one-click.php', $args, '', WC_EBANX::get_templates_path() . 'one-click/' );\n\t}", "public function checkout()\r\n\t{\r\n\t\t$data['view_file_name'] = 'checkout_view';\r\n $this->template->load_info_view('order/checkout_view',$data);\r\n\t}", "public function showCartButton() {\n\t\t\n\t\techo $this->getCartButton();\n\t}", "static function pmpro_checkout_default_submit_button($show)\n\t\t{\n\t\t\tglobal $gateway, $pmpro_requirebilling;\n\t\t\t\n\t\t\t//show our submit buttons\n\t\t?>\n\t\t\n\t\t<span id=\"pmpro_fondy_checkout\" <?php if(($gateway != \"fondy\") || !$pmpro_requirebilling) { ?>style=\"display: none;\"<?php } ?>>\n\t\t\t\t<input type=\"hidden\" name=\"submit-checkout\" value=\"1\" />\t\t\n\t\t\t\t<input type=\"submit\" class=\"pmpro_btn pmpro_btn-submit-checkout\" value=\"<?php if($pmpro_requirebilling) { _e('Submit and Check Out', 'pmpro'); } else { _e('Submit and Confirm', 'pmpro');}?> &raquo;\" />\t\n\t\t</span>\n\t\t\t<?php\n\t\t\n\t\t\t//don't show the default\n\t\t\treturn false;\n\t\t}", "private function Checkout()\n\t{\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// If the customer is signed in, then the first step of the checkout is actually the choose billing address page so show that\n\t\tif(CustomerIsSignedIn()) {\n\t\t\t$this->ChooseBillingAddress();\n\t\t\treturn;\n\t\t}\n\n\t\t$_SESSION['CHECKOUT']['CHECKOUT_TYPE'] = 'normal';\n\n\t\tif(isset($_REQUEST['bad_login']) && $_REQUEST['bad_login'] == 1) {\n\t\t\t$GLOBALS['LoginMessage'] = getLang('BadLoginDetails');\n\t\t\t$GLOBALS['MessageClass'] = 'ErrorMessage';\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideLoginMessage'] = 'none';\n\t\t}\n\n\t\t// Otherwise, we need to show the login page for checking out\n\t\tif(GetConfig('GuestCheckoutEnabled') && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'multiple')) {\n\t\t\t$GLOBALS['HideCheckoutRegistrationRequired'] = 'display: none';\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideCheckoutGuest'] = 'display: none';\n\t\t}\n\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Checkout'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('checkout');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "static function pmpro_checkout_after_form()\n\t\t{\n\t\t?>\n\t\t<script>\n\t\t\t<!--\n\t\t\t//choosing payment method\n\t\t\tjQuery('input[name=gateway]').click(function() {\n\t\t\t\tif(jQuery(this).val() == 'paypal')\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').hide();\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').show();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').show();\n\t\t\t\t\tjQuery('#pmpro_submit_span').show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tjQuery('#pmpro_billing_address_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_payment_information_fields').hide();\n\t\t\t\t\tjQuery('#pmpro_submit_span').hide();\n\t\t\t\t\tjQuery('#pmpro_paypalexpress_checkout').show();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//select the radio button if the label is clicked on\n\t\t\tjQuery('a.pmpro_radio').click(function() {\n\t\t\t\tjQuery(this).prev().click();\n\t\t\t});\n\t\t\t-->\n\t\t</script>\n\t\t<?php\n\t\t}", "function give_display_checkout_button( $form_id, $args ) {\n\n\t$display_option = ( isset( $args['display_style'] ) && ! empty( $args['display_style'] ) )\n\t\t? $args['display_style']\n\t\t: give_get_meta( $form_id, '_give_payment_display', true );\n\n\tif ( 'button' === $display_option ) {\n\t\tadd_action( 'give_post_form', 'give_add_button_open_form', 10, 2 );\n\t\treturn '';\n\t}\n\n\tif ( $display_option === 'onpage' ) {\n\t\treturn '';\n\t}\n\n\t$display_label_field = give_get_meta( $form_id, '_give_reveal_label', true );\n\t$display_label = ! empty( $args['continue_button_title'] ) ? $args['continue_button_title'] : ( ! empty( $display_label_field ) ? $display_label_field : esc_html__( 'Donate Now', 'give' ) );\n\n\t$output = '<button type=\"button\" class=\"give-btn give-btn-' . $display_option . '\">' . $display_label . '</button>';\n\n\t/**\n\t * filter the button html\n\t *\n\t * @param string $output Button HTML.\n\t * @param int $form_id Form ID.\n\t * @param array $args Shortcode argument\n\t */\n\techo apply_filters( 'give_display_checkout_button', $output, $form_id, $args );\n}", "static function pmpro_checkout_default_submit_button($show)\n\t\t{\n\t\t\tglobal $gateway, $pmpro_requirebilling;\n\n\t\t\t//show our submit buttons\n\t\t\t?>\n\t\t\t<span id=\"pmpro_paypalexpress_checkout\" <?php if(($gateway != \"paypalexpress\" && $gateway != \"paypalstandard\") || !$pmpro_requirebilling) { ?>style=\"display: none;\"<?php } ?>>\n\t\t\t\t<input type=\"hidden\" name=\"submit-checkout\" value=\"1\" />\n\t\t\t\t<input type=\"image\" id=\"pmpro_btn-submit-paypalexpress\" class=\"pmpro_btn-submit-checkout\" value=\"<?php _e('Check Out with PayPal', 'paid-memberships-pro' );?> &raquo;\" src=\"<?php echo apply_filters(\"pmpro_paypal_button_image\", \"https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif\");?>\" />\n\t\t\t</span>\n\n\t\t\t<span id=\"pmpro_submit_span\" <?php if(($gateway == \"paypalexpress\" || $gateway == \"paypalstandard\") && $pmpro_requirebilling) { ?>style=\"display: none;\"<?php } ?>>\n\t\t\t\t<input type=\"hidden\" name=\"submit-checkout\" value=\"1\" />\n\t\t\t\t<input type=\"submit\" id=\"pmpro_btn-submit\" class=\"pmpro_btn pmpro_btn-submit-checkout\" value=\"<?php if($pmpro_requirebilling) { _e('Submit and Check Out', 'paid-memberships-pro' ); } else { _e('Submit and Confirm', 'paid-memberships-pro' );}?> &raquo;\" />\n\t\t\t</span>\n\t\t\t<?php\n\n\t\t\t//don't show the default\n\t\t\treturn false;\n\t\t}", "public function okAction() { \n $this->setSession();\n $this->setOrder($this->getOrderIdFromResponse());\n $this->setPayment();\n $this->checkHash($this->getPaymentHashFromResponse());\n $this->_session->getQuote()->setIsActive(false)->save();\n if ($this->isNewOrder()) {\n $this->_redirect('checkout/onepage/success', array('_secure'=>true)); \n } else {\n $this->loadLayout();\n $this->renderLayout(); \n } \n }", "function show_my_text_on_checkout() {\n echo '<p>All credit card details are processed and stored securely via Stripe.</p>'; \n}", "public function successAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n try {\n $quoteId = $event->successEvent();\n $this->_getCheckout()->setLastSuccessQuoteId($quoteId);\n $this->_redirect('checkout/onepage/success');\n return;\n } catch (Mage_Core_Exception $e) {\n $this->_getCheckout()->addError($e->getMessage());\n } catch(Exception $e) {\n Mage::logException($e);\n }\n $this->_redirect('checkout/cart');\n }", "function give_checkout_submit( $form_id, $args ) {\n\t?>\n\t<fieldset id=\"give_purchase_submit\" class=\"give-donation-submit\">\n\t\t<?php\n\t\t/**\n\t\t * Fire before donation form submit.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_before_submit', $form_id, $args );\n\n\t\tgive_checkout_hidden_fields( $form_id );\n\n\t\techo give_get_donation_form_submit_button( $form_id, $args );\n\n\t\t/**\n\t\t * Fire after donation form submit.\n\t\t *\n\t\t * @since 1.7\n\t\t */\n\t\tdo_action( 'give_donation_form_after_submit', $form_id, $args );\n\t\t?>\n\t</fieldset>\n\t<?php\n}", "public function success()\n {\n setcookie(\"shoppingCart\", \"\", time() - 3600, \"/\");\n return $this->twig->render('checkout/success.html.twig');\n }", "public function successAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/success', array('_secure'=>true));\n\t}", "function uni_continue_shopping_button() {\n\t$shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );\n\techo '<div class=\"continue_shopping\"><a href=\"'. $shop_page_url .'\" class=\"button\">'. __('Continue Shopping','shtheme') .' →</a></div>';\n}", "public function paymentAction()\n {\n try {\n $session = $this->_getCheckout();\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n if (!$order->getId()) {\n Mage::throwException('No order for processing found');\n }\n $order->setState(Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING, Paw_Payanyway_Model_Abstract::STATE_PAYANYWAY_PENDING,\n Mage::helper('payanyway')->__('The customer was redirected to Payanyway.')\n );\n $order->save();\n\n $session->setPayanywayQuoteId($session->getQuoteId());\n $session->setPayanywayRealOrderId($session->getLastRealOrderId());\n $session->getQuote()->setIsActive(false)->save();\n $session->clear();\n\n $this->loadLayout();\n $this->renderLayout();\n } catch (Exception $e){\n Mage::logException($e);\n parent::_redirect('checkout/cart');\n }\n }", "public function checkoutAction()\r\n\t{\r\n\r\n\t\t$this->_view->hienthi = false;\r\n\t\t$this->_view->_title = 'Thông tin đặt hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t// $this->_view->user = $this->_model->infoItem($this->_arrParam, ['task' => 'info_user']);\r\n\r\n\t\tif (isset($this->_arrParam['form']['token'])) {\t\t //khi nhan nut xac nhan\t\r\n\t\t\t$this->_validate->validateInfoOrder($this->_arrParam['form_user']);\r\n\t\t\t$this->_arrParam['form_user'] = $this->_validate->getResult();\r\n\t\t\tif (!$this->_validate->isValid()) {\r\n\t\t\t\t$this->_view->user = $this->_model->infoItem($this->_arrParam, ['task' => 'info_user']);\r\n\t\t\t\t$this->_view->hienthi = true;\r\n\t\t\t\t$this->_view->errors = $this->_validate->showErrorsPublic();\r\n\t\t\t} else {// khong co loi\r\n\r\n\t\t\t\t$this->_model->save($this->_arrParam, ['task' => 'submit_cart']);\r\n\t\t\t\t// URL::redirect('frontend', 'index', 'notice', ['type' => 'dat_hang_thanh_cong']);\r\n\t\t\t}\r\n\t\t} else { // moi vao trang\r\n\t\t\t$this->_view->hienthi = true;\r\n\t\t\t$this->_view->user = $this->_model->infoItem($this->_arrParam, ['task' => 'info_user']);\r\n\t\t}\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/checkout');\r\n\t}", "public function payAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setSinapayPaymentQuoteId($session->getQuoteId());\n\n $order = $this->getOrder();\n\n if (!$order->getId())\n {\n $this->norouteAction();\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('sinapay')->__('Customer was redirected to payment center')\n );\n $order->save();\n\n \n $this->loadLayout();\n $this->renderLayout();\n }", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "public function gotoCheckOutPage(){\n if(session('cart')){\n $cart = session('cart');\n if(count($cart['items'])>0){\n return $this->redirect('/checkout');\n }\n\n }\n $this->dispatchBrowserEvent('from-backend',['is'=>'toastr','type'=>'info','message'=>'Cart is empty.']);\n }", "public function checkout()\n {\n \\Stripe\\Stripe::setApiKey('sk_test_51HlQt5AOYmkBFRPiESZkoJGmmDsVN2lekG3Zo8lSaEjBr80nC5TLBidqgNyl9wxunXivJ8OHRSj2Ro3vEvmVTtqb00gXaVlvAG');\n \t\t\n\t\t$amount = 100;\n\t\t$amount *= 100;\n $amount = (int) $amount;\n \n $payment_intent = \\Stripe\\PaymentIntent::create([\n\t\t\t'description' => 'Stripe Test Payment',\n\t\t\t'amount' => $amount,\n\t\t\t'currency' => 'eur',\n\t\t\t'description' => 'Payment From Muhammed',\n\t\t\t'payment_method_types' => ['card'],\n\t\t]);\n\t\t$intent = $payment_intent->client_secret;\n\n\t\treturn view('chechout',compact('intent'));\n\n }", "function checkOut ( ) {\r\n\r\n\t\t// make sure the cart stays locked\r\n\t\t$this->lockCart(true);\r\n\r\n\t\t$this->glmsg .= '<checkout-shopping-cart xmlns=\"http://checkout.google.com/schema/2\">';\r\n\t\t$this->addProductsToMessage();\r\n\r\n\t\t$this->glmsg .= '<checkout-flow-support>';\r\n\t\t$this->glmsg .= '<merchant-checkout-flow-support>';\r\n\t\t$this->glmsg .= '<edit-cart-url>' . htmlspecialchars( $this->getFullUrl( 'cart.php', false, true ), ENT_NOQUOTES) . '</edit-cart-url>';\r\n\t\t$this->addShippingToMessage();\r\n\t\t$this->addTaxRates();\r\n\t\t$this->glmsg .= '</merchant-checkout-flow-support>';\r\n\t\t$this->glmsg .= '</checkout-flow-support>';\r\n\r\n\t\t$this->glmsg .= '</checkout-shopping-cart>';\r\n\r\n\t\t// contact Google\r\n\t\t$this->htmlapi_call();\r\n\t\t#print_r($this->resArray);\r\n\r\n\t\tif( $this->resArray['ACK'] != 'redirect' ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\theader(\"Location: \" . $this->resArray['URL']);\r\n\r\n\t\treturn true;\r\n\t}", "public function thank_you_page()\r\n {\r\n if ($this->instructions) {\r\n return $this->displayPaymentApprovalInstructions();\r\n }\r\n }", "public function execute()\r\n {\r\n \t\r\n\t\t$session = ObjectManager::getInstance()->get('Magento\\Checkout\\Model\\Session');\r\n\t\t\r\n $session->setPdcptbQuoteId($session->getQuoteId());\r\n //$this->_resultRawFactory->create()->setContents($this->_viewLayoutFactory->create()->createBlock('Asiapay\\Pdcptb\\Block\\Redirect')->toHtml());\r\n $session->unsQuoteId(); \r\n\r\n //get all parameters.. \r\n /*$param = [\r\n 'merchantid' => $this->getConfigData('merchant_id')\r\n \r\n ];*/\r\n //echo $this->_modelPdcptb->getUrl();\r\n $html = '<html><body>';\r\n $html.= 'You will be redirected to the payment gateway in a few seconds.';\r\n //$html.= $form->toHtml();\r\n $html.= '<script type=\"text/javascript\">\r\nrequire([\"jquery\", \"prototype\"], function(jQuery) {\r\ndocument.getElementById(\"pdcptb_checkout\").submit();\r\n});\r\n</script>';\r\n $html.= '</body></html>';\r\n echo $html;\r\n //$this->_modelPdcptb->getCheckoutFormFields();\r\n //$this->resultPageFactory->create();\r\n $params = $this->_modelPdcptb->getCheckoutFormFields();\r\n //return $resultPage;\r\n //sleep(25);\r\n //echo \"5 sec up. redirecting begin\";\r\n $result = $this->resultRedirectFactory->create();\r\n\t\t//$result = $this->resultRedirectFactory;\r\n \t$result->setPath($this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n \t//echo($this->_modelPdcptb->getUrl().http_build_query($params));\r\n \t//return $result;\r\n header('Refresh: 4; URL='.$this->_modelPdcptb->getUrl().\"?\".http_build_query($params));\r\n\t\t//$this->_redirect($this->_modelPdcptb->getUrl(),$params);\r\n\t\t//header('Refresh: 10; URL=https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp');\r\n \r\n}", "public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }", "public function render_button() {\n\n\t\t$total = WC()->cart->total;\n\n\t\t?>\n\n\t\t<div id=\"wc_braintree_paypal_container\"></div>\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_amount\" value=\"<?php echo esc_attr( WC_Braintree_Framework\\SV_WC_Helper::number_format( $total, 2 ) ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_currency\" value=\"<?php echo esc_attr( get_woocommerce_currency() ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_locale\" value=\"<?php echo esc_attr( $this->get_gateway()->get_safe_locale() ); ?>\" />\n\t\t<input type=\"hidden\" name=\"wc_braintree_paypal_single_use\" value=\"<?php echo (int) $this->is_single_use(); ?>\" />\n\n\t\t<?php\n\t}" ]
[ "0.6786226", "0.66228294", "0.6604154", "0.64324665", "0.6425758", "0.6398898", "0.63734585", "0.63566506", "0.6330638", "0.63095325", "0.62946326", "0.62737215", "0.62566847", "0.6229695", "0.62105095", "0.62018585", "0.61375", "0.6136642", "0.6135022", "0.6009594", "0.60082334", "0.59992653", "0.5992181", "0.597959", "0.5977155", "0.5942503", "0.59006226", "0.5883139", "0.58595854", "0.585621" ]
0.8038283
0
/ popup_head STYLES MEDIA THICKBOX
function popup_head() { if(isset($_GET["acf_type"]) && $_GET['acf_type'] == 'file') { ?> <style type="text/css"> #media-upload-header #sidemenu li#tab-type_url, #media-upload-header #sidemenu li#tab-gallery { display: none; } #media-items tr.url, #media-items tr.align, #media-items tr.image_alt, #media-items tr.image-size, #media-items tr.post_excerpt, #media-items tr.post_content, #media-items tr.image_alt p, #media-items table thead input.button, #media-items table thead img.imgedit-wait-spin, #media-items tr.submit a.wp-post-thumbnail { display: none; } .media-item table thead img { border: #DFDFDF solid 1px; margin-right: 10px; } </style> <script type="text/javascript"> (function($){ $(document).ready(function(){ $('#media-items').bind('DOMNodeInserted',function(){ $('input[value="Insert into Post"]').each(function(){ $(this).attr('value','<?php _e("Select File",'acf'); ?>'); }); }).trigger('DOMNodeInserted'); $('form#filter').each(function(){ $(this).append('<input type="hidden" name="acf_type" value="file" />'); }); }); })(jQuery); </script> <?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addHead()\n\t{ \n JHtml::_('bootstrap.tooltip');\n $doc = JFactory::getDocument();\n $doc->addScript(JURI::root() . 'modules/mod_hwd_flickr_photobox/js/jquery.magnific-popup.js');\n $doc->addStylesheet(JURI::root() . 'modules/mod_hwd_flickr_photobox/css/magnific-popup.css');\n $doc->addStylesheet(JURI::root() . 'modules/mod_hwd_flickr_photobox/css/strapped.3.hwd.css');\n \n // Extract the layout.\n list($template, $layout) = explode(':', $this->params->get('layout', '_:default'));\n \n // Check for layout stylesheet.\n if (file_exists(__DIR__ . '/css/' . $layout . '.css'))\n {\n $doc->addStyleSheet(JURI::base( true ) . '/modules/mod_hwd_flickr_photobox/css/' . $layout . '.css');\n }\n\n $doc->addScriptDeclaration(\"\njQuery.noConflict();\n(function( $ ) {\n $(function() {\n $(document).ready(function() {\n $('.popup-title-\" . $this->module->id . \"').magnificPopup({ \n type: 'image',\n mainClass: 'hwd-flickr-popup',\n gallery: {\n enabled: true\n }\n }); \n $('.popup-thumbnail-\" . $this->module->id . \"').magnificPopup({ \n type: 'image',\n mainClass: 'hwd-flickr-popup',\n gallery: {\n enabled: true\n }\n }); \n });\n });\n})(jQuery);\"); \n\t}", "function mpcth_add_admin_head() {\r\n\tmpcth_admin_alternative_styles();\r\n}", "public function action_wp_head() {\n\t\t?>\n\t\t<style>\n\t\t\t.wpcom-related-posts ul li {\n\t\t\t\tlist-style-type: none;\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}", "public function display() {\n\n\t\t// Register WP built-in Thickbox for popup.\n\t\tadd_thickbox();\n\n\t\tparent::display();\n\t}", "function tb_longwave_header_options_callback() {\n\techo '<p>Settings for things visible in the Head of the theme.</p>';\n}", "public static function admin_head() {\n echo <<<EOD\n<style>\n .media-icon {\n background: #eee;\n box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.05);\n }\n\n .media-icon img[src$=\".svg\"],\n img[src$=\".svg\"].attachment-post-thumbnail {\n width: 100% !important;\n height: auto !important;\n }\n</style>\nEOD;\n }", "public function webp_metabox_header() {\r\n\t\t$this->view(\r\n\t\t\t'webp/meta-box-header',\r\n\t\t\tarray(\r\n\t\t\t\t'is_disabled' => ! $this->settings->get( 'webp_mod' ) || ! WP_Smush::get_instance()->core()->s3->setting_status(),\r\n\t\t\t\t'is_configured' => true === WP_Smush::get_instance()->core()->mod->webp->is_configured(),\r\n\t\t\t)\r\n\t\t);\r\n\t}", "public function media_button()\n\t{\n\t\t$type = 'picasa';\n\t\t$id = 'picasa';\n\t\t$title = \"Add Picasa Media\";\n\t\t$icon = plugins_url('/images/picasa-logo.png', __FILE__);\n\n\t\techo \"<a href='\" . esc_url( get_upload_iframe_src($type) ) . \"' id='{$id}-add_{$type}' class='thickbox add_$type' title='\" . esc_attr( $title ) . \"'><img src='\" . $icon . \"' alt='$title' onclick='return false;' /></a>\";\n\t}", "function add_head() {\r\n\t\tglobal $locale;\r\n\t\t$wpca_settings = get_option('wpcareers');\r\n\t\techo \"<link rel=\\\"stylesheet\\\" href=\\\"\" . $this->plugin_url . \"/themes/default/css/default.css\\\" type=\\\"text/css\\\" media=\\\"screen\\\">\";\r\n\t\tif($wpca_settings['edit_style']==null || $wpca_settings['edit_style']=='plain') {\r\n\t\t\t// nothing\r\n\t\t} elseif($wpca_settings['edit_style']=='tinymce') {\r\n\t\t\t// activate these includes if the user chooses tinyMCE on the settings page\r\n\t\t\t$mce_path = get_option('siteurl');\r\n\t\t\t$mce_path .= '/wp-includes/js/tinymce/tiny_mce.js';\r\n\t\t\techo '<script type=\"text/javascript\" src=\"' . $mce_path . '\"></script>';\r\n\t\t}\r\n\t}", "public function admin_head_style() {\n global $post_type;\n\n if ( $post_type === 'portfolio_item' ) { ?>\n <style type=\"text/css\">\n #icon-edit.icon32-posts-portfolio_item {\n background: transparent url( '<?php echo WPZOOM::$assetsPath . '/images/components/portfolio/portfolio-32.png'; ?>' ) no-repeat;\n }\n </style>\n <?php }\n }", "public function meta_box_css() {\n\n ?>\n <style type=\"text/css\">.misc-pub-section:not(.misc-pub-post-status) { display: none; }</style>\n <?php\n\n // Fire action for CSS on Envira post type screens.\n do_action( 'envira_gallery_admin_css' );\n\n }", "function fix_acf_fc_popup_css() {\n \techo '<style>\n\t\t\t/* acf_fc_popup */\n\t\t\ta[data-event=\"add-layout\"].acf-button.button-primary {\n\t\t\t\tmin-width: 200px;\n\t\t\t margin-right: 12px !important;\n\t\t\t text-align: center;\n\t\t\t}\n\n\t\t\tinput[type=\"submit\"]#publish {\n\t\t\t\tbackground: #33cc33;\n\t\t\t\tborder-color: #009900 #009900 #009900;\n\t\t\t box-shadow: 0 1px 0 #009900;\n\t\t text-shadow: 0 -1px 1px #009900, 1px 0 1px #009900, 0 1px 1px #009900, -1px 0 1px #009900;\n\t\t\t}\n\t\t</style>';\n}", "function publisher_cpHeader()\r\n{\r\n xoops_cp_header();\r\n\r\n //cannot use xoTheme, some conflit with admin gui\r\n echo '<link type=\"text/css\" href=\"' . PUBLISHER_URL . '/css/jquery-ui-1.7.1.custom.css\" rel=\"stylesheet\" />\r\n <link type=\"text/css\" href=\"' . PUBLISHER_URL . '/css/publisher.css\" rel=\"stylesheet\" />\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/funcs.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/cookies.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ui.core.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ui.tabs.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/ajaxupload.3.9.js\"></script>\r\n <script type=\"text/javascript\" src=\"' . PUBLISHER_URL . '/js/publisher.js\"></script>\r\n ';\r\n}", "function metabox_styles() { ?>\n\t<style type=\"text/css\">\n\t.hidetable { display:none; }\n\t#uploadfield { width:500px; }\n\t#uploadfield input { display:inline; }\n\t.req { font-size:12px; color:#FF0000; font-weight:bold; }\n\t.attchmt { border-bottom:21px solid #666; padding:10px 0; margin:10px 0; }\n\t.prevImage { float:right; width:250px; text-align:center; }\n\t.fr { float:right; }\n\t</style>\n\t<?php\t\n}", "function admin_head() {\n $labels = array(\n 'Bold',\n 'Italic',\n 'Underline',\n 'Strikethrough',\n 'Insert'\n );\n $acf_field = '.acf-field[data-key=\"field_vf-gutenberg-lede_content\"]';\n $mce_btn = $acf_field . ' .mce-toolbar .mce-btn';\n?>\n<style>\n<?php echo $mce_btn; ?> {\n display: none;\n}\n<?php foreach ($labels as $label) { ?>\n<?php echo $mce_btn; ?>[aria-label^=\"<?php echo $label; ?>\"] {\n display: inline-block;\n}\n<?php } ?>\n</style>\n<?php\n }", "function acitpo_custom_header_admin_head() {\n?>\n\t<style type=\"text/css\">\n\t.appearance_page_custom-header #headimg {\n\t\tborder: none;\n\t\ttext-align: center;\n\t}\n\t<?php if ( ! display_header_text() ) : ?>\n\t#headimg h1,\n\t#desc {\n\t\tdisplay: none;\n\t}\n\t<?php endif; ?>\n\t#headimg h1 {\n\t\tfont: 700 42px/1 'Helvetica Neue', Arial, Helvetica, sans-serif;\n\t\tmargin: 15px auto;\n\t}\n\t#headimg h1 a {\n\t\ttext-decoration: none;\n\t}\n\t#desc {\n\t\tfont: 14px/1.3 'Helvetica Neue', Arial, Helvetica, sans-serif;\n\t\topacity: 0.7;\n\t}\n\t#headimg img {\n\t\tmargin: 30px auto 15px auto\n\t}\n\t#headimg img[src*=\"gravatar\"] {\n\t\tborder-radius: 50%;\n\t}\n\t</style>\n<?php\n}", "function db099_lifterlms_admin_head() { \r\n\tglobal $post;\r\n\t$s = get_current_screen();\r\n\tif(!empty($s->post_type) and $s->post_type=='course') { \r\n?>\r\n<script>\r\njQuery(function($){\r\n\t$('.et_pb_toggle_builder_wrapper').insertBefore($('#wp-content-wrap')).show();\r\n\t$('#et_pb_layout').insertAfter($('#wp-content-wrap'));\r\n\t\r\n\t$(document).on('mouseup', '#et_pb_toggle_builder:not(.et_pb_builder_is_used)', function() {\r\n\t\t$('#wp-content-wrap').hide();\r\n\t});\t\r\n\t$(document).on('click', '[data-action=\"deactivate_builder\"] .et_pb_prompt_proceed', function() {\r\n\t\t$('#wp-content-wrap').show();\r\n\t});\r\n\t<?php if (dbdb_is_pagebuilder_used($post->ID)) { ?>\r\n\t\t$('#wp-content-wrap').hide();\r\n\t<?php } else { ?>\r\n\t\t$('#wp-content-wrap').show();\r\n\t<?php } ?>\r\n});\r\n</script>\r\n<style>\r\n#et_pb_layout { margin-top:20px; margin-bottom:0px }\r\n.et_pb_toggle_builder_wrapper { display:none; }\r\n</style>\r\n<?php\r\n\t}\r\n}", "function fzproject_meta_box()\n{\n add_meta_box('fzproject_meta_box', 'New portfolio item', 'display_fzproject_meta_box', 'fzproject_post', 'normal', 'high');\n}", "function rs_meta_box()\n{\n add_meta_box('rs_focus', 'Destaque na home', 'rs_focus', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post_region', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'event', 'side');\n}", "function buildCustomPostWidgets()\n {\n // add_meta_box( $id, $title, $callback, $screen, $context, $priority, $callback_args );\n add_meta_box( 'cover_image_meta_box', 'Add an Image', array($this,'selectImageMetaBox'), 'playscripts', 'normal', 'high' );\n add_meta_box( 'cover_sound_meta_box', 'Add a Sound', array($this,'selectSoundMetaBox'), 'playscripts', 'normal', 'high' );\n }", "function jigoshop_admin_head() {\n\t?>\n\t<style type=\"text/css\">\n\t\t\n\t\t<?php if ( isset($_GET['taxonomy']) && $_GET['taxonomy']=='product_cat' ) : ?>\n\t\t\t.icon32-posts-product { background-position: -243px -5px !important; }\n\t\t<?php elseif ( isset($_GET['taxonomy']) && $_GET['taxonomy']=='product_tag' ) : ?>\n\t\t\t.icon32-posts-product { background-position: -301px -5px !important; }\n\t\t<?php endif; ?>\n\n\t</style>\n\t<?php\n}", "function customisetheme_admin_header_style() {\n ?>\n <style type=\"text/css\">\n #wpbody-content #headimg {\n height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;\n width: <?php echo HEADER_IMAGE_WIDTH; ?>px;\n border: 1px solid #333;\n }\n </style>\n <?php\n }", "function add_fl_style(){\n?>\n<style type=\"text/css\">\n\t#form-lightbox td.first {width: 100px;vertical-align: top;}\n\t#form-lightbox input[type=\"text\"], #form-lightbox textarea {width: 350px;margin-bottom:3px}\n\t#form-lightbox small {margin-bottom:8px}\n</style>\n<?php\n}", "function seo_discount_popup_include() {\n\twp_enqueue_style( 'seo-discount-popup-style', plugin_dir_url( __FILE__ ) . 'seo-discount-popup.css', '', '1.0' );\n\twp_enqueue_script( 'jquery-cookie', plugin_dir_url( __FILE__ ) . 'js.cookie.js', array('jquery'), '1.4.1', true );\n\twp_enqueue_script( 'seo-discount-popup-script', plugin_dir_url( __FILE__ ) . 'seo-discount-popup.js', array('jquery', 'jquery-cookie'), '1.0', true );\n}", "function popup_elements()\n\t\t{\n\t\t\t\n\t\t}", "function pagebuilder_inner_custom_box($post)\n{\n isset($_POST['tinymce_activation_class']) ? $tinymce_activation_class = $_POST['tinymce_activation_class'] : $tinymce_activation_class = '';\n $now_post_type = get_post_type();\n\n wp_nonce_field(null, 'pagebuilder_noncename');\n $gt3_theme_pagebuilder = get_plugin_pagebuilder($post->ID);\n if (!is_array($gt3_theme_pagebuilder)) {\n $gt3_theme_pagebuilder = array();\n }\n\n global $modules;\n\n#get all sidebars\n $media_for_this_post = get_media_for_this_post(get_the_ID());\n $js_for_pb = \"\n <script>\n var post_id = \" . get_the_ID() . \";\n var show_img_media_library_page = 1;\n </script>\";\n\n echo $js_for_pb;\n echo \"\n<!-- popup background -->\n<div class='popup-bg'></div>\n<div class='waiting-bg'><div class='waiting-bg-img'></div></div>\n\";\n#START BUILDER AREA\n if (in_array($now_post_type, $GLOBALS[\"pbconfig\"]['pb_modules_enabled_for'])) {\n echo \"\n<div class='pb-cont page-builder-container bbg'>\n <div class='padding-cont main_descr'>\" . __(\"You can use this drag and drop page builder to create unlimited custom page layouts. It is too simple, just click any module below, adjust your own settings and preview the page. That's all.\", \"gt3_builder\") . \"</div>\n <div>\n <div class='hideable-content'>\n <div class='padding-cont'>\n <div class='available-modules-cont'>\n \" . get_html_all_available_pb_modules($modules) . \"\n </div>\n <div class='clear'></div>\n </div>\";\n\n#--------extended version (2) start -----\n\n if (isset($GLOBALS['pbconfig']['extended_mode']) && $GLOBALS['pbconfig']['extended_mode'] == 'on') {\n\n $exists_templates = get_option(\"builder_templates\");\n if ($exists_templates == false) {\n update_option(\"builder_templates\", array());\n $exists_templates = array();\n } \n\n $templates_string = '';\n foreach ($exists_templates as $name => $value) {\n $templates_string .= $name . ',';\n }\n $templates_string = rtrim($templates_string, ',');\n\n echo \"\n <div class='padding-cont main_descr_2'>\" . __(\"The \\\"Template\\\" feature allows you to save the entire content of the page as a template and then to load it on any newly created pages.\", \"gt3_builder\") . \"\n </div>\n <div class='padding-cont templates_block'>\n <div title='\" . esc_attr('Save whole page content into template') . \"' class='text-shadow1 visual_style1 tiptip save_pb_template'>\n <span class='module-name'>\" . __('Save Template', 'gt3_builder') . \"</span>\n </div>\n <div title='\" . __('Load whole page content from template', 'gt3_builder') . \"' class='text-shadow1 visual_style1 tiptip load_pb_template'>\n <span class='module-name'>\" . __('Load Template', 'gt3_builder') . \"</span>\n </div>\n <div title='\" . __('Delete template permanently', 'gt3_builder') . \"' class='text-shadow1 visual_style1 tiptip delete_pb_template'>\n <span class='module-name'>\" . __('Delete Template', 'gt3_builder') . \"</span>\n </div>\n <div title='\" . __('Paste content from clipboard', 'gt3_builder') . \"' class='text-shadow1 tiptip paste_from_clipboard'>\n <span class='module-name'>\" . __('Paste from Clipboard', 'gt3_builder') . \"</span>\n </div>\n <div class='clear'></div>\n <div class='form_manage_templates'>\n <div class='form_save_template'>\n <label>\n <span>\" . __('Template Name: ', 'gt3_builder') . \"</span>\n <input type='text' name='saved_template_name' class='textoption type1' data-templates='\".$templates_string.\"'>\n </label>\n <input name='save_template_submit' class='green-btn-type2 save_template_submit' value='Save' type='submit'>\n <div class='clear'></div>\n </div>\n \n <div class='form_load_template'>\n <span>\" . __('Template Name: ', 'gt3_builder') . \"</span>\n <div class='select_wrapper'>\n <select type='text' name='load_template_name' class='newselect'>\";\n foreach ($exists_templates as $key => $value) {\n echo \"<option value='\".$key.\"'>\".$key.\"</option>\";\n }\n echo \"\n </select>\n </div>\n <input name='load_template_submit' class='green-btn-type2 load_template_submit' value='Load' type='submit'>\n <div class='clear'></div>\n </div>\n\n <div class='form_delete_template'>\n <span>\" . __('Template Name: ', 'gt3_builder') . \"</span>\n <div class='select_wrapper'>\n <select type='text' name='delete_template_name' class='newselect'>\";\n foreach ($exists_templates as $key => $value) {\n echo \"<option value='\".$key.\"'>\".$key.\"</option>\";\n }\n echo \"\n </select>\n </div>\n <input name='delete_template_submit' class='green-btn-type2 delete_template_submit' value='Delete' type='submit'>\n <div class='clear'></div>\n </div>\n \n </div>\n \n <div class='clear'></div>\n </div>\";\n }\n\n# -------extended version (2) end -------\n\n echo \"\n <div class='pb-list-active-modules'>\n <div class='padding-cont'>\n <ul class='sortable-modules'>\n \";\n\n if (isset($gt3_theme_pagebuilder['modules']) && is_array($gt3_theme_pagebuilder['modules'])) {\n foreach ($gt3_theme_pagebuilder['modules'] as $moduleid => $module) {\n if ($module['size'] == \"block_1_4\") {\n $size_caption = \"1/4\";\n }\n if ($module['size'] == \"block_1_3\") {\n $size_caption = \"1/3\";\n }\n if ($module['size'] == \"block_1_2\") {\n $size_caption = \"1/2\";\n }\n if ($module['size'] == \"block_2_3\") {\n $size_caption = \"2/3\";\n }\n if ($module['size'] == \"block_3_4\") {\n $size_caption = \"3/4\";\n }\n if ($module['size'] == \"block_1_1\") {\n $size_caption = \"1/1\";\n }\n echo get_pb_module($module['name'], $module['caption'], $moduleid, $gt3_theme_pagebuilder, $module['size'], $size_caption, $tinymce_activation_class);\n }\n }\n\n echo \"\n </ul>\n <div class='clear'></div>\n </div>\n </div>\n </div>\n </div>\n</div>\n\";\n }\n#END BUILDER AREA\n\n\n#Subtitle\n if ($now_post_type == \"page\" || $now_post_type == \"port\") {\n echo \"\n <div id='page_subtitle' class='pt_\" . $now_post_type . \"' style='padding: 20px 18px 18px 18px; font-size: 12px;'>\n <div>\n <div>\n <h2>Page Subtitle (You may use HTML tags)</h2>\n </div>\n <div>\n <textarea style='height: 80px; width: 100%;' class='medium textoption' name='pagebuilder[page_settings][page_subtitle]'>\" . (isset($gt3_theme_pagebuilder['page_settings']['page_subtitle']) ? $gt3_theme_pagebuilder['page_settings']['page_subtitle'] : \"\") . \"</textarea>\n </div>\n </div>\n\n <h2 style='padding-top: 10px; padding-bottom: 5px;'>\" . __('Page Title Alignment:', 'gt3_builder') . \"</h2>\n <select name='pagebuilder[page_settings][page_title_alignment]' class='admin_newselect'>\";\n $gt3_options = array(\"center\" => \"Center\", \"left\" => \"Left\", \"right\" => \"Right\");\n foreach ($gt3_options as $var_data => $var_caption) {\n echo \"<option \" . ((isset($gt3_theme_pagebuilder['page_settings']['page_title_alignment']) && $gt3_theme_pagebuilder['page_settings']['page_title_alignment'] == $var_data) ? 'selected=\"selected\"' : '') . \" value='\" . $var_data . \"'>\" . $var_caption . \"</option>\";\n }\n echo \"\n </select>\n\n <h2 style='padding-top: 10px; padding-bottom: 5px;'>\" . __('Page Subtitle Alignment:', 'gt3_builder') . \"</h2>\n <select name='pagebuilder[page_settings][page_subtitle_alignment]' class='admin_newselect'>\";\n $gt3_options = array(\"center\" => \"Center\", \"left\" => \"Left\", \"right\" => \"Right\");\n foreach ($gt3_options as $var_data => $var_caption) {\n echo \"<option \" . ((isset($gt3_theme_pagebuilder['page_settings']['page_subtitle_alignment']) && $gt3_theme_pagebuilder['page_settings']['page_subtitle_alignment'] == $var_data) ? 'selected=\"selected\"' : '') . \" value='\" . $var_data . \"'>\" . $var_caption . \"</option>\";\n }\n echo \"\n </select>\n\n <h2 style='padding-top: 10px; padding-bottom: 5px;'>\" . __('Text Divider:', 'gt3_builder') . \"</h2>\n <select name='pagebuilder[page_settings][title_divider]' class='admin_newselect'>\";\n $gt3_options = array(\"show\" => \"Show\", \"hide\" => \"Hide\");\n foreach ($gt3_options as $var_data => $var_caption) {\n echo \"<option \" . ((isset($gt3_theme_pagebuilder['page_settings']['title_divider']) && $gt3_theme_pagebuilder['page_settings']['title_divider'] == $var_data) ? 'selected=\"selected\"' : '') . \" value='\" . $var_data . \"'>\" . $var_caption . \"</option>\";\n }\n echo \"\n </select>\n </div>\n \";\n }\n\n\n#POSTFORMATS FOR POST. VISIBLE ONLY ON GT3 THEMES.\n if (GT3THEME_INSTALLED == true && $now_post_type == \"post\") {\n echo \"\n<div class='pb-cont page-settings-container'>\n <div class='pb10'>\n <div class='hideable-content'>\n <div class='post-formats-container'>\n <!-- Video post format -->\n <div id='video_sectionid_inner'>\n <h2>Post Format Video URL:</h2>\n <input type='text' class='medium textoption type1' name='pagebuilder[post-formats][videourl]' value='\" . (isset($gt3_theme_pagebuilder['post-formats']['videourl']) ? $gt3_theme_pagebuilder['post-formats']['videourl'] : \"\") . \"'>\n <div class='example'>Examples:<br>Youtube - http://www.youtube.com/watch?v=6v2L2UGZJAM<br>Vimeo - http://vimeo.com/47989207</div>\n\n <div class='container_height_section mt20'>\n <div class='hleft mediasettings_type'>\" . esc_html__('Video height, px:', 'insquare') . \"</div>\n <div class='hright'>\n <input id='video_height' type='text' class='medium textoption type1' name='pagebuilder[post-formats][video_height]' value='\" . (isset($gt3_theme_pagebuilder['post-formats']['video_height']) ? $gt3_theme_pagebuilder['post-formats']['video_height'] : \"540\") . \"' style='width:70px;text-align:center;'>\n </div>\n <div class='clear height10'></div>\n </div>\n </div>\n\t\t\t\t<!-- Audio post format -->\n <div id='audio_sectionid_inner'>\n <h2>Post Format Audio Code:</h2>\";\n\t\t\t\t\techo '<textarea class=\"enter_text1 audio_textarea\" name=\"pagebuilder[post-formats][audiourl]\">'. (isset($gt3_theme_pagebuilder['post-formats']['audiourl']) ? $gt3_theme_pagebuilder['post-formats']['audiourl'] : \"\") .'</textarea>';\n\t\t\t\t\t\n echo \"\n <div class='example'>Examples:<br>\n\t\t\t\t\t\t&lt;iframe src='https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/141816093&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_artwork=true' width='100%' height='166' frameborder='no' scrolling='no'&gt;&lt;/iframe&gt;\n\t\t\t\t\t</div>\n </div>\t\t\t\t\n <!-- Image post format -->\n <div id='portslides_sectionid_inner'>\n <div class='portslides_sectionid_title'><h2>Slider Images</h2></div>\n <div class='selected-images-for-pf'>\n \" . get_selected_pf_images_for_admin($gt3_theme_pagebuilder) . \"\n </div>\n\t\t\t\t\t<hr class='img_seperator'>\n <div class='available-images-for-pf available_media'>\n <div class='ajax_cont'>\n \" . get_media_html($media_for_this_post, \"small\") . \"\n </div>\n <div class='for_post_fomrats img-item style_small add_image_to_sliders_available_media cboxElement'>\n <div class='img-preview'>\n <img alt='' src='\" . PBIMGURL . \"/add_image.png'>\n </div>\n </div><!-- .img-item -->\n </div>\n\t\t\t\t\t<input type='hidden' name='settings_type' value='fullscreen' class='settings_type'>\t\t\t\t\t\n </div>\n </div>\n <div class='clear'></div>\n </div>\n </div>\n</div>\";\n}\n\n\n#GALLERY AREA\n if ($now_post_type == \"gallery\") {\n echo \"\n <!-- FULLSCREEN SLIDER SETTINGS -->\n <div class='padding-cont stand-s pt_\" . $now_post_type . \"'>\n <div class='bg_or_slider_option slider_type active'>\n <input type='hidden' name='settings_type' value='fullscreen' class='settings_type'>\n <div class='hideable-area'>\n <div class='padding-cont help text-shadow2'></div>\n <div class='padding-cont' style='padding-bottom:11px;'>\n <div class='selected_media'>\n <div class='append_block'>\n <ul class='sortable-img-items'>\n \" . get_slider_items(\"fullscreen\", (isset($gt3_theme_pagebuilder['sliders']['fullscreen']['slides']) ? $gt3_theme_pagebuilder['sliders']['fullscreen']['slides'] : '')) . \"\n </ul>\n </div>\n <div class='clear'></div>\n </div>\n </div>\n <div style='' class='hr_double style2'></div>\n <div class='padding-cont' style='padding-top:12px;'>\n\t\t\t\t\t\t\t\t<div class='gt3settings_box no-margin'>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div class='gt3settings_box_title'><h2>\" . __('Gallery Options', 'gt3_builder') . \"</h2></div>\n\t\t\t\t\t\t\t\t\t<div class='gt3settings_box_content'>\n\t\t\t\t\t\t\t\t\t\t<div class='available_media'>\n\t\t\t\t\t\t\t\t\t\t\t<div class='ajax_cont'>\n\t\t\t\t\t\t\t\t\t\t\t\t\" . get_media_html($media_for_this_post, \"small\") . \"\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class='img-item style_small add_image_to_sliders_available_media cboxElement'>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='img-preview'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img alt='' src='\" . PBIMGURL . \"/add_image.png'>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div><!-- .img-item -->\n\t\t\t\t\t\t\t\t\t\t\t<div class='img-item style_small add_video_slider'>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class='img-preview'>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<img alt='' class='previmg' data-full-url='\" . PBIMGURL . \"/video_item.png' src='\" . PBIMGURL . \"/add_video.png'>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t</div><!-- .img-item -->\n\t\t\t\t\t\t\t\t\t\t\t<div class='clear'></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\";\n\n\t\t\t\t\t\t\t\techo \"</div>\n </div>\n </div>\n </div>\n\t\t\t\t<style>\n\t\t\t\t\t/*.preview_img_video_cont .select_image_root {display:none!important}*/\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t/*.this-option .padding-cont:last-child,*/\n\t\t\t\t\t.this-option .hr_double,\n\t\t\t\t\t.this-option .right_block,\n\t\t\t\t\t.custom_select_bcarea.title_bcarea {\n\t\t\t\t\t\tdisplay:none!important;\n\t\t\t\t\t}\n\t\t\t\t\t.this-option .w9 {\n\t\t\t\t\t\twidth:720px!important;\n\t\t\t\t\t}\n\t\t\t\t</style>\n <!-- END SETTINGS -->\";\n }\n\n#TESTIMONIALS AREA\n if ($now_post_type == \"testimonials\") {\n echo \"\n <!-- TESTIMONIALS SETTINGS -->\n <div class='padding-cont pt_\" . $now_post_type . \"'>\n\n <div class='testimonials_cont'>\n <div class='append_items'>\n <label for='testimonials_author' class='label_type1'>\" . __('Author:', 'gt3_builder') . \"</label> <input type='text' value='\" . (isset($gt3_theme_pagebuilder['page_settings']['testimonials']['testimonials_author']) ? $gt3_theme_pagebuilder['page_settings']['testimonials']['testimonials_author'] : '') . \"' id='testimonials_author' name='pagebuilder[page_settings][testimonials][testimonials_author]' class='testimonials_author itt_type1'><br>\n <label for='testimonials_position' class='label_type1'>\" . __('Occupation:', 'gt3_builder') . \"</label> <input type='text' value='\" . (isset($gt3_theme_pagebuilder['page_settings']['testimonials']['company']) ? $gt3_theme_pagebuilder['page_settings']['testimonials']['company'] : '') . \"' id='testimonials_company' name='pagebuilder[page_settings][testimonials][company]' class='testimonials_company itt_type1'>\n </div>\n </div>\n\n </div>\n <!-- END SETTINGS -->\";\n }\n\n// index\n\n if ($now_post_type == \"page\") {\n echo \"<div class='pb-cont page-settings-container'>\n <div class='pb10'>\n <div class='hideable-content'>\n <div class='post-formats-container'>\n <div class='rev_slider_shortcode_style'>\n <h2>Revolution Slider Shortcode:</h2>\n <input type='text' class='medium textoption type1' name='pagebuilder[rev_slider_shortcode]' value='\" . (isset($gt3_theme_pagebuilder['rev_slider_shortcode']) ? $gt3_theme_pagebuilder['rev_slider_shortcode'] : \"\") . \"'>\n <div class='example'>Examples:<br>[rev_slider alias=\\\"Home-Slider\\\"]</div>\n </div>\n </div>\n <div class='clear'></div>\n </div>\n </div>\n </div>\";\n }\n\n#TEAM AREA\n if ($now_post_type == \"team\") {\n echo \"\n <!-- TEAM SETTINGS -->\n <div class='padding-cont pt_\" . $now_post_type . \"'>\n\n <div class='partners_cont gt3settings_box'>\n\t\t\t\t<div class='gt3settings_box_title'><h2>Advanced Options</h2></div>\n\t\t\t\t<div class='gt3settings_box_content'>\n\t\t\t\t\t<div class='append_items'>\n\t\t\t\t\t\t<label for='position_link' class='label_type1'>Position:</label> <input type='text' value='\" . (isset($gt3_theme_pagebuilder['page_settings']['team']['position']) ? $gt3_theme_pagebuilder['page_settings']['team']['position'] : '') . \"' id='position_link' name='pagebuilder[page_settings][team][position]' class='position_link itt_type1'>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<div class='hleft' style='vertical-align:top;'>\" . __('Social Icons', 'gt3_builder') . \"</div>\n\t\t\t\t\t\t\t<div class='hright'>\n\t\t\t\t\t\t\t\t<div class='added_icons sortable_icons_list team_icons'>\";\n\n if (isset($gt3_theme_pagebuilder['page_settings']['icons']) && is_array($gt3_theme_pagebuilder['page_settings']['icons'])) {\n foreach ($gt3_theme_pagebuilder['page_settings']['icons'] as $key => $value) {\n echo \"\n\t\t\t\t\t<div class='stand_iconsweet ui-state-default '>\n\t\t\t\t\t\t<span class='stand_icon-container'><i class='stand_icon \" . $value['data-icon-code'] . \"'></i></span>\n\t\t\t\t\t\t<input type='hidden' name='pagebuilder[page_settings][icons][\" . $key . \"][data-icon-code]' value='\" . $value['data-icon-code'] . \"'>\n\t\t\t\t\t\t<input class='icon_name' type='text' name='pagebuilder[page_settings][icons][\" . $key . \"][name]' value='\" . $value['name'] . \"' placeholder='\" . __('Give Some Name', 'gt3_builder') . \"'>\n\t\t\t\t\t\t<input class='icon_link' type='text' name='pagebuilder[page_settings][icons][\" . $key . \"][link]' value='\" . $value['link'] . \"' placeholder='\" . __('Give Some Link', 'gt3_builder') . \"'>\n\t\t\t\t\t\t<input class='cpicker' type='text' name='pagebuilder[page_settings][icons][\" . $key . \"][fcolor]' value='\" . $value['fcolor'] . \"' placeholder='\" . __('Background Color', 'gt3_builder') . \"'>\t\t\t\n\t\t\t\t\t\t<div style='width: 190px;' class='caption'>\n\t\t\t\t\t\t\t<h2>\" . __('Open in New Window:', 'gt3_builder') . \"</h2>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class='radio_selector'>\n\t\t\t\t\t\t\t\" . toggle_radio_on_off('pagebuilder[page_settings][icons][' . $key . '][target]', (isset($gt3_theme_pagebuilder['page_settings']['icons'][$key]['target']) ? $gt3_theme_pagebuilder['page_settings']['icons'][$key]['target'] : ''), 'on') . \"\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<span class='remove_me'><i class='stand_icon icon-times'></i></span>\n\t\t\t\t\t</div>\";\n }\n }\n echo \"\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='social_list_for_select_team'>\";\n foreach ($GLOBALS[\"pbconfig\"]['all_available_font_icons'] as $icon) {\n echo \"<div class='stand_social'><i data-icon-code='\" . $icon . \"' class='stand_icon \" . $icon . \"'></i></div>\";\n }\n echo \"\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t</div>\n </div>\n </div>\n <!-- END SETTINGS -->\";\n }\n\n# WOOCOMMERCE PRODUCT\nif ($now_post_type == 'product') {\n echo \"\n <style>\n .select_sidebar {\n display: none;\n }\n </style>\n \";\n}\n\n#JS FOR AJAX UPLOADER\n ?>\n <script type=\"text/javascript\">\n\n function reactivate_ajax_image_upload() {\n var admin_ajax = '<?php echo admin_url(\"admin-ajax.php\"); ?>';\n jQuery('.btn_upload_image').each(function () {\n var clickedObject = jQuery(this);\n var clickedID = jQuery(this).attr('id');\n new AjaxUpload(clickedID, {\n action: '<?php echo admin_url(\"admin-ajax.php\"); ?>',\n name: clickedID, // File upload name\n data: { // Additional data to send\n action: 'mix_ajax_post_action',\n type: 'upload',\n data: clickedID },\n autoSubmit: true, // Submit file after selection\n responseType: false,\n onChange: function (file, extension) {\n },\n onSubmit: function (file, extension) {\n clickedObject.text('Uploading'); // change button text, when user selects file\n this.disable(); // If you want to allow uploading only 1 file at time, you can disable upload button\n interval = window.setInterval(function () {\n var text = clickedObject.text();\n if (text.length < 13) {\n clickedObject.text(text + '.');\n }\n else {\n clickedObject.text('Uploading');\n }\n }, 200);\n },\n onComplete: function (file, response) {\n\n window.clearInterval(interval);\n clickedObject.text('Upload Image');\n this.enable(); // enable upload button\n\n // If there was an error\n if (response.search('Upload Error') > -1) {\n var buildReturn = '<span class=\"upload-error\">' + response + '</span>';\n jQuery(\".upload-error\").remove();\n clickedObject.parent().after(buildReturn);\n\n }\n else {\n var buildReturn = '<a href=\"' + response + '\" class=\"uploaded-image\" target=\"_blank\"><img class=\"hide option-image\" id=\"image_' + clickedID + '\" src=\"' + response + '\" alt=\"\" /></a>';\n\n jQuery(\".upload-error\").remove();\n jQuery(\"#image_\" + clickedID).remove();\n clickedObject.parent().next().after(buildReturn);\n jQuery('img#image_' + clickedID).fadeIn();\n clickedObject.next('span').fadeIn();\n clickedObject.parent().prev('input').val(response);\n }\n }\n });\n });\n }\n\n jQuery(document).ready(function () {\n reactivate_ajax_image_upload();\n });\n </script>\n <?php #END JS FOR AJAX UPLOADER ?>\n\n<?php\n#DEVELOPER CONSOLE\n if (gt3pb_get_option(\"dev_console\") == \"true\") {\n echo \"<pre style='color:#000000;'>\";\n print_r($gt3_theme_pagebuilder);\n echo \"</pre>\";\n }\n\n}", "public function cdn_metabox_header() {\r\n\t\t$this->view(\r\n\t\t\t'cdn/meta-box-header',\r\n\t\t\tarray(\r\n\t\t\t\t'title' => __( 'CDN', 'wp-smushit' ),\r\n\t\t\t\t'tooltip' => __( 'This feature is likely to work without issue, however our CDN is in beta stage and some issues are still present.', 'wp-smushit' ),\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function media_button() {\n global $post;\n\n if( WP_Dummy_Admin::is_in_post_page() ) {\n $thickbox_url = '#TB_inline?width=753&height=578&inlineId=lipsum-generator';\n echo '<a href=\"'. $thickbox_url .'\" class=\"button add-lipsum-dummy\" id=\"add-lipsum-dummy\" title=\"' . esc_attr__( 'Lipsum Generator', 'colabsthemes' ) . '\" onclick=\"return false;\">'. __('Lipsum Generator', 'colabsthemes') .'</a>';\n }\n }", "function fielding_head_top() {\n\t$theme_dir = get_template_directory_uri();\n\n\t?>\n\t<!--[if gt IE 8]><!--><link rel='stylesheet' id='fielding-site-css' href='<?php echo $theme_dir; ?>/css/site.css' type='text/css' media='all'><!--<![endif]-->\n\t<script type=\"text/javascript\">\n\t\tvar ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>',\n\t\t\ttemplateurl = '<?php echo get_bloginfo( 'template_url' ); ?>';\n\t</script>\n\t<?php\n}", "public function add_media_upload_thickbox_css() {\n\t\techo '<style type=\"text/css\">#media-items,#media-upload #filter{width:auto!important}.media-item .describe input[type=\"text\"],.media-item .describe textarea{width:100%!important}.media-item .image-editor input[type=\"text\"]{width:3em!important}</style>' . \"\\n\";\n\t}" ]
[ "0.7114883", "0.6542088", "0.6391102", "0.63659793", "0.6343879", "0.6194973", "0.61317265", "0.60871404", "0.6086672", "0.60591704", "0.603693", "0.603667", "0.60150325", "0.60047954", "0.5970681", "0.5956265", "0.5952326", "0.5932", "0.5925613", "0.5905263", "0.590126", "0.5893779", "0.58889914", "0.5854372", "0.5846764", "0.58454007", "0.58422565", "0.5836462", "0.5828649", "0.58178705" ]
0.7285876
0
/ media_send_to_editor SEND IMAGE TO ACF DIV
function media_send_to_editor($html, $id) { parse_str($_POST["_wp_http_referer"], $arr_postinfo); if(isset($arr_postinfo["acf_type"]) && $arr_postinfo["acf_type"] == "file") { $file_src = wp_get_attachment_url($id); ?> <script type="text/javascript"> self.parent.acf_div.find('input.value').val('<?php echo $id; ?>'); self.parent.acf_div.find('span.file_url').text('<?php echo $file_src; ?>'); self.parent.acf_div.addClass('active'); // reset acf_div and return false self.parent.acf_div = null; self.parent.tb_remove(); </script> <?php exit; } else { return $html; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_media_send_to_editor($html, $attachment_id, $attachment)\n {\n }", "function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-' . esc_attr($align) . '\">';\n\n \t\t$html_str .= \"<p><img src='$url' alt='$title' /></p>\";\n\n\t\tif($caption) $html_str .= '\n\t\t<p class=\"wp-caption-text\">' . $caption . '</p>\n\t\t';\n\n\t$html_str .= '</div>';\n\n return $html_str;\n}", "function media_send_to_editor($html)\n {\n }", "function get_image_send_to_editor($id, $caption, $title, $align, $url = '', $rel = \\false, $size = 'medium', $alt = '')\n {\n }", "function edit_form_image_editor($post)\n {\n }", "function wp_ajax_image_editor()\n {\n }", "function wp_ajax_send_link_to_editor()\n {\n }", "function my_acf_result_result( $html, $post )\n{\n\t$image = get_field('thumbnail', $post->ID);\n \n\tif( $image )\n\t{\n\t\t$html = '<img src=\"' . $image['url'] . '\" />' . $html;\n\t}\n \n return $html;\n}", "function media_selector_print_scripts() {\n\n\t//$my_saved_attachment_post_id = get_option( 'media_selector_attachment_id', 0 );\n\n\t?><script type='text/javascript'>\n\n\t\tjQuery( document ).ready( function( $ ) {\n\n\t\t\t// Uploading files\n\t\t\tvar file_frame;\n\t\t\tvar wp_media_post_id = wp.media.model.settings.post.id; // Store the old id\n\t\t\t//var set_to_post_id = <?php echo $my_saved_attachment_post_id; ?>; // Set this\n\n\t\t\tjQuery('#upload_image_button').on('click', function( event ){\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// If the media frame already exists, reopen it.\n\t\t\t\tif ( file_frame ) {\n\t\t\t\t\t// Set the post ID to what we want\n\t\t\t\t\tfile_frame.uploader.uploader.param( 'post_id', set_to_post_id );\n\t\t\t\t\t// Open frame\n\t\t\t\t\tfile_frame.open();\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// Set the wp.media post id so the uploader grabs the ID we want when initialised\n\t\t\t\t\t//wp.media.model.settings.post.id = set_to_post_id;\n\t\t\t\t}\n\n\t\t\t\t// Create the media frame.\n\t\t\t\tfile_frame = wp.media.frames.file_frame = wp.media({\n\t\t\t\t\ttitle: 'Select a image to upload',\n\t\t\t\t\tbutton: {\n\t\t\t\t\t\ttext: 'Use this image',\n\t\t\t\t\t},\n\t\t\t\t\tmultiple: false\t// Set to true to allow multiple files to be selected\n\t\t\t\t});\n\n\t\t\t\t// When an image is selected, run a callback.\n\t\t\t\tfile_frame.on( 'select', function() {\n\t\t\t\t\t// We set multiple to false so only get one image from the uploader\n\t\t\t\t\tattachment = file_frame.state().get('selection').first().toJSON();\n\n\t\t\t\t\t// Do something with attachment.id and/or attachment.url here\n\t\t\t\t\t$( '#image-preview' ).attr( 'src', attachment.url ).css( 'width', 'auto' );\n\t\t\t\t\t$( '#image_attachment_id' ).val( attachment.id );\n\n\t\t\t\t\t// Restore the main post ID\n\t\t\t\t\twp.media.model.settings.post.id = wp_media_post_id;\n\t\t\t\t});\n\n\t\t\t\t\t// Finally, open the modal\n\t\t\t\t\tfile_frame.open();\n\t\t\t});\n\n\t\t\t// Restore the main ID when the add media button is pressed\n\t\t\tjQuery( 'a.add_media' ).on( 'click', function() {\n\t\t\t\twp.media.model.settings.post.id = wp_media_post_id;\n\t\t\t});\n\t\t});\n\n\t</script><?php\n\n}", "function myimg_handle_attachments()\r\n{\r\n\tglobal $mybb, $attachedfile, $lang, $templates, $myimgbox, $myimgbox_js;\r\n\t\r\n\tif (is_member($mybb->settings['myimg_groups'])) {\r\n\t\t\r\n\tif($mybb->settings['myimg_id'] && $mybb->settings['myimg_api'] && $mybb->settings['myimg_authdomain'] && $mybb->settings['myimg_databaseurl'] && $mybb->settings['myimg_storagebucket'] && $mybb->settings['myimg_messagingsenderid']){\r\n\t\t\r\n\t\teval(\"\\$myimgbox = \\\"\".$templates->get(\"myimg_box\").\"\\\";\");\r\n\t\teval(\"\\$myimgbox_js = \\\"\".$templates->get(\"myimg_js\").\"\\\";\");\r\n\t\r\n\t}else{\r\n\t\t$myimgbox = '<div class=\"myimgboxes_box largetext\"><img src=\"images/MyImg/warn.png\"> Missing parameter in plugin setting.</div>';\r\n\t}\r\n\t\r\n\t}\r\n}", "public function media_upload_content()\n\t{\n\t\t$this->media_upload_picasa_upload();\t\t\n\t}", "function my_attachments( $attachments )\n{\n $fields = array(\n array(\n 'name' => 'title', // unique field name\n 'type' => 'text', // registered field type\n 'label' => __( 'Title', 'attachments' ), // label to display\n 'default' => 'title', // default value upon selection\n ),\n array(\n 'name' => 'caption', // unique field name\n 'type' => 'textarea', // registered field type\n 'label' => __( 'Caption', 'attachments' ), // label to display\n 'default' => 'caption', // default value upon selection\n ),\n );\n\n $args = array(\n\n // title of the meta box (string)\n 'label' => 'Anexos de imagem',\n\n // all post types to utilize (string|array)\n 'post_type' => array( 'post', 'page','solucao','projeto' ),\n\n // meta box position (string) (normal, side or advanced)\n 'position' => 'normal',\n\n // meta box priority (string) (high, default, low, core)\n 'priority' => 'high',\n\n // allowed file type(s) (array) (image|video|text|audio|application)\n 'filetype' => array('image, text'), // no filetype limit\n\n // include a note within the meta box (string)\n 'note' => 'Anexe arquivos de imagem aqui!',\n\n // by default new Attachments will be appended to the list\n // but you can have then prepend if you set this to false\n 'append' => true,\n\n // text for 'Attach' button in meta box (string)\n 'button_text' => __( 'Anexe imagens', 'attachments' ),\n\n // text for modal 'Attach' button (string)\n 'modal_text' => __( 'Anexos', 'attachments' ),\n\n // which tab should be the default in the modal (string) (browse|upload)\n 'router' => 'browse',\n\n // whether Attachments should set 'Uploaded to' (if not already set)\n\t'post_parent' => false,\n\n // fields array\n 'fields' => $fields,\n\n );\n\n $attachments->register( 'my_attachments', $args ); // unique instance name\n}", "function fl_text_editor_button($context){\n $image_btn = plugins_url(\"/form-lightbox.gif\", __FILE__);\n $out = '<a href=\"#TB_inline?inlineId=fl_form\" class=\"thickbox\" title=\"' . __(\"Add Form Lightbox\", 'form-lightbox') . '\"><img src=\"'.$image_btn.'\" alt=\"' . __(\"Add Form Lighbox\", 'form-lightbox') . '\" /></a>';\n return $context . $out;\n}", "public function render_image_field($args) {\n include( dirname( __FILE__ ) . '/views/media-image.php' );\n }", "public static function media_field( $args ) {\n\n\t\t$value = get_option( $args['label_for'] );\n\t\t$has_image = ( ! empty( $value ) ) ? 'has_image' : '';\n\n\t\t$html = \"<div class='preview_{$args['label_for']} preview_image_box {$has_image}'>\";\n\t\t$html .= \" <img src='{$value}' alt='\" . esc_attr__( 'Image Preview', 'dorzki-notifications-to-slack' ) . \"'>\";\n\t\t$html .= \" <button type='button' class='remove-image'>\" . esc_html__( 'Remove Image', 'dorzki-notifications-to-slack' ) . '</button>';\n\t\t$html .= '</div>';\n\n\t\t$html .= sprintf( \"<input type='hidden' class='%s' name='%s' value='%s'>\", implode( ' ', $args['classes'] ), $args['label_for'], $value );\n\n\t\techo apply_filters( 'slack_before_output_media_field', $html );\n\n\t}", "public function render( ) { ?>\n <div id=\"<?php echo esc_attr($this->get_id()); ?>-container\" class=\"rwc-metabox-field-media\">\n <input type=\"hidden\"\n name=\"<?php echo esc_attr($this->get_id()); ?>\"\n id=\"<?php echo esc_attr($this->get_id()); ?>\"\n value=\"<?php echo esc_attr( $this->get_value() ); ?>\" />\n <div class=\"image-container\">\n <span class=\"add-new-image-btn\">+</span>\n </div>\n </div>\n <?php wp_enqueue_media(); ?>\n <?php wp_enqueue_script( 'rwc-metabox-field-media',\n $this->get_metabox()->get_library()->get_uri() .\n '/js/rwc/metabox/field/media.js', array( 'jquery' ) ); ?>\n <?php wp_enqueue_style( 'rwc-metabox-field-media-css',\n $this->get_metabox()->get_library()->get_uri() .\n '/css/rwc/metabox/field/media.css' ); ?>\n <?php }", "function my_acf_pre_save_post($post_id) {\n\n if ( !function_exists('wp_handle_upload') ) {\n require_once(ABSPATH . 'wp-admin/includes/file.php');\n }\n \n // Move file to media library\n $movefile = wp_handle_upload( $_FILES['my_image_upload'], array('test_form' => false) );\n \n // If move was successful, insert WordPress attachment\n if ( $movefile && !isset($movefile['error']) ) {\n $wp_upload_dir = wp_upload_dir();\n $attachment = array(\n 'guid' => $wp_upload_dir['url'] . '/' . basename($movefile['file']),\n 'post_mime_type' => $movefile['type'],\n 'post_title' => preg_replace( '/\\.[^.]+$/', ”, basename($movefile['file']) ),\n 'post_content' => ”,\n 'post_status' => 'inherit'\n );\n $attach_id = wp_insert_attachment($attachment, $movefile['file']);\n \n // Assign the file as the featured image\n set_post_thumbnail($post_id, $attach_id);\n update_field('my_image_upload', $attach_id, $post_id);\n \n }\n \n return $post_id;\n \n }", "function media_upload_image()\n {\n }", "function newsletter_image($ref, $size){\r\n\t\r\n\t$default_attr = array(\r\n\t\t'class'\t=> \"attachment-$size\",\r\n\t\t'alt' => trim(strip_tags( get_post_meta($ref, '_wp_attachment_image_alt', true) ))\r\n\t);\r\n\t\r\n\t$retour->image\t\t= wp_get_attachment_image( $ref, $size , false, $default_attr);\r\n\t$retour->legende\t= '<p style=\"font-family:Tahoma, Arial, sans-serif;color:#666666;font-size:11px;margin:7px 0;padding:0;font-style:italic;\">' . get_post_meta($ref, '_wp_attachment_image_alt', true) . '</p>';\r\n\t\r\n\treturn $retour;\r\n}", "function chocorocco_show_custom_field($id, $field, $value) {\n\t$output = '';\n\tswitch ($field['type']) {\n\t\t\n\t\tcase 'mediamanager':\n\t\t\twp_enqueue_media( );\n\t\t\t$title = empty($field['data_type']) || $field['data_type']=='image'\n\t\t\t\t\t\t\t? esc_html__( 'Choose Image', 'chocorocco')\n\t\t\t\t\t\t\t: esc_html__( 'Choose Media', 'chocorocco');\n\t\t\t$output .= '<a id=\"'.esc_attr($id).'\"'\n\t\t\t\t\t\t\t. ' class=\"button mediamanager chocorocco_media_selector\"'\n\t\t\t\t\t\t\t. '\tdata-param=\"' . esc_attr($id) . '\"'\n\t\t\t\t\t\t\t. '\tdata-choose=\"'.esc_attr(!empty($field['multiple']) ? esc_html__( 'Choose Images', 'chocorocco') : $title).'\"'\n\t\t\t\t\t\t\t. ' data-update=\"'.esc_attr(!empty($field['multiple']) ? esc_html__( 'Add to Gallery', 'chocorocco') : $title).'\"'\n\t\t\t\t\t\t\t. '\tdata-multiple=\"'.esc_attr(!empty($field['multiple']) ? '1' : '0').'\"'\n\t\t\t\t\t\t\t. '\tdata-type=\"'.esc_attr(!empty($field['data_type']) ? $field['data_type'] : 'image').'\"'\n\t\t\t\t\t\t\t. '\tdata-linked-field=\"'.esc_attr($field['linked_field_id']).'\"'\n\t\t\t\t\t\t\t. '>'\n\t\t\t\t\t\t\t. (!empty($field['multiple'])\n\t\t\t\t\t\t\t\t\t? (empty($field['data_type']) || $field['data_type']=='image'\n\t\t\t\t\t\t\t\t\t\t? esc_html__( 'Add Images', 'chocorocco')\n\t\t\t\t\t\t\t\t\t\t: esc_html__( 'Add Files', 'chocorocco')\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: esc_html($title)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t. '</a>';\n\t\t\t$output .= '<span class=\"chocorocco_meta_box_field_preview\">';\n\t\t\t$images = explode('|', $value);\n\t\t\tif (is_array($images)) {\n\t\t\t\tforeach ($images as $img)\n\t\t\t\t\t$output .= $img && !chocorocco_is_inherit($img)\n\t\t\t\t\t\t\t? '<span>'\n\t\t\t\t\t\t\t\t\t. (in_array(chocorocco_get_file_ext($img), array('gif', 'jpg', 'jpeg', 'png'))\n\t\t\t\t\t\t\t\t\t\t\t? '<img src=\"' . esc_url($img) . '\" alt=\"' . esc_html(basename($img)) . '\">'\n\t\t\t\t\t\t\t\t\t\t\t: '<a href=\"' . esc_attr($img) . '\">' . esc_html(basename($img)) . '</a>'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t. '</span>' \n\t\t\t\t\t\t\t: '';\n\t\t\t}\n\t\t\t$output .= '</span>';\n\t\t\tbreak;\n\n\t\tcase 'icons':\n\t\t\t$icons_type = !empty($field['style']) \n\t\t\t\t\t\t\t? $field['style'] \n\t\t\t\t\t\t\t: chocorocco_get_theme_setting('icons_type');\n\t\t\tif (empty($field['return']))\n\t\t\t\t$field['return'] = 'full';\n\t\t\t$chocorocco_icons = $icons_type=='images'\n\t\t\t\t\t\t\t\t? chocorocco_get_list_images()\n\t\t\t\t\t\t\t\t: chocorocco_array_from_list(chocorocco_get_list_icons());\n\t\t\tif (is_array($chocorocco_icons)) {\n\t\t\t\tif (!empty($field['button']))\n\t\t\t\t\t$output .= '<span id=\"'.esc_attr($id).'\"'\n\t\t\t\t\t\t\t\t\t. ' class=\"chocorocco_list_icons_selector'\n\t\t\t\t\t\t\t\t\t\t\t. ($icons_type=='icons' && !empty($value) ? ' '.esc_attr($value) : '')\n\t\t\t\t\t\t\t\t\t\t\t.'\"'\n\t\t\t\t\t\t\t\t\t. ' title=\"'.esc_attr__('Select icon', 'chocorocco').'\"'\n\t\t\t\t\t\t\t\t\t. ' data-style=\"'.($icons_type=='images' ? 'images' : 'icons').'\"'\n\t\t\t\t\t\t\t\t\t. ($icons_type=='images' && !empty($value) \n\t\t\t\t\t\t\t\t\t\t? ' style=\"background-image: url('.esc_url($field['return']=='slug' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? $chocorocco_icons[$value] \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $value).');\"' \n\t\t\t\t\t\t\t\t\t\t\t: '')\n\t\t\t\t\t\t\t\t. '></span>';\n\t\t\t\tif (!empty($field['icons'])) {\n\t\t\t\t\t$output .= '<div class=\"chocorocco_list_icons\">';\n\t\t\t\t\tforeach($chocorocco_icons as $slug=>$icon) {\n\t\t\t\t\t\t$output .= '<span class=\"'.esc_attr($icons_type=='icons' ? $icon : $slug)\n\t\t\t\t\t\t\t\t. (($field['return']=='full' ? $icon : $slug) == $value ? ' chocorocco_list_active' : '')\n\t\t\t\t\t\t\t\t. '\"'\n\t\t\t\t\t\t\t\t. ' title=\"'.esc_attr($slug).'\"'\n\t\t\t\t\t\t\t\t. ' data-icon=\"'.esc_attr($field['return']=='full' ? $icon : $slug).'\"'\n\t\t\t\t\t\t\t\t. ($icons_type=='images' ? ' style=\"background-image: url('.esc_url($icon).');\"' : '')\n\t\t\t\t\t\t\t\t. '></span>';\n\t\t\t\t\t}\n\t\t\t\t\t$output .= '</div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'checklist':\n\t\t\tif (!empty($field['sortable']))\n\t\t\t\twp_enqueue_script('jquery-ui-sortable', false, array('jquery', 'jquery-ui-core'), null, true);\n\t\t\t$output .= '<div class=\"chocorocco_checklist chocorocco_checklist_'.esc_attr($field['dir'])\n\t\t\t\t\t\t. (!empty($field['sortable']) ? ' chocorocco_sortable' : '') \n\t\t\t\t\t\t. '\">';\n\t\t\tif (!is_array($value)) {\n\t\t\t\tif (!empty($value) && !chocorocco_is_inherit($value)) parse_str(str_replace('|', '&', $value), $value);\n\t\t\t\telse $value = array();\n\t\t\t}\n\t\t\t// Sort options by values order\n\t\t\tif (!empty($field['sortable']) && is_array($value)) {\n\t\t\t\t$field['options'] = chocorocco_array_merge($value, $field['options']);\n\t\t\t}\n\t\t\tforeach ($field['options'] as $k=>$v) {\n\t\t\t\t$output .= '<label class=\"chocorocco_checklist_item_label' \n\t\t\t\t\t\t\t\t. (!empty($field['sortable']) ? ' chocorocco_sortable_item' : '') \n\t\t\t\t\t\t\t\t. '\">'\n\t\t\t\t\t\t\t. '<input type=\"checkbox\" value=\"1\" data-name=\"'.$k.'\"'\n\t\t\t\t\t\t\t\t.( isset($value[$k]) && (int) $value[$k] == 1 ? ' checked=\"checked\"' : '')\n\t\t\t\t\t\t\t\t.' />'\n\t\t\t\t\t\t\t. (substr($v, 0, 4)=='http' ? '<img src=\"'.esc_url($v).'\">' : esc_html($v))\n\t\t\t\t\t\t. '</label>';\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'scheme_editor':\n\t\t\tif (!is_array($value)) break;\n\t\t\t$output .= '<select class=\"chocorocco_scheme_editor_selector\">';\n\t\t\tforeach ($value as $scheme=>$v)\n\t\t\t\t$output .= '<option value=\"' . esc_attr($scheme) . '\">' . esc_html($v['title']) . '</option>';\n\t\t\t$output .= '</select>';\n\t\t\t$groups = chocorocco_storage_get('scheme_color_groups');\n\t\t\t$colors = chocorocco_storage_get('scheme_color_names');\n\t\t\t$output .= '<div class=\"chocorocco_scheme_editor_colors\">';\n\t\t\tforeach ($value as $scheme=>$v) {\n\t\t\t\t$output .= '<div class=\"chocorocco_scheme_editor_header\">'\n\t\t\t\t\t\t\t\t. '<span class=\"chocorocco_scheme_editor_header_cell\"></span>';\n\t\t\t\tforeach ($groups as $group_name=>$group_data) {\n\t\t\t\t\t$output .= '<span class=\"chocorocco_scheme_editor_header_cell\" title=\"'.esc_html($group_data['description']).'\">' \n\t\t\t\t\t\t\t\t. esc_html($group_data['title'])\n\t\t\t\t\t\t\t\t. '</span>';\n\t\t\t\t}\n\t\t\t\t$output .= '</div>';\n\t\t\t\tforeach ($colors as $color_name=>$color_data) {\n\t\t\t\t\t$output .= '<div class=\"chocorocco_scheme_editor_row\">'\n\t\t\t\t\t\t\t\t. '<span class=\"chocorocco_scheme_editor_row_cell\" title=\"'.esc_html($color_data['description']).'\">'\n\t\t\t\t\t\t\t\t. esc_html($color_data['title'])\n\t\t\t\t\t\t\t\t. '</span>';\n\t\t\t\t\tforeach ($groups as $group_name=>$group_data) {\n\t\t\t\t\t\t$slug = $group_name == 'main' \n\t\t\t\t\t\t\t\t\t? $color_name \n\t\t\t\t\t\t\t\t\t: str_replace('text_', '', \"{$group_name}_{$color_name}\");\n\t\t\t\t\t\t$output .= '<span class=\"chocorocco_scheme_editor_row_cell\">'\n\t\t\t\t\t\t\t\t\t. (isset($v['colors'][$slug])\n\t\t\t\t\t\t\t\t\t\t? \"<input type=\\\"text\\\" name=\\\"{$slug}\\\" class=\\\"iColorPicker\\\" value=\\\"\".esc_attr($v['colors'][$slug]).\"\\\">\"\n\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t. '</span>';\n\t\t\t\t\t}\n\t\t\t\t\t$output .= '</div>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn apply_filters('chocorocco_filter_show_custom_field', $output, $id, $field, $value);\n}", "function wp_custom_attachment() {\n\n\twp_nonce_field(plugin_basename(__FILE__), 'wp_custom_attachment_nonce');\n\t\n\t$html = '<p class=\"description\">';\n\t\t$html .= 'Upload your file here.';\n\t$html .= '</p>';\n\t$html .= '<input id=\"wp_custom_attachment\" name=\"wp_custom_attachment\" value=\"\" size=\"25\" type=\"file\">';\n\t\n\techo $html;\n\n}", "function do_comcode_attachments($original_comcode,$type,$id,$previewing_only=false,$connection=NULL,$insert_as_admin=NULL,$for_member=NULL)\n{\n\trequire_lang('comcode');\n\n\tglobal $COMCODE_ATTACHMENTS;\n\tunset($COMCODE_ATTACHMENTS[$id]); // In case we have some kind of conflict\n\n\tif (is_null($connection)) $connection=$GLOBALS['SITE_DB'];\n\n\tif ($for_member!==NULL)\n\t{\n\t\t$member=$for_member;\n\t\tif (is_null($insert_as_admin)) $insert_as_admin=false;\n\t} else\n\t{\n\t\tif (function_exists('get_member'))\n\t\t{\n\t\t\t$member=get_member();\n\t\t\tif (is_null($insert_as_admin)) $insert_as_admin=false;\n\t\t} else\n\t\t{\n\t\t\t$member=0;\n\t\t\tif (is_null($insert_as_admin)) $insert_as_admin=true;\n\t\t}\n\t}\n\n\t$comcode_text=(substr($original_comcode,0,8)!='<comcode');\n\n\t// Handle data URLs for attachment embedding\n\tif ((function_exists('imagecreatefromstring')) && (strpos($original_comcode,'[html]')===false))\n\t{\n\t\t$matches=array();\n\t\t$matches2=array();\n\t\t$num_matches=preg_match_all('#<img[^<>]*src=\"data:image/\\w+;base64,([^\"]*)\"[^<>]*>#',$original_comcode,$matches);\n\t\t$num_matches2=preg_match_all('#\\[img[^\\[\\]]*\\]data:image/\\w+;base64,([^\"]*)\\[/img\\]#',$original_comcode,$matches2);\n\t\tfor ($i=0;$i<$num_matches2;$i++)\n\t\t{\n\t\t\t$matches[0][$num_matches]=$matches2[0][$i];\n\t\t\t$matches[1][$num_matches]=$matches2[1][$i];\n\t\t\t$num_matches++;\n\t\t}\n\t\tfor ($i=0;$i<$num_matches;$i++)\n\t\t{\n\t\t\tif (strpos($original_comcode,$matches[0][$i])!==false) // Check still here (if we have same image in multiple places, may have already been attachment-ified)\n\t\t\t{\n\t\t\t\t$data=@base64_decode($matches[1][$i]);\n\t\t\t\tif (($data!==false) && (function_exists('imagepng')))\n\t\t\t\t{\n\t\t\t\t\t$image=@imagecreatefromstring($data);\n\t\t\t\t\tif ($image!==false)\n\t\t\t\t\t{\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$new_filename=uniqid('',true).'.png';\n\t\t\t\t\t\t\t$new_path=get_custom_file_base().'/uploads/attachments/'.$new_filename;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (file_exists($new_path));\n\t\t\t\t\t\timagepng($image,$new_path);\n\t\n\t\t\t\t\t\t$attachment_id=$GLOBALS['SITE_DB']->query_insert('attachments',array(\n\t\t\t\t\t\t\t'a_member_id'=>get_member(),\n\t\t\t\t\t\t\t'a_file_size'=>strlen($data),\n\t\t\t\t\t\t\t'a_url'=>'uploads/attachments/'.$new_filename,\n\t\t\t\t\t\t\t'a_thumb_url'=>'',\n\t\t\t\t\t\t\t'a_original_filename'=>basename($new_filename),\n\t\t\t\t\t\t\t'a_num_downloads'=>0,\n\t\t\t\t\t\t\t'a_last_downloaded_time'=>time(),\n\t\t\t\t\t\t\t'a_description'=>'',\n\t\t\t\t\t\t\t'a_add_time'=>time()),true);\n\t\t\t\t\t\t$GLOBALS['SITE_DB']->query_insert('attachment_refs',array('r_referer_type'=>$type,'r_referer_id'=>$id,'a_id'=>$attachment_id));\n\t\n\t\t\t\t\t\t$original_comcode=str_replace($matches[0][$i],'[attachment type=\"inline\" thumb=\"0\"]'.strval($attachment_id).'[/attachment]',$original_comcode);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tglobal $ATTACHMENTS_ALREADY_REFERENCED;\n\t$old_already=$ATTACHMENTS_ALREADY_REFERENCED;\n\t$ATTACHMENTS_ALREADY_REFERENCED=array();\n\t$before=$connection->query_select('attachment_refs',array('a_id','id'),array('r_referer_type'=>$type,'r_referer_id'=>$id));\n\tforeach ($before as $ref)\n\t{\n\t\t$ATTACHMENTS_ALREADY_REFERENCED[$ref['a_id']]=1;\n\t}\n\n\t$has_one=false;\n\t$may_have_one=false;\n\tforeach($_POST as $key=>$value)\n\t{\n\t\tif (is_string($key) && preg_match('#^hidFileID\\_#i',$key)!=0)\n\t\t{\n\t\t\trequire_code('uploads');\n\t\t\t$may_have_one=is_swf_upload();\n\t\t}\n\t}\n\tif ($may_have_one)\n\t{\n\t\trequire_code('uploads');\n\t\tis_swf_upload(true);\n\n\t\trequire_code('comcode_from_html');\n\t\t$original_comcode=preg_replace_callback('#<input [^>]*class=\"ocp_keep_ui_controlled\" [^>]*title=\"([^\"]*)\" [^>]*type=\"text\" [^>]*value=\"[^\"]*\"[^>]*/?'.'>#siU','debuttonise',$original_comcode);\n\t}\n\t$myfile=mixed();\n\tforeach ($_FILES as $key=>$file)\n\t{\n\t\t$matches=array();\n\t\tif ((($may_have_one) && (is_swf_upload()) || (is_uploaded_file($file['tmp_name']))) && (preg_match('#file(\\d+)#',$key,$matches)!=0))\n\t\t{\n\t\t\t$has_one=true;\n\n\t\t\t$atype=post_param('attachmenttype'.$matches[1],'');\n\t\t\t$is_extract=(preg_match('#\\[attachment [^\\]]*type=\"\\w+_extract\"[^\\]]*\\]new_'.$matches[1].'\\[/#',$original_comcode)!=0) || (preg_match('#<attachment [^>]*type=\"\\w+_extract\"[^>]*>new_'.$matches[1].'</#',$original_comcode)!=0);\n\n\t\t\tif ((substr($atype,-8)=='_extract') || ($is_extract))\n\t\t\t{\n\t\t\t\trequire_code('uploads');\n\t\t\t\trequire_code('files');\n\t\t\t\trequire_code('files2');\n\t\t\t\t$thumb=(preg_match('#\\[(attachment|attachment_safe) [^\\]]*thumb=\"1\"[^\\]]*\\]new_'.$matches[1].'\\[/#',$original_comcode)!=0) || (preg_match('#<(attachment|attachment_safe) [^>]*thumb=\"1\"[^>]*>new_'.$matches[1].'</#',$original_comcode)!=0);\n\n\t\t\t\t$arcext=get_file_extension($_FILES[$key]['name']);\n\t\t\t\tif (($arcext=='tar') || ($arcext=='zip'))\n\t\t\t\t{\n\t\t\t\t\tif ($arcext=='tar')\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_code('tar');\n\t\t\t\t\t\t$myfile=tar_open($file['tmp_name'],'rb');\n\t\t\t\t\t\t$dir=tar_get_directory($myfile,true);\n\t\t\t\t\t} elseif ($arcext=='zip')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((!function_exists('zip_open')) && (get_option('unzip_cmd')=='')) warn_exit(do_lang_tempcode('ZIP_NOT_ENABLED'));\n\t\t\t\t\t\tif (!function_exists('zip_open'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trequire_code('m_zip');\n\t\t\t\t\t\t\t$mzip=true;\n\t\t\t\t\t\t} else $mzip=false;\n\n\t\t\t\t\t\t$myfile=zip_open($file['tmp_name']);\n\t\t\t\t\t\tif (is_integer($myfile))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trequire_code('failure');\n\t\t\t\t\t\t\twarn_exit(zip_error($myfile,$mzip));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$dir=array();\n\t\t\t\t\t\twhile (($zip_entry=zip_read($myfile))!==false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dir[]=array(\n\t\t\t\t\t\t\t\t'zip_entry'=>$zip_entry,\n\t\t\t\t\t\t\t\t'path'=>zip_entry_name($zip_entry),\n\t\t\t\t\t\t\t\t'size'=>zip_entry_filesize($zip_entry),\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\tif (count($dir)>100)\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_code('site');\n\t\t\t\t\t\tattach_message(do_lang_tempcode('TOO_MANY_FILES_TO_EXTRACT'),'warn');\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($dir as $entry)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (substr($entry['path'],-1)=='/') continue; // Ignore folders\n\n\t\t\t\t\t\t\t$_file=preg_replace('#\\..*\\.#','.',basename($entry['path']));\n\n\t\t\t\t\t\t\tif (!check_extension($_file,false,NULL,true)) continue;\n\t\t\t\t\t\t\tif (should_ignore_file($entry['path'],IGNORE_ACCESS_CONTROLLERS | IGNORE_HIDDEN_FILES)) continue;\n\n\t\t\t\t\t\t\t$place=get_custom_file_base().'/uploads/attachments/'.$_file;\n\t\t\t\t\t\t\t$i=2;\n\t\t\t\t\t\t\t// Hunt with sensible names until we don't get a conflict\n\t\t\t\t\t\t\twhile (file_exists($place))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_file=strval($i).basename($entry['path']);\n\t\t\t\t\t\t\t\t$place=get_custom_file_base().'/uploads/attachments/'.$_file;\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$i=2;\n\t\t\t\t\t\t\t$_file_thumb=basename($entry['path']);\n\t\t\t\t\t\t\t$place_thumb=get_custom_file_base().'/uploads/attachments_thumbs/'.$_file_thumb;\n\t\t\t\t\t\t\t// Hunt with sensible names until we don't get a conflict\n\t\t\t\t\t\t\twhile (file_exists($place_thumb))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_file_thumb=strval($i).basename($entry['path']);\n\t\t\t\t\t\t\t\t$place_thumb=get_custom_file_base().'/uploads/attachments_thumbs/'.$_file_thumb;\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ($arcext=='tar')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$file_details=tar_get_file($myfile,$entry['path'],false,$place);\n\t\t\t\t\t\t\t} elseif ($arcext=='zip')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tzip_entry_open($myfile,$entry['zip_entry']);\n\t\t\t\t\t\t\t\t$file_details=array(\n\t\t\t\t\t\t\t\t\t'size'=>$entry['size'],\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t$out_file=@fopen($place,'wb') OR intelligent_write_error($place);\n\t\t\t\t\t\t\t\t$more=mixed();\n\t\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$more=zip_entry_read($entry['zip_entry']);\n\t\t\t\t\t\t\t\t\tif ($more!==false)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (fwrite($out_file,$more)<strlen($more)) warn_exit(do_lang_tempcode('COULD_NOT_SAVE_FILE'));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twhile (($more!==false) && ($more!=''));\n\t\t\t\t\t\t\t\tfclose($out_file);\n\n\t\t\t\t\t\t\t\tzip_entry_close($entry['zip_entry']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$description=do_lang('EXTRACTED_FILE');\n\t\t\t\t\t\t\tif (strpos($entry['path'],'/')!==false)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$description=do_lang('EXTRACTED_FILE_PATH',dirname($entry['path']));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Thumbnail\n\t\t\t\t\t\t\t$thumb_url='';\n\t\t\t\t\t\t\trequire_code('images');\n\t\t\t\t\t\t\tif (is_image($_file))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$gd=((get_option('is_on_gd')=='1') && (function_exists('imagetypes')));\n\t\t\t\t\t\t\t\tif ($gd)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\trequire_code('images');\n\t\t\t\t\t\t\t\t\tif (!is_saveable_image($_file)) $ext='.png'; else $ext='.'.get_file_extension($_file);\n\t\t\t\t\t\t\t\t\t$thumb_url='uploads/attachments_thumbs/'.$_file_thumb;\n\t\t\t\t\t\t\t\t\tconvert_image(get_custom_base_url().'/uploads/attachments/'.$_file,$place_thumb,-1,-1,intval(get_option('thumb_width')),true,NULL,false,true);\n\n\t\t\t\t\t\t\t\t\tif ($connection->connection_write!=$GLOBALS['SITE_DB']->connection_write) $thumb_url=get_custom_base_url().'/'.$thumb_url;\n\t\t\t\t\t\t\t\t} else $thumb_url='uploads/attachments/'.$_file;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$url='uploads/attachments/'.$_file;\n\t\t\t\t\t\t\tif (addon_installed('galleries'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trequire_code('images');\n\t\t\t\t\t\t\t\tif ((is_video($url)) && ($connection->connection_read==$GLOBALS['SITE_DB']->connection_read))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\trequire_code('transcoding');\n\t\t\t\t\t\t\t\t\t$url=transcode_video($url,'attachments','a_url','a_original_filename',NULL,NULL);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$attachment_id=$connection->query_insert('attachments',array(\n\t\t\t\t\t\t\t\t'a_member_id'=>get_member(),\n\t\t\t\t\t\t\t\t'a_file_size'=>$file_details['size'],\n\t\t\t\t\t\t\t\t'a_url'=>$url,\n\t\t\t\t\t\t\t\t'a_thumb_url'=>$thumb_url,\n\t\t\t\t\t\t\t\t'a_original_filename'=>basename($entry['path']),\n\t\t\t\t\t\t\t\t'a_num_downloads'=>0,\n\t\t\t\t\t\t\t\t'a_last_downloaded_time'=>time(),\n\t\t\t\t\t\t\t\t'a_description'=>$description,\n\t\t\t\t\t\t\t\t'a_add_time'=>time()),true);\n\t\t\t\t\t\t\t$connection->query_insert('attachment_refs',array('r_referer_type'=>$type,'r_referer_id'=>$id,'a_id'=>$attachment_id));\n\n\t\t\t\t\t\t\tif ($comcode_text)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$original_comcode.=chr(10).chr(10).'[attachment type=\"'.comcode_escape(str_replace('_extract','',$atype)).'\" description=\"'.comcode_escape($description).'\" thumb=\"'.($thumb?'1':'0').'\"]'.strval($attachment_id).'[/attachment]';\n\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\trequire_code('comcode_xml');\n\t\t\t\t\t\t\t\t//$original_comcode.=chr(10).chr(10).'<attachment type=\"'.comcode_escape(str_replace('_extract','',$atype)).'\" thumb=\"'.($thumb?'1':'0').'\"><attachmentDescription>'.comcode_text__to__comcode_xml($description).'</attachmentDescription>'.strval($attachment_id).'</attachment>';\t\t\tWould go in bad spot\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\tif ($arcext=='tar')\n\t\t\t\t\t{\n\t\t\t\t\t\ttar_close($myfile);\n\t\t\t\t\t} elseif ($arcext=='zip')\n\t\t\t\t\t{\n\t\t\t\t\t\tzip_close($myfile);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif ((strpos($original_comcode,']new_'.$matches[1].'[/attachment]')===false) && (strpos($original_comcode,'>new_'.$matches[1].'</attachment>')===false) && (strpos($original_comcode,']new_'.$matches[1].'[/attachment_safe]')===false) && (strpos($original_comcode,'>new_'.$matches[1].'</attachment_safe>')===false))\n\t\t\t\t{\n\t\t\t\t\tif ((preg_match('#\\]\\d+\\[/attachment\\]#',$original_comcode)==0) && (preg_match('#>\\d+</attachment>#',$original_comcode)==0)) // Attachment could have already been put through (e.g. during a preview). If we have actual ID's referenced, it's almost certainly the case.\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($comcode_text)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$original_comcode.=chr(10).chr(10).'[attachment]new_'.$matches[1].'[/attachment]';\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//$original_comcode.=chr(10).chr(10).'<attachment>new_'.$matches[1].'</attachment>';\t\tWould go in bad spot\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}\n\n\tglobal $LAX_COMCODE;\n\t$temp=$LAX_COMCODE;\n\tif ($has_one) $LAX_COMCODE=true; // We don't want a simple syntax error to cause us to lose our attachments\n\t$tempcode=comcode_to_tempcode($original_comcode,$member,$insert_as_admin,60,$id,$connection,false,false,false,false,false,NULL,$for_member);\n\t$LAX_COMCODE=$temp;\n\t$ATTACHMENTS_ALREADY_REFERENCED=$old_already;\n\n\t/*if ((array_key_exists($id,$COMCODE_ATTACHMENTS)) && (array_key_exists(0,$COMCODE_ATTACHMENTS[$id])))\n\t{\n\t\t$original_comcode=$COMCODE_ATTACHMENTS[$id][0]['comcode'];\n\t}*/\n\n\t$new_comcode=$original_comcode;\n\n\tif (array_key_exists($id,$COMCODE_ATTACHMENTS))\n\t{\n\t\t$ids_present=array();\n\t\tfor ($i=0;$i<count($COMCODE_ATTACHMENTS[$id]);$i++)\n\t\t{\n\t\t\t$attachment=$COMCODE_ATTACHMENTS[$id][$i];\n\n\t\t\t// If it's a new one, we need to change the comcode to reference the ID we made for it\n\t\t\tif ($attachment['type']=='new')\n\t\t\t{\n\t\t\t\t$marker=$attachment['marker'];\n//\t\t\t\techo $marker.'!'.$new_comcode;\n\t\t\t\t$a_id=$attachment['id'];\n\n\t\t\t\t$old_length=strlen($new_comcode);\n\n\t\t\t\t// Search backwards from $marker\n\t\t\t\t$tag_end_start=$marker-strlen('[/'.$attachment['tag_type'].']'); // </attachment> would be correct if it is Comcode-XML, but they have the same length, so it's irrelevant\n\t\t\t\t$tag_start_end=$tag_end_start;\n\t\t\t\twhile (($tag_start_end>1) && ((!isset($new_comcode[$tag_start_end-1])) || (($new_comcode[$tag_start_end-1]!=']') && ($new_comcode[$tag_start_end-1]!='>')))) $tag_start_end--;\n\t\t\t\t$param_keep=substr($new_comcode,0,$tag_start_end-1);\n\t\t\t\t$end_keep=substr($new_comcode,$tag_end_start);\n\t\t\t\tif ($comcode_text)\n\t\t\t\t{\n\t\t\t\t\t$new_comcode=$param_keep;\n\t\t\t\t\tif (strpos(substr($param_keep,strrpos($param_keep,'[')),' type=')===false) $new_comcode.=' type=\"'.comcode_escape($attachment['attachmenttype']).'\"';\n\t\t\t\t\tif (strpos(substr($param_keep,strrpos($param_keep,'[')),' description=')===false) $new_comcode.=' description=\"'.comcode_escape($attachment['description']).'\"';\n\t\t\t\t\t$new_comcode.=']'.strval($a_id).$end_keep;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\trequire_code('comcode_xml');\n\t\t\t\t\t$new_comcode=$param_keep;\n\t\t\t\t\tif (strpos(substr($param_keep,strrpos($param_keep,'<')),' type=')===false) $new_comcode.=' type=\"'.comcode_escape($attachment['attachmenttype']);\n\t\t\t\t\t$new_comcode.='\">';\n\t\t\t\t\tif (strpos(substr($param_keep,strrpos($param_keep,'<')),' description=')===false)\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_code('comcode_xml');\n\t\t\t\t\t\t$new_comcode.='<attachmentDescription>'.comcode_text__to__comcode_xml($attachment['description'],true).'</attachmentDescription>';\n\t\t\t\t\t}\n\t\t\t\t\t$new_comcode.=strval($a_id).$end_keep;\n\t\t\t\t}\n//\t\t\t\techo $new_comcode.'<br />!<br />';\n\n\t\t\t\t// Update other attachment markers\n\t\t\t\t$dif=strlen($new_comcode)-$old_length;\n\t\t\t\tfor ($j=$i+1;$j<count($COMCODE_ATTACHMENTS[$id]);$j++)\n\t\t\t\t{\n//\t\t\t\t\techo $COMCODE_ATTACHMENTS[$id][$i]['marker'].'!';\n\t\t\t\t\t$COMCODE_ATTACHMENTS[$id][$j]['marker']+=$dif;\n\t\t\t\t}\n\n\t\t\t\tif (!is_null($type))\n\t\t\t\t\t$connection->query_insert('attachment_refs',array('r_referer_type'=>$type,'r_referer_id'=>$id,'a_id'=>$a_id));\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// (Re-)Reference it\n\t\t\t\t$connection->query_delete('attachment_refs',array('r_referer_type'=>$type,'r_referer_id'=>$id,'a_id'=>$attachment['id']),'',1);\n\t\t\t\t$connection->query_insert('attachment_refs',array('r_referer_type'=>$type,'r_referer_id'=>$id,'a_id'=>$attachment['id']));\n\t\t\t}\n\n\t\t\t$ids_present[]=$attachment['id'];\n\t\t}\n\n\t\tif ((!$previewing_only) && (get_value('disable_attachment_cleanup')!=='1'))\n\t\t{\n\t\t\t// Clear any de-referenced attachments\n\t\t\tforeach ($before as $ref)\n\t\t\t{\n\t\t\t\tif ((!in_array($ref['a_id'],$ids_present)) && (strpos($new_comcode,'attachment.php?id=')===false) && (!multi_lang()))\n\t\t\t\t{\n\t\t\t\t\t// Delete reference (as it's not actually in the new comcode!)\n\t\t\t\t\t$connection->query_delete('attachment_refs',array('id'=>$ref['id']),'',1);\n\n\t\t\t\t\t// Was that the last reference to this attachment? (if so -- delete attachment)\n\t\t\t\t\t$test=$connection->query_value_null_ok('attachment_refs','id',array('a_id'=>$ref['a_id']));\n\t\t\t\t\tif (is_null($test))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire_code('attachments3');\n\t\t\t\t\t\t_delete_attachment($ref['a_id'],$connection);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array(\n\t\t'comcode'=>$new_comcode,\n\t\t'tempcode'=>$tempcode\n\t);\n}", "function stream_preview_image($post_id)\n {\n }", "function jigoshop_custom_image($args=array()) {\n\trequire_once (ABSPATH . '/wp-admin/includes/image.php');\n\n\t$defaults = array('image'=>null, 'echo'=>true, 'width'=>60, 'height'=>60);\n\t$args = wp_parse_args($args, $defaults);\n\n\textract($args);\n\n\tif (isset($_POST['image']) && defined('DOING_AJAX') && DOING_AJAX){\n\t\t$image = isset($_POST['image']) ? $_POST['image'] : null;\n\t\t$width = isset($_POST['width']) ? $_POST['width'] : $width;\n\t\t$height = isset($_POST['height']) ? $_POST['height'] : $height;\n\t}\n\n\t$src = jigoshop_custom_image_src($image, $width, $height);\n\n\tif ($echo){\n\t\techo '<img src=\"' . $src . '\" width=\"' . $width . '\" height=\"' . $height . '\" class=\"jigoshop-media-preview\"/>';\n\t}\n\n\tif (defined('DOING_AJAX') && DOING_AJAX){\n\t\texit();\n\t} else {\n\t\treturn $src;\n\t}\n}", "static function media_templates() { ?>\n<script id=\"tmpl-wp-form-attachment-field\" type=\"text/html\">\n<div class=\"attachment-container\">\n\t<img src=\"{{ data.type == 'image' ? data.url : data.icon }}\" />\n</div>\n<label>\n\t<span><?php esc_html_e( \"ID:\", 'wp-forms-api' ); ?></span>\n\t<input type=\"text\" name=\"{{ data.input_name }}\" class=\"wp-form-attachment-id\" value=\"{{ data.id }}\" />\n</label>\n<label>\n\t<span><?php esc_html_e( \"Title:\", 'wp-forms-api' ); ?></span>\n\t<input type=\"text\" value=\"{{ data.title }}\" readonly=\"readonly\" />\n</label>\n<label>\n\t<a href=\"{{ data.link }}\" target=\"_blank\"><?php __( \"View\", 'wp-forms-api' ); ?></a>\n</label>\n<# if(data.url) { #><span class=\"attachment-delete\"></span><# } #>\n<p>\n<# if(data.editLink) { #><a href=\"{{ data.editLink }}\">Edit</a>&nbsp;&nbsp;<# } #>\n<# if(data.url) { #><a href=\"{{ data.url }}\">View</a><# } #>\n</p>\n</script>\n\t<?php\n\t}", "function acf_get_attachment($attachment)\n{\n}", "function acf_connect_attachment_to_post($attachment_id = 0, $post_id = 0)\n{\n}", "function add_attachment(){\n\tadd_action( 'admin_head', 'metabox_styles' );\n\tadd_action( 'admin_head', 'metabox_scripts' );\n\tadd_meta_box( 'img-uploads', __( 'Add Attachments' ), 'add_attachments', 'product', 'normal', 'high' );\n}", "function uultra_get_addlink_html_form($meta, $content)\r\n\t{\r\n\t\tob_start();\r\n\t\t\r\n\t\t$editor_id = $meta;\t\t\t\t\r\n\t\t$editor_settings = array('media_buttons' => false , 'textarea_rows' => 40 , 'teeny' =>true, 'tinymce' => array( 'height' => 300 ), 'quicktags' => false); \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\twp_editor( $content, $editor_id , $editor_settings);\r\n\t\t\r\n\t\t// Store the contents of the buffer in a variable\r\n\t\t$editor_contents = ob_get_clean();\r\n\t\t\r\n\t\t// Return the content you want to the calling function\r\n\t\treturn $editor_contents;\r\n\t\t\t\r\n\t}", "public function wp_roni_photo_contest_shortcode( $attr, $content = null ) {\n global $post;\n \n $data = [];\n \n // Checks if there was a POST request\n if( $_POST ) {\n\n if( empty( $_POST['author-name'] ) ) {\n $this->errors[] = 'Pozabili ste vnesti svoje ime!';\n }\n\n if( empty( $_POST['author-email'] ) ) {\n $this->errors[] = 'Pozabili ste vnesti svoj e-mail!';\n } \n\n /* \n * TODO: Email already exists\n * This check is implemented bot not used\n */ \n /*if( emailExists( filter_var( $_POST['author_email'], FILTER_SANITIZE_EMAIL ) ) ) {\n $this->errors[] = 'Ta email je že obstaja';\n }*/\n\n if( $_FILES['file-upload']['error'] == 4 ) {\n $this->errors[] = 'Pozabili ste vstaviti sliko!';\n } \n\n if( $_FILES['file-upload']['size'] > 1000000 ) {\n $this->errors[] = 'Slike je prevelika!. Naložite manjšo sliko! Maksimalno 1MB.';\n }\n\n $image_type = strtolower( substr( strrchr( $_FILES['file-upload']['type'], '/' ), 1 ) );\n\n if( $image_type != 'jpg' && $image_type != 'jpeg' && $image_type != 'png' && $image_type != 'gif' && $image_type != '' ) {\n $this->errors[] = 'Format ' . '.' . $image_type . ' ni podprt. Podprti so samo .jpg, .jpeg, .png in .gif!';\n } \n\n \n if( !empty( $this->errors ) ) {\n $_SESSION['errors'] = $this->errors;\n } else {\n $name = $_POST['author-name'];\n $email = $_POST['author-email'];\n $title = $_POST['image-title'];\n $description = $_POST['image-description'];\n\n $upload = new MediaUpload;\n $file = $upload->saveUpload( $field_name = 'file-upload' );\n\n $original_path = $this->upload_dir['baseurl'] . '/' . _wp_relative_upload_path( $file['file'] );\n \n $resize_image = new ResizeImage( $original_path );\n $resize_image->resizeImage( 350, 350, 'crop' );\n\n $crop_path = 'wp-content/uploads/tekmovanje' . $this->upload_dir['subdir'] . '/' . $file['file_info']['filename'] . '-350x350' . '.' . $file['file_info']['extension'];\n\n $resize_image->saveImage( $crop_path, 100 );\n \n $data['attachment_id'] = $file['attachment_id'];\n $data['title'] = $title;\n $data['description'] = $description;\n $data['attachment_id'] = $file['attachment_id'];\n $data['image_path'] = $original_path;\n $data['image_thumb_path'] = $this->upload_dir['baseurl'] . '/' . _wp_relative_upload_path( $file['file_info']['dirname'] ) . '/' . $file['file_info']['filename'] . '-350x350' . '.' . $file['file_info']['extension'];\n $data['author_name'] = $name;\n $data['author_email'] = $email;\n $data['number_of_votes'] = 0;\n $data['created'] = date('d.m.Y G:i:s');\n\n $save_data = $this->saveToDatabse($data);\n\n # TODO: Database error handler not implemented yet \n\n $_SESSION['success'] = 'Slika je bila uspešno naložena!';\n\n # TOO: Create post for every image upload \n $my_post = array(\n 'post_title' => 'Nov vnos',\n 'post_content' => 'This is my post.',\n 'post_status' => 'publish',\n 'post_author' => 1\n );\n\n //wp_insert_post( $my_post );\n \n } \n }\n\n $images_data = $this->getImages();\n $contest_subtitle = get_option( 'wp_roni_photo_contest_subtitle' );\n $contest_description = get_option( 'wp_roni_photo_contest_description' );\n\n // Get the front end ( form, and images grid )\n ob_start();\n require( 'inc/front-end.php' );\n $content = ob_get_clean();\n\n session_destroy();\n\n return $content;\n }" ]
[ "0.766068", "0.71962106", "0.6821833", "0.6803288", "0.6479158", "0.6464659", "0.6266107", "0.6123092", "0.6122282", "0.6063534", "0.6046032", "0.60208213", "0.6011127", "0.6002279", "0.59955156", "0.59920454", "0.59417444", "0.5940703", "0.5930676", "0.59271455", "0.5918169", "0.58992696", "0.5898625", "0.58833325", "0.58769226", "0.58570164", "0.5838105", "0.5822954", "0.58207715", "0.58112496" ]
0.7584899
1
Register Skinr API information. This is required for your module to have its include files loaded. The full documentation for this hook is in the advanced help.
function hook_skinr_api() { return array( 'api' => 1, 'path' => drupal_get_path('module', 'modulename'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "function registerHooks()\n{\n add_action('after_setup_theme', 'setupTheme');\n add_action('rest_api_init', 'registerEndpoints');\n}", "private function settings_api_init() {\r\n\t\tif ( ! isset( $this->hook_suffix ) )\r\n\t\t\treturn;\r\n\r\n\t\t// Infusion API settings\r\n\t\t$section = 'infusion-api';\r\n\t\tadd_settings_section(\r\n\t\t\t$section,\r\n\t\t\t__( 'Infusion API Settings', 'inf-member' ),\r\n\t\t\tarray( &$this, 'section_header' ),\r\n\t\t\t$this->hook_suffix\r\n\t\t);\r\n\r\n\t\tadd_settings_field(\r\n\t\t\t'inf_url',\r\n\t\t\t_x( 'Infusion API Service URL', 'inf-member' ),\r\n\t\t\tarray( &$this, 'display_inf_url' ),\r\n\t\t\t$this->hook_suffix,\r\n\t\t\t$section,\r\n\t\t\tarray( 'label_for' => 'inf_url' )\r\n\t\t);\r\n\t\tadd_settings_field(\r\n\t\t\t'inf_key',\r\n\t\t\t_x( 'Infusion API key', 'inf-member' ),\r\n\t\t\tarray( &$this, 'display_api_key' ),\r\n\t\t\t$this->hook_suffix,\r\n\t\t\t$section,\r\n\t\t\tarray( 'label_for' => 'inf_key' )\r\n\t\t);\r\n\r\n /*if(Inf_Member::app_credentials_exist())\r\n $this->db_install();*/\r\n\t}", "public static function register()\n\t{\n\t\tRichText_AdminModule::register();\n//\t\tRichText_FrontModule::register();\n\t}", "private function setup_api() {\n\t\trequire_once 'includes/class-themeisle-ob-rest-server.php';\n\t\tif ( ! class_exists( 'Themeisle_OB_Rest_Server' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$api = new Themeisle_OB_Rest_Server();\n\t\t$api->init();\n\t\trequire_once 'includes/importers/helpers/trait-themeisle-ob.php';\n\t}", "function libravatar_install()\n{\n\tHook::register('load_config', 'addon/libravatar/libravatar.php', 'libravatar_load_config');\n\tHook::register('avatar_lookup', 'addon/libravatar/libravatar.php', 'libravatar_lookup');\n\tLogger::notice(\"registered libravatar in avatar_lookup hook\");\n}", "protected static function register() {}", "public function register() {\n\t\tadd_action( 'plugins_loaded', [ $this, 'register_services' ] );\n\t\tadd_action( 'init', [ $this, 'register_assets_handler' ] );\n\t}", "final public function register() : void {\n\t\tregister_rest_field(\n\t\t\t$this->obj_type,\n\t\t\t$this->field_name,\n\t\t\t[\n\t\t\t\t'get_callback' => [ $this, 'get_callback' ],\n\t\t\t\t'update_callback' => method_exists( $this, 'update_callback' )\n\t\t\t\t\t? [ $this, 'update_callback' ]\n\t\t\t\t\t: null,\n\t\t\t\t'schema' => $this->schema,\n\t\t\t]\n\t\t);\n\t}", "protected function init_api() {\n\t\tinclude_once dirname( __FILE__ ) . '/includes/class-coinbase-api-handler.php';\n\n\t\tCoinbase_API_Handler::$log = get_class( $this ) . '::log';\n\t\tCoinbase_API_Handler::$api_key = $this->get_option( 'api_key' );\n\t}", "function indie_studio_customize_register( $wp_customize ) {\n \n //Add Site Identity Settings\n include ( 'identity.php' );\n \n //Add any general settings\n include ( 'general.php' );\n \n //Add footer settings\n include ( 'footer.php' );\n \n //Add font and theme colour options\n include ( 'fonts_colours.php' );\n \n include ( 'social/register_social.php' );\n \n //Add custom scripts fields\n include ( 'scripts.php' );\n \n //Add API key fields\n include ( 'API.php' );\n \n}", "function init() {\n\t\\add_action(\n\t\t'rest_api_init',\n\t\t__NAMESPACE__ . '\\register_rest_routes'\n\t);\n\t\\add_action(\n\t\t'enqueue_block_editor_assets',\n\t\t__NAMESPACE__ . '\\sc_enqueue_block_editor_assets'\n\t);\n}", "public function register()\n {\n add_filter( 'upload_mimes', array( $this, 'add_custom_file_types_supprot' ) );\n\n // add svg support\n add_filter( 'wp_prepare_attachment_for_js', array( $this, 'add_svg_media_thumbnails' ), 10, 3 );\n\n // filter wordpress filetype security check\n add_filter('wp_check_filetype_and_ext', array( $this, 'wp_check_filetype_and_ext' ) , 5, 5);\n\n // Add Custom user fields to ccd_client user role\n add_action( 'show_user_profile', array( $this, 'add_custom_user_fields' ) );\n add_action( 'edit_user_profile', array( $this, 'add_custom_user_fields' ) );\n\n // handle custom user fields update / form post\n add_action( 'personal_options_update', array( $this, 'update_custom_user_fields' ) );\n add_action( 'edit_user_profile_update', array( $this, 'update_custom_user_fields' ) );\n }", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "function render_register()\n {\n }", "public function register()\n\t{\n $this->registerApi();\n\t}", "function media_customize_register( $wp_customize )\n{\n\t$wp_customize->add_section( 'media_integration' , array(\n 'title' => __('Media Integration'),\n 'priority' => 30,\n 'description'=> __('Necessary details for the accounts that are to be integrated into the Theme.')\n\t) );\n\t$wp_customize->add_setting( 'vimeo_user_id' , array(\n\t 'default' => '',\n\t 'transport' => 'refresh',\n\t 'type'\t\t => 'option'\n\t) );\n\t$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'vimeo_id', array(\n\t\t'label' => __( 'Vimeo User ID' ),\n\t\t'section' => 'media_integration',\n\t\t'settings' => 'vimeo_user_id'\n\t) ) );\n\t$wp_customize->add_setting( 'flickr_api_key' , array(\n\t 'default' => '',\n\t 'transport' => 'refresh',\n\t 'type'\t\t => 'option'\n\t) );\n\t$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'flickr_api_key', array(\n\t\t'label' => __( 'Flickr API Key' ),\n\t\t'section' => 'media_integration',\n\t\t'settings' => 'flickr_api_key'\n\t) ) );\n\t$wp_customize->add_setting( 'flickr_user_id' , array(\n\t 'default' => '',\n\t 'transport' => 'refresh',\n\t 'type'\t\t => 'option'\n\t) );\n\t$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'flickr_id', array(\n\t\t'label' => __( 'Flickr User ID' ),\n\t\t'section' => 'media_integration',\n\t\t'settings' => 'flickr_user_id'\n\t) ) );\n}", "public function hook_init() {\n\n\t\t$this->register_blocks();\n\t\t$this->register_assets();\n\n\t}", "public function _register()\n {\n }", "public function register() {}", "private function _initApiCommons()\n {\n // Disable debug information - Required to generate valid XML output\n //Configure::write('debug', 0);\n\n // Avoids render() call\n $this->disableLayout();\n $this->_helper->viewRenderer->setNoRender();\n\n // Instanciate Upload Module\n $this->uploadApi = new KwUploadAPI($this->apiSetup);\n }", "function setup(){\n\t\t$n = function( $function ){\n\t\t\treturn __NAMESPACE__ . '\\\\' . $function;\n\t\t};\n\t\t\n\t\t//add the hooks and filters here\n\t\tadd_action( \"init\", $n(\"register_block\") );\n\t}" ]
[ "0.61668235", "0.61668235", "0.5984445", "0.59811187", "0.5975049", "0.58939624", "0.58470666", "0.5816593", "0.5813113", "0.5775154", "0.57325256", "0.5711132", "0.57100123", "0.56764996", "0.5669077", "0.5669077", "0.5669077", "0.5669077", "0.5669077", "0.5669077", "0.5669077", "0.5669077", "0.56652904", "0.56629544", "0.5636823", "0.56368136", "0.5632484", "0.5602781", "0.56009376", "0.5598264" ]
0.70791835
0
Apply this filter on the given listing.
public function apply(AbstractListing $listing);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ApplyFilter($listing_type)\n\t{\n\t\tif(!$this->request->is('ajax') && !Configure::read('debug') > 0)\n\t\t\treturn;\n\n\t\tif ($this->params == null || !array_key_exists('url', $this->params))\n\t\t\treturn;\n\n\t\t$this->layout = 'ajax';\n\t\t$filterSettings = $this->params['url'];\n\t\t$listing_type = $this->Listing->listing_type($listing_type);\n\t\t$response = $this->Listing->GetMarkerIdList($listing_type, $filterSettings);\n\t\t$this->set('response', $response);\n\t}", "protected function applyAttributeFilters(PageList $listObj){\n foreach($_REQUEST['akID'] AS $keyID => $akArray){\n $akObj = CollectionAttributeKey::getByID( $keyID );\n if( is_object($akObj) ){\n $akObj->getController()->searchForm($listObj);\n }\n }\n }", "public function applyFilters() {\n\t\tforeach ($this->filters as $filter) {\n\t\t\t$filter->apply($this);\n\t\t}\n\t\t$this->removeFilters();\n\t}", "protected function applyFiltering()\n\t{\n\t\tif (!$this->hasFilters()) return;\n\n\t\tparse_str($this->filters, $list);\n\t\tforeach ($list as $column => $value) {\n\t\t\tif ($value !== '') {\n\t\t\t\t$this[$column]->applyFilter($value);\n\t\t\t}\n\t\t}\n\t}", "function wp_list_filter($input_list, $args = array(), $operator = 'AND')\n {\n }", "protected function defineListFilter()\n {\n // Initialise the filter\n $filter = $this->initFilter();\n if (!isset($filter['limit'])) {\n $filter['limit'] = array();\n }\n\n // Handle the page browsing variables\n if (isset($this->piVars['max'])) {\n $filter['limit']['max'] = $this->piVars['max'];\n }\n $filter['limit']['offset'] = isset($this->piVars['page']) ? $this->piVars['page'] : 0;\n\n // If the limit is still empty after that, consider the default value from TypoScript\n if (empty($filter['limit']['max'])) {\n $filter['limit']['max'] = $this->conf['listView.']['limit'];\n }\n\n // Handle sorting variables\n if (isset($this->piVars['sort'])) {\n $sortParts = GeneralUtility::trimExplode('.', $this->piVars['sort'], 1);\n $table = '';\n $field = $sortParts[0];\n if (count($sortParts) == 2) {\n $table = $sortParts[0];\n $field = $sortParts[1];\n }\n $order = isset($this->piVars['order']) ? $this->piVars['order'] : 'asc';\n $orderby = array(0 => array('table' => $table, 'field' => $field, 'order' => $order));\n $filter['orderby'] = $orderby;\n\n // If there were no variables, check a default sorting configuration\n } elseif (!empty($this->conf['listView.']['sort'])) {\n $sortParts = GeneralUtility::trimExplode('.', $this->conf['listView.']['sort'], 1);\n $table = '';\n $field = $sortParts[0];\n if (count($sortParts) == 2) {\n $table = $sortParts[0];\n $field = $sortParts[1];\n }\n $order = isset($this->conf['listView.']['order']) ? $this->conf['listView.']['order'] : 'asc';\n $orderby = array(0 => array('table' => $table, 'field' => $field, 'order' => $order));\n $filter['orderby'] = $orderby;\n }\n\n // Save the filter's hash in session\n $cacheKey = $this->prefixId . '_filterCache_default_' . $this->cObj->data['uid'] . '_' . $GLOBALS['TSFE']->id;\n $GLOBALS['TSFE']->fe_user->setKey('ses', $cacheKey, $filter);\n\n return $filter;\n }", "protected function filterItems()\n\t{\n\t\t// must be in this order\n\t\t$this->applyDefaultFiltering();\n\t\t$this->applyDefaultSorting();\n\t\t$this->applyItems();\n\t\t$this->applyFiltering();\n\t\t$this->applySorting();\n\t\t$this->applyPaging();\n\t}", "function home_filter()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif($data['t'] == 'best_evaluated_bidders') $data['listtype'] = 'best_bidders';\n\t\t\n\t\t$this->load->view($this->get_section_folder($data['t']).'/list_filter', $data);\n\t}", "protected function _applyCustomFilter() {\r\n return $this;\r\n }", "public function processFilter()\n {\n call_user_func($this->builder, $this);\n\n return $this->filter->execute();\n }", "public function filter(callable $callback): \\IvoPetkov\\DataList\n {\n $this->actions[] = ['filter', $callback];\n return $this;\n }", "public function apply() {\n\t\t$prepLookup = clone $this->oLookup;\n\n\t\t$size = $this->oLookup->getSize();\n\n\t\t// Prepare preprocessor query\n\t\t$prepLookup->setSize( $size );\n\t\t$prepLookup->clearSourceField();\n\t\t$prepLookup->addSourceField( 'basename' );\n\t\t$prepLookup->addSourceField( 'namespace' );\n\t\t$prepLookup->addSourceField( 'prefixed_title' );\n\n\t\t$excludes = [];\n\n\t\t$this->getExcludesForCurrentPage( $prepLookup, $size, $excludes );\n\n\t\tif ( empty( $excludes ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add result _ids to exclude from the search\n\t\t$this->oLookup->addBoolMustNotTerms( '_id', $excludes );\n\t}", "function filter(\\Closure $f) {\r\n return new ListM(array_values(array_filter($this->list, $f)));\r\n }", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "public function applyFilter(Query $query);", "public function filterAction()\n\t{\n\t\t$userSession = new Container('fo_user');\n\t\t$this->layout('frontend');\n\t\t$request \t\t= $this->getRequest();\n\t\t$message\t\t= '';\n\t\t$errorMessage\t= '';\n\t\t\n\t\t//\tDestroy listing Session Vars\n\t\t$listingSession = new Container('fo_listing');\n\t\t/*\t$sessionArray\t= array();\n\t\tforeach($listingSession->getIterator() as $key => $value) {\n\t\t\t$sessionArray[]\t= $key;\n\t\t}\n\t\tforeach($sessionArray as $key => $value) {\n\t\t\t$listingSession->offsetUnset($value);\n\t\t}\t*/\n\t\t\n\t\tif ($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\t\n\t\t\tif(isset($formData['search'])) {\n\t\t\t\t//\tKeyword\n\t\t\t\tif($formData['search'] != '')\n\t\t\t\t\t$listingSession->keyword\t= $formData['search'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->keyword\t= '';\n\t\t\t\t\n\t\t\t\t//\tTrack Search Keyword Query\n\t\t\t\t$this->insertSearchQuery($listingSession->keyword);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//\tCategory\n\t\t\t\tif(isset($formData['category']) && $formData['category'] != '')\n\t\t\t\t\t$listingSession->category\t= $formData['category'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->category\t= '';\n\t\t\t\t//\tRanking\n\t\t\t\tif(isset($formData['ranking']) && $formData['ranking'] != '')\n\t\t\t\t\t$listingSession->ranking\t= $formData['ranking'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->ranking\t= '';\n\t\t\t\t//\tLength\n\t\t\t\tif(isset($formData['length']) && $formData['length'] != '')\n\t\t\t\t\t$listingSession->length\t= $formData['length'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->length\t= '';\n\t\t\t\t//\tFriend\n\t\t\t\tif(isset($formData['friend']) && $formData['friend'] != '')\n\t\t\t\t\t$listingSession->friend\t= $formData['friend'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->friend\t= '';\n\t\t\t\t//\tSeen\n\t\t\t\tif(isset($formData['seen']) && $formData['seen'] != '')\n\t\t\t\t\t$listingSession->seen\t= $formData['seen'];\n\t\t\t\telse\n\t\t\t\t\t$listingSession->seen\t= '';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new ViewModel(array(\n\t\t\t'userObject'\t=> $userSession->userSession,\n\t\t\t'message'\t\t=> $message,\n\t\t\t'errorMessage'\t=> $errorMessage,\n\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t'controller'\t=> $this->params('controller'),\n\t\t));\n }", "protected function _filterNode($nodeList, $filter) {}", "public function applyFilters()\n {\n $filters = sfConfig::get('app_sft_papi_plugin_filters_sequence');\n \n if (!(is_array($filters) && count($filters) > 0))\n {\n return $this;\n }\n\n foreach($filters as $filter)\n { \n $className = $filter['class_name'];\n if(!class_exists($className))\n {\n throw new Exception('The filter \"'.$className. '\" does not exists');\n }\n\n $configuration = $filter['configuration'];\n $this -> attributes = call_user_func(array($className ,'execute'), \n $this -> attributes, $configuration);\n } \n return $this;\n }", "private function _applyFilter($filter)\n\t{\n\t\tglobal $context, $scripturl;\n\n\t\tif (isset($filter['variable']))\n\t\t{\n\t\t\t$context['filter'] = &$filter;\n\n\t\t\t// Set the filtering context.\n\t\t\tswitch ($filter['variable'])\n\t\t\t{\n\t\t\t\tcase 'id_member':\n\t\t\t\t\t$id = $filter['value']['sql'];\n\t\t\t\t\tMembersList::load($id, false, 'minimal');\n\t\t\t\t\t$name = MembersList::get($id)->real_name;\n\t\t\t\t\t$context['filter']['value']['html'] = '<a href=\"' . getUrl('profile', ['action' => 'profile', 'u' => $id, 'name' => $name]) . '\">' . $name . '</a>';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'url':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars((substr($filter['value']['sql'], 0, 1) === '?' ? $scripturl : '') . $filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array('\\_' => '_')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'message':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\t$context['filter']['value']['html'] = preg_replace('~&amp;lt;span class=&amp;quot;remove&amp;quot;&amp;gt;(.+?)&amp;lt;/span&amp;gt;~', '$1', $context['filter']['value']['html']);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'error_type':\n\t\t\t\t\t$context['filter']['value']['html'] = '\\'' . strtr(htmlspecialchars($filter['value']['sql'], ENT_COMPAT, 'UTF-8'), array(\"\\n\" => '<br />', '&lt;br /&gt;' => '<br />', \"\\t\" => '&nbsp;&nbsp;&nbsp;', '\\_' => '_', '\\\\%' => '%', '\\\\\\\\' => '\\\\')) . '\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$context['filter']['value']['html'] = &$filter['value']['sql'];\n\t\t\t}\n\t\t}\n\t}", "public function render_filtered_list( $atts ) {\n $id = $atts['id'];\n $context = $this->fetch_base_config( $id, get_post( $id ) );\n $context['selector'] = 'feed' . $id;\n $context['cdp_indexes'] = cdp_get_option('cdp_indexes');\n $context['filters'] = $this->fetch_filters( $atts ); // get_post_meta( $id, 'yali_list_filters', true);\n $context['lang_key'] = get_post_meta( $id, 'yali_cb_lang_selection', true);\n $context['types'] = $this->convert_to_str( get_post_meta( $id, 'yali_list_filters_types', true) );\n $context['date_display'] = get_post_meta( $id, 'yali_filtered_list_date_display', true);\n $context = $this->fetch_btn_config( $context, $id, get_post_meta( $id ) );\n\n switch ( $context['lang_key'] ) {\n case 'en-us' :\n $context['lang_value'] = 'English';\n break;\n case 'fr-fr' :\n $context['lang_value'] = 'French';\n break;\n case 'pt-br' :\n $context['lang_value'] = 'Portuguese';\n break;\n }\n\n return Twig::render( 'content_blocks/post-filtered-list.twig', $context );\n }", "function _sf_get_listing_args($post) {\n\t\t\n\t\tglobal $paged;\n\t\t\n\t\t//// STARTS BASIC ARGUMENTS\n\t\t$args = array(\n\t\t\n\t\t\t'post_type' => 'spot',\n\t\t\t'meta_query' => array(),\n\t\t\t'tax_query' => array(),\n\t\t\t'posts_per_page' => _sf_get_posts_per_page(),\n\t\t\t'paged' => $paged,\n\t\t\n\t\t);\n\t\t\n\t\t///// IF IT'S A CATEGORY PAGE\n\t\tif(is_tax('spot_cats')) { \n\t\t\n\t\t\t$this_tax = get_term_by('name', single_cat_title('', false), 'spot_cats');\n\t\t\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\n\t\t\t\t'taxonomy' => 'spot_cats',\n\t\t\t\t'terms' => $this_tax->term_id,\n\t\t\t\t'field' => 'ID',\n\t\t\t\n\t\t\t);\n\t\t\n\t\t}\n\t\t\n\t\t///// IF IT'S A TAG PAGE\n\t\tif(is_tax('spot_tags')) { \n\t\t\n\t\t\t$this_tax = get_term_by('name', single_cat_title('', false), 'spot_tags');\n\t\t\n\t\t\t$args['tax_query'][] = array(\n\t\t\t\n\t\t\t\t'taxonomy' => 'spot_tags',\n\t\t\t\t'terms' => $this_tax->term_id,\n\t\t\t\t'field' => 'ID',\n\t\t\t\n\t\t\t);\n\t\t\n\t\t}\n\t\t\n\t\tif(isset($post['p_ids'])) { $post_ids = $post['p_ids']; }\n\t\tif(!is_array($post['p_ids'])) { \n\t\t\t\n\t\t\t//// WE HAVE COMMAS IN IT, LET'S EXPLODE IT\n\t\t\tif(strpos($post['p_ids'], ',') !== false) {\n\t\t\t\t\n\t\t\t\t$post_ids = explode(',', $post['p_ids']);\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t//// CHECKS IF WE ARE GETTING OLDEST FIRST\n\t\tif(_sf_get_list_sort() == 'oldest') {\n\t\t\t\n\t\t\t//// SETS OUR ORDER BY\n\t\t\t$args['order'] = 'ASC';\n\t\t\t\n\t\t}\n\t\t\n\t\t///// IF WE HAVE AN UNDERSCORE, WHICH MEANS WE ARE SORTING BY A FIELD\n\t\tif(strpos(_sf_get_list_sort(), '_')) {\n\t\t\t\n\t\t\tglobal $wpdb;\n\t\t\n\t\t\t//// LETS GET THE FIELD WE ARE SORTING BY\n\t\t\t$field_slug = array_shift(explode('_', _sf_get_list_sort()));\n\t\t\t$order = array_pop(explode('_', _sf_get_list_sort()));\n\t\t\t$field_id = $wpdb->get_var(\"SELECT ID FROM $wpdb->posts WHERE post_name = '\".$field_slug.\"' AND post_type = 'search_field'\");\n\t\t\t\n\t\t\t//// IF WE HAVE FOUND THE FIELD\n\t\t\tif(is_numeric($field_id)) {\n\t\t\t\t\n\t\t\t\t$search_field = get_post($field_id);\n\t\t\t\t\n\t\t\t\t//// BUILDS UP THE NEW QUERY\n\t\t\t\t$args['orderby'] = 'meta_value_num';\n\t\t\t\t$args['meta_key'] = '_sf_field_'.$field_id;\n\t\t\t\t\n\t\t\t\t//// IF ITS LOW TO HIGH\n\t\t\t\tif($order == 'low') { $args['order'] = 'ASC'; }\n\t\t\t\telse { $args['order'] = 'DESC'; }\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tif(!isset($post_ids)) {\n\n\t\t\t///// CHECKS FOR SEARCH FIELDS BUT PNLY IF WE DONT HAVE ALREADY A LIST OF POST IDS\n\t\t\t$fields = $_GET;\n\t\t\tif (!is_array($fields)) { $fields = array(); }\n\n// DAHERO #1667462 STRT\n\t\t\tif ($fields['glat'] != '' &&\n\t\t\t\t$fields['glng'] != '' &&\n\t\t\t\t($lat_range = explode('|', $fields['glat'])) &&\n\t\t\t\t($lng_range = explode('|', $fields['glng'])) &&\n\t\t\t\tcount($lat_range) * count($lng_range) == 4 &&\n\t\t\t\tabs($lat_range[0]) <= 90 && abs($lat_range[1]) <= 90 &&\n\t\t\t\tabs($lng_range[1]) <= 180 && abs($lng_range[1]) <= 180 // &&\n//\t\t\t\t$fields['_sf_enable_radius_search'] != 'true'\n\t\t\t) {\n\t\t\t\tif ($lat_range[0] > $lat_range[1]) $lat_range = array_reverse($lat_range);\n\t\t\t\tif ($lng_range[0] > $lng_range[1]) $lng_range = array_reverse($lng_range);\n/*\n\t\t\t\t///// LETS CHECK FOR SENSITIVITY\n\t\t\t\tif (get_post_meta($field->ID, 'google_places_sensitivity', true) != '') {\n\t\t\t\t\t$sensitivity = get_post_meta($field->ID, 'google_places_sensitivity', true);\n\t\t\t\t\t//// IF ITS A NUMBER\n\t\t\t\t\tif(is_numeric($sensitivity) || is_float($sensitivity)) {\n\t\t\t\t\t\t//// IF WE ARE USING MILES LET'S PUT THAT TO KILOMETREST\n\t\t\t\t\t\tif(ddp('geo_distance_type') == 'Miles') { $sensitivity = $sensitivity/0.62137; }\n\t\t\t\t\t\t//// LET'S TRANSFORM THIS SENSITIVITY IN LATITUDE\n\t\t\t\t\t\t$lat_sensitivity = $sensitivity / 110.54;\n\t\t\t\t\t\t$lng_sensitivity = $sensitivity / (111.320*cos($lng_range[0]));\n\t\t\t\t\t\t///// LETS CHANGE OUR VARIABLES\n\t\t\t\t\t\t$lat_range[0] = $lat_range[0] - $lat_sensitivity;\n\t\t\t\t\t\t$lat_range[1] = $lat_range[1] + $lat_sensitivity;\n\t\t\t\t\t\t$lng_range[0] = $lng_range[0] - $lng_sensitivity;\n\t\t\t\t\t\t$lng_range[1] = $lng_range[1] + $lng_sensitivity;\n\t\t\t\t\t}\n\t\t\t\t}\n*/\n\t\t\t\t//// LETS DO OUR QUERY\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'latitude',\n\t\t\t\t\t'value' => $lat_range[0],\n\t\t\t\t\t'compare' => '>=',\n\t\t\t\t\t'type' => 'DECIMAL',\n\t\t\t\t);\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'latitude',\n\t\t\t\t\t'value' => $lat_range[1],\n\t\t\t\t\t'compare' => '<=',\n\t\t\t\t\t'type' => 'DECIMAL',\n\t\t\t\t);\n\t\t\t\t//// LETS DO OUR QUERY\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'longitude',\n\t\t\t\t\t'value' => $lng_range[0],\n\t\t\t\t\t'compare' => '>=',\n\t\t\t\t\t'type' => 'DECIMAL',\n\t\t\t\t);\n\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t'key' => 'longitude',\n\t\t\t\t\t'value' => $lng_range[1],\n\t\t\t\t\t'compare' => '<=',\n\t\t\t\t\t'type' => 'DECIMAL',\n\t\t\t\t);\n\t\t\t}\n// DAHERO #1667462 STOP\n\t\t\t\n\t\t\t//// GOES THROUGH EACH GET AND SEE IF IT\"S A FIELD\n\t\t\tforeach($fields as $field => $value) {\n\t\t\t\t\n\t\t\t\t///// IF ITS A SEARCH FIELD\n\t\t\t\tif($this_field = get_posts(array('name' => $field, 'post_type' => 'search_field', 'post_status' => 'publish', 'numberposts' => '1'))) {\n\t\t\t\t\t\n\t\t\t\t\t$this_field = array_pop($this_field);\n\t\t\t\t\t///// FIELD TYPE\n\t\t\t\t\t$field_type = get_post_meta($this_field->ID, 'field_type', true);\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A DROPDOWN\n\t\t\t\t\tif($field_type == 'dropdown') {\n\t\t\t\t\t\t//// IF WE ARE USING CATEGORIES\n\t\t\t\t\t\tif(get_post_meta($this_field->ID, 'dropdown_type', true) == 'categories') { \n\t\t\t\t\t\t\t/// FIRST LETS MAKE SURE THE TAXONOMY EXISTS\n\t\t\t\t\t\t\tif($this_tax = get_term_by('slug', $value, 'spot_cats')) {\n\t\t\t\t\t\t\t\t//// ADDS TO OUR QUERY\n\t\t\t\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t\t\t\t'taxonomy' => 'spot_cats',\n\t\t\t\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t\t\t\t'terms' => $value,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//// MAKES SURE THE VALUE EXISTS\n\t\t\t\t\t\t\tif(_sf_dropdown_value_exists($this_field->ID, $value)) {\n\t\t\t\t\t\t\t\t///// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t\t\t\t\t'key' => '_sf_field_'.$this_field->ID,\n\t\t\t\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t\t\t\t'compare' => 'LIKE',\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} //// ENDS IF DROPDOWN\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A DEPENDENT\n\t\t\t\t\tif($field_type == 'dependent') {\n\t\t\t\t\t\t$parent_id = get_post_meta($this_field->ID, 'dependent_parent', true);\n\t\t\t\t\t\t//// IF THE DEPENDENTS PARENT IS A CATEGORY\n\t\t\t\t\t\tif(get_post_meta($parent_id, 'dropdown_type', true) == 'categories') {\n\t\t\t\t\t\t\t/// FIRST LETS MAKE SURE THE TAXONOMY EXISTS\n\t\t\t\t\t\t\tif($this_tax = get_term_by('slug', $value, 'spot_cats')) {\n\t\t\t\t\t\t\t\t//// ADDS TO OUR QUERY\n\t\t\t\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t\t\t\t'taxonomy' => 'spot_cats',\n\t\t\t\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t\t\t\t'terms' => $value,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//// MAKES SURE THE VALUE EXISTS\n\t\t\t\t\t\t\tif(_sf_dependent_value_exists($this_field->ID, $value)) {\n\t\t\t\t\t\t\t\t///// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t\t\t\t\t'key' => '_sf_field_'.$this_field->ID,\n\t\t\t\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t\t\t\t'compare' => 'LIKE',\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} // ENDS IF DEPENDENT\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A RANGE\n\t\t\t\t\tif($field_type == 'range') {\n\t\t\t\t\t\t//// OUR MAXIMUM VALUE FIRST\n\t\t\t\t\t\tif(isset($fields[$field.'_max'])) {\n\t\t\t\t\t\t\t//// IF MAXIMUM FIELD IS SMALLER THAN OUR MAXIMUM\n\t\t\t\t\t\t\tif($fields[$field.'_max'] <= get_post_meta($this_field->ID, 'range_maximum', true)) {\n\t\t\t\t\t\t\t\t//// IF OUR MINIMUM IS GREATER THAN THE MAXIMUM\n\t\t\t\t\t\t\t\tif($fields[$field.'_min'] >= get_post_meta($this_field->ID, 'range_minimum', true)) {\n\t\t\t\t\t\t\t\t\t///// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t\t\t\t\t\t'key' => '_sf_field_'.$this_field->ID,\n\t\t\t\t\t\t\t\t\t\t'value' => array($fields[$field.'_min'], $fields[$field.'_max']),\n\t\t\t\t\t\t\t\t\t\t'compare' => 'BETWEEN',\n\t\t\t\t\t\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} // ENDS IF RANGE\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A MINIMUM VALUE\n\t\t\t\t\tif($field_type == 'min_val' && is_numeric($value)) {\n\t\t\t\t\t\t///// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t\t\t'key' => '_sf_field_'.$this_field->ID,\n\t\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t\t'compare' => '>=',\n\t\t\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t\t\t);\n\t\t\t\t\t} // ENDS IF MINIMUM VALUE\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A MAXIMUM VALUE\n\t\t\t\t\tif($field_type == 'max_val' && is_numeric($value)) {\n\t\t\t\t\t\t///// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t\t\t'key' => '_sf_field_'.$this_field->ID,\n\t\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t\t'compare' => '<=',\n\t\t\t\t\t\t\t'type' => 'NUMERIC',\n\t\t\t\t\t\t);\n\t\t\t\t\t} // ENDS IF MINIMUM VALUE\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A CHECK FIELD\n\t\t\t\t\tif($field_type == 'check' && $value == true) {\n\t\t\t\t\t\t///// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t$args['meta_query'][] = array(\n\t\t\t\t\t\t\t'key' => '_sf_field_'.$this_field->ID,\n\t\t\t\t\t\t\t'value' => 'on',\n\t\t\t\t\t\t\t'compare' => '==',\n\t\t\t\t\t\t);\n\t\t\t\t\t} // ENDS IF CHECKFIELD\n\t\t\t\t\t\n\t\t\t\t\t///// IF IT'S A KEYWORD\n\t\t\t\t\tif($field_type == 'text') {\n\t\t\t\t\t\t///// IF ITS A VALID TAG\n\t\t\t\t\t\tif($term = get_term_by('slug', $value, 'spot_tags')) {\n\t\t\t\t\t\t\t//// ADDS IT TO OUR QUERY\n\t\t\t\t\t\t\t$args['tax_query'][] = array(\n\t\t\t\t\t\t\t\t'terms' => $value,\n\t\t\t\t\t\t\t\t'field' => 'slug',\n\t\t\t\t\t\t\t\t'taxonomy' => 'spot_tags',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} // ENDS IF KEYWORD\n\n\t\t\t\t} /// ENDS IF A SEARCH FIELD\n\t\t\t} //// ENDS FOREACH\n\t\t} //// ENDS IF WE DONT HAVE A LIST OF POST IDS\n\t\t\t\n\t\tif(isset($post_ids)) { $args['post__in'] = $post_ids; }\n\t\t\n\t\t//echo '<pre>'; print_r($args); exit;\n\t\t\n\t\t//////////////////////////////////////////////////////\n\t\t//// IF WE ARE ORDERING BY DISTANCE\n\t\t//////////////////////////////////////////////////////\n\t\t\n\t\tif(_sf_get_list_sort() == 'closest') {\n\t\t\t\n\t\t\t/// IF THE ADMIN AHS ENABLED IT\n\t\t\tif(ddp('map_geolocation_sort')) {\n\t\t\t\t\n\t\t\t\t///// IF WE CAN GET OUR LATITUDE AND LONGITUDE COOKIE\n\t\t\t\tif(isset($_COOKIE['user_latitude']) && isset($_COOKIE['user_longitude'])) {\n\t\t\t\t\t\n\t\t\t\t\t$latitude = $_COOKIE['user_latitude'];\n\t\t\t\t\t$longitude = $_COOKIE['user_longitude'];\n\t\t\t\t\n\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\n\t\t\t\t\t//// IF WE HAVE A LIST OF POST IDS\n\t\t\t\t\tif(!isset($post_ids)) { $post_ids = array(); }\n\t\t\t\t\tif(!is_array($post_ids)) { $post_ids = array(); }\n\t\t\t\t\t\n\t\t\t\t\t//// MAEKS SURE WE DONT HAVE ANY INVALID POST IDS IN THERE\n\t\t\t\t\t$i = 0; foreach($post_ids as $single_id) { if(!is_numeric($single_id) || $single_id == '') { unset($post_ids[$i]); $i++; } }\n\t\t\t\t\t\n\t\t\t\t\t//// LET'S DO A CUSTOM QUERY TO RETURN ALL POSSIBLE ITEMS BY DISTANCE\n\t\t\t\t\t$distance_query_string = \"\n\t\t\t\t\t\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t{$wpdb->prefix}posts.ID,\n\t\t\t\t\t\t\tlatitude.meta_value as latitude,\n\t\t\t\t\t\t\tlongitude.meta_value as longitude,\n\t\t\t\t\t\t\t6371 * acos( cos( radians({$latitude}) ) * cos( radians( latitude.meta_value ) ) * cos( radians ( longitude.meta_value ) - radians({$longitude}) ) + sin( radians({$latitude}) ) * sin( radians ( latitude.meta_value ) ) ) as 'distance'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t{$wpdb->prefix}postmeta as latitude,\n\t\t\t\t\t\t\t{$wpdb->prefix}postmeta as longitude,\n\t\t\t\t\t\t\t{$wpdb->prefix}posts\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tWHERE \";\n\t\t\t\t\t\t\n\t\t\t\t\t//// IF WE HAVE A LIST OF POST IDS\n\t\t\t\t\tif(sizeof($post_ids) > 0) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$distance_query_string .= \"\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t1=1 AND {$wpdb->prefix}posts.ID IN\n\t\t\t\t\t\t\t(\".implode(',', $post_ids).\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\t\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t$distance_query_string .= \"(\n\t\t\t\t\t\t\t{$wpdb->prefix}posts.ID = latitude.post_id\n\t\t\t\t\t\t\tAND latitude.meta_key = 'latitude'\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tAND (\n\t\t\t\t\t\t\t{$wpdb->prefix}posts.ID = longitude.post_id\n\t\t\t\t\t\t\tAND longitude.meta_key = 'longitude'\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tAND {$wpdb->prefix}posts.post_status = 'publish'\n\t\t\t\t\t\tAND {$wpdb->prefix}posts.post_type = 'spot'\n\t\t\t\t\t\t\n\t\t\t\t\t\tORDER BY distance\n\t\t\t\t\t\n\t\t\t\t\t\";\n\t\t\t\t\t\n\t\t\t\t\t$results = $wpdb->get_results($distance_query_string);\n\t\t\t\t\t\n\t\t\t\t\t$post__in_arr = array();\n\t\t\t\t\t\n\t\t\t\t\tforeach($results as $single_result) { array_push($post__in_arr, $single_result->ID); }\n\t\t\t\t\t\n\t\t\t\t\t$args['post__in'] = $post__in_arr;\n\t\t\t\t\t$args['orderby'] = 'post__in';\n\t\t\t\t\t\n\t\t\t\t\t//// LET'S ADD SOME OF OUR METAQUERIES IN THERE JUST SO WE HAVE LESS STUFF TO GO THROUGH\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t///// IF WE ARE SORTING BY RATING\n\t\tif(_sf_get_list_sort() == 'ratingdesc' || _sf_get_list_sort() == 'ratingasc') {\n\t\t\t\n\t\t\t//// IF WE ARE ABLE TO\n\t\t\tif(ddp('rating') == 'on' && ddp('rating_sortby') == 'on') {\n\t\t\t\t\n\t\t\t\t//// IF WE ARE SORTING DESC\n\t\t\t\tif(_sf_get_list_sort() == 'ratingdesc') {\n\t\t\t\t\t\n\t\t\t\t\t$args['orderby'] = 'meta_value_num';\n\t\t\t\t\t$args['meta_key'] = 'rating';\n\t\t\t\t\t$args['order'] = 'DESC';\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//// IF WE ARE SORTING DESC\n\t\t\t\tif(_sf_get_list_sort() == 'ratingasc') {\n\t\t\t\t\t\n\t\t\t\t\t$args['orderby'] = 'meta_value_num';\n\t\t\t\t\t$args['meta_key'] = 'rating';\n\t\t\t\t\t$args['order'] = 'ASC';\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//// RETRUN ARGUMENTS\n\t\treturn $args;\n\t\t\n\t}", "private function filters() {\n\n\n\t}", "public function onFilter()\n {\n // $this->currentPageNumber = 1;\n return $this->onRefresh();\n }", "public function onFilter()\n {\n $this->currentPageNumber = 1;\n return $this->onRefresh();\n }", "public function set_listing( $listing ) {\r\n\t\t$this->listing = $listing;\r\n\t}", "public function __construct($listing){\n\t\t//\n\t\t$this->listing = $listing;\n\t}", "public function filtering();", "public function __construct(Listing $listing)\n {\n $this->listing = $listing;\n }", "public function applyFilter($value)\n\t{\n\t\treturn;\n\t}", "public function applyFilterSearch() {\n\t\t$this->table->writeFilterToSession();\n\t\t$this->table->resetOffset();\n\t\t$this->search();\n\t}" ]
[ "0.5979383", "0.5771317", "0.57443184", "0.57345635", "0.55280644", "0.55153775", "0.54941267", "0.5309077", "0.5269654", "0.52590233", "0.5241889", "0.5092571", "0.5045326", "0.50415593", "0.5018646", "0.4993416", "0.49844474", "0.4983254", "0.49534687", "0.49480397", "0.49445683", "0.49394438", "0.49150962", "0.49141398", "0.49106303", "0.49092636", "0.49046454", "0.4903326", "0.48919958", "0.4884367" ]
0.7384152
0
Adds an error to the Crowdfox error log.
protected function addToErrorLog($error) { $add = $error['DETAILS']; unset($add['ErrorCode']); unset($add['ErrorMessage']); $add['Action'] = $error['APIACTION']; MagnaDB::gi()->insert(TABLE_MAGNA_COMPAT_ERRORLOG, array( 'mpID' => $this->mpID, 'errormessage' => $error['ERRORMESSAGE'], 'dateadded' => date('Y-m-d H:i:s'), 'additionaldata' => serialize($add), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addError($error){\n $this->_errors[] = $error;\n }", "protected function add_error($error){\n\t\t$this->errors[] = $error;\n\t}", "public function add_error($error)\n {\n\n $this->erorr = true;\n $this->errors[] = $error;\n\n $this->set_errors();\n\n }", "private function addError($error){\n $this->_errors[] = $error; \n }", "public function logError() {}", "function add_error(&$log, $message){\n if(!is_array($log)) return;\n\n $log[] = array(\n \"type\" => \"error\",\n \"message\" => $message\n );\n}", "private function addError($error) {\n $this->_errors[] = $error;\n }", "protected function log_error($message)\n {\n $this->log['error'][] = $message;\n }", "function add($error) {\n\t\t$this->errors[] = $error;\n\t}", "function add_error($msg) {\n\t\t$this->errors[] = $msg;\n\t}", "protected function errorAdd($error){\r\n //array_merge($this->errors,array('error'=>$error));\r\n $this->_errors['error']=$error;\r\n $this->_errorcnt++;\r\n }", "public function add($error)\n\t{\n\t\t$this->error[] = $error;\n\t}", "public function addError($field, $error) {\n $this->errors[$field] = $error;\n }", "public function addError($value)\n {\n $error = new Error($value);\n array_push($this->errors, $error);\n }", "public function AddError($err){\n\t\t$this->Add($err);\n\t}", "public function addApiError($error)\n {\n $this->errors['api'] = $error;\n }", "public function error($error) {\n // que vai fazer alguma coisa (mandar um email,\n // gravar log, etc )\n $this->log($error);\n }", "public function error (string $error) : void {\n\t\t$this->errors [] = $error;\n\t}", "public function AddError($err){\n\t\t$this->Add($err->getMessage());\n\t}", "private function addError(string $file, int $line, string $error): void\n {\n $this->errors[] = \"error in file '\".$file.\":\".$line.\"' \".$error;\n }", "function pushError( $error );", "public function addError($field, $error)\n {\n $this->errors[$field][] = $error;\n }", "public function addError($key, $value)\n {\n //@TODO add error flash messaging\n $this->set('errors', [$key => $value]);\n }", "public function error($string)\n {\n $this->celcatWebAPI->logs[] = ['string' => $string, 'type' => 'error'];\n }", "public function addError($msg)\n\t{\n\t\t// Add to error array\n\t\t$this->errors[] = $msg;\n\t}", "function error($error, $file, $line) {\n\t$this->ERRORS[] = $error;\n\tif ($this->REPORTS['print_errors'] == URL_DO_PRINT_ERRORS) {\n\t\tprintf(\"<b>%s Error:</b> %s in <b>%s:%d</b><br>\",\n\t\t\tstrToUpper(get_class($this)),\n\t\t\thtmlSpecialChars($error),\n\t\t\t$file,\n\t\t\t$line);\n\t\t}\n\t}", "public function error()\n {\n $this->appendLog(\n 'error',\n \\func_get_args(),\n $this->internal->getErrorCaller()\n );\n }", "public function addError($message)\n {\n $this->_errors[] = $message;\n }", "public function addError(array $error)\n {\n $this->errors[] = $error;\n }", "private function _logError()\n {\n if(!$this->_error) return;\n\n $error_file = APPLICATION_DATA . '/logs/log_apps.log';\n // set content of error file\n $content = 'Date: ' . date('Y-m-d H:i:s') . PHP_EOL;\n $content .= 'Message: ' . $this->_error->exception->getMessage() . PHP_EOL;\n $content .= 'File: ' . $this->_error->exception->getFile() . PHP_EOL;\n $content .= 'Line: ' . $this->_error->exception->getLine() . PHP_EOL;\n $content .= 'Request Uri: ' . $this->_error->request->getRequestUri() . PHP_EOL;\n $content .= 'Request Method: ' . $this->_error->request->getMethod() . PHP_EOL;\n $content .= 'Request Params: ' . json_encode($this->_error->request->getParams()) . PHP_EOL;\n $content .= 'Id User: ' . Base_Auth::getUser('id_user') . PHP_EOL;\n $content .= '-----------------------------------' . PHP_EOL;\n\n // write content to file\n if(file_exists($error_file)){\n $content.= file_get_contents($error_file, false, null, null, 1024*1024); // last 1Mb of log;\n }\n\n $handle = fopen( $error_file, 'w' );\n fwrite($handle, $content);\n fclose($handle);\n }" ]
[ "0.6957766", "0.6884796", "0.68320507", "0.6805602", "0.67948514", "0.6791798", "0.67000777", "0.6686646", "0.66764367", "0.6674423", "0.6658749", "0.66341823", "0.6633284", "0.65961623", "0.6502241", "0.64977914", "0.64953595", "0.64688045", "0.64618176", "0.64349157", "0.6405166", "0.63802385", "0.63598955", "0.6358978", "0.63378453", "0.63193995", "0.6292216", "0.6286794", "0.62055045", "0.6184833" ]
0.7044375
0
Creates an array for a PHP Extension URL. Replaces %compiler% and %phpversion% placeholder strings in that URL: array ( 'x86' => array( '5.4.0' => url, '5.5.0' => url, '5.6.0' => url ), 'x64' => array( '5.4.0' => url, '5.5.0' => url, '5.6.0' => url ), )
public function createPhpVersionsArrayForExtension($version, $url, $skipURLcheck = false) { $url = str_replace("%version%", $version, $url); $bitsizes = array('x86', 'x64'); $phpversions = array('5.4.0', '5.5.0', '5.6.0'); $urls = array(); foreach ($bitsizes as $bitsize) { foreach ($phpversions as $phpversion) { $compiler = ($phpversion === '5.4.0') ? 'VC9' : 'vc11'; $replacedUrl = str_replace( array('%compiler%', '%phpversion%', '%bitsize%'), array($compiler, $phpversion, $bitsize), $url ); #if ($skipURLcheck === true) { $urls[$bitsize][$phpversion] = $replacedUrl; #} elseif($this->fileExistsOnServer($replacedUrl) === true) { # $urls[$bitsize][$phpversion] = $replacedUrl; #} } } return $urls; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sa_phpInfoLite() // Returns loaded PHP extensions and versions\n{\n $values = array(\n 'php' => phpversion(),\n 'os' => php_uname(),\n 'extensions' => get_loaded_extensions(),\n );\n\n // assign extension version if available\n if ($values['extensions']) {\n foreach ($values['extensions'] as $lkey => $extension) {\n $values['extensions'][$lkey] = phpversion($extension) ? $extension. \n ' ('. phpversion($extension). ')' : $extension;\n }\n }\n\n return $values;\n}", "static public function grabPhpInfos() {\n $php = [\n 'version' => str_replace(PHP_EXTRA_VERSION, '', PHP_VERSION),\n 'modules' => get_loaded_extensions(),\n 'setup' => [\n 'max_execution_time' => ini_get('max_execution_time'),\n 'memory_limit' => ini_get('memory_limit'),\n 'post_max_size' => ini_get('post_max_size'),\n 'safe_mode' => ini_get('safe_mode'),\n 'session' => ini_get('session.save_handler'),\n 'upload_max_filesize' => ini_get('upload_max_filesize')\n ]\n ];\n\n return $php;\n }", "public function getExtensions($extension = null, $version = null, $condition = null)\n {\n $phpMin = '5.1.2';\n $extensions = array(\n self::REF_NAME => array($phpMin, '', self::REF_VERSION)\n );\n return $extensions;\n }", "function getInstalledExtensions()\r\n\t{\r\n\t\tglobal $sourcedir, $smcFunc, $modSettings;\r\n\t\r\n\t\t$extensions = array();\r\n\t\tif ($dh = opendir($sourcedir . '/ProjectTools/'))\r\n\t\t{\r\n\t\t\twhile (($file = readdir($dh)) !== false)\r\n\t\t\t{\r\n\t\t\t\tif ($file[0] == '.')\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\tif (is_dir($sourcedir . '/ProjectTools/' . $file . '/') && file_exists($sourcedir . '/ProjectTools/' . $file . '/Extension.php'))\r\n\t\t\t\t{\r\n\t\t\t\t\t$extension = self::loadExtension($file, false);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$extInfo = $extension->getExtensionInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$extensions[$file] = array(\r\n\t\t\t\t\t\t'id' => $file,\r\n\t\t\t\t\t\t'name' => $extInfo['title'],\r\n\t\t\t\t\t\t'version' => $extInfo['version'],\r\n\t\t\t\t\t\t'api_version' => $extInfo['api_version'],\r\n\t\t\t\t\t\t'filename' => $file,\r\n\t\t\t\t\t\t'enabled' => in_array($file, $modSettings['projectExtensions']),\r\n\t\t\t\t\t\t'can_enable' => $extInfo['api_version'] === 2,\r\n\t\t\t\t\t\t'can_disable' => true, // Todo: check if it's in use\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tclosedir($dh);\r\n\t\t\r\n\t\treturn $extensions;\r\n\t}", "public static function phpInfoAsArray()\n {\n $values = array(\n 'php' => phpversion(),\n 'os' => php_uname(),\n 'extensions' => get_loaded_extensions(),\n );\n\n natcasesort($values['extensions']);\n\n // assign extension version\n if ($values['extensions']) {\n foreach($values['extensions'] as $key => $extension) {\n $values['extensions'][$key] = phpversion($extension) ? sprintf('%s (%s)', $extension, phpversion($extension)) : $extension;\n }\n }\n\n return $values;\n }", "public function getExtensions($extension = null, $version = null, $condition = null)\n {\n $phpMin = version_compare($version, '5.0.0', 'lt') ? '4.0.0' : '5.0.0';\n\n $extensions = array(\n self::REF_NAME => array($phpMin, '', self::REF_VERSION)\n );\n\n return $extensions;\n }", "public function getExtensions($extension = null, $version = null, $condition = null)\n {\n $phpMin = '4.0.0';\n $extensions = array(\n self::REF_NAME => array($phpMin, '', self::REF_VERSION)\n );\n return $extensions;\n }", "public function getExtensions($extension = null, $version = null, $condition = null)\n {\n $phpMin = '4.0.0';\n $extensions = array(\n self::REF_NAME => array($phpMin, '', self::REF_VERSION)\n );\n return $extensions;\n }", "public function supportedPhpLinkPathProvider()\n {\n return [\n [\n '/test/path/php/7.3.0/test', // linked path\n [ // matches\n 'path/php/7.3.0/test',\n 'php',\n '',\n '7.3',\n '.0',\n ],\n 'php', // expected link formula\n ],\n [\n '/test/path/[email protected]/7.2.13/test',\n [\n 'path/[email protected]/7.2.13/test',\n 'php',\n '@7.2',\n '7.2',\n '.13',\n ],\n '[email protected]'\n ],\n [\n '/test/path/php/7.2.9_2/test',\n [\n 'path/php/7.2.9_2/test',\n 'php',\n '',\n '7.2',\n '.9_2',\n ],\n 'php',\n ],\n [\n '/test/path/php72/7.2.9_2/test',\n [\n 'path/php72/7.2.9_2/test',\n 'php',\n '72',\n '7.2',\n '.9_2',\n ],\n 'php72',\n ],\n [\n '/test/path/php56/test',\n [\n 'path/php56/test',\n 'php',\n '56',\n '',\n '',\n ],\n 'php56',\n ],\n ];\n }", "public function getPhpExtensionsConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPextensions');\n\t}", "public static function getCompilerVersions()\n\t{\n\t\treturn [];\n\t}", "protected function initializeCompatibilityLoadedExtArray() {}", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }", "public function getConstants($extension = null, $version = null, $condition = null)\n {\n $this->setFilter(func_get_args());\n\n $constants = array();\n\n $release = '4.0.0'; // 2000-05-22\n $items = array(\n 'DEFAULT_INCLUDE_PATH' => array('4.0.0', ''),\n 'E_ALL' => array('4.0.0', ''),\n 'E_COMPILE_ERROR' => array('4.0.0', ''),\n 'E_COMPILE_WARNING' => array('4.0.0', ''),\n 'E_CORE_ERROR' => array('4.0.0', ''),\n 'E_CORE_WARNING' => array('4.0.0', ''),\n 'E_ERROR' => array('4.0.0', ''),\n 'E_NOTICE' => array('4.0.0', ''),\n 'E_PARSE' => array('4.0.0', ''),\n 'E_USER_ERROR' => array('4.0.0', ''),\n 'E_USER_NOTICE' => array('4.0.0', ''),\n 'E_USER_WARNING' => array('4.0.0', ''),\n 'E_WARNING' => array('4.0.0', ''),\n 'FALSE' => array('4.0.0', ''),\n 'NULL' => array('4.0.0', ''),\n 'PEAR_EXTENSION_DIR' => array('4.0.0', ''),\n 'PEAR_INSTALL_DIR' => array('4.0.0', ''),\n 'PHP_BINDIR' => array('4.0.0', ''),\n 'PHP_CONFIG_FILE_PATH' => array('4.0.0', ''),\n 'PHP_CONFIG_FILE_SCAN_DIR' => array('4.0.0', ''),\n 'PHP_DATADIR' => array('4.0.0', ''),\n 'PHP_EXTENSION_DIR' => array('4.0.0', ''),\n 'PHP_LIBDIR' => array('4.0.0', ''),\n 'PHP_LOCALSTATEDIR' => array('4.0.0', ''),\n 'PHP_OS' => array('4.0.0', ''),\n 'PHP_OUTPUT_HANDLER_CONT' => array('4.0.0', ''),\n 'PHP_OUTPUT_HANDLER_END' => array('4.0.0', ''),\n 'PHP_OUTPUT_HANDLER_START' => array('4.0.0', ''),\n 'PHP_SYSCONFDIR' => array('4.0.0', ''),\n 'PHP_VERSION' => array('4.0.0', ''),\n 'TRUE' => array('4.0.0', ''),\n 'ZEND_THREAD_SAFE' => array('4.0.0', ''),\n '__FILE__' => array('4.0.0', ''),\n '__LINE__' => array('4.0.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '4.2.0'; // 2002-04-22\n $items = array(\n 'PHP_SAPI' => array('4.2.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '4.3.0'; // 2002-12-27\n $items = array(\n 'PHP_PREFIX' => array('4.3.0', ''),\n 'PHP_SHLIB_SUFFIX' => array('4.3.0', ''),\n 'STDERR' => array('4.3.0', ''),\n 'STDIN' => array('4.3.0', ''),\n 'STDOUT' => array('4.3.0', ''),\n 'UPLOAD_ERR_FORM_SIZE' => array('4.3.0', ''),\n 'UPLOAD_ERR_INI_SIZE' => array('4.3.0', ''),\n 'UPLOAD_ERR_NO_FILE' => array('4.3.0', ''),\n 'UPLOAD_ERR_OK' => array('4.3.0', ''),\n 'UPLOAD_ERR_PARTIAL' => array('4.3.0', ''),\n '__CLASS__' => array('4.3.0', ''),\n '__FUNCTION__' => array('4.3.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '4.3.10'; // 2004-12-14\n $items = array(\n 'PHP_EOL' => array('4.3.10', ''),\n 'UPLOAD_ERR_NO_TMP_DIR' => array('4.3.10', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '4.4.0'; // 2005-07-11\n $items = array(\n 'PHP_INT_MAX' => array('4.4.0', ''),\n 'PHP_INT_SIZE' => array('4.4.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.0.0'; // 2004-07-13\n $items = array(\n 'E_STRICT' => array('5.0.0', ''),\n '__METHOD__' => array('5.0.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.1.0'; // 2005-11-24\n $items = array(\n 'UPLOAD_ERR_CANT_WRITE' => array('5.1.0', ''),\n '__COMPILER_HALT_OFFSET__' => array('5.1.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.2.0'; // 2006-11-02\n $items = array(\n 'E_RECOVERABLE_ERROR' => array('5.2.0', ''),\n 'UPLOAD_ERR_EXTENSION' => array('5.2.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.2.7'; // 2008-12-04\n $items = array(\n 'PHP_DEBUG' => array('5.2.7', ''),\n 'PHP_EXTRA_VERSION' => array('5.2.7', ''),\n 'PHP_MAJOR_VERSION' => array('5.2.7', ''),\n 'PHP_MANDIR' => array('5.3.7', ''),\n 'PHP_MINOR_VERSION' => array('5.2.7', ''),\n 'PHP_RELEASE_VERSION' => array('5.2.7', ''),\n 'PHP_VERSION_ID' => array('5.2.7', ''),\n 'PHP_ZTS' => array('5.2.7', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.3.0'; // 2009-06-30\n $items = array(\n 'E_DEPRECATED' => array('5.3.0', ''),\n 'E_USER_DEPRECATED' => array('5.3.0', ''),\n 'PHP_MAXPATHLEN' => array('5.3.0', ''),\n 'PHP_WINDOWS_NT_DOMAIN_CONTROLLER' => array('5.3.0', ''),\n 'PHP_WINDOWS_NT_SERVER' => array('5.3.0', ''),\n 'PHP_WINDOWS_NT_WORKSTATION' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_BUILD' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_MAJOR' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_MINOR' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_PLATFORM' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_PRODUCTTYPE' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_SP_MAJOR' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_SP_MINOR' => array('5.3.0', ''),\n 'PHP_WINDOWS_VERSION_SUITEMASK' => array('5.3.0', ''),\n 'ZEND_DEBUG_BUILD' => array('5.3.0', ''),\n '__DIR__' => array('5.3.0', ''),\n '__NAMESPACE__' => array('5.3.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.3.4'; // 2010-12-09\n $items = array(\n 'ZEND_MULTIBYTE' => array('5.3.4', '5.3.19'),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.3.6'; // 2011-03-17\n $items = array(\n 'DEBUG_BACKTRACE_IGNORE_ARGS' => array('5.3.6', ''),\n 'DEBUG_BACKTRACE_PROVIDE_OBJECT' => array('5.3.6', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n $release = '5.4.0'; // 2012-03-01\n $items = array(\n 'PHP_BINARY' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_CLEAN' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_CLEANABLE' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_DISABLED' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_FINAL' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_FLUSH' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_FLUSHABLE' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_REMOVABLE' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_STARTED' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_STDFLAGS' => array('5.4.0', ''),\n 'PHP_OUTPUT_HANDLER_WRITE' => array('5.4.0', ''),\n '__TRAIT__' => array('5.4.0', ''),\n );\n $this->applyFilter($release, $items, $constants);\n\n return $constants;\n }", "public function provideFileAndExtension()\n {\n return [\n [__FILE__, 'php'],\n ['.htaccess', 'htaccess'],\n ['name', ''],\n ['a.combined.filename.with.multiple.ext.separator', 'separator']\n ];\n }", "private function getExtFlags(): array\n\t{\n\t\treturn config('curl-connection.' . $this->service . '.ext_flags');\n\t}", "public function extensions(): array;", "public function getExtensions($extension = null, $version = null)\n {\n $extensions = array(\n 'apc' => array('4.0.0', '', '3.1.7')\n );\n return $extensions;\n }", "public function get_test_php_extensions()\n {\n }", "private function getExtensions($zend = false)\n {\n $data = array();\n $extensions = get_loaded_extensions($zend);\n foreach ($extensions as $extension) {\n $data[$extension] = phpversion($extension);\n }\n\n return $data;\n }", "function getExtension() ;", "function ispapissl_addon_config(): array\n{\n return [\n \"name\" => \"ISPAPI SSL\",\n \"description\" => \"Quickly add and configure SSL Certificates\",\n \"author\" => '<a href=\"https://www.hexonet.net/\" target=\"_blank\"><img style=\"max-width:100px\" src=\"' . SSLHelper::getLogo() . '\" alt=\"HEXONET\" /></a>',\n \"language\" => \"english\",\n \"version\" => \"9.2.1\"\n ];\n}", "private static function getPhpVersionInfo()\n {\n $currentVersionFull = PHP_VERSION;\n preg_match(\"#^\\d+(\\.\\d+)*#\", $currentVersionFull, $filtered);\n $currentVersion = $filtered[0];\n\n return [\n 'full' => $currentVersionFull,\n 'version' => $currentVersion\n ];\n }", "abstract public function getExtensionVersion();", "public function gatherExtensionVersions()\n {\n $extensions = array(\n 'Iparcel_All' => 0,\n 'Iparcel_CartHandoff' => 0,\n 'Iparcel_GlobaleCommerce' => 0,\n 'Iparcel_Logistics' => 0\n );\n\n $allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();\n\n foreach ($extensions as $key => &$version) {\n if (array_key_exists($key, $allExtensions)) {\n $version = $allExtensions[$key]['version'];\n } else {\n unset($extensions[$key]);\n }\n }\n\n return $extensions;\n }", "private function buildExtension(array $meta, array $definition, string $refPathname): array\n {\n $data = $meta;\n $components = ['releases', 'iniEntries', 'constants', 'functions', 'classes', 'interfaces', 'const', 'methods'];\n foreach ($components as $component) {\n if (isset($definition[$component])) {\n $data[$component] = $this->readData($refPathname, $definition[$component], $component, $meta['type']);\n } else {\n $data[$component] = [];\n }\n }\n return $data;\n }", "protected function extensions() \n {\n return ['php'];\n }", "public function getConstants($extension = null, $version = null)\n {\n $constants = array();\n\n if ((null == $version ) || ('4' == $version)) {\n $version4 = array(\n );\n $constants = array_merge(\n $constants,\n $version4\n );\n }\n if ((null == $version ) || ('5' == $version)) {\n $version5 = array(\n 'INPUT_POST' => array('5.2.0', ''),\n 'INPUT_GET' => array('5.2.0', ''),\n 'INPUT_COOKIE' => array('5.2.0', ''),\n 'INPUT_ENV' => array('5.2.0', ''),\n 'INPUT_SERVER' => array('5.2.0', ''),\n 'INPUT_SESSION' => array('5.2.0', ''),\n 'INPUT_REQUEST' => array('5.2.0', ''),\n 'FILTER_FLAG_NONE' => array('5.2.0', ''),\n 'FILTER_REQUIRE_SCALAR' => array('5.2.0', ''),\n 'FILTER_REQUIRE_ARRAY' => array('5.2.0', ''),\n 'FILTER_FORCE_ARRAY' => array('5.2.0', ''),\n 'FILTER_NULL_ON_FAILURE' => array('5.2.0', ''),\n 'FILTER_VALIDATE_INT' => array('5.2.0', ''),\n 'FILTER_VALIDATE_BOOLEAN' => array('5.2.0', ''),\n 'FILTER_VALIDATE_FLOAT' => array('5.2.0', ''),\n 'FILTER_VALIDATE_REGEXP' => array('5.2.0', ''),\n 'FILTER_VALIDATE_URL' => array('5.2.0', ''),\n 'FILTER_VALIDATE_EMAIL' => array('5.2.0', ''),\n 'FILTER_VALIDATE_IP' => array('5.2.0', ''),\n 'FILTER_DEFAULT' => array('5.2.0', ''),\n 'FILTER_UNSAFE_RAW' => array('5.2.0', ''),\n 'FILTER_SANITIZE_STRING' => array('5.2.0', ''),\n 'FILTER_SANITIZE_STRIPPED' => array('5.2.0', ''),\n 'FILTER_SANITIZE_ENCODED' => array('5.2.0', ''),\n 'FILTER_SANITIZE_SPECIAL_CHARS' => array('5.2.0', ''),\n 'FILTER_SANITIZE_EMAIL' => array('5.2.0', ''),\n 'FILTER_SANITIZE_URL' => array('5.2.0', ''),\n 'FILTER_SANITIZE_NUMBER_INT' => array('5.2.0', ''),\n 'FILTER_SANITIZE_NUMBER_FLOAT' => array('5.2.0', ''),\n 'FILTER_SANITIZE_MAGIC_QUOTES' => array('5.2.0', ''),\n 'FILTER_CALLBACK' => array('5.2.0', ''),\n 'FILTER_FLAG_ALLOW_OCTAL' => array('5.2.0', ''),\n 'FILTER_FLAG_ALLOW_HEX' => array('5.2.0', ''),\n 'FILTER_FLAG_STRIP_LOW' => array('5.2.0', ''),\n 'FILTER_FLAG_STRIP_HIGH' => array('5.2.0', ''),\n 'FILTER_FLAG_STRIP_BACKTICK' => array('5.3.2', ''),\n 'FILTER_FLAG_ENCODE_LOW' => array('5.2.0', ''),\n 'FILTER_FLAG_ENCODE_HIGH' => array('5.2.0', ''),\n 'FILTER_FLAG_ENCODE_AMP' => array('5.2.0', ''),\n 'FILTER_FLAG_NO_ENCODE_QUOTES' => array('5.2.0', ''),\n 'FILTER_FLAG_EMPTY_STRING_NULL' => array('5.2.0', ''),\n 'FILTER_FLAG_ALLOW_FRACTION' => array('5.2.0', ''),\n 'FILTER_FLAG_ALLOW_THOUSAND' => array('5.2.0', ''),\n 'FILTER_FLAG_ALLOW_SCIENTIFIC' => array('5.2.0', ''),\n 'FILTER_FLAG_SCHEME_REQUIRED' => array('5.2.0', ''),\n 'FILTER_FLAG_HOST_REQUIRED' => array('5.2.0', ''),\n 'FILTER_FLAG_PATH_REQUIRED' => array('5.2.0', ''),\n 'FILTER_FLAG_QUERY_REQUIRED' => array('5.2.0', ''),\n 'FILTER_FLAG_IPV4' => array('5.2.0', ''),\n 'FILTER_FLAG_IPV6' => array('5.2.0', ''),\n 'FILTER_FLAG_NO_RES_RANGE' => array('5.2.0', ''),\n 'FILTER_FLAG_NO_PRIV_RANGE' => array('5.2.0', ''),\n 'FILTER_SANITIZE_FULL_SPECIAL_CHARS'\n => array('5.3.3', ''),\n );\n $constants = array_merge(\n $constants,\n $version5\n );\n }\n\n return $constants;\n }", "function getInfo()\n {\n return array(\n 'releasetypes' => array('php', 'extsrc', 'extbin', 'bundle'),\n 'installable' => true,\n 'locationconfig' => false,\n 'honorsbaseinstall' => true,\n 'unusualbaseinstall' => false,\n 'phpfile' => false,\n 'executable' => false,\n 'phpextension' => false,\n );\n }" ]
[ "0.6123766", "0.56523794", "0.56503075", "0.5628713", "0.56201184", "0.55051166", "0.5504988", "0.5504988", "0.5500268", "0.5486984", "0.539605", "0.5269689", "0.52493113", "0.52493113", "0.5242244", "0.5168981", "0.510137", "0.50708765", "0.5032049", "0.5016292", "0.50048625", "0.5003051", "0.49777573", "0.4966854", "0.49619338", "0.49616992", "0.4959948", "0.49431413", "0.4913967", "0.4907634" ]
0.63974136
0
Get data of a TaskAssignee from a record
public function getTaskAssigneeDataFromRecord (array $record, $taskUserType) { try { switch ($taskUserType) { case 1: return array( "aas_uid" => $record[0], "aas_name" => $record[1], "aas_lastname" => $record[2], "aas_username" => $record[3], "aas_type" => $record[4] ); break; case 2: return array( "ada_uid" => $record[0], "ada_name" => $record[1], "ada_lastname" => $record[2], "ada_username" => $record[3], "ada_type" => $record[4] ); break; } } catch (\Exception $e) { throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAssigneeName();", "public function getAssignee()\n {\n return $this->assignee;\n }", "public function getAssigneeEmail();", "function todos_get_assignee_filter_callback($row) {\n\t$result = new stdClass();\n\t$result->name = $row->name;\n\t$result->guid = (int) $row->guid;\n\t\n\treturn $result;\n}", "function getAssignedTo() {\n\t\treturn $this->data_array['assigned_to'];\n\t}", "public function getNextAssignee() {\n\t\t$admin = &Yii::app()->params->admin;\n\t\t$type = $admin->serviceDistribution;\n\t\tif ($type == \"\") {\n\t\t\treturn \"Anyone\";\n\t\t} elseif ($type == \"evenDistro\") {\n\t\t\treturn $this->evenDistro();\n\t\t} elseif ($type == \"trueRoundRobin\") {\n\t\t\treturn $this->roundRobin();\n\t\t} elseif($type=='singleUser') {\n $user=User::model()->findByPk($admin->srrId);\n if(isset($user)){\n return $user->username;\n }else{\n return \"Anyone\";\n }\n } elseif($type=='singleGroup') {\n $group=Groups::model()->findByPk($admin->sgrrId);\n if(isset($group)){\n return $group->id;\n }else{\n return \"Anyone\";\n }\n }\n\t}", "public function setAssignee($var)\n {\n GPBUtil::checkString($var, True);\n $this->assignee = $var;\n\n return $this;\n }", "public function getTask() {\r\n $query = \"SELECT DISTINCT taskID, content, deadline, status, IF(assignee IS NULL, NULL, user.username)\r\n FROM task, user\r\n WHERE projectID = :projectID\r\n AND (assignee IS NULL OR user.userID = assignee)\r\n ORDER BY deadline;\";\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam(':projectID', $this->projectID);\r\n\r\n if($stmt->execute()) {\r\n return $stmt;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public function getTaskAssignees ($processUid, $taskUid, $option, $taskUserType, $arrayFilterData = null, $start = null, $limit = null, $type = null)\n {\n try {\n $arrayAssignee = array();\n $numRecTotal = 0;\n $startbk = $start;\n $limitbk = $limit;\n //Verify data\n //Set variables\n $filterName = \"filter\";\n if ( !is_null ($arrayFilterData) && is_array ($arrayFilterData) && isset ($arrayFilterData[\"filter\"]) )\n {\n $filterName = isset ($arrayFilterData[\"filterOption\"]) ? $arrayFilterData[\"filterOption\"] : \"\";\n }\n //Get data\n if ( !is_null ($limit) && $limit . \"\" == \"0\" )\n {\n //Return\n return array(\n \"total\" => $numRecTotal,\n \"start\" => (int) ((!is_null ($startbk)) ? $startbk : 0),\n \"limit\" => (int) ((!is_null ($limitbk)) ? $limitbk : 0),\n $filterName => (!is_null ($arrayFilterData) && is_array ($arrayFilterData) && isset ($arrayFilterData[\"filter\"])) ? $arrayFilterData[\"filter\"] : \"\",\n \"data\" => $arrayAssignee\n );\n }\n //Verify data\n (new Process())->throwExceptionIfNotExistsProcess ($processUid);\n $this->throwExceptionIfNotExistsTask ($processUid, $taskUid);\n\n //Set variables\n $numRecTotalGroup = 0;\n $numRecTotalUser = 0;\n switch ($option) {\n case \"ASSIGNED\":\n break;\n case \"AVAILIABLE\":\n $task = new \\Task();\n $arrayGroupUid = array();\n foreach ($task->getGroupsOfTask ($taskUid, $taskUserType) as $value) {\n $arrayGroupUid[] = $value['team_id'];\n }\n $arrayUserUid = array();\n foreach ($task->getUsersOfTask ($taskUid, $taskUserType) as $value) {\n $arrayUserUid[] = $value['usrid'];\n }\n break;\n }\n\n $arrParameters = array();\n\n $joinType = $option === \"AVAILIABLE\" ? \"LEFT\" : \"INNER\";\n\n //Groups\n //Query\n if ( empty ($type) || $type == \"group\" )\n {\n $TeamSelect = \"SELECT u.usrid, t.team_name, t.team_id \";\n $teamSql = \"FROM user_management.poms_users u\n \" . $joinType . \" JOIN workflow.TASK_USER p ON u.team_id = p.USR_UID AND p.TU_RELATION = 2\n LEFT JOIN user_management.teams t ON t.team_id = u.team_id\n WHERE 1=1\";\n\n switch ($option) {\n case \"ASSIGNED\":\n\n $teamSql .= \" AND p.TAS_UID = ? AND p.TU_RELATION = 2\";\n $arrParameters = array($taskUid);\n break;\n case \"AVAILIABLE\":\n if ( !empty ($arrayGroupUid) )\n {\n $teamSql .= \" AND t.team_id NOT IN (\" . implode (\",\", $arrayGroupUid) . \")\";\n }\n\n break;\n }\n\n if ( !is_null ($arrayFilterData) && is_array ($arrayFilterData) && isset ($arrayFilterData[\"filter\"]) && trim ($arrayFilterData[\"filter\"]) != \"\" )\n {\n $search = isset ($arrayFilterData[\"filter\"]) ? $arrayFilterData[\"filter\"] : \"\";\n $teamSql .= \" AND t.team_name LIKE '%\" . $search . \"%'\";\n }\n\n $teamSql .= \" AND t.status = 1\";\n\n //$teamQuery = $TeamSelect . $teamSql;\n\n $selectCount = \"SELECT COUNT(t.team_id) AS NUM_REC \";\n\n\n $selectCount .= $teamSql;\n\n $countResult = $this->objMsql->_query ($selectCount, $arrParameters);\n\n $numRecTotalGroup = (int) ($countResult[0][\"NUM_REC\"]);\n $numRecTotal = $numRecTotal + $numRecTotalGroup;\n }\n //Users\n //Query\n if ( empty ($type) || $type == \"user\" )\n {\n $userSelect = \"SELECT u.usrid, u.username, u.firstName, u.lastName \";\n $userSql = \"FROM user_management.poms_users u\n \" . $joinType . \" JOIN workflow.TASK_USER p ON u.usrid = p.USR_UID AND p.TU_RELATION = 1\n WHERE 1 = 1\";\n\n switch ($option) {\n case \"ASSIGNED\":\n $userSql .= \" AND TAS_UID = ? AND TU_RELATION = 1\";\n\n $arrParameters = array($taskUid);\n\n break;\n case \"AVAILIABLE\":\n if ( !empty ($arrayUserUid) )\n {\n $userSql .= \" AND u.usrid NOT IN (\" . implode (\",\", $arrayUserUid) . \")\";\n }\n\n break;\n }\n\n if ( !is_null ($arrayFilterData) && is_array ($arrayFilterData) && isset ($arrayFilterData[\"filter\"]) && trim ($arrayFilterData[\"filter\"]) != \"\" )\n {\n $search = isset ($arrayFilterData[\"filter\"]) ? $arrayFilterData[\"filter\"] : \"\";\n\n $userSql .= \" AND (u.username LIKE '%\" . $search . \"%' OR u.firstName LIKE '%\" . $search . \"%' OR lastName LIKE '%\" . $search . \"%')\";\n }\n\n $userSql .= \" AND u.status = 1\";\n //Number records total\n $sqlCount = \"SELECT COUNT(u.usrid) AS NUM_REC \";\n $sqlCount .= $userSql;\n\n $countResult = $this->objMsql->_query ($sqlCount, $arrParameters);\n\n $numRecTotalUser = (int) ($countResult[0][\"NUM_REC\"]);\n $numRecTotal = $numRecTotal + $numRecTotalUser;\n }\n //Groups\n //Query\n\n\n\n if ( empty ($type) || $type == \"group\" )\n {\n $teamSql .= \" GROUP BY u.team_id\";\n\n $teamSql .= \" ORDER BY t.team_name ASC\";\n\n if ( !is_null ($limit) )\n {\n $teamSql .= \" LIMIT \" . (int) $limit;\n }\n\n if ( !is_null ($start) )\n {\n $teamSql .= \" OFFSET \" . (int) $start;\n }\n\n $fullTeamQuery = $TeamSelect . $teamSql;\n\n $results = $this->objMsql->_query ($fullTeamQuery, $arrParameters);\n\n $numRecGroup = 0;\n foreach ($results as $row) {\n\n $sql2 = \"SELECT COUNT(team_id) AS NUM_REM FROM user_management.teams WHERE team_id = \" . $row[\"team_id\"];\n\n $result2 = $this->objMsql->_query ($sql2);\n\n $row2 = $result2[0];\n\n $row[\"GRP_TITLE\"] = $row[\"team_name\"] . \" (\" . $row2[\"NUM_REM\"] . \" \" . (int) $row2[\"NUM_REM\"] == 1 ? \"ID_USER\" : \"ID_USERS\" . \")\";\n $arrayAssignee[] = $this->getTaskAssigneeDataFromRecord (\n array(\n $row[\"team_id\"],\n $row[\"team_name\"],\n \"\",\n $row[\"team_name\"],\n \"group\"\n ), $taskUserType\n );\n $numRecGroup++;\n }\n }\n //Users\n //Query\n if ( empty ($type) || $type == \"user\" )\n {\n $userSql .= \" GROUP BY u.usrid\";\n\n $flagUser = true;\n if ( $numRecTotalGroup > 0 )\n {\n if ( $numRecGroup > 0 )\n {\n if ( !is_null ($limit) )\n {\n if ( $numRecGroup < (int) ($limit) )\n {\n $start = 0;\n $limit = $limit - $numRecGroup;\n }\n else\n {\n //$flagUser = false;\n }\n }\n else\n {\n $start = 0;\n }\n }\n else\n {\n $start = (int) ($start) - $numRecTotalGroup;\n }\n }\n if ( $flagUser )\n {\n //Users\n //Query\n $userSql .= \" ORDER BY u.firstName ASC\";\n\n if ( !is_null ($limit) )\n {\n $userSql .= \" LIMIT \" . (int) $limit;\n }\n\n if ( !is_null ($start) )\n {\n $userSql .= \" OFFSET \" . (int) $start;\n }\n\n $fullUserQuery = $userSelect . $userSql;\n\n $results = $this->objMsql->_query ($fullUserQuery, $arrParameters);\n\n foreach ($results as $row) {\n\n $arrayAssignee[] = $this->getTaskAssigneeDataFromRecord (\n array(\n $row[\"usrid\"],\n $row[\"firstName\"],\n $row[\"lastName\"],\n $row[\"username\"],\n \"user\"\n ), $taskUserType\n );\n }\n }\n }\n\n //Return\n return array(\n \"total\" => $numRecTotal,\n \"start\" => (int) ((!is_null ($startbk)) ? $startbk : 0),\n \"limit\" => (int) ((!is_null ($limitbk)) ? $limitbk : 0),\n $filterName => (!is_null ($arrayFilterData) && is_array ($arrayFilterData) && isset ($arrayFilterData[\"filter\"])) ? $arrayFilterData[\"filter\"] : \"\",\n \"data\" => $arrayAssignee\n );\n } catch (\\Exception $e) {\n throw $e;\n }\n }", "abstract public function getAssignments($userId);", "public function getUserId() {\n\t\t$this->assignment->getUserId();\n\t}", "public function assignment($user_id) {\n return $this->allAssignedTo->where('user_id', $user_id)->first();\n }", "public function assignee()\n {\n return $this->belongsTo('App\\User');\n }", "abstract public function getAssignment($userId, $itemName);", "public function getAssignedByUser()\n\t{\n\t\treturn User::where(['id' => $this->staff_free_assigned_by])->first();\n\t}", "function getAssignedEmail() {\n\t\treturn $this->data_array['assigned_email'];\n\t}", "public function taskOwner()\n {\n return $this->belongsTo('App\\User', 'super_id');\n }", "private static function getParticipant($userId) {\n return CRUDApiMisc::getFirstWherePropertyEquals(new ParticipantDateApi(), 'user_id', $userId);\n }", "public function getIdUserTask()\n {\n return $this->id_user;\n }", "public function assignee() {\n\t\t// TODO create the inverse relationship method in the correct model class\n\t\t// TODO add '_tickets' in the eloquent of the correct class in its controller\n\t\t// TODO copy the code in comment to the correct class and change '_tickets' function name\n\t\t/*\n public function _tickets() {\n return $this->hasOne('App\\Ticket', 'assignee_id');\n // return $this->hasMany('App\\Ticket', 'assignee_id');\n }\n */\n return $this->belongsTo('App\\Assignee', 'assignee_id');\n // return $this->belongsToMany('App\\Assignee', 'assignee_id');\n }", "protected function fetchTaskUid() {\n\t\t$this->uid = (is_object($this->task) ?\n\t\t\t$this->task->getTaskUid() :\n\t\t\t0);\n\t}", "function nf_getAssignedUID($taskID) {\n global $_TABLES;\n\n $assigned = array ();\n\n $sql = \"SELECT uid FROM {$_TABLES['nfproductionassignments']} WHERE task_id=$taskID\";\n $res = DB_query($sql);\n if (DB_numRows($res) == 0 AND DB_count($_TABLES['nfqueue'],'id',$taskID)) {\n // Check if this is an interactive task\n $sql = \"SELECT is_interactiveStepType FROM {$_TABLES['nfqueue']} a \";\n $sql .= \"LEFT JOIN {$_TABLES['nftemplatedata']} b on a.nf_templateDataID=b.id \";\n $sql .= \"LEFT JOIN {$_TABLES['nfsteptype']} c on b.nf_stepType=c.id \";\n $sql .= \"WHERE a.id=$taskID\";\n list ($isStepInteractive) = DB_fetchArray(DB_query($sql));\n if ($isStepInteractive == 1) {\n // Valid interactive task that should have an assignment record\n // but there is no current production AssignmentRecord\n // maybe I should create a ProdAssignment record but for now return an array with 0 for the assigned UID\n $assigned[] = 0;\n }\n } else {\n while ($A = DB_fetchArray ($res)) {\n $assigned[] = $A['uid'];\n }\n }\n\n return $assigned;\n}", "function &getEditAssignmentsByUserId($userId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT e.*, u.first_name, u.last_name, u.email, u.initials, r.role_id AS editor_role_id FROM articles a LEFT JOIN edit_assignments e ON (a.article_id = e.article_id) LEFT JOIN users u ON (e.editor_id = u.user_id) LEFT JOIN roles r ON (r.user_id = e.editor_id AND r.role_id = ' . ROLE_ID_EDITOR . ' AND r.journal_id = a.journal_id) WHERE e.editor_id = ? AND a.article_id = e.article_id ORDER BY e.date_notified ASC',\n\t\t\t$userId\n\t\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnEditAssignmentFromRow');\n\t\treturn $returner;\n\t}", "public function setAssigneeName($assigneeName);", "public function subaccount_assigned_users($params) {\n global $DB;\n\n if (empty($params->externalid)) {\n return [];\n }\n\n $assigns = $DB->get_records_sql(\n \"SELECT *\n FROM {local_intelliboard_assign}\n WHERE userid = :userid\",\n ['userid' => $params->externalid]\n );\n\n $assign_users = [];\n $assign_courses = [];\n $assign_cohorts = [];\n $assign_categories = [];\n $assign_fields = [];\n\n foreach ( $assigns as $assign) {\n if ($assign->type == 'users') {\n $assign_users[] = (int) $assign->instance;\n } elseif ($assign->type == 'courses') {\n $assign_courses[] = (int) $assign->instance;\n } elseif ($assign->type == 'categories') {\n $assign_categories[] = (int) $assign->instance;\n } elseif ($assign->type == 'cohorts') {\n $assign_cohorts[] = (int) $assign->instance;\n } elseif ($assign->type == 'fields') {\n $assign_fields[] = $assign->instance;\n }\n }\n\n if ($assign_fields) {\n $sql_arr = array();\n\n foreach ($assign_fields as $key=>$field) {\n $elem = explode(\"|\", $field);\n $fieldid = (int) $elem[0];\n $value = $elem[1];\n $sql_arr[] = \"fieldid = :field{$key} AND \" . $DB->sql_like('data', \":data{$key}\", false, false);\n $this->params[\"data{$key}\"] = \"$value\";\n $this->params[\"field{$key}\"] = $fieldid;\n }\n\n $sql_filter = \" AND (\".implode(\") OR (\", $sql_arr) .\")\";\n\n if ($list = $DB->get_records_sql(\n \"SELECT DISTINCT userid FROM {user_info_data} WHERE data <> '' $sql_filter\", $this->params\n )) {\n foreach ($list as $item) {\n $assign_users[] = (int) $item->userid;\n }\n }\n }\n\n $assign_users_list = implode(\",\", array_unique($assign_users));\n\n if ($assign_users) {\n $this->users = array_unique(array_merge($this->users, $assign_users));\n }\n if ($assign_cohorts_list) {\n $result = $DB->get_records_sql(\n \"SELECT userid FROM {cohort_members} WHERE cohortid IN ($assign_cohorts_list)\"\n );\n\n if ($result) {\n $list = [];\n foreach ($result as $value) {\n $list[] = $value->userid;\n }\n $this->users = array_unique(array_merge($this->users, $list));\n }\n }\n if ($assign_courses_list) {\n $result = $DB->get_records_sql(\n \"SELECT distinct ra.userid\n FROM {role_assignments} ra, {context} ctx\n WHERE ctx.id = ra.contextid AND ctx.contextlevel = 50 AND\n tx.instanceid IN ($assign_courses_list)\",\n $this->params\n );\n\n if ($result) {\n $list = [];\n foreach ($result as $value) {\n $list[] = $value->userid;\n }\n $this->users = array_unique(array_merge($this->users, $list));\n }\n }\n\n return empty($this->users) ? [] : $this->users;\n }", "public function getMember(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->email = $row['email'];\n $this->username = $row['username'];\n }", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "function get_assigned() {\n // When a new ticket is stored, there is no id. We want to stop here.\n if (empty($this->id)) {\n return false;\n }\n $records = get_records('helpdesk_ticket_assignments', 'ticketid', $this->id);\n\n // If there are no records, there are no users assigned.\n if (!$records) {\n return false;\n }\n\n // At this point we have to process each user. This may sound scary but\n // the number of assigned users is usually low.\n foreach($records as $record) {\n $users[] = helpdesk_get_user($record->userid);\n }\n\n return $users;\n }", "public function show(assignee $assignee)\n {\n //\n }", "public function assignedTo()\n {\n return $this->belongsTo(User::class, 'assigned_user_id');\n }" ]
[ "0.6486139", "0.61653143", "0.6121818", "0.6118804", "0.6062872", "0.5794433", "0.55956435", "0.5594956", "0.5552415", "0.5549948", "0.55202794", "0.5459199", "0.54537106", "0.54421103", "0.5438439", "0.5320148", "0.52923447", "0.52818376", "0.521014", "0.52020836", "0.5143991", "0.5139975", "0.5124676", "0.5111853", "0.5060335", "0.50601935", "0.5057496", "0.5055509", "0.50490236", "0.50455385" ]
0.7041452
0
Register settings in admin area.
public function register_haa_settings() { add_settings_section( 'haa_settings_section', 'Hide Admin Area', '', 'general' ); add_settings_field( 'haa_admin_area', '<label for="haa_admin_area">Admin URL slug</label>', array($this, 'display_settings_field'), 'general', 'haa_settings_section' ); register_setting( 'general', 'haa_admin_area', 'sanitize_key' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin_init() {\n\t\tregister_setting( $this->options_key, $this->options_key, array( $this, 'save_settings' ) );\n\t}", "public function register_settings()\n {\n }", "public function register_settings()\n {\n }", "public static function register_settings() {\n\t\t// Settings\n\t\t$settings = array(\n\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t'weight' => 124,\n\t\t\t\t'settings' => array(\n\t\t\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t\t\t'label' => self::__( 'Merchant Edit Profile Path' ),\n\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t'label' => trailingslashit( get_home_url() ),\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => self::$edit_path\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\tdo_action( 'gb_settings', $settings, Group_Buying_UI::SETTINGS_PAGE );\n\t}", "function register_settings() {\n register_setting( 'athen_tweaks', 'athen_tweaks', array( $this, 'admin_sanitize' ) ); \n }", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New', 'mailoptin'));\n $this->register_core_settings($instance);\n $instance->build(true, true);\n }", "function bg_AddAdminSettings(){\n global $bg_optionGroup, $bg_optionName, $bg_page, $bg_sectionId, $bg_opts_apiKey;\n \n register_setting( $bg_optionGroup, $bg_optionName, 'bg_ValidateOptions' );\n add_settings_section($bg_sectionId, 'License Settings', 'bg_AddSettingsSectionHtml', $bg_page);\t\n add_settings_field($bg_opts_apiKey, 'Api Key', 'bg_AddApiKeySettingsFieldHtml', $bg_page, $bg_sectionId);\n}", "public function registerSettings()\n {\n register_setting(self::SETTING_GROUPNAME, self::SETTING_BASENAME);\n \n // Section: API Keys\n // -----------------------------------------------------------------\n\n add_settings_section(\n 'wistia_section-api_keys',\n __('API Settings'),\n [$this->renderer, 'renderAPISettingsSection'],\n self::ADMIN_PAGE_ID\n );\n\n add_settings_field(\n 'url_prefix',\n __('URL Prefix'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'url_prefix',\n null,\n [\n 'before' => '<code>http://</code>',\n 'after' => '<code>.wistia.com</code>',\n ]\n )\n );\n add_settings_field(\n 'project_key',\n __('Project Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'project_key',\n __('Enter the ID of the project that the Upload API should send videos to.'),\n [\n 'classes' => 'regular-text'\n ]\n )\n );\n add_settings_field(\n 'upload_key',\n __('Upload Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'upload_key',\n __('This API key should have <strong>upload permissions only</strong>. It will be '\n .'visible in the source of any front-end pages that use the JavaScript uploader.'),\n [\n 'classes' => 'regular-text',\n ]\n )\n );\n add_settings_field(\n 'data_key',\n __('Data API Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'data_key',\n __('This API key should have <strong>read and write</strong> permissions.'),\n [\n 'classes' => 'regular-text',\n ]\n )\n );\n }", "public function registerMenu()\n\t\t{\n\t\t\tadd_options_page( 'Thingdom Settings', 'Thingdom Settings', 'manage_options', $this->slug, array($this, 'loadSettings')); \n\t\t\tadd_action('admin_init', array($this, 'registerSettings'));\n\t\t}", "function register_clix_uppe_admin_settings() {\r\n\t//register our settings\r\n\tregister_setting( 'clix_uppe_settings', 'clix_content_fail' );\r\n\tregister_setting( 'clix_uppe_settings', 'clix_rss_fail' );\r\n}", "function wcusp_register_settings() {\n\tregister_setting('wcusp_settings_group', 'wcusp_settings');\n}", "public function register_settings() {\n\t\tregister_setting('eaboot_options', 'eaboot_options', array(&$this, 'validate_settings'));\n\n\t\tforeach ($this->sections as $slug => $title) {\n\t\t\tif ($slug == 'about')\n\t\t\t\tadd_settings_section($slug, $title, array(&$this, 'display_about_section'), 'eaboot_options');\n\t\t\telse\n\t\t\t\tadd_settings_section($slug, $title, array(&$this, 'display_section'), 'eaboot_options');\n\t\t}\n\n\t\t$this->get_settings();\n\n\t\tforeach ($this->settings as $id => $setting) {\n\t\t\t$setting['id'] = $id;\n\t\t\t$this->create_setting($setting);\n\t\t}\n\t}", "public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }", "public function admin_init()\n\t{\n\t\tforeach( (array) $this->InstanceRegistred as $id => $args ) :\n\t\t\t\\register_setting( $this->page, $args['name'] );\n\t\tendforeach;\n\t}", "function mpc_register_settings() {\n\tregister_setting('mpc_settings_group', 'mpc_settings');\n}", "function hb_register_settings() {\r\n\tregister_setting('hb_settings_group', 'hb_settings');\r\n\r\n}", "function tsuiseki_tracking_admin_init() {\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_key');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_css_class');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_excluded_uris');\n}", "protected function _registerSettingsPage()\n {\n // Add action to register field sections to tab\n $this->on('!wprss_add_settings_fields_sections',\n array($this, '_renderSettingsPage'), 10, 1);\n }", "function register_settings() {\n\t\t\tif( get_option( $this->func . '_settings' ) == false ) {\n\t\t\t\tadd_option( $this->func . '_settings' );\n\t\t\t}\n\n\t\t\tforeach( $this->get_registered_settings() as $tab => $sections ) {\n\t\t\t\tforeach( $sections as $section => $settings ) {\n\t\t\t\t\t// Check for backwards compatibility\n\t\t\t\t\t$section_tabs = $this->get_settings_tab_sections( $tab );\n\n\t\t\t\t\tif( ! is_array( $section_tabs ) || ! array_key_exists( $section, $section_tabs ) ) {\n\t\t\t\t\t\t$section = 'main';\n\t\t\t\t\t\t$settings = $sections;\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_settings_section(\n\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t__return_null(),\n\t\t\t\t\t\t'__return_false',\n\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach( $settings as $option ) {\n\t\t\t\t\t\t// For backwards compatibility\n\t\t\t\t\t\tif( empty( $option['id'] ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$name = isset( $option['name'] ) ? $option['name'] : '';\n\n\t\t\t\t\t\tadd_settings_field(\n\t\t\t\t\t\t\t$this->func . '_settings[' . $option['id'] . ']',\n\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\tfunction_exists( $this->func . '_' . $option['type'] . '_callback' ) ? $this->func . '_' . $option['type'] . '_callback' : ( method_exists( $this, $option['type'] . '_callback' ) ? array( $this, $option['type'] . '_callback' ) : array( $this, 'missing_callback' ) ),\n\t\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'section' => $section,\n\t\t\t\t\t\t\t\t'id' => isset( $option['id'] ) ? $option['id'] : null,\n\t\t\t\t\t\t\t\t'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',\n\t\t\t\t\t\t\t\t'name' => isset( $option['name'] ) ? $option['name'] : null,\n\t\t\t\t\t\t\t\t'size' => isset( $option['size'] ) ? $option['size'] : null,\n\t\t\t\t\t\t\t\t'options' => isset( $option['options'] ) ? $option['options'] : '',\n\t\t\t\t\t\t\t\t'std' => isset( $option['std'] ) ? $option['std'] : '',\n\t\t\t\t\t\t\t\t'min' => isset( $option['min'] ) ? $option['min'] : null,\n\t\t\t\t\t\t\t\t'max' => isset( $option['max'] ) ? $option['max'] : null,\n\t\t\t\t\t\t\t\t'step' => isset( $option['step'] ) ? $option['step'] : null,\n\t\t\t\t\t\t\t\t'select2' => isset( $option['select2'] ) ? $option['select2'] : null,\n\t\t\t\t\t\t\t\t'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,\n\t\t\t\t\t\t\t\t'multiple' => isset( $option['multiple'] ) ? $option['multiple'] : null,\n\t\t\t\t\t\t\t\t'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,\n\t\t\t\t\t\t\t\t'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,\n\t\t\t\t\t\t\t\t'buttons' => isset( $option['buttons'] ) ? $option['buttons'] : null,\n\t\t\t\t\t\t\t\t'wpautop' => isset( $option['wpautop'] ) ? $option['wpautop'] : null,\n\t\t\t\t\t\t\t\t'teeny' => isset( $option['teeny'] ) ? $option['teeny'] : null,\n\t\t\t\t\t\t\t\t'tab' => isset( $option['tab'] ) ? $option['tab'] : null,\n\t\t\t\t\t\t\t\t'tooltip_title' => isset( $option['tooltip_title'] ) ? $option['tooltip_title'] : false,\n\t\t\t\t\t\t\t\t'tooltip_desc' => isset( $option['tooltip_desc'] ) ? $option['tooltip_desc'] : false,\n\n\t\t\t\t\t\t\t\t'available_header'\t=> isset( $option['available_header'] ) ? $option['available_header'] : null,\n\t\t\t\t\t\t\t\t'selected_header'\t=> isset( $option['selected_header'] ) ? $option['selected_header'] : null,\n\n\t\t\t\t\t\t\t\t'class' => isset( $option['class'] ) ? $option['class'] : '',\n\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\n\t\t\tregister_setting( $this->func . '_settings', $this->func . '_settings', array( $this, 'settings_sanitize' ) );\n\t\t}", "function register() {\n\tadd_action( 'admin_menu', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\add_menu' );\n\tadd_action( 'admin_init', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\action_handler' );\n\tadd_action( 'admin_enqueue_scripts', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\register_style' );\n\n\t\\Sgdd\\Admin\\SettingsPages\\Basic\\register();\n\t\\Sgdd\\Admin\\SettingsPages\\Advanced\\register();\n\t\\Sgdd\\Admin\\Editor\\register();\n}", "function jb_register_settings() {\n\tregister_setting( JB_SETTINGS_FIELD, JB_SETTINGS_FIELD );\n\tadd_option( JB_SETTINGS_FIELD , jb_option_defaults() );\n\tadd_settings_section('jb_main','Main Settings', 'jb_main_section_text', JB_SETTINGS_FIELD );\n\tadd_settings_field('jb_featured_cat', 'Featured Category', 'jb_featured_cat_slug_setting', JB_SETTINGS_FIELD , 'jb_main');\n\tadd_settings_field('jb_featured_content_limit', 'Homepage Featured Post Word Count Limit', 'jb_featured_content_limit_setting', JB_SETTINGS_FIELD , 'jb_main');\n\tadd_settings_field('jb_post_content_limit', 'Post Word Count Limit', 'jb_post_content_limit_setting', JB_SETTINGS_FIELD , 'jb_main');\n}", "public static function register_settings() {\n\t\t\tregister_setting( 'ELMT_theme_options', 'ELMT_theme_options', array( 'ELMT_theme_options', 'sanitize' ) );\n\t\t}", "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "function splashgate_admin_init(){\n\t\t\tregister_setting(\tSPLASHGATE_SETTINGS_GROUP, 'splashgate_options' ); // 'options' will be an array holding everything\n\t\t}", "function register_admin_screen () {\n \n $this->admin_page = add_submenu_page('edit.php?post_type=transaction', __( 'Settings', 'colabsthemes' ), __( 'Settings', 'colabsthemes' ), 'manage_options', $this->token, array( &$this, 'admin_screen' ) );\n \n add_action( \"admin_print_styles-\".$this->admin_page, 'colabs_admin_styles' );\n add_action( \"admin_print_scripts-\".$this->admin_page, 'colabs_load_only' ); \n add_action( \"admin_head-\".$this->admin_page, array( $this, 'save_options') ); \n }", "public function register() {\n\n\t\tregister_setting(\n\t\t\t'emcl_settings',\t\t\t// Group of options\n\t\t\t'emcl_settings', \t // Name of options\n\t\t\tarray( $this, 'sanitize' )\t// Sanitization function\n\t\t);\n\n\t\tadd_settings_section(\n\t\t\t'emcl-server',\t\t\t// ID of the settings section\n\t\t\t'Server Settings',\t\t// Title of the section\n\t\t\t'',\n\t\t\t'emcl-section'\t\t\t// ID of the page\n\t\t);\n\n\t\tforeach( $this->server_fields as $key => $name) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key, \t\t\t// The ID of the settings field\n\t\t\t\t$name, \t// The name of the field of setting(s)\n\t\t\t\tarray( $this, 'display_'.$key ),\n\t\t\t\t'emcl-section', \t// ID of the page on which to display these fields\n\t\t\t\t'emcl-server' // The ID of the setting section\n\t\t\t);\n\t\t}\n\n\t\tadd_settings_section(\n\t\t\t'emcl-app',\t\t\t // ID of the settings section\n\t\t\t'App Settings',\t\t\t// Title of the section\n\t\t\t'',\n\t\t\t'emcl-section'\t\t\t// ID of the page\n\t\t);\n\n\t\tforeach( $this->app_fields as $key => $name) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key, \t\t\t// The ID of the settings field\n\t\t\t\t$name, \t// The name of the field of setting(s)\n\t\t\t\tarray( $this, 'display_'.$key ),\n\t\t\t\t'emcl-section', \t// ID of the page on which to display these fields\n\t\t\t\t'emcl-app' \t// The ID of the setting section\n\t\t\t);\n\t\t}\n\t}", "function register_settings() {\n add_settings_section(\n 'main-settings-section',\n 'Main Settings',\n array($this, 'print_main_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'app_id',\n 'App ID', \n array($this, 'create_input_app_id'), \n 'share-fb-sections-plugin', \n 'main-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_main_settings', array($this, 'plugin_main_settings_validate') );\n \n // add_settings_section( $id, $title, $callback, $page )\n add_settings_section(\n 'additional-settings-section',\n 'Additional Settings & Default Value',\n array($this, 'print_additional_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'render_meta_tag',\n 'Render Meta Tag',\n array($this, 'create_input_render_meta_tag'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'title', \n 'Default Title', \n array($this, 'create_input_title'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'description', \n 'Default Description', \n array($this, 'create_input_description'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'image_url', \n 'Default Image URL', \n array($this, 'create_input_image_url'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_additonal_settings', array($this, 'plugin_additional_settings_validate') );\n }", "public function register_settings() {\n\n\t\tadd_settings_section(\n\t \t'thaim_utilities_section',\n\t \t__( 'Thaim Utilities Settings', 'thaim-utilities' ),\n\t \tarray( $this, 'settings_callback_section' ),\n\t \t'buddypress'\n\t );\n\n\t $settings = apply_filters( 'thaim_utilities_settings_fields', array( \n\t \tarray(\n\t \t\t'name' => 'thaim_link_wordpress_org',\n\t \t\t'title' => __( 'WordPress.org account', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'link_wp_org_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_perpage_wordpress_org',\n\t \t\t'title' => __( 'Number of WordPress plugins to display', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'perpage_wp_org_callback' ),\n\t \t\t'sanitize' => 'absint',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_list_github_repos',\n\t \t\t'title' => __( 'List your github repos', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'list_github_repos_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t ) );\n\n\t\tforeach( $settings as $setting ) {\n\t\t\tadd_settings_field(\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['title'],\n\t\t\t\t$setting['display'],\n\t\t\t\t'buddypress',\n\t\t\t\t'thaim_utilities_section'\n\t\t\t);\n\n\t\t\tregister_setting(\n\t\t\t\t'buddypress',\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['sanitize']\n\t\t\t);\n\t\t}\n\t}", "public function admin_init() {\n //register settings sections\n foreach ( $this->settings_sections as $tab_key => $sections ) {\n foreach ($sections as $section){\n if ( false == get_option( $this->get_option_prefix($section['id']) ) ) {\n add_option( $this->get_option_prefix($section['id']) );\n }\n\n if ( isset($section['desc']) && !empty($section['desc']) ) {\n $section['desc'] = '<div class=\"inside\">'.$section['desc'].'</div>';\n $callback = function () use($section) {\n echo str_replace('\"', '\\\"', $section['desc']);\n };\n } else if ( isset( $section['callback'] ) ) {\n $callback = $section['callback'];\n } else {\n $callback = null;\n }\n\n add_settings_section( $section['id'], $section['title'], $callback, $tab_key );\n }\n }\n\n //register settings fields\n foreach ( $this->settings_fields as $tab_key => $sections ) {\n foreach ($sections as $section_key => $field ) {\n foreach ($field as $field_args) {\n\n $args = $this->set_default_field_args( $field_args, $tab_key, $section_key );\n\n if ($args['global'] === true) {\n register_setting($tab_key, $args['name_id'], (is_callable($args['sanitize_callback'])) ? $args['sanitize_callback'] : false);\n }\n\n add_settings_field($args['name_id'], $args['label'], array($this, 'callback_' . $args['type']), $tab_key, $section_key, $args);\n\n if ($args['sub_fields']) {\n\n foreach ( $args['sub_fields'] as $sub_field_args ) {\n $sub_field_args['parent'] = $args;\n $sub_args = $this->set_default_field_args( $sub_field_args, $tab_key, $section_key );\n\n add_settings_field($sub_args['name_id'], $sub_args['label'], array($this, 'callback_' . $sub_args['type']), $tab_key, $section_key, $sub_args);\n }\n\n }\n }\n }\n }\n\n // creates our settings in the options table\n foreach ( $this->settings_sections as $tab_key => $sections ) {\n foreach ($sections as $section) {\n register_setting( $tab_key, $this->get_option_prefix( $section['id'] ), array( $this, 'sanitize_options' ) );\n }\n }\n\n }", "function admin_init() {\r\n register_setting('e_tools_options', 'e_tools');\r\n}" ]
[ "0.766443", "0.7506476", "0.7505662", "0.74705565", "0.74521106", "0.73050004", "0.7267962", "0.72407234", "0.7227277", "0.7221165", "0.7180942", "0.7176924", "0.71709675", "0.71666557", "0.715807", "0.71288097", "0.71215546", "0.70814985", "0.70776325", "0.70585775", "0.7004779", "0.6979465", "0.69782084", "0.69780874", "0.6931918", "0.69244564", "0.69213635", "0.6895143", "0.6894865", "0.68942815" ]
0.75238883
1
Display the admin setting field.
public function display_settings_field($args) { $value = get_option('haa_admin_area', 'hidden-admin'); echo '<input name="haa_admin_area" type="text" id="haa_admin_area" value="' . $value . '" class="regular-text">'; echo '<p class="description">Use alpha-numeric characters, dashes and underscores.<br>Avoid existing posts/pages slugs.</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show_settings() {\n\n\t\twoocommerce_admin_fields( $this->get_settings() );\n\t}", "public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }", "function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }", "public function display() {\n\t\tif ( $this->read_only && $this->selectable ) {\n\t\t\techo \"<input onClick='this.select();' type='text' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( get_option( $this->setting_id, $this->default_value ) ) . \"' readonly class='regular-text'>\";\n\t\t} elseif ( $this->read_only && ! $this->selectable ) {\n\t\t\techo \"<input type='text' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( get_option( $this->setting_id, $this->default_value ) ) . \"' readonly class='regular-text'>\";\n\t\t} else {\n\t\t\techo \"<input type='text' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( get_option( $this->setting_id, $this->default_value ) ) . \"' class='regular-text'>\";\n\t\t}\n\t}", "function settings_html() {\n $this->render_setting( 'label_any' );\n $this->render_setting( 'modifiers' );\n $this->render_setting( 'orderby' );\n $this->render_setting( 'count' );\n }", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e($this->getSettingsDescription(), 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "public function display() {\n\t\techo \"<input id='\" . esc_attr( $this->setting_id ) . \"' type='hidden' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( wp_json_encode( $this->get(), JSON_UNESCAPED_UNICODE ) ) . \"'>\";\n\t}", "function display_edit_field() {\n data_field_admin::check_lang_strings($this);\n parent::display_edit_field();\n }", "public function admin_options() {\n\n echo '<h3>'.__('MTN Mobile Money Settings', 'woocommerce').'</h3>';\n echo '<table class=\"form-table\">';\n\n $this->generate_settings_html();\n echo '</table>';\n }", "public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}", "public function setting()\n {\n return view('admin.setting');\n }", "public function getSettingsHtml()\n {\n return craft()->templates->render('controlleractionfield/fieldtypes/controlleraction/settings', array(\n 'settings' => $this->getSettings(),\n 'placeholders' => $this->getPlaceholderStrings(),\n ));\n }", "public function admin_options() {\n\n\t\t\t?>\n\t\t\t<h3>ATOS</h3>\n\t\t\t<p><?php _e('Acceptez les paiements par carte bleue grâce à Atos.', 'woothemes'); ?></p>\n\t\t\t<p><?php _e('Plugin créé par David Fiaty', 'woothemes'); ?> - <a href=\"http://www.cmsbox.fr\">http://www.cmsbox.fr</a></p>\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}", "function acf_settings_show_admin( $setting ) {\n\t\t\n\t\t// 5.0.0 - removed ACF_LITE\n\t\treturn ( defined('ACF_LITE') && ACF_LITE ) ? false : $setting;\n\t\t\n\t}", "function settings_html() {\n $this->render_setting( 'label_any' );\n }", "function admin_options() {\r\n ?>\r\n <h3><?php _e('Bitcoin Payment','Bitcoin_Payment'); ?></h3>\r\n <table class=\"form-table\">\r\n <?php $this->generate_settings_html(); ?>\r\n </table> <?php\r\n }", "public function admin_options() { ?>\n <h3><?php _e( 'Veritrans', 'woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Veritrans.', 'woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "public function render_settings_page() {\n\t\tinclude( get_inc_dir() . '/templates/admin-settings.php' );\n\t}", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "function DisplaySettings()\n {\n $this->DisplayBreadcrumb();\n PrintPluginSettings($this->pluginid, array('form_wizard_settings','form_export_settings'), $this->_page);\n }", "public function admin_options(){\r\n echo '<h3>'.__('Netgíró Payment Gateway', 'netgiro').'</h3>';\r\n echo '<p>'.__('Verslaðu á netinu með Netgíró á einfaldan hátt.').'</p>';\r\n echo '<table class=\"form-table\">';\r\n $this -> generate_settings_html();\r\n echo '</table>';\r\n }", "function postageapp_admin_form() {\n $form = array();\n \n $form['settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Postageapp settings'),\n );\n \n $form['settings']['postageapp_api_key'] = array(\n '#type' => 'textfield',\n '#title' => t('PostageApp API Key'),\n '#required' => TRUE,\n '#default_value' => variable_get('postageapp_api_key', ''),\n '#description' => t('The API key for your PostageApp account. Get or generate a valid API key at your PostageApp dashboard which is available at yourusername.postageapp.com')\n );\n \n return system_settings_form($form);\n}", "public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Midtrans.', 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form. generated from `init_form_fields`\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "function wpcron_display_settings_page() {\n\n\t// check if user is allowed access\n\tif ( ! current_user_can( 'manage_options' ) ) return;\n\n\t?>\n\n\t<div class=\"wrap\">\n\n\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\n\t\t<?php echo wpcron_log(); ?>\n\n\t</div>\n\n<?php\n\n}", "public function admin_options() {\n\n ?>\n <h3>交通银行支付平台</h3>\n \n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }", "public function display_analytics_settings() {\n\t\tadd_settings_field( 'wsuwp-ga-id', 'Google Analytics ID', array( $this, 'general_settings_ga_id' ), $this->settings_page, 'wsuwp-analytics', array(\n\t\t\t'label_for' => 'wsuwp_ga_id',\n\t\t) );\n\t\tadd_settings_field( 'wsuwp-ga4-id', 'GA4 Analytics ID', array( $this, 'general_settings_ga4_id' ), $this->settings_page, 'wsuwp-analytics', array(\n\t\t\t'label_for' => 'wsuwp_ga4_id',\n\t\t) );\n\t\tadd_settings_field( 'wsuwp-analytics-option-map', 'General Analytics Settings', array( $this, 'general_settings_inputs' ), $this->settings_page, 'wsuwp-analytics', array(\n\t\t\t'label_for' => 'wsuwp_analytics_option_map',\n\t\t) );\n\t}", "public function admin_options() {\n\t\t\t?>\n\t\t\t<img style=\"float:right\" src=\"<?php echo plugin_dir_url(__FILE__); ?>coinsimple.png\" />\n\t\t\t<h3><?php _e('CoinSimple', 'woocommerce');?></h3>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}", "public function displayAdminPanel() {}", "public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "function ed_employee_display_settings(){\n\tadd_settings_section( // Call add_settings_section and add parameters\n\t\t'ed_setting_section',\n\t\t'Employee Display Settings', // Human readable name\n\t\t'ed_setting_section_callback', // Callback\n\t\t'reading'// Put it in the Settings reading section\n\t);\n\n\tadd_settings_field( // Add field and parameters\n\t\t'ed_setting_show_editor',\n\t\t'Show Editor', // Human readable name\n\t\t'ed_setting_show_editor_callback', // Callback\n\t\t'reading', // Put it in the Settings reading section\n\t\t'ed_setting_section' // Put it in this section\n\t);\n\n\tregister_setting('reading', 'ed_setting_show_editor'); // Call register setting, put it in reading, pass in ed_setting_show_editor\n // Media buttons settings\n\tadd_settings_field(\n\t\t'ed_setting_show_media_buttons',\n\t\t'Show Media Buttons',\n\t\t'ed_setting_show_media_buttons_callback',\n\t\t'reading',\n\t\t'ed_setting_section'\n\t);\n\n\tregister_setting('reading', 'ed_setting_show_media_buttons'); // register field\n}" ]
[ "0.7783596", "0.7523776", "0.74974597", "0.7376712", "0.73449314", "0.72992563", "0.72598404", "0.72366637", "0.712594", "0.71164614", "0.7097803", "0.7045047", "0.701411", "0.69982946", "0.69931847", "0.69823045", "0.6926087", "0.69090605", "0.6900909", "0.6877817", "0.68565005", "0.6827032", "0.6819634", "0.6770751", "0.67683333", "0.6753682", "0.6716085", "0.66988057", "0.6695522", "0.66928536" ]
0.7547517
1
Redirect the user to the login page with secret key.
public function redirect_with_secret_key() { $page_url = $this->get_current_page_url(); $admin_page = get_site_url() . '/' . $this->admin_area; if (($page_url == $admin_page) || ($page_url == $admin_page . '/')) { wp_redirect(home_url() . '/wp-login.php?secret_key=' . $this->secret_key); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirect_wp_login() {\n if (is_user_logged_in()) {\n wp_redirect(get_admin_url());\n }\n elseif (!$_GET['secret_key'] == $this->secret_key) {\n wp_redirect(home_url());\n }\n }", "public function redirectToLogin() {\n\t\t//\tcreate and save the state parameter\n\t\t$openIdStateMap =& storageFindOrCreate( \"openIdStateMap\" );\n\t\t$state = generatePassword(10);\n\t\t$openIdStateMap[ $state ] = $this->code;\n\n\t\t//\tcreate the URL\n\t\t$config = $this->getConfig();\n\t\t$request = new HttpRequest( $config[\"authorization_endpoint\"], \"GET\", array( \n\t\t\t\"response_type\" => \"code\",\n\t\t\t\"scope\" => $this->scope,\n\t\t\t\"client_id\" => $this->clientId,\n\t\t\t\"state\" => $state,\n\t\t\t\"redirect_uri\" => projectURL() . GetTableLink(\"openidcallback\")\n\t\t));\n\n\t\theader( \"Location: \" . $request->getUrl() );\n\t}", "function redirectLogin()\n\t{\n\t\tredirect('auth/login');\n\t}", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "function _loginRedirect(){\r\n \t// send user to the login page\r\n \theader(\"Location:/index.php\");\r\n }", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "private function redirectToSpotifyAuthorizeUrl()\n {\n header(\"Location: {$this->session->getAuthorizeUrl($this->options)}\");\n die();\n }", "public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}", "public function actionLogin()\r\n\t{\r\n\t $this->redirect(array('//user/auth'));\r\n\t}", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "public function login()\n {\n return Redirect::to('https://' . Request::server('SERVER_NAME')\n . ':' . Request::server('SERVER_PORT') . config('shibboleth.idp_login')\n . '?target=' . action('\\\\' . __CLASS__ . '@idpAuthenticate'));\n }", "private function redirect()\n\t\t{\n\t\t\tif(isUserLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: \" . APPROOT);\n\t\t\t}\n\t\t}", "public function login(): RedirectResponse\n {\n return redirect($this->auth->getLoginUrl());\n }", "public function login()\n {\n require_once(app_path().'/config/id.php');\n\n // if user is already logged in, redirect to current page\n if (Session::has('user'))\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n // else redirect user to CS50 ID\n else\n {\n //store url in session\n Session::put('redirect', URL::previous());\n\n return Redirect::to(CS50::getLoginUrl(TRUST_ROOT, RETURN_TO));\n }\n }", "public function doRedirectLogin() {\n\t\t\theader(\"Location: ../../login.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "public function securePage(){\n\t\tif( !$this->currentUser && !$this->ci->user_model->autoLoginUser() ){\n\t\t\tsetcookie('redirect', $this->ci->uri->uri_string(), 0, '/' );\n\t\t\tredirect('main', 'refresh');\n\t\t}\n\t}", "public function login()\n {\n $login = new Login();\n\n $path = '/inloggen';\n if (CSRF::validate() && $login->check()) {\n // try to send the user to the reservation form or sign up for meet the expert page\n $path = Session::get('path');\n unset($_SESSION['path']);\n\n if (empty($path)) {\n $path = '/';\n }\n }\n\n return new RedirectResponse($path);\n }", "public function index() {\n redirect(\"auth/login\", \"refresh\");\n }", "public function logged_in_redirect(){\n\n\t\tif (isset($_SESSION['user_id'])) {\n\t\t \t# code...\n\t\t \theader('Location: index.php');\n\t\t } \n\t}", "public function redirect()\n {\n $temp = $this->server->getTemporaryCredentials();\n\n // We have a stateless app without sessions, so we use the cache to\n // store the secret for man in the middle attack protection\n $key = 'oauth_temp_'.$temp->getIdentifier();\n $this->cache->put($key, $temp, ProviderContract::CACHE_TTL);\n\n $this->storeReturnUrl($temp);\n\n return new RedirectResponse($this->server->getAuthorizationUrl($temp));\n }", "public function login()\r\n {\r\n $helper = $this->facebook->getRedirectLoginHelper();\r\n $loginUrl = $helper->getLoginUrl(app_url('/facebook/callback'));\r\n\r\n // Redirect to facebook login page.\r\n header('location: ' . $loginUrl);\r\n exit;\r\n }", "function template_redirect() {\r\n\t\tappthemes_auth_redirect_login();\r\n\t}", "public function loginAction()\n {\n $session = new Zend_Session_Namespace(__CLASS__);\n $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n try {\n $referer = Zend_Uri_Http::factory($_SERVER['HTTP_REFERER']);\n } catch (Exception $e) {\n }\n if ($this->_getParam('referer')) {\n $session->referer = $this->_getParam('referer');\n } else if ($referer && \n $referer->getHost() == $_SERVER['HTTP_HOST'] &&\n (!$referer->getPort() || $referer->getPort() == $_SERVER['SERVER_PORT']) &&\n substr($referer->getPath(), 0, strlen($baseUrl)) == $baseUrl) {\n $session->referer = substr($referer->getPath(), strlen($baseUrl));\n $session->referer = ltrim($session->referer, '/'); \n if ($referer->getQuery()) {\n $session->referer .= '?' . $referer->getQuery();\n }\n if ($referer->getFragment()) {\n $session->referer .= '#' . $referer->getFragment();\n }\n } else {\n $session->referer = $this->_getDefaultLandingPath();\n }\n \n $this->_redirect($this->_getCasAdapter()->getLoginUrl());\n }", "function good_login()\n\t{\n\t\tif( $GLOBALS['appshore_data']['api']['nextop'] )\n\t\t\theader('Location: '.$GLOBALS['appshore']->session->baseurl.base64_decode($GLOBALS['appshore_data']['api']['nextop']));\n\t}", "protected function LoginRedirect()\n {\n try\n {\n // set cookies to know where to redirect on success\n setcookie( 'AUTHURL', $this->sSuccessUrl, 0, \"/\", '.clemson.edu', false, true);\n setcookie( 'AUTHREASON', '', 0, \"/\", '.clemson.edu', false, true);\n\n // redirect to the login site\n header( 'Location: https://login.clemson.edu' );\n die();\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function redirectAction()\n {\n $this->facebookOAuth->authorize();\n }", "function auth_redirect()\n {\n }", "public function maverickLoginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authMaverickLogin' );\n }", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n if ($auth->hasIdentity()) {\n $this->_redirect($this->getUrl());\n }\n\n $request = $this->getRequest();\n\n $redirect = $request->getPost('redirect');\n if (strlen($redirect) == 0)\n $redirect = $request->getServer('REQUEST_URI');\n if (strlen($redirect) == 0)\n $redirect = $this->getUrl();\n\n $errors = array();\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n $username = $request->getPost('username');\n $password = $request->getPost('password');\n\n if (strlen($username) == 0 || strlen($password) == 0)\n $errors['username'] = 'Required field must not be blank';\n\n if (count($errors) == 0) {\n $adapter = new Champs_Auth_Doctrine($username, $password);\n\n $result = $auth->authenticate($adapter);\n\n if ($result->isValid()) {\n $this->_redirect($this->getUrl());\n }\n\n $errors['username'] = 'Your login details were invalid';\n }\n }\n }\n\n // setup hash\n $this->initHash();\n\n $this->view->errors = $errors;\n $this->view->redirect = $redirect;\n }" ]
[ "0.7395793", "0.68597186", "0.6719834", "0.6717994", "0.6570512", "0.6562267", "0.6526539", "0.6480429", "0.6467411", "0.64668715", "0.6466571", "0.64567727", "0.6449607", "0.64067537", "0.64016044", "0.6377699", "0.6357113", "0.6333054", "0.6302936", "0.6278311", "0.6242418", "0.6213252", "0.61979085", "0.6177964", "0.6165417", "0.613427", "0.6128147", "0.61237025", "0.61167645", "0.6077385" ]
0.77438414
0
check if we are stull logged in on the remote cloud
public function isLoggedIn(){ if(!$this->connected){ return false; } return $this->apiCall('checklogin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_authenticated(){\n\t\tif(isset($_SESSION['uid']) && $_SESSION['ip'] == $_SERVER['REMOTE_ADDR']){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "public function isLogged()\n {\n if (!isset($_SESSION['userID'])) {\n return false;\n }\n $this->userID = $_SESSION['userID'];\n $this->vcsLogin = $_SESSION['vcsLogin'];\n $this->vcsPasswd = $_SESSION['vcsPasswd'];\n $this->vcsLang = $_SESSION['lang'];\n $this->project = $_SESSION['project'];\n $this->anonymousIdent = $_SESSION['anonymousIdent'];\n $this->isAnonymous = $_SESSION['isAnonymous'];\n $this->haveKarma = $_SESSION['haveKarma'];\n $this->email = $_SESSION['email'];\n\n $this->authService = ( isset($_SESSION['authService']) ) ? $_SESSION['authService'] : false;\n $this->authServiceID = ( isset($_SESSION['authServiceID']) ) ? $_SESSION['authServiceID'] : false;\n\n ProjectManager::getInstance()->setProject($this->project);\n\n $this->userConf = isset($_SESSION['userConf'])\n ? $_SESSION['userConf']\n : $this->defaultConf;\n\n $this->updateLastConnect();\n\n return true;\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "public function loginExists() {\n return (bool) $this->local_account;\n }", "private function isLoggedIn()\n {\n $response = $this->httpRequest(\n 'GET',\n 'https://sceneaccess.eu/browse',\n array(),\n $this->token\n );\n\n $titleElement = $this->DOMDocumentXPathQuery($response, '//html/head/title');\n\n if (preg_match('/SceneAccess \\| Login/', $titleElement->item(0)->nodeValue)) {\n return false;\n } else {\n /* We already have the /browse, might aswell make it useful */\n $this->getTorrentsFromHTML($response);\n }\n\n return true;\n }", "protected function isLogin()\n {\n $skey = \\Web\\Config\\Auth::$prefix . $this->sessionId;\n if (\\Web\\Config\\Auth::$username != $this->gdata($skey)) {\n return false;\n }else{\n $this->gexpire($skey, \\Web\\Config\\Auth::$expire);\n return true;\n }\n }", "static public function isLoggedIn(){\n \treturn (self::getInstance()->getId()>1);\n }", "public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }", "public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}", "public function isLoggedIn() {\n $cookie = $this->login();\n return $cookie != NULL;\n }", "public function isCurrentlyLoggedIn() {}", "function is_authorized() {\n global $logged;\n global $login_netid;\n if (!$logged)\n return false;\n if (empty($login_netid))\n return false;\n return true;\n}", "function is_login()\n {\n }", "public function is_logged_in() {\n\n\t}", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function drupalIsLoggedIn()\n {\n // TODO: implement without the client/crawler\n }", "function loggedin() {return $this->login_state!=0;}", "public function isLogged(){\n\t\tif(isset($_SESSION['ccUser']) && !empty($_SESSION['ccUser'])){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isLogged(){\n\t\tif(isset($_SESSION['ccUser']) && !empty($_SESSION['ccUser'])){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }", "public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}", "function logged_in() {\r\n\t\treturn isset($_SESSION[\"admin_id\"]);\r\n\t}", "public function isLoggedIn()\n {\n return true;\n }", "public function ownerLoggedIn()\n {\n // For now just check session for an email and owner type\n if ( empty($_SESSION['email']) || $_SESSION['type'] != 'owner')\n return false;\n else\n return true;\n\n }", "function is_logged_in()\n\t{\n\t\treturn require_login();\n\t}", "public static function isConnected() {\n return isset($_SESSION['userid']);\n }", "public function customerIsAlreadyLoggedIn()\n {\n return (bool)$this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_AUTH);\n }", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "public function isLoggedIn();" ]
[ "0.71268004", "0.7119378", "0.70059866", "0.6981071", "0.69660866", "0.6896745", "0.6894364", "0.6881728", "0.6871433", "0.6856603", "0.68371224", "0.68370557", "0.68236864", "0.681719", "0.68129855", "0.68038446", "0.6790503", "0.67749", "0.6761543", "0.6761543", "0.6757974", "0.6756113", "0.6730257", "0.6709044", "0.67039436", "0.66990834", "0.6695813", "0.6685224", "0.6685065", "0.668442" ]
0.73428464
0
Update Status all sample in project
public function updateStatus(int $projectId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_status();", "public function run()\n {\n $status = new ProjectStatus();\n $status->alias = 'new';\n $status->name = 'NEW';\n $status->save();\n\n $status = new ProjectStatus();\n $status->alias = 'pending';\n $status->name = 'PENDING';\n $status->save();\n\n $status = new ProjectStatus();\n $status->alias = 'failed';\n $status->name = 'FAILED';\n $status->save();\n\n $status = new ProjectStatus();\n $status->alias = 'done';\n $status->name = 'DONE';\n $status->save();\n }", "public function can_change_status_properly()\n {\n $project = factory(Project::class)->create();\n $statuses = [\n Project::STATUS_ON_HOLD => 'onHoldProject',\n Project::STATUS_FINISHED => 'finishProject',\n Project::STATUS_RUNNING => 'runProject',\n Project::STATUS_PLANNED => 'planProject',\n Project::STATUS_CANCEL => 'cancelProject',\n ];\n\n foreach ($statuses as $status => $method) {\n $project->{$method}();\n $this->assertDatabaseHas('projects', [\n 'id' => $project->id,\n 'status' => $status,\n ]);\n }\n }", "public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }", "private function updateTutorialStates(){\n $this->tutorialModel->updateRaisingFundTutorials();\n $this->tutorialModel->updatePrepareTutorials();\n }", "public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}", "public function updateIndex() {\n\t\t$projectsConfig = $this->api->getJSONConfig();\n\n\t\tforeach ( $projectsConfig as $project => $config ) {\n\t\t\t$projectsConfig[$project]['Updated'] = $this->api->getBotLastEditDate( $config['Report'] );\n\t\t}\n\n\t\t// Generate and return wikitext.\n\t\t$output = $this->twig->render( 'index.wikitext.twig', [\n\t\t\t'projects' => $projectsConfig,\n\t\t\t'configPage' => $this->api->getWikiConfig()['config'],\n\t\t] );\n\n\t\t$this->api->setText(\n\t\t\t$this->api->getWikiConfig()['index'],\n\t\t\t$output,\n\t\t\t$this->i18n->msg( 'edit-summary' )\n\t\t);\n\t}", "public function updated(Project $project)\n {\n $this->createActivity($project,'project_updated');\n }", "public function changeStatus()\n {\n }", "public function testUpdateProject()\n {\n echo \"\\nTesting project update...\";\n $id = \"P5334183\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('prj_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function massStatusAction()\n {\n $curriculumdocIds = $this->getRequest()->getParam('curriculumdoc');\n if (!is_array($curriculumdocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Please select curriculum docs.')\n );\n } else {\n try {\n foreach ($curriculumdocIds as $curriculumdocId) {\n $curriculumdoc = Mage::getSingleton('bs_curriculumdoc/curriculumdoc')->load($curriculumdocId)\n ->setStatus($this->getRequest()->getParam('status'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d curriculum docs were successfully updated.', count($curriculumdocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was an error updating curriculum docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function respon(){\n //update 'status'\n }", "public function testSetStatus()\n {\n $this->todo('stub');\n }", "public function run()\n {\n $statuses = [\n ['name' => 'On track', 'value' => 'on-track', 'color' => '#00423f', 'bg' => '#00d4c8'],\n ['name' => 'At risk', 'value' => 'at-risk', 'color' => '#574500', 'bg' => '#ffd100'],\n ['name' => 'On track', 'value' => 'off-track', 'color' => '#fff', 'bg' => '#fb5779'],\n ];\n\n Status::insert($statuses);\n }", "function updateStatus(){\n\t\t$this->setPost();\n\n\t\t$postData = $_POST;\n\n\t\tif($postData->status_id == 1){\n\t\t\t$updateData = array('status_id' => 2);\n\t\t}else{\n\t\t\t$updateData = array('status_id' => 1);\n\t\t}\n\n\t\t$where = array('id' => $postData->id);\n\n\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t$response = array('status' => TRUE, 'message' => 'Document status updated successfully.');\n\n\t\techo json_encode($response);\n\t}", "public function projectTaskStatusUpdate(){\r\n\t\t//fetch activity feed list\r\n\t\t$post = $this->input->post(null, true);\r\n\t\t$parent_id = $post['pid'];\r\n\t\t$task_id = $post['tid'];\r\n\t\t$status_id = $post['stat'];\r\n\t\t$completed_time = gmdate('Y-m-d H:i:s');\r\n\r\n\t\t//$task = new Task();\r\n\t\t$data = array('status_id' => $status_id, 'completed_date'=>$completed_time);\r\n\t\t$this->db->where(\"parent_id\", $parent_id);\r\n\t\t$this->db->where(\"task_id\", $task_id);\r\n\t\t$this->db->update(\"sc_tasks\", $data);\r\n\r\n\t}", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['t']) && !empty($data['list'])) $result = $this->_bid->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The bid status has been changed.': 'ERROR: The bid status could not be changed.';\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public function run()\n {\n $statuses = [\n ['name' => \"active\", 'code' => \"active\",'is_default' => 1],\n ['name' => \"inactive\", 'code' => \"inactive\",'is_default' => 0]\n ];\n foreach ($statuses as $status) {\n Status::create($status);\n }\n }", "public function updateStatusOnNewDay() {\n // Update advs\n UIAdv::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update advgroups\n UIAdvGroup::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update campaign\n UICampaign::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update project\n UIProject::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n }", "function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "public function massStatusAction()\n {\n $coursedocIds = $this->getRequest()->getParam('coursedoc');\n if (!is_array($coursedocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Please select course docs.')\n );\n } else {\n try {\n foreach ($coursedocIds as $coursedocId) {\n $coursedoc = Mage::getSingleton('bs_coursedoc/coursedoc')->load($coursedocId)\n ->setStatus($this->getRequest()->getParam('status'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d course docs were successfully updated.', count($coursedocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was an error updating course docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function testGetStatus()\n {\n $this->todo('stub');\n }", "public function updateStatus($params)\r\n {\r\n }", "function updates($details_obj,$project){\n\t\t$project->all_versions = $details_obj->project->all_versions;\n\t\t$project->testVersion = $details_obj->project->testVersion;\n\t\t$project->pomPath = $details_obj->project->pomPath;\n\t\tif ($project->pomPath==\"\"){\n\t\t\t$str_tmp_pom_path = \"\";\n\t\t}else{\n\t\t\t$str_tmp_pom_path = \"\\\\\".$project->pomPath;\n\t\t}\n\t\t$project->full_pomPath = $project->userProjectRoot.\"\\\\\".$project->gitName.$str_tmp_pom_path;\n\t\t$project->issue_tracker_product_name = $details_obj->project->issue_tracker_product_name;\n\t\t$project->issue_tracker_url = $details_obj->project->issue_tracker_url;\n\t\t$project->issue_tracker = $details_obj->project->issue_tracker;\n\t\t$project->path_online = $project->runingRoot.\"\\\\path.txt\";\n\t\t$project = update_project_list($project,\"start_offline\",true);\n\t\tupdate_project_details($project);\n\t\treturn $project;\t\t\n\t}", "function changeStatus() {\n\n $newStatus = $_GET['newstatus'];\n\n foreach ($_POST['status'] as $key => $val) {\n \n DB::update(CFG::$tblPrefix . \"ticket\", array(\"status\" => $newStatus), \" id=%d \", $key);\n \n }\n }", "public function updateUrgencyStatuses() {\n\n\n $deadlineOverdue = date('Y-m-d H:i:s', strtotime('-' . Configure::read('TICKET.OVERDUE_DAYS') . ' days'));\n $overdueTickets = $this->getPendingTicketsByAge($deadlineOverdue);\n\n foreach ($overdueTickets as $i => $overdueTicket) {\n\n $this->id = $overdueTicket['Ticket']['ticket_id'];\n $overdueTicket['Ticket']['status'] = 'Overdue';\n $this->save($overdueTicket, array('validate' => false, 'modified' => false, 'callbacks' => false));\n }\n\n\n $deadlineUrgend = date('Y-m-d H:i:s', strtotime('-' . Configure::read('TICKET.URGEND_DAYS') . ' days'));\n $urgendTickets = $this->getPendingTicketsByAge($deadlineUrgend, array('New', 'Requested'));\n\n foreach ($urgendTickets as $i => $urgendTicket) {\n\n $this->id = $urgendTicket['Ticket']['ticket_id'];\n $urgendTicket['Ticket']['status'] = 'Urgend';\n $this->save($urgendTicket, array('validate' => false, 'modified' => false, 'callbacks' => false));\n }\n\n }", "public function update() {\r\n\r\n\t}", "private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "public static function updateAll()\r\n\t{\r\n\t}" ]
[ "0.63575876", "0.604334", "0.600676", "0.5991699", "0.59541637", "0.57963043", "0.5714366", "0.5692025", "0.56891114", "0.5672661", "0.56637764", "0.564574", "0.5632518", "0.5630245", "0.561199", "0.5597773", "0.55701053", "0.5565452", "0.5531552", "0.5493782", "0.5483481", "0.547612", "0.5475941", "0.5460983", "0.5455706", "0.545288", "0.54527885", "0.54492575", "0.543924", "0.5438392" ]
0.6218852
1
Find Sample Active Apply In Project
public function findActiveSampleInProject(int $projectId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOneClickApplyProfiles();", "public function isApplied();", "public function getOneClickApply();", "function rawpheno_function_project() {\n $sql = \"SELECT FROM pheno_project_cvterm\";\n $project_count = db_query($sql)\n ->rowCount();\n\n return ($project_count <= 0) ? 0 : 1;\n}", "public function getAppliesTo()\n\t{\n\t\t$coveredElements = array(\n\t\t\t'general'\n\t\t);\n\n\t\treturn $coveredElements;\n\t}", "public function getAppliesTo()\n\t{\n\t\t$coveredElements = array(\n\t\t\t'param'\n\t\t);\n\n\t\treturn $coveredElements;\n\t}", "public function getGathercontentProject();", "private function term_project() {\n $matched = false;\n $project = array();\n\n $line = $this->_lines->cur();\n\n // special default project zero, for orphaned tasks and the like\n if ($this->_index == 0) {\n $text = \\tpp\\lang('orphaned');\n $note = $this->empty_note();\n $matched = true;\n $line = '';\n\n } elseif (preg_match($this->term['project'], $line , $match) > 0) {\n $this->_lines->move();\n\n $text = $match[1];\n $note = $this->term_note();\n $matched = true;\n }\n\n if ($matched) {\n $project = (object) array('type' => 'project', 'text' => $text, 'index' => $this->_index, 'note' => $note, 'raw' => $line);\n $this->_index++;\n\n $project->children = $this->match_any(array('term_task', 'term_info', 'term_empty'), array());\n return $project;\n } else {\n return false;\n }\n }", "public function getInstanceApply()\n {\n return $this->get(self::_INSTANCE_APPLY);\n }", "public function perProjectAction() {\n//\t\t\t\tROUND(sum(f.allowed),2) AS allowed, ROUND(sum(f.used),2) AS used, ROUND(sum(f.progress),2) AS in_progress, ROUND(sum(f.rest),2) AS rest\n//\t\t\t\tFROM (\n//\t\t\t\t\tSELECT a.target_id AS target_id, up.target_name AS target_name, a.category_id AS category_id, a.planned AS planned,\n//\t\t\t\t\tIFNULL(a.allowed, 0) AS allowed, IFNULL(up.used, 0) AS used, IFNULL(up.progress, 0) AS progress,\n//\t\t\t\t\t(IFNULL(a.allowed, 0) - IFNULL(up.used,0) - IFNULL(up.progress,0)) AS rest\n//\t\t\t\t\tFROM (\n//\t\t\t\t\t\tSELECT budgets.target_id AS target_id, categories.id AS category_id, categories.planned AS planned, sum(budgets_data.allowed) AS allowed\n//\t\t\t\t\t\tFROM budgets\n//\t\t\t\t\t\tLEFT JOIN budgets_data ON budgets.id = budgets_data.budget_id\n//\t\t\t\t\t\tLEFT JOIN categories ON budgets_data.category_id = categories.id\n//\t\t\t\t\t\tWHERE budgets.type = 1\n//\t\t\t\t\t\t\tAND budgets.id IN (\n//\t\t\t\t\t\t\t\tSELECT max(budgets.id) FROM budgets GROUP BY budgets.month, budgets.target_id ORDER BY budgets.id asc\n//\t\t\t\t\t\t\t)\n//\t\t\t\t\t\tGROUP BY categories.id, budgets.target_id, categories.planned) AS a\n//\t\t\t\t\tLEFT JOIN (\n//\t\t\t\t\t\tSELECT u.target_id AS target_id, u.target_name AS target_name, u.category_id AS category_id, IFNULL(u.used, 0) AS used, IFNULL(p.progress, 0) AS progress\n//\t\t\t\t\t\tFROM (\n//\t\t\t\t\t\t\tSELECT points.id AS target_id, nets.name AS target_name, categories.id AS category_id, ROUND(sum(requests_points.amount),2) AS used\n//\t\t\t\t\t\t\tFROM requests, requests_points, points, nets, categories\n//\t\t\t\t\t\t\tWHERE requests_points.request_id = requests.id\n//\t\t\t\t\t\t\t\tAND requests_points.point_id = points.id\n//\t\t\t\t\t\t\t\tAND points.project = 1\n//\t\t\t\t\t\t\t\tAND requests.category_id = categories.id\n//\t\t\t\t\t\t\t\tAND requests.status = 10\n//\t\t\t\t\t\t\tGROUP BY categories.id, points.id, categories.planned) AS u\n//\t\t\t\t\t\tLEFT JOIN(\n//\t\t\t\t\t\t\tSELECT points.id AS target_id, categories.id AS category_id, ROUND(sum(requests_points.amount),2) AS progress\n//\t\t\t\t\t\t\tFROM requests, requests_points, points, categories\n//\t\t\t\t\t\t\tWHERE requests_points.request_id = requests.id\n//\t\t\t\t\t\t\t\tAND requests_points.point_id = points.id\n//\t\t\t\t\t\t\t\tAND points.project = 1\n//\t\t\t\t\t\t\t\tAND requests.category_id = categories.id\n//\t\t\t\t\t\t\t\tAND requests.status <> 10\n//\t\t\t\t\t\t\tGROUP BY categories.id, points.id, categories.planned) AS p\n//\t\t\t\t\t\tON u.target_id = p.target_id AND u.category_id = p.category_id) AS up\n//\t\t\t\t\tON a.target_id = up.target_id AND a.category_id = up.category_id) AS f\n//\t\t\t\tGROUP BY f.planned, f.target_id\";\n\t\t$sql = \"SELECT a.target_id AS target_id, a.planned AS planned,\n\t\t\t\t\tROUND(IFNULL(SUM(a.allowed),0),2) AS allowed, ROUND(IFNULL(up.used,0),2) AS used, ROUND(IFNULL(up.in_progress,0),2) AS in_progress,\n\t\t\t\t\tROUND(IFNULL(SUM(a.allowed),0) - IFNULL(up.used,0) - IFNULL(up.in_progress,0), 2) AS rest\n\t\t\t\tFROM budget_per_project_allowed AS a\n\t\t\t\tLEFT OUTER JOIN (\n\t\t\t\t\tSELECT u.target_id AS target_id, c.planned AS planned, SUM(ifnull(u.used, 0)) AS used, SUM(ifnull(p.in_progress, 0)) AS in_progress\n\t\t\t\t\tFROM budget_per_project_used AS u\n\t\t\t\t\tLEFT JOIN budget_per_project_in_progress AS p ON p.target_id = u.target_id AND p.category_id = u.category_id, categories AS c\n\t\t\t\t\tWHERE u.category_id = c.id\n\t\t\t\t\tGROUP BY u.target_id, c.planned\n\t\t\t\t) AS up ON a.target_id = up.target_id AND a.planned = up.planned\n\t\t\t\tGROUP BY a.target_id, a.planned\";\n\n\t\t$result = $this->query($sql);\n\t\t$rows = $result->fetchAll();\n\n\t\t$response = new JsonResponse();\n\t\t$response->success = true;\n\t\t$response->setData($this->root, $rows);\n\t\t$response->total = count($rows);\n\n\t\techo $response;\n\t}", "public function getApplied(): array\n {\n return $this->applied;\n }", "public function applies() {\n return IWJ_Applies::instance();\n }", "function getCommonProvisions();", "public function get_projects(){\n\n $projects = project::latest()->get();\n\n $student = \\Auth::user()->Student;\n\n $collection = collect();\n $tasks = task::all();\n $results = \"\";\n foreach ($tasks as $task) {\n $match = 0;\n foreach ($task->skill()->get() as $skill) {\n if ($student->user()->get()->first()->skill()->get()->contains($skill->id)) {\n $match++;\n //dd($task);\n }\n }\n if($task->skill()->count()!=0){\n $match /= $task->skill()->count();}\n else{\n $match = 0; \n }\n //$match = round($match);\n $task->setMatch($match);\n $collection->push($task);\n $results = $results . $task->id . $task->skill()->get() . \" \\n\";\n }\n $tasks = $collection->sortByDesc(function ($task, $key) {\n $match = $task->getMatch();\n //$task->setMatch((string) $match . \"%\");\n return $match;\n });\n\n //$tasks = task::all()->where('status','=','0');// = not working on server\n // $tasks = task::all()->where('status',0);\n \n return view('project.freelancer',compact('tasks'));\n\n }", "public function testApply() {\n\t\t$group = new Group();\n\t\t$group->add($this->_paths['testClassTest']);\n\t\t$this->report->group = $group;\n\n\t\tComplexity::apply($this->report, $group->tests());\n\n\t\t$results = array_pop($this->report->results['filters'][$this->_paths['complexity']]);\n\t\t$expected = [$this->_paths['testClass'] => $this->_metrics];\n\t\t$this->assertEqual($expected, $results);\n\n\t\tFilters::clear($group);\n\t}", "public function hasExperiment(){\n return $this->_has(2);\n }", "public function matchingApplicationContextConditionsDataProvider() {}", "public function get_project_all(){\n }", "function dwsim_flowsheet_completed_proposals_all()\n{\n\t$output = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 3);\n\t$query->orderBy('actual_completion_date', 'DESC');\n\t//$query->condition('is_completed', 1);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$output .= \"Work has been completed for the following flow sheets. We welcome your contributions. For more details, please visit \".l(\"https://dwsim.fossee.in/flowsheeting-project\",\"https://dwsim.fossee.in/flowsheeting-project\", array('attributes' => array('target' => '_blank'))).\"<br>\".\"<h4>\".\"If you are looking for flowsheeting project ideas, \".l(\"click here\",\"https://dwsim.fossee.in/flowsheeting-ideas\",array('attributes' => array('class' => array('flash_content'), 'target' => '_blank'))).\"</h4>\".\"<hr>\";\n\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$output .= \"Total number of completed flowsheets: \" . $result->rowCount() . \"<br>\";\n\t\t$output .= \"Work has been completed for the following flow sheets. We welcome your contributions. For more details, please visit \".l(\"https://dwsim.fossee.in/flowsheeting-project\",\"https://dwsim.fossee.in/flowsheeting-project\", array('attributes' => array('target' => '_blank'))).\"<br>\".\"<h4>\".\"If you are looking for flowsheeting project ideas, \".l(\"click here\",\"https://dwsim.fossee.in/flowsheeting-ideas\",array('attributes' => array('class' => array('flash_content'), 'target' => '_blank'))).\"</h4>\".\"<hr>\";\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$completion_date = date(\"Y\", $row->actual_completion_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\tl($row->project_title, \"flowsheeting-project/dwsim-flowsheet-run/\" . $row->id, array('attributes' => array('title' => 'This is a zip file containing a pdf (abstract) and a dwxml/dwxmz file which is the DWSIM flow sheet which is to be viewed by right clicking on the file and opening with DWSIM.'))),\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$completion_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year of Completion'\n\t\t);\n\t\t$output .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $output;\n}", "function reportResultsPerProject($ReportCondition = '1')\r\n{\r\n return reportPerProject('Result',$ReportCondition);\r\n}", "public function getCurrentApplicants()\n {\n $builder = $this->createQueryBuilder('a');\n $subQueryBuilder = $this->_em->createQueryBuilder();\n $subQuery = $subQueryBuilder\n ->select('apl')\n ->from('MentorshipMasterBundle:Application', 'apl')\n ->where('apl.applicant = a')\n ->andWhere('apl.finishedAt IS NULL')\n ->getQuery();\n $query = $builder\n ->where($builder->expr()->exists($subQuery->getDQL()))\n ->getQuery();\n $cacheId = self::getCacheId(self::CACHE_ID_ACTIVE_APPLICANTS_SET);\n $query->useResultCache(true, 3600, $cacheId);\n return $query->getResult();\n }", "function stage_get_features_status()\n{\n $features = stage_get_default('features');\n $status = array();\n\n foreach ($features as $feature => $settings) {\n $status[ $feature ] = stage_is_feature_active($feature);\n }\n\n return (object) $status;\n}", "public static function active(): array {\n\n // Find the states we don't want.\n $rejection_states_text_ids = [\n 'reject_journal_title',\n 'reject_init_review',\n 'reject_bm_review',\n 'reject_full_review',\n 'full_end',\n ];\n $storage = \\Drupal::entityTypeManager()->getStorage('taxonomy_term');\n $query = $storage->getQuery()->accessCheck(FALSE);\n $query->condition('vid', 'states');\n $query->condition('field_text_id', $rejection_states_text_ids, 'IN');\n $rejection_state_ids = $query->execute();\n\n // Find the decisions we don't want.\n $unwanted_decisions = [\n 'Not cited',\n 'Cited (citation only)',\n 'Cited (legacy)',\n 'Text approved',\n ];\n $query = $storage->getQuery()->accessCheck(FALSE);\n $query->condition('vid', 'board_decisions');\n $query->condition('name', $unwanted_decisions, 'IN');\n $unwanted_decision_ids = $query->execute();\n\n // Create the query.\n $query = \\Drupal::database()->select('ebms_article', 'article');\n $query->addField('article', 'id');\n $query->addExpression('CONVERT(article.source_id, UNSIGNED INTEGER)', 'pmid');\n $query->join('ebms_state', 'state', 'state.article = article.id');\n $query->condition('state.current', 1);\n $query->condition('state.value', $rejection_state_ids, 'NOT IN');\n $query->join('taxonomy_term__field_text_id', 'state_text_id', 'state_text_id.entity_id = state.value');\n $query->leftJoin('ebms_state__decisions', 'state_decisions', 'state_decisions.entity_id = state.id');\n $group = $query->orConditionGroup()\n ->condition('state_decisions.decisions_decision', $unwanted_decision_ids, 'NOT IN')\n ->isNull('state_decisions.decisions_decision');\n $query->condition($group);\n $query->orderBy('pmid');\n $active = [];\n foreach ($query->execute() as $row) {\n $active[$row->id] = $row->pmid;\n }\n return $active;\n }", "function getProjects() {\n\n\tglobal $db;\n\treturn $db->getProjectsByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function scopeIsPartItem($query, $apply = true)\n {\n if ( !$apply )\n return $query;\n\n return $query->where(function ($query) {\n $query->where( 'procurement_type', 'assembly');\n $query->orWhere('procurement_type', 'purchase');\n $query->orWhere('procurement_type', 'none');\n });\n }", "public function scenarios(): array;", "private function getJobAwardedStage()\n {\n return $this->model->whereCompanyId($this->scope->id())\n ->whereActive(1)\n ->first();\n }", "public function getFilterMatches()\n\t{\n\t\tif ($this->filter_changes !== null) return $this->filter_changes;\n\n\t\t$filters = $this->getApplicableFilters();\n\t\t$all_agents = App::getEntityRepository('DeskPRO:Person')->getAgents();\n\t\t$team2agents = App::getEntityRepository('DeskPRO:AgentTeam')->getTeamToAgentsMap();\n\n\t\t$old_dep_id = null;\n\t\t$new_dep_id = null;\n\t\tif ($dep_change = $this->tracker->getChangedProperty('department')) {\n\t\t\t$old_dep_id = $dep_change['old'];\n\t\t\tif ($old_dep_id) {\n\t\t\t\t$old_dep_id = $old_dep_id->getId();\n\t\t\t}\n\t\t\t$new_dep_id = $dep_change['new'];\n\t\t\tif ($new_dep_id) {\n\t\t\t\t$new_dep_id = $new_dep_id->getId();\n\t\t\t}\n\t\t}\n\n\t\t$orig_ticket = $this->tracker->getOriginalTicket();\n\t\t$new_ticket = $this->tracker->getTicket();\n\n\t\t$changed = array();\n\n\t\t$scope_counts = 0;\n\t\t$time = microtime(true);\n\n\t\tforeach ($filters as $filter) {\n\n\t\t\t// If the filter is the recycle bin and we are nuking the ticket,\n\t\t\t// then dont show it entering the list\n\t\t\tif ($filter->sys_name == 'archive_deleted' && $this->tracker->isExtraSet('is_physical_delete')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$changed[$filter->id] = array(\n\t\t\t\t'add' => array(),\n\t\t\t\t'del' => array(),\n\t\t\t\t'orig_match' => array(),\n\t\t\t\t'new_match' => array(),\n\t\t\t\t'filter' => $filter\n\t\t\t);\n\n\t\t\t$this->logMessage(\"Filter {$filter['id']} {$filter['title']}\");\n\n\t\t\t$agent_scopes = null;\n\n\t\t\tif ($filter->is_global) {\n\t\t\t\t$agent_scopes = $all_agents;\n\t\t\t} else if ($filter->agent_team) {\n\t\t\t\tif (isset($team2agents[$filter->agent_team->id])) {\n\t\t\t\t\t$agent_scopes = array();\n\t\t\t\t\tforeach ($team2agents[$filter->agent_team->id] as $id) {\n\t\t\t\t\t\tif (isset($all_agents[$id])) $agent_scopes[] = $all_agents[$id];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ($filter->person) {\n\t\t\t\t$agent_scopes = array($filter->person);\n\t\t\t}\n\n\t\t\t$affected_agent_ids = array();\n\t\t\tif ($agent_scopes) {\n\t\t\t\tforeach ($agent_scopes as $a) {\n\t\t\t\t\t$affected_agent_ids[] = $a->getId();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->logMessage(\"-- Affected agents: \" . implode(', ', $affected_agent_ids));\n\n\t\t\tif (!$agent_scopes) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($agent_scopes as $agent) {\n\n\t\t\t\t$agent->loadHelper('Agent');\n\t\t\t\t$agent->loadHelper('AgentTeam');\n\t\t\t\t$agent->loadHelper('AgentPermissions');\n\t\t\t\t$agent->loadHelper('PermissionsManager');\n\n\t\t\t\t$reset_status = false;\n\t\t\t\tif ($filter->sys_name) {\n\t\t\t\t\t// System filters are special in that we ignore status/hold\n\t\t\t\t\t// for notifications\n\t\t\t\t\t$searcher = $filter->getSearcher(array(\n\t\t\t\t\t\tarray('type' => 'status', 'op' => 'ignore'),\n\t\t\t\t\t\tarray('type' => 'hidden_status', 'op' => 'ignore'),\n\t\t\t\t\t\tarray('type' => 'is_hold', 'op' => 'ignore')\n\t\t\t\t\t));\n\n\t\t\t\t\t// Reset because we have to re-run to get proper result for add/del lists\n\t\t\t\t\t$reset_status = true;\n\t\t\t\t} else {\n\t\t\t\t\t$searcher = $filter->getSearcher();\n\t\t\t\t}\n\t\t\t\t$searcher->setPersonContext($agent);\n\n\t\t\t\t$orig_match_failterm = null;\n\t\t\t\t$new_match_failterm = null;\n\n\t\t\t\tif ($dep_change) {\n\t\t\t\t\tif (!$this->tracker->isNewTicket() && !$agent->AgentPermissions->isDepartmentAllowed($old_dep_id)) {\n\t\t\t\t\t\t$orig_match = false;\n\t\t\t\t\t\t$orig_match_failterm = 'ticket.department_id';\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!$agent->AgentPermissions->isDepartmentAllowed($new_dep_id)) {\n\t\t\t\t\t\t$new_match = false;\n\t\t\t\t\t\t$new_match_failterm = 'ticket.department_id';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($orig_match_failterm === null) {\n\t\t\t\t\tif ($this->tracker->isNewTicket()) {\n\t\t\t\t\t\t// there is no such thing as an original match with a new ticket\n\t\t\t\t\t\t$orig_match = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$orig_match = $searcher->doesTicketMatch($orig_ticket, 'orig_match', $orig_match_failterm);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($new_match_failterm === null) {\n\t\t\t\t\t$new_match = $searcher->doesTicketMatch($new_ticket, null, $new_match_failterm);\n\t\t\t\t}\n\n\t\t\t\tif ($orig_match && $agent->PermissionsManager->TicketChecker->canView($orig_ticket)) {\n\t\t\t\t\t$changed[$filter->id]['orig_match'][] = $agent;\n\t\t\t\t}\n\t\t\t\tif ($new_match && $agent->PermissionsManager->TicketChecker->canView($new_ticket)) {\n\t\t\t\t\t$changed[$filter->id]['new_match'][] = $agent;\n\t\t\t\t}\n\n\t\t\t\tif ($reset_status) {\n\t\t\t\t\t$searcher = $filter->getSearcher();\n\t\t\t\t\t$searcher->setPersonContext($agent);\n\n\t\t\t\t\tif ($this->tracker->isNewTicket()) {\n\t\t\t\t\t\t$orig_match = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$orig_match = $searcher->doesTicketMatch($orig_ticket, 'orig_match', $orig_match_failterm);\n\t\t\t\t\t}\n\t\t\t\t\t$new_match = $searcher->doesTicketMatch($new_ticket, null, $new_match_failterm);\n\t\t\t\t}\n\n\t\t\t\tif (!$orig_match) {\n\t\t\t\t\t$this->logMessage(\"-- Orig failed term: $orig_match_failterm\");\n\t\t\t\t}\n\t\t\t\tif (!$new_match) {\n\t\t\t\t\t$this->logMessage(\"-- New failed term: $new_match_failterm\");\n\t\t\t\t}\n\n\t\t\t\tif (!$orig_match AND !$new_match) {\n\t\t\t\t\t$this->logMessage(\"-- Agent Scope {$agent->id}: Nothing changed (both no-match)\");\n\t\t\t\t} else if ($orig_match AND $new_match) {\n\t\t\t\t\t$this->logMessage(\"-- Agent Scope {$agent->id}: Nothing changed (both match)\");\n\t\t\t\t} else if ($orig_match AND !$new_match) {\n\t\t\t\t\t$this->logMessage(\"-- Agent Scope {$agent->id}: Removed from list\");\n\t\t\t\t\t$changed[$filter->id]['del'][] = $agent;\n\t\t\t\t} else if (!$orig_match AND $new_match) {\n\t\t\t\t\t$this->logMessage(\"-- Agent Scope {$agent->id}: Added to list\");\n\t\t\t\t\t$changed[$filter->id]['add'][] = $agent;\n\t\t\t\t}\n\n\t\t\t\t$scope_counts++;\n\t\t\t}\n\t\t}\n\n\t\t$this->filter_changes = array();\n\t\tforeach ($changed as $fid => $changes) {\n\t\t\tif ($changes['orig_match'] || $changes['new_match']) {\n\t\t\t\t$this->filter_changes[$fid] = $changes;\n\t\t\t}\n\t\t}\n\n\t\t$total_time = microtime(true) - $time;\n\n\t\t$this->logMessage('Found ' . count($this->filter_changes) . ' matches');\n\t\t$this->logMessage(\"Full check done in iterations: \" . $scope_counts . \" in time \" . sprintf('%.5f', $total_time) . \" seconds\");\n\t\t$this->logMessage(\\Orb\\Util\\Util::debugVar($this->filter_changes));\n\n\t\treturn $this->filter_changes;\n\t}", "public function getAppliesTo()\n\t{\n\t\t$coveredElements = array(\n\t\t\t'input'\n\t\t);\n\n\t\treturn $coveredElements;\n\t}", "public function getAppliesTo()\n\t{\n\t\t$coveredElements = array(\n\t\t\t'input'\n\t\t);\n\n\t\treturn $coveredElements;\n\t}" ]
[ "0.52683234", "0.50888425", "0.5032004", "0.49825245", "0.4849124", "0.4844841", "0.4811023", "0.4760454", "0.4751761", "0.47218826", "0.47097147", "0.47039616", "0.4655123", "0.45806608", "0.45697522", "0.4563264", "0.45605454", "0.45381746", "0.44945025", "0.44728136", "0.44606066", "0.44507796", "0.44405916", "0.4434632", "0.44235733", "0.44216126", "0.44021127", "0.44012198", "0.4383901", "0.4383901" ]
0.5821371
0
Check if file of the same deployed path exists in package
private function isFileExistsInPackage($filePath, Package $package) { /** @var PackageFile $file */ foreach ($package->getFiles() as $file) { if ($file->getDeployedFileName() === $filePath) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function localFileExists()\n {\n return file_exists($this->GetRealPath());\n }", "function neosIsInstalled(): bool\n{\n return test('[ -f {{deploy_path}}/shared/Configuration/Settings.yaml ]');\n}", "public function is_exist_file() {\r\n\t\treturn file_exists( $this->get_path( 'file' ) );\r\n\t}", "public function file_exists($file);", "private function riddleFileExists()\n\t\t{\n\n\t\t\tif (FileSystem::exists(Settings::setting('riddle_location')) == false)\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "private function checkFilesPresent() {\n $store = $this->dataStoreGet(array('platform'));\n $server = (!empty($store) && isset($store['platform'])) ? $store['platform']['php_quantum']['SERVER'] : \\Drupal::request()->server->all();\n $files_exist = FALSE;\n $files_to_remove = array('CHANGELOG.txt', 'COPYRIGHT.txt', 'INSTALL.mysql.txt', 'INSTALL.pgsql.txt', 'INSTALL.txt', 'LICENSE.txt',\n 'MAINTAINERS.txt', 'README.txt', 'UPGRADE.txt', 'PRESSFLOW.txt', 'install.php',\n );\n\n foreach ($files_to_remove as $file) {\n $path = $server['DOCUMENT_ROOT'] . base_path() . $file;\n if (file_exists($path)) {\n $files_exist = TRUE;\n }\n }\n\n return $files_exist ? 1 : 0;\n }", "function getFileExists() {\n\t\treturn file_exists($this->getFilename());\n\t}", "function kfn_file_exists( $path ) {\r\n\tif ( defined( 'KFN_DIR_PATH' ) ) {\r\n\t\treturn file_exists( KFN_DIR_PATH . $path );\r\n\t}\r\n\r\n\treturn file_exists( plugin_dir_path( dirname( dirname( $path ) ) ) );\r\n}", "public function testIsVendorFileReturnsFalseIfFileIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorFile(__FILE__));\n }", "public function isFileExistsRemotely();", "function exists() {\n\t\treturn is_file($this->path);\n\t}", "public function testIsVendorFileReturnsTrueIfFileIsLocatedInVendorDirectory()\n {\n $this->assertTrue(VendorResources::isVendorFile($this->getVendorFilePath()));\n }", "public function isExists(){\n\t\treturn file_exists($this->getFullName());\n\t}", "public function check() {\n\t\treturn file_exists($this->getFilePath());\n\t}", "private function fileExists()\n {\n return $this->files->exists($this->path) ? new Exception(\"The class exists!\") : false;\n }", "public function testIsVendorFileReturnsFalseIfFileThatIsReferencedByFileObjectIsNotLocatedInVendorDirectory()\n {\n $this->assertFalse(VendorResources::isVendorFile(new \\SplFileInfo(__FILE__)));\n }", "function exists()\n {\n return is_file($this->getPath());\n }", "public static function filecheck($file)\n \t{\n \t\tif (CREATE_PACKAGE):\n\t \t\tif (!file_exists($file)):\n\t\t\t\tfopen($file, 'w') or die('can\\'t open file');\n\t\t\t\t//fclose($file);\n\t\t\tendif;\n\t\tendif;\n \t}", "static function fileExists()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::fileExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testIsVendorFileReturnsTrueIfFileThatIsReferencedByFileObjectIsLocatedInVendorDirectory()\n {\n $this->assertTrue(VendorResources::isVendorFile(new \\SplFileInfo($this->getVendorFilePath())));\n }", "public function hasFile(string $name): bool {}", "public function hasComposerFile()\n {\n return file_exists(sprintf('%s/composer.lock', $this->baseDirectory));\n }", "public function exists($file) {\n\t}", "public function fileExists($name);", "public function checkIfPackageExists()\n {\n if (is_dir($this->packagePath())) {\n throw new RuntimeException('Package already exists');\n }\n }", "private function checkIfExtFileExists($file){\n\t\t\t$b = @fopen($file, \"r\");\n\t\t\t@fclose($b);\n\t\t\treturn $b==true;\n\t\t}", "private function _checkFile( $fileName = false )\r\n\t{\r\n\t\tif( Configure::read() != 0 )\r\n\t\t{\r\n\t\t\t$fileName = str_replace( \"/\", \"\", $fileName );\r\n\t\t\t$fileName = str_replace( \"\\\\\", \"\", $fileName );\r\n\r\n\t\t\tif( file_exists( SERVICE_BROWSER_PATH . $fileName ) )\r\n\t\t\t{\r\n\t\t\t\treturn $fileName;\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public function exists(string $path, string $version): bool;", "function atkexists($type, $name)\n{\n\treturn file_exists(atkgetinclude($type, $name));\n}", "public function exists(){\n\t\t$fichName = $this->getPath();\n\t\treturn file_exists($fichName);\n\t}" ]
[ "0.6696969", "0.6673357", "0.6640315", "0.65828615", "0.65762126", "0.6548806", "0.6526441", "0.65192235", "0.65053487", "0.6492756", "0.64772654", "0.64634717", "0.6448921", "0.6436461", "0.64267933", "0.6424429", "0.642147", "0.64121205", "0.6405623", "0.6394189", "0.63828695", "0.6376648", "0.63655627", "0.63522065", "0.6334838", "0.6329876", "0.63240886", "0.63145113", "0.6312417", "0.6303434" ]
0.7132946
0
Provides test data for finding the date to pay salary
public function dataProviderSalary() { return [ [2018, 11, '2018-11-30'], [2018, 12, '2018-12-31'], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function computeSalary()\n {\n /**\n * Payments are done every 15th and 30th of every month\n * For 15th:\n * Day 1 to 14th of the month plus day 30 and 31st of the previous month\n * For 30th:\n * Day 15th to 29th\n */\n\n // check if today is the 15th or 30th / 28th for Feb\n $today = new \\DateTime();\n $day_today = $today->format( 'd' );\n $is_leap_year = intval( date('Y') ) % 4 == 0;\n\n // compute salary only on the 15th and the 30th\n if( $day_today == 15 ){\n // get teacher whose salary was not computed yet\n $teachers = ( new TeacherPivot )->getSalaryUnprocessedAsOf( $today->format('Y-m-d') );\n foreach( $teachers as $teacher ){\n $teacher->processDailyIncome();\n }\n }elseif( $day_today == 30 ){\n\n }elseif( $day_today == 28 && date('m') == 2 && !$is_leap_year ){\n\n }elseif( $day_today == 29 && date('m') == 2 && $is_leap_year ){\n\n }\n\n }", "public function testGetProfit() {\n $month = 10;\n $year = 2017;\n $numberOfDays = 29;\n $amount = 1000;\n $this->assertEquals('28.06', $this->tranche->getProfit($month, $year, $numberOfDays, $amount));\n }", "public function getSalaryStatement(Request $request)\n {\n $self='employee-payroll-summery';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message' => language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n\n $v = \\Validator::make($request->all(), [\n 'date_from' => 'required', 'date_to' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('reports/payroll')->withErrors($v->errors());\n }\n\n $cmd = Input::get('cmd');\n $date_from = Input::get('date_from');\n $date_to = Input::get('date_to');\n\n $date_from = date('Y-m-01', strtotime($date_from));\n $date_to = date('Y-m-t', strtotime($date_to));\n\n $payslip = Payroll::where('emp_id', $cmd)->first();\n\n if ($payslip==''){\n return redirect('reports/payroll')->with([\n 'message'=> language_data('User pay transaction data not found'),\n 'message_important'=>true\n ]);\n }\n\n $payroll = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->get();\n\n $net_salary = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('net_salary');\n $over_time = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('overtime_salary');\n $tax = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('tax');\n $provident_fund = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('provident_fund');\n $loan = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('loan');\n $total_salary = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('total_salary');\n $attendance_panelty = Payroll::where('emp_id', $cmd)->whereBetween('payment_date', [$date_from, $date_to])->sum('attendance_panelty');\n\n\n return view('admin.employee-salary-statement', compact('payroll', 'payslip', 'cmd', 'date_from', 'date_to', 'net_salary', 'over_time', 'tax', 'provident_fund', 'loan', 'total_salary', 'attendance_panelty'));\n\n\n }", "public function testWorkingDayComputationForMonthlyRegular() {\n// Artisan::call('db:seed', [\"--class\" => \"TestWorkingDayComputation_HolidaySeeder\"]);\n\n $payroll = Payroll::firstOrNew([\"pay_period\" => \"2017-02-15\"]);\n $payroll->cutoff_start = DateTime::createFromFormat('Y-m-d', \"2017-01-26\");\n $payroll->cutoff_end = DateTime::createFromFormat('Y-m-d', \"2017-02-10\");\n $payroll->next_pay_period = DateTime::createFromFormat('Y-m-d', \"2017-03-01\");\n\n $payroll->include_monthly_processable = true;\n\n $payroll->save();\n\n// $employee = Employee::find(\"20170120001\");\n $employee = Employee::find(\"20170120003\");\n\n // test one regular holiday, ranged\n $holiday = new Holiday();\n $holiday->code = \"01_30_Test01\";\n $holiday->description = \"test regular holiday\";\n $holiday->holiday_type_code = \"REG\";\n $holiday->date_start = DateTime::createFromFormat('Y-m-d', \"2017-01-30\");\n $holiday->date_end = DateTime::createFromFormat('Y-m-d', \"2017-01-31\");\n\n $holiday->save();\n\n // test one special holiday\n $holiday2 = new Holiday();\n $holiday2->code = \"02_01_Test02\";\n $holiday2->description = \"test special holiday\";\n $holiday2->holiday_type_code = \"SNW\";\n $holiday2->date_start = DateTime::createFromFormat('Y-m-d', \"2017-02-01\");\n $holiday2->date_end = DateTime::createFromFormat('Y-m-d', \"2017-02-01\");\n\n $holiday2->save();\n\n $workingDayComputationService = new WorkingDayComputationService();\n\n $workingDays = $workingDayComputationService->getWorkingDays($payroll, $employee);\n\n echo json_encode($workingDays);\n\n $this->assertTrue(true);\n }", "public function testTotalMonthlyPrice()\n {\n }", "function payDay(){\n\t\t$totalStaffCost = 0;\n\t\t// get all memeber's weekly salary and add them together\n\t\tforeach($this->urlms->getLab_index(0)->getStaffMembers() as $member){\n\t\t\t$totalStaffCost += $member->getWeeklySalary();\n\t\t}\n\t\tdate_default_timezone_set('America/New_York');\n\t\t$date = date('m/d/Y', time());\n\t\t$this->addTransaction(\"Staff Funding\", \"PAYDAY\", $totalStaffCost, \"expense\", $date);\n\t\treturn $totalStaffCost;\n\t}", "public function testGetEndDate(): void \n {\n $loan = new Loan(\"2020-01-01\", \"2020-05-05\");\n $this->assertEquals(\"2020-05-05\", \n $loan->getEndDate());\n }", "public function bonusDateProvider() \n {\n return [\n [3, 2017, '2017-03-15', 'Check expected date matches given date for mar 2017'],\n [1, null, '2018-01-15', 'Check expected date matches given date for jan 2018'],\n [4, 2018, '2018-04-18', 'Check expected date matches given date for april 2018'],\n [9, null, '2018-09-19', 'Check expected date matches given date for sept 2018'],\n [12, null, '2018-12-19', 'Check expected date matches given date for dec 2018'],\n [6, 2019, '2019-06-19', 'Check expected date matches given date for jun 2019'],\n [7, 2019, '2019-07-15', 'Check expected date matches given date for jul 2019'],\n ];\n }", "public static function getSalePerDay($i,$month,$year,$branch)\n {\n $str = $i. '-' . $month . '-' . $year;\n $date = date('Y-m-d', strtotime($str));\n $data = DB::table('month_sales')->where('branch_id', $branch)->where('_date', $date)->first();\n\n $with_receipt_total = 0;\n $with_out_receipt_total = 0;\n $credit_total = 0;\n $expense_total = 0;\n $return_total = 0;\n $total_amount = 0;\n $taken_total = 0;\n $deposit_total = 0;\n $is_check = 2;\n $coh = 0;\n\n\n $expense_string = '';\n $firstRec ='' ;\n $lastRec ='' ;\n\n $number_of_check = 0;\n\n if($data != null){\n $json_data = json_decode($data->data,TRUE);\n\n\n $rec_no = [];\n foreach ($json_data['with_receipt'] as $key => $val){\n $total =0;\n if($val['rec_amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['rec_amount'];\n }\n $with_receipt_total = $with_receipt_total + $total ;\n array_push($rec_no,$val['rec_no']);\n\n $number_of_check = $number_of_check + (isset($val['is_check']) ? 1 : 0 );\n }\n\n $firstRec = $rec_no[0];\n $lastRec = $rec_no[count($rec_no) - 1];\n\n foreach ($json_data['without_receipt'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $with_out_receipt_total = $with_out_receipt_total + $total ;\n }\n foreach ($json_data['credit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $credit_total = $credit_total + $total ;\n }\n foreach ($json_data['expense'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $expense_total = $expense_total + $total ;\n\n $expense_string .= $val['details'].' ';\n\n }\n foreach ($json_data['return'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $return_total = $return_total + $total ;\n }\n\n\n $amount_1000 = ($json_data['amount_1000'] != null) ? json_decode($data->data,TRUE)['amount_1000'] * 1000 : 0;\n $amount_500 = ($json_data['amount_500'] != null) ? json_decode($data->data,TRUE)['amount_500'] * 500 : 0;\n $amount_100 = ($json_data['amount_100'] != null) ? json_decode($data->data,TRUE)['amount_100'] * 100 : 0;\n $amount_50 = ($json_data['amount_50'] != null) ? json_decode($data->data,TRUE)['amount_50'] * 50 : 0;\n $amount_20 = ($json_data['amount_20'] != null || json_decode($data->data,TRUE)['amount_20'] != '') ? json_decode($data->data,TRUE)['amount_20'] * 20 : 0;\n $amount_coins = ($json_data['amount_coins'] != null) ? json_decode($data->data,TRUE)['amount_coins'] : 0;\n $total_amount = $amount_1000 + $amount_500 + $amount_100 + $amount_50 +$amount_20+ $amount_coins;\n $is_check = (isset($json_data['is_check'])) ? json_decode($data->data,TRUE)['is_check'] : $is_check;\n $coh = (isset($json_data['coh'])) ? json_decode($data->data,TRUE)['coh'] : $coh;\n\n foreach (json_decode($data->data,TRUE)['taken'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $taken_total = $taken_total + $total ;\n }\n foreach (json_decode($data->data,TRUE)['deposit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $deposit_total = $deposit_total + $total ;\n }\n\n }\n\n\n $_data =[\n 'with_receipt_total' =>$with_receipt_total,\n 'with_out_receipt_total' =>$with_out_receipt_total,\n 'credit_total' =>$credit_total,\n 'expense_total' =>$expense_total,\n 'return_total' =>$return_total,\n 'amount_total' =>$total_amount,\n 'taken_total' =>$taken_total,\n 'deposit_total' =>$deposit_total,\n 'data' =>($data != null) ? $data->data : '',\n 'date' =>$date,\n 'is_check'=>$is_check,\n 'coh'=>$coh,\n 'expense_details'=>$expense_string,\n 'rec_no'=>$firstRec.'-'.$lastRec,\n 'number_of_check' =>$number_of_check\n\n\n ];\n\n\n return json_encode($_data);\n\n }", "public function testGetPayrollCalendar()\n {\n }", "public function calculateSalaryDay()\n {\n /**\n * (numberOfDays + indexOfFirstDay + 6) mod 7\n * gives you the numeric representation of the last day of the month \n */\n $lastDay = ($this->_numberOfDays + $this->_startsOn + 6) % 7;\n if ($lastDay == 0) {\n return $this->_numberOfDays - (7 - $this->_altSalaryDay);\n } else if ($lastDay == 6) {\n return $this->_numberOfDays - (6 - $this->_altSalaryDay);\n } else {\n return $this->_numberOfDays;\n }\n }", "public function testGetPayrollCalendars()\n {\n }", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function dateToStringTestData() {\n\t\treturn [\n\t\t\t[\\DateTime::createFromFormat(\"d/m/Y\", \"23/04/1974\"), \"1974-04-23\"],\n\t\t];\n\t}", "public function calculateRentalFees($rentalsData): array\n {\n// die(var_dump('test'));\n $totalAmount = 0;\n $frequentRenterPoints = 0;\n $rentals = [];\n\n foreach ($rentalsData as $rental) {\n\n $thisAmount = 0;\n\n switch($rental->code_name) {\n case Movie::REGULAR:\n case Movie::SCI_FI:\n $thisAmount += 2;\n if ($rental->duration > 2) {\n $thisAmount += ($rental->duration - 2) * 1.5;\n }\n break;\n case Movie::NEW_RELEASE:\n $thisAmount += $rental->total_rentals * 3;\n if ($rental->duration > 1) {\n $frequentRenterPoints++;\n }\n break;\n case Movie::CHILDRENS:\n $thisAmount += 1.5;\n if ($rental->duration > 3) {\n $thisAmount += ($rental->duration - 3) * 1.5;\n }\n break;\n }\n\n $totalAmount += $thisAmount;\n $frequentRenterPoints++;\n $rentals[] = [\n 'name' => $rental->name,\n 'total_rentals' => $rental->total_rentals,\n 'duration' => $rental->duration,\n 'individual_amount_owed' => number_format($thisAmount, 2, '.', '')\n ];\n }\n\n $totals = [\n 'total_amount_owed' => number_format($totalAmount, 2, '.', ''),\n 'frequent_renter_points' => $frequentRenterPoints\n ];\n\n return [\n 'rentals' => $rentals,\n 'totals' => $totals\n ];\n }", "public function testGetPriceSenior()\n {\n $value = Yaml::parseFile(__DIR__.'/../../config/contraints/config.yaml');\n $expectedResult = $value['TicketPrice']['prices']['senior'];\n\n $reduced = false;\n $halfday = false;\n $birthdate = new DateTime('1940-01-01');\n\n $ticket = new TicketPrice();\n $result = $ticket->getPrice($birthdate, $reduced, $halfday);\n \n $this->assertEquals($expectedResult, $result);\n }", "private function getSalaryByUser($idUser, $date, $type)\n\t{\n\t\t$salaryUser = $this->getPayrollModel()->getSalaryByUser($idUser, $desde, $date);\n\t\treturn $salaryUser;\n\t}", "public function testPayersPayerTypeCommissionAmountGet()\n {\n }", "public function testCreatePayrollCalendar()\n {\n }", "function salary() {\n if (empty($this->bio_salary)) {\n if ( $this->page[\"Bio\"] == \"\" ) $this->openpage (\"Bio\",\"person\");\n $pos_s = strpos($this->page[\"Bio\"],\"<h5>Salary</h5>\");\n $pos_e = strpos($this->page[\"Bio\"],\"</table\",$pos_s);\n $block = substr($this->page[\"Bio\"],$pos_s,$pos_e - $pos_s);\n if (preg_match_all(\"/<tr.*?<td.*?>(.*?)<\\/td>.*?<td.*?>(.*?)<\\/td>/ms\",$block,$matches)) { // for each table row\n $mc = count($matches[0]);\n for ($i=0;$i<$mc;++$i) {\n if (preg_match(\"/\\/title\\/tt(\\d{7})\\/\\\">(.*?)<\\/a>\\s*\\((\\d{4})\\)/\",$matches[1][$i],$match)) {\n $movie[\"imdb\"] = $match[1];\n $movie[\"name\"] = $match[2];\n $movie[\"year\"] = $match[3];\n } else {\n $movie[\"name\"] = $matches[1][$i];\n }\n $this->bio_salary[] = array(\"movie\"=>$movie,\"salary\"=>$matches[2][$i]);\n }\n }\n }\n return $this->bio_salary;\n }", "public function testSetPaydateModelData() \n\t{\n\t\t$data = array( \n\t\t\t'income_frequency' => 'WEEKLY',\n\t\t\t'paydate_model' => 'DW', \n\t\t\t'day_of_week' => 'MON', \n\t\t\t'last_paydate' => date('Y-m-d'), \n\t\t\t'day_of_month_1' => 12, \n\t\t\t'day_of_month_2' => 13, \n\t\t\t'week_1' => 1, \n\t\t\t'week_2' => 2); \n\t\t$state = new VendorAPI_StateObject(); \n\n\t\t$app_model = $this->getMock('FakeApplicationModel', array('loadBy', 'save', 'loadByKey'), array(), '', FALSE);\n\t\t$version_model = $this->getMock(\"ECash_Models_ApplicationVersion\", array('loadBy', 'save', 'loadByKey'), array(), '', FALSE);\n\t\t$stat_client = $this->getMock('VendorAPI_StatProClient', array(), array(), '', FALSE);\n\t\t$qualify = $this->getMock('VendorAPI_IQualify');\n\t\t$factory = $this->getMock(\"ECash_Factory\", array('getModel'), array(), '', FALSE);\n\n\t\t$persistor = new VendorAPI_StateObjectPersistor($state);\n\t\t$application = $this->getMock( \n\t\t\t'ECash_VendorAPI_Application', \n\t\t\tarray('getApplicationId'), \n\t\t\tarray($persistor, $app_model, $version_model, $state, $qualify, $factory, $stat_client));\n\t\t$application->setApplicationData($data); \n\t\t$this->assertEquals($data['income_frequency'], $app_model->income_frequency); \n\t\t$this->assertEquals($data['paydate_model'], $app_model->paydate_model); \n\t\t$this->assertEquals($data['day_of_week'], $app_model->day_of_week); \n\t\t$this->assertEquals($data['last_paydate'], $app_model->last_paydate); \n\t\t$this->assertEquals($data['day_of_month_1'], $app_model->day_of_month_1); \n\t\t$this->assertEquals($data['day_of_month_2'], $app_model->day_of_month_2); \n\t\t$this->assertEquals($data['week_1'], $app_model->week_1); \n\t\t$this->assertEquals($data['week_2'], $app_model->week_2); \n\t}", "public function testReport(){\n // $autoTaskTools->checkTask('AutoDaySessReport');\n // $date = array(\n // date_to_int('-',date('Y-m-01', strtotime('-1 month'))),\n // date_to_int('-',date('Y-m-t', strtotime('-1 month'))),\n // );\n\n $reportTools = new ReportTools();\n $reportTools->saveReportList('AutoDaySessReport');\n\n\n $BeginDate = date('Y-m-01', strtotime(date(\"Y-m-d\")));\n $date = array(\n date_to_int('-',$BeginDate),\n date_to_int('-',date('Y-m-d', strtotime(\"$BeginDate +1 month -1 day\"))),\n );\n $month = date('Y-m-01', strtotime('-1 month'));\n $month1 = date('Y-m-t', strtotime('-1 month'));\n dump($month);\n dump($month1);\n $mytime = date(\"Y-01-01\", strtotime(\"-1 year\"));\n dump($mytime);\n $monthEndDays = cal_days_in_month(CAL_GREGORIAN, 12, date(\"Y\", strtotime(\"-1 year\")));\n $year = date(\"Y-12-\".$monthEndDays, strtotime(\"-1 year\"));\n echo 'year:' . $year;\n $monthDays = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 month')), date('Y'));\n dump($monthDays);\n echo 'n:' . date('n');\n $season = ceil((date('n'))/3)-1;\n echo '<br>上季度起始时间:<br>';\n echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n //获取第几季度\n // $season = ceil((date('n'))/3);\n // echo date('m', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n // echo date('Y-m-d', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n dump($season);\n // $daySessReportTools = new DaySessReportTools();\n // $daySessReportTools->getDateList($date);\n // $daySessReportTools->daySessExcelGen($date);\n //\n // $dayErrorReportTools = new DayErrorReportTools();\n // $dayErrorReportTools->dayErrorExcelGen($date);\n // $daySessReportTools->getDateList($date);\n $str = stristr('DaySuccessReport_UID_2017-06-29.xlsx','_',true);\n dump($str);\n $this->display();\n }", "function getEmployeesSalary() {\n $query = \"SELECT a.emp_nip, a.emp_fullname, a.emp_branch, b.dept_division, b.dept_position, b.dept_level,\n c.*\n FROM employee a\n LEFT JOIN department b ON b.master_nip = a.emp_nip\n LEFT JOIN payroll_salary c ON c.master_nip = a.emp_nip\";\n $result = $this->db->query($query);\n\n return $result->result();\n }", "public function testReportsPaymentsHistoryGet()\n {\n }", "public function getPayRollByUserToDateEnlasa($type, $date)\n\t{\n\t\t$NTyp = 0;\n\t\tif($type == \"S\"){\n\t\t\t$NTyp = 1;\n\t\t}elseif($type == \"Q\"){\n\t\t\t$NTyp = 2;\n\t\t}elseif($type == \"M\"){\n\t\t\t$NTyp = 3;\n\t\t}\n\t\t// LISTA DE EMPLEADOS EN LA NOMINA\n\t\t$rows = $this->getPayrollModel()->getPayRollByUserToDateEnlasa($NTyp, $date);\n\t\t//echo \"<pre>\"; print_r($rows); exit;\n\t\t//$desdeHasta = $this->calcularRangoFechas($date,$type);\n\t\t//$rangoFechas = $this->fechas($desdeHasta['desde'], $desdeHasta['hasta']);\n\t\t\n\t\tforeach ($rows as $row){\n\t\t\t// SALARIO POR VIAJES\n\t\t\t//$salaryShippings = $this->getSalaryByUserShippings($row['user_id'] ,$date,$type);\n\t\t\t\n\t\t\t// TOTAL DIAS DE ASISTENCIA\n\t\t\t$assistanceDaysByUser = $this->assistanceDaysByUser($row['user_id'] ,$date, $type);\n\t\t\t//echo \"<pre>\"; print_r($assistanceDaysByUser);\n\t\t\t// FECHAS DE ASISTENCIA\n\t\t\t$diasAplicaAsistencia = $this->diasAplicaAsistencia($row['user_id'] ,$date, $type);\n\t\t\t//echo \"<pre>\"; print_r($diasAplicaAsistencia);\n\t\t\t// IMPORTE POR COMIDA\n\t\t\tif($row['name_job'] == \"Operador\"){\n\t\t\t\t$food = self::SALARY_FOOD_OPERATOR;\n\t\t\t}else{\n\t\t\t\t$food = self::SALARY_FOOD_ASSISTANCE;\n\t\t\t}\n\t\t\t\n\t\t\t// SALARIO POR ASISTENCIA\n\t\t\t$salaryByAssistance = ($row['cost'] + $food) * ($assistanceDaysByUser - $diasAplicaAsistencia);\n\t\t\t//echo \"<pre>\"; print_r($salaryByAssistance); exit;\n\t\t\t// SALARIO TOTAL POR VIAJES LOCALES\n\t\t\t$salarioViajesLocales = $this->obtenerSalarioViajesLocales($row['user_id'], $date, $type);\n\t\t\t\n\t\t\t// SALARIO TOTAL POR VIAJES FORANEOS\n\t\t\t$salarioViajesForaneos = $this->obtenerSalarioViajesForaneos($row['user_id'], $date, $type);\n\t\t\t\n\t\t\t// TOTAL DE VIAJES LOCALES\n\t\t\t$totalViajesLocales = $this->obtenerTotalViajesLocales($row['user_id'], $date, $type);\n\t\t\t\n\t\t\t// TOTAL DE VIAJES FORANEOS\n\t\t\t$totalViajesForaneos = $this->obtenerTotalViajesForaneos($row['user_id'], $date, $type);\n\t\t\t\n\t\t\t//TOTAL DE BONOS APLICABLES POR EMPLEADO\n\t\t\t$aplicablesBonos = $this->getAllAplicableBonus($row['user_id'], \"BONO\");\n\t\t\t\n\t\t\t// SUMA TOTAL DE LOS BONOS APLICADOS POR EMPLEADO\n\t\t\t$totalBonos = $this->obtenerBonos($row['user_id'], $date, $type);\n\t\t\t\n\t\t\t//TOTAL DE DESCUENTOS APLICABLES POR EMPLEADO\n\t\t\t$aplicableDiscount = $this->getAllAplicableDiscount($row['user_id'], \"DESCUENTO\");\n\t\t\t\n\t\t\t// SUMA TOTAL DE LOS DESCUENTOS APLICADOS POR EMPLEADO\n\t\t\t$totalDescuentos = $this->obtenerDescuentos($row['user_id'], $date, $type);\n\t\t\t\n\t\t\tif ($row['pay'] == 0){\n\t\t\t\t// TOTAL SALARIO POSIBLE\n\t\t\t\t$salarioTotal = ($salarioViajesForaneos + $salarioViajesLocales + $totalBonos + $salaryByAssistance) - $totalDescuentos;\n\t\t\t}else {\n\t\t\t\t// TOTAL SALARIO PAGADO\n\t\t\t\t$salarioTotal =\t$this->getSalaryPaidPayrollByUser($row['user_id'], $date);\n\t\t\t}\n\t\t\t\n\t\t\t//echo \"<pre>\"; print_r($salarioViajesLocales); exit;\n\t\t\t$payroll[] = array(\n\t\t\t\t\t'user_id' => $row['user_id'],\n\t\t\t\t\t'name' => $row['name'],\n\t\t\t\t\t'surname' => $row['surname'],\n\t\t\t\t\t'lastname' => $row['lastname'],\n\t\t\t\t\t'pay' => $row['pay'],\n\t\t\t\t\t'cost' => $row['cost'],\n\t\t\t\t\t'period' => $row['period'],\n\t\t\t\t\t'mannerofpayment' => $row['mannerofpayment'],\n\t\t\t\t\t'date_admission' => $row['date_admission'],\n\t\t\t\t\t'name_job' => $row['name_job'],\n\t\t\t\t\t'info' => array(\n\t\t\t\t\t\t\t'days_assistance' => $assistanceDaysByUser,\n\t\t\t\t\t\t\t'amount_food' => $food,\n\t\t\t\t\t\t\t'salario_asistencia' => $salaryByAssistance,\n\t\t\t\t\t\t\t'total_bonos_aplicados' => $totalBonos,\n\t\t\t\t\t\t\t'total_descu_aplicados' => $totalDescuentos,\n\t\t\t\t\t\t\t'total_viajes_locales' => $totalViajesLocales,\n\t\t\t\t\t\t\t'total_viajes_foraneos' => $totalViajesForaneos,\n\t\t\t\t\t\t\t'salario_viajes_locales' => $salarioViajesLocales,\n\t\t\t\t\t\t\t'salario_viajes_foraneos' => $salarioViajesForaneos,\n\t\t\t\t\t\t\t'salario_total' => $salarioTotal,\n\t\t\t\t\t\t\t'bonos' => $aplicablesBonos,\n\t\t\t\t\t\t\t'descuentos' => $aplicableDiscount\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t//echo \"<pre>\"; print_r($payroll); exit;\n\t\treturn $payroll;\n\t}", "public function testGetSalaryDateForMonth($month, $year, $expected) \n {\n $actualDate = DateCalculator::getSalaryDateForMonth($month, $year);\n $this->assertSame(\n $expected,\n $actualDate->format('Y-m-d')\n );\n }", "public function testGetStartDate(): void \n {\n $loan = new Loan(\"2020-01-01\", \"2020-05-05\");\n $this->assertEquals(\"2020-01-01\", \n $loan->getStartDate());\n }", "public function calculate()\n {\n $person_id = $this->security->xss_clean($this->input->post('person_id'));\n $revision_date = $this->security->xss_clean($this->input->post('increment_date'));\n $grade = $this->security->xss_clean($this->input->post('grade'));\n $current_salary_step = $this->security->xss_clean($this->input->post('salary_step'));\n $revision_year = date(Y, strtotime($revision_date));\n\n $current_salary = $this->calculateSalary($grade, $current_salary_step, $revision_year-1);\n $new_salary = $this->calculateSalary($grade, $current_salary_step, $revision_year);\n\n $next_salary_increment = $this->calculateSalary($grade, $current_salary_step+1, $revision_year);\n\n $increment = $new_salary - $current_salary;\n\n $salaryDetails = array('new_salary' => $new_salary, 'increment' => $increment, 'current_salary' => $current_salary, 'next_salary' => $next_salary_increment, 'year' => $revision_year);\n\n echo json_encode($salaryDetails);\n }", "public function test_success_get_complete_pos_daily_cash_resume()\n {\n $response = $this->resumePosDailyCashService->getCompleteResumePosDailyCash();\n\n $this->assertArrayHasKey('opening_timestamp', $response);\n $this->assertArrayHasKey('opening_user', $response);\n $this->assertArrayHasKey('ingress_total', $response);\n $this->assertArrayHasKey('egress_total', $response);\n $this->assertArrayHasKey('estimated_cash_total', $response);\n $this->assertArrayHasKey('ingress_total_detail', $response);\n $this->assertArrayHasKey('initial_amount_cash', $response['ingress_total_detail']);\n $this->assertArrayHasKey('ingress_cash_movement_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sales_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('employee_sales_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sales_total_detail', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_cash_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_debit_card_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_credit_cash_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_check_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_customer_credit_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('employee_sales_total_detail', $response['ingress_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_cash_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_debit_card_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_credit_cash_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_check_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_employee_credit_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('egress_total_detail', $response);\n $this->assertArrayHasKey('egress_cash_movement_total', $response['egress_total_detail']);\n\n // Check sum totals\n $this->assertEquals($response['ingress_total'], (\n $response['ingress_total_detail']['initial_amount_cash'] + \n $response['ingress_total_detail']['ingress_cash_movement_total'] + \n $response['ingress_total_detail']['customer_sales_total'] + \n $response['ingress_total_detail']['employee_sales_total']\n ));\n\n // Check sum totals\n $this->assertEquals($response['ingress_total_detail']['customer_sales_total'], (\n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_cash_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_debit_card_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_credit_cash_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_check_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_customer_credit_total'] \n ));\n\n // Check sum totals\n $this->assertEquals($response['ingress_total_detail']['employee_sales_total'], (\n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_cash_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_debit_card_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_credit_cash_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_check_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_employee_credit_total'] \n ));\n\n // Check sum totals\n $this->assertEquals($response['egress_total'], (\n $response['egress_total_detail']['egress_cash_movement_total'] \n\n ));\n }", "public static function calculate($arrParams){\n $dateMonthofPay = $arrParams['year'].'-'.str_pad($arrParams['month'],2,'0',STR_PAD_LEFT).'-01';\n\n\t\t// Fetch payslip\n $objPayslip = static::where(['employee_id'=>$arrParams['employee_id'],'month_of_pay'=>$dateMonthofPay])->first();\n \n if($objPayslip){\n return false;\n }\n\t\t$objPayslip = new static();\n $objPayslip->employee_id = $arrParams['employee_id'];\n $objPayslip->month_of_pay = $dateMonthofPay;\n $objPayslip->days_worked = $arrParams['days_worked'];\n $objPayslip->leaves_taken = $arrParams['leaves_taken'];\n\n $objPayslip->gross_salary = $arrParams['monthly_gross'];\n\t\t\n\t\t$objPayslip->calculateBasicSalary();\n\t\t\n\t\t$objPayslip->calculateHRA();\n\t\t\n\t\t$objPayslip->setAllownaceFromConfig();\n \n $objPayslip->setDeductionsFromConfig();\n\t\t\n\t\t\n\t\t$intLeaveBalance = $arrParams['leave_balance'] - $arrParams['leaves_taken'];\n\t\t \n\t\t$arrParams['objSalary']->leave_balance = ($intLeaveBalance > 0 )?$intLeaveBalance:0;\n\t\t\n\t\t$intLeaveDeductions = $objPayslip->calculateLeavesDeductions($intLeaveBalance);\n\t\t\n\t\t$objPayslip->other_deduction = $intLeaveDeductions;\n\t\t\n\t\t$objPayslip->calculateSpecialAllowance();\n\t\t\n\t\t$objPayslip->calculateNetSalary();\n \n $objPayslip->save();\n\t\t\n\t\treturn true;\n }" ]
[ "0.6308793", "0.60931927", "0.59872735", "0.57946426", "0.5648555", "0.56429446", "0.56188905", "0.5607961", "0.555235", "0.5541905", "0.55404884", "0.5462851", "0.5459157", "0.5426858", "0.5421501", "0.54212666", "0.5380788", "0.53655034", "0.5360677", "0.53471816", "0.5344267", "0.53377014", "0.53219247", "0.53093255", "0.53090507", "0.53060406", "0.5289461", "0.5285058", "0.52752924", "0.5259709" ]
0.6678473
0
Provides test data for finding the date to pay bonus
public function dataProviderBonus() { return [ [2018, 11, '2018-11-15'], [2018, 12, '2018-12-19'], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bonusDateProvider() \n {\n return [\n [3, 2017, '2017-03-15', 'Check expected date matches given date for mar 2017'],\n [1, null, '2018-01-15', 'Check expected date matches given date for jan 2018'],\n [4, 2018, '2018-04-18', 'Check expected date matches given date for april 2018'],\n [9, null, '2018-09-19', 'Check expected date matches given date for sept 2018'],\n [12, null, '2018-12-19', 'Check expected date matches given date for dec 2018'],\n [6, 2019, '2019-06-19', 'Check expected date matches given date for jun 2019'],\n [7, 2019, '2019-07-15', 'Check expected date matches given date for jul 2019'],\n ];\n }", "public function testGetProfit() {\n $month = 10;\n $year = 2017;\n $numberOfDays = 29;\n $amount = 1000;\n $this->assertEquals('28.06', $this->tranche->getProfit($month, $year, $numberOfDays, $amount));\n }", "public function dateToStringTestData() {\n\t\treturn [\n\t\t\t[\\DateTime::createFromFormat(\"d/m/Y\", \"23/04/1974\"), \"1974-04-23\"],\n\t\t];\n\t}", "public function getValueTestDataProvider() {\n $t = 1400000000;\n $f = 'Y-m-d H:i:s';\n return [\n 'timestamp' => [$t, $t],\n 'string timestamp' => [\"$t\", $t],\n 'float timestamp' => [$t + 0.12, $t],\n 'date string' => [gmdate($f, $t), $t],\n 'date string with timezone' => [date($f . 'P', $t), $t],\n ];\n }", "public function getTestData()\n {\n yield [false, false, '-5 days', '+5 days', true];\n // changing before last dockdown period is not allowed with grace permission\n yield [false, true, '-5 days', '+5 days', true];\n // changing before last dockdown period is allowed with full permission\n yield [true, true, '-5 days', '+5 days', false];\n yield [true, false, '-5 days', '+5 days', false];\n // changing a value in the last lockdown period is allowed during grace period\n yield [false, false, '+5 days', '+5 days', false];\n // changing outside grace period is not allowed\n yield [false, false, '+5 days', '+11 days', true];\n // changing outside grace period is allowed with grace and full permission\n yield [false, true, '+5 days', '+11 days', false];\n yield [true, false, '+5 days', '+11 days', false];\n yield [true, true, '+5 days', '+11 days', false];\n }", "public function getTestData()\n {\n return [\n 'user_id' => 1,\n 'status' => 1,\n 'created_at' => '2016-01-21 15:00:00',\n 'updated_at' => '2016-01-21 18:00:00'\n ];\n }", "public function testPayersPayerTypeCommissionAmountGet()\n {\n }", "public function getStatForDonations() {\r\n // TODO: Move to config\r\n $requiredPerYear = 1000;\r\n $requiredPerMonth = 85;\r\n\r\n // Calculate donations received for current year\r\n $result = $this->dao->query(\"\r\n SELECT\r\n SUM(amount) AS YearDonation,\r\n year(NOW()) AS yearnow,\r\n month(NOW()) AS month,\r\n quarter(NOW()) AS quarter\r\n FROM\r\n donations\r\n WHERE\r\n created > CONCAT(CONCAT(year(NOW()), '-01'), '-01')\r\n \");\r\n $rowYear = $result->fetch(PDB::FETCH_OBJ);\r\n\r\n switch ($rowYear->quarter) {\r\n case 1:\r\n $start = $rowYear->yearnow . \"-01-01\";\r\n $end = $rowYear->yearnow . \"-04-01\";\r\n break;\r\n case 2:\r\n $start = $rowYear->yearnow . \"-04-01\";\r\n $end = $rowYear->yearnow . \"-07-01\";\r\n break;\r\n case 3:\r\n $start = $rowYear->yearnow . \"-07-01\";\r\n $end = $rowYear->yearnow . \"-10-01\";\r\n break;\r\n case 4:\r\n $start = $rowYear->yearnow . \"-10-01\";\r\n $end = $rowYear->yearnow . \"-12-31\";\r\n break;\r\n }\r\n\r\n $query = \"\r\n SELECT\r\n SUM(ROUND(amount)) AS Total,\r\n year(now()) AS year\r\n FROM\r\n donations\r\n WHERE\r\n created >= '$start'\r\n AND\r\n created < '$end'\r\n \";\r\n $result = $this->dao->query($query);\r\n\r\n $row = $result->fetch(PDB::FETCH_OBJ);\r\n $row->QuarterDonation = sprintf(\"%d\", $row->Total);\r\n $row->MonthNeededAmount = $requiredPerMonth;\r\n $row->YearNeededAmount = $requiredPerYear;\r\n $row->QuarterNeededAmount = $requiredPerMonth * 3;\r\n $row->YearDonation = $rowYear->YearDonation;\r\n\r\n return $row;\r\n }", "function get_test_data(){\r\n $result = array();\r\n $date = new DateTime('2013-01-01');\r\n for($i=0; $i<20; $i++){\r\n \r\n $date->add(new DateInterval('P1D'));\r\n \r\n $result[] = array(\r\n 'date' => $date->format('Y-m-d') ,\r\n 'weight' => mt_rand(800, 920)/10\r\n );\r\n }\r\n\r\n return $result;\r\n}", "public function getDataWithTypeDate() {}", "public function testWorkingDayComputationForMonthlyRegular() {\n// Artisan::call('db:seed', [\"--class\" => \"TestWorkingDayComputation_HolidaySeeder\"]);\n\n $payroll = Payroll::firstOrNew([\"pay_period\" => \"2017-02-15\"]);\n $payroll->cutoff_start = DateTime::createFromFormat('Y-m-d', \"2017-01-26\");\n $payroll->cutoff_end = DateTime::createFromFormat('Y-m-d', \"2017-02-10\");\n $payroll->next_pay_period = DateTime::createFromFormat('Y-m-d', \"2017-03-01\");\n\n $payroll->include_monthly_processable = true;\n\n $payroll->save();\n\n// $employee = Employee::find(\"20170120001\");\n $employee = Employee::find(\"20170120003\");\n\n // test one regular holiday, ranged\n $holiday = new Holiday();\n $holiday->code = \"01_30_Test01\";\n $holiday->description = \"test regular holiday\";\n $holiday->holiday_type_code = \"REG\";\n $holiday->date_start = DateTime::createFromFormat('Y-m-d', \"2017-01-30\");\n $holiday->date_end = DateTime::createFromFormat('Y-m-d', \"2017-01-31\");\n\n $holiday->save();\n\n // test one special holiday\n $holiday2 = new Holiday();\n $holiday2->code = \"02_01_Test02\";\n $holiday2->description = \"test special holiday\";\n $holiday2->holiday_type_code = \"SNW\";\n $holiday2->date_start = DateTime::createFromFormat('Y-m-d', \"2017-02-01\");\n $holiday2->date_end = DateTime::createFromFormat('Y-m-d', \"2017-02-01\");\n\n $holiday2->save();\n\n $workingDayComputationService = new WorkingDayComputationService();\n\n $workingDays = $workingDayComputationService->getWorkingDays($payroll, $employee);\n\n echo json_encode($workingDays);\n\n $this->assertTrue(true);\n }", "function calculate_fee_form18_re($FORMATION_PROPRIETORY_DATE){\r\nglobal $conn2;\r\n$fee = array();\r\n\r\nif($FORMATION_PROPRIETORY_DATE != '' && $FORMATION_PROPRIETORY_DATE != '0000-00-00'){\r\n\r\n$current_date = date('Y-m-d');\r\n$FORMATION_PROPRIETORY_DATE = new DateTime($FORMATION_PROPRIETORY_DATE);\r\n$current_date = new DateTime($current_date);\r\n$days_from_current_date = $FORMATION_PROPRIETORY_DATE->diff($current_date)->format(\"%r%a\");\r\nif($days_from_current_date > 30 && $days_from_current_date <= 60){\r\n$fee['DELAY_FEE'] = 100;\r\n}elseif($days_from_current_date > 60 && $days_from_current_date <= 180){\r\n$fee['DELAY_FEE'] = 300;\r\n}elseif($days_from_current_date > 180){\r\n$fee['DELAY_FEE'] = 1000;\r\n}else{\r\n$fee['DELAY_FEE'] = 0;\r\n}\r\n\r\n}\r\n\r\n//$fee['S109'] = 1000;\r\n//$fee['S110'] = 1000;\r\n$fee['TOTAL_AMT'] = $fee['DELAY_FEE'];\r\n//print_r($fee);die;\r\nreturn $fee;\r\n\r\n}", "public function dataProviderSalary() {\n return [\n [2018, 11, '2018-11-30'],\n [2018, 12, '2018-12-31'],\n ];\n\n }", "public function testTotalMonthlyPrice()\n {\n }", "public function test_success_get_complete_pos_daily_cash_resume()\n {\n $response = $this->resumePosDailyCashService->getCompleteResumePosDailyCash();\n\n $this->assertArrayHasKey('opening_timestamp', $response);\n $this->assertArrayHasKey('opening_user', $response);\n $this->assertArrayHasKey('ingress_total', $response);\n $this->assertArrayHasKey('egress_total', $response);\n $this->assertArrayHasKey('estimated_cash_total', $response);\n $this->assertArrayHasKey('ingress_total_detail', $response);\n $this->assertArrayHasKey('initial_amount_cash', $response['ingress_total_detail']);\n $this->assertArrayHasKey('ingress_cash_movement_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sales_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('employee_sales_total', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sales_total_detail', $response['ingress_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_cash_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_debit_card_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_credit_cash_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_check_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('customer_sale_with_customer_credit_total', $response['ingress_total_detail']['customer_sales_total_detail']);\n $this->assertArrayHasKey('employee_sales_total_detail', $response['ingress_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_cash_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_debit_card_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_credit_cash_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_check_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('employee_sale_with_employee_credit_total', $response['ingress_total_detail']['employee_sales_total_detail']);\n $this->assertArrayHasKey('egress_total_detail', $response);\n $this->assertArrayHasKey('egress_cash_movement_total', $response['egress_total_detail']);\n\n // Check sum totals\n $this->assertEquals($response['ingress_total'], (\n $response['ingress_total_detail']['initial_amount_cash'] + \n $response['ingress_total_detail']['ingress_cash_movement_total'] + \n $response['ingress_total_detail']['customer_sales_total'] + \n $response['ingress_total_detail']['employee_sales_total']\n ));\n\n // Check sum totals\n $this->assertEquals($response['ingress_total_detail']['customer_sales_total'], (\n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_cash_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_debit_card_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_credit_cash_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_check_total'] + \n $response['ingress_total_detail']['customer_sales_total_detail']['customer_sale_with_customer_credit_total'] \n ));\n\n // Check sum totals\n $this->assertEquals($response['ingress_total_detail']['employee_sales_total'], (\n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_cash_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_debit_card_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_credit_cash_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_check_total'] + \n $response['ingress_total_detail']['employee_sales_total_detail']['employee_sale_with_employee_credit_total'] \n ));\n\n // Check sum totals\n $this->assertEquals($response['egress_total'], (\n $response['egress_total_detail']['egress_cash_movement_total'] \n\n ));\n }", "function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}", "public function getDebitData()\n {\n $where = \"(SELECT DATEDIFF(sales_order.`due_date`, '$this->curDate') AS days) < 14 AND sales_order.`status_paid` = 0 AND sales_order.`active` = 1\";\n $this->db->where($where);\n $this->db->from('sales_order');\n $query = $this->db->get();\n\n $data['sum'] = 0;\n $data['count'] = 0;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data['count']++;\n $data['sum'] += ($row->grand_total - $row->paid);\n }\n }\n return $data;\n }", "function getDateResponseDue() {\n\t\treturn $this->getData('dateResponseDue');\n\t}", "public function test_getDrawByDate_calledWithValidDate_returnActionResultWithOnceDraw()\n {\n $today = new \\DateTime('2015-11-03');\n $draw_to_persist = new EuroMillionsDraw();\n $sut = $this->getSut();\n $this->lotteryDrawRepository_double->findOneBy(['draw_date' => $today])->willReturn($draw_to_persist);\n $actual = $sut->getDrawByDate($today);\n $this->assertEquals(true,$actual->success());\n }", "public function testReadByDate()\n {\n $today = date('Y-m-d');\n $tomorrow = date('Y-m-d', strtotime('tomorrow'));\n\n $result = $this->_leads->getDate($today, $tomorrow);\n $this->assertTrue(is_array($result));\n }", "public function testGetStartDate(): void \n {\n $loan = new Loan(\"2020-01-01\", \"2020-05-05\");\n $this->assertEquals(\"2020-01-01\", \n $loan->getStartDate());\n }", "public function testGetEndDate(): void \n {\n $loan = new Loan(\"2020-01-01\", \"2020-05-05\");\n $this->assertEquals(\"2020-05-05\", \n $loan->getEndDate());\n }", "public function testReportsPaymentsHistoryGet()\n {\n }", "public function get_expected_data() \n {\n return array('answer' => PARAM_INTEGER);\n }", "public function testGetPayrollCalendar()\n {\n }", "public function getFundDateEstimate()\n\t{\n\t\treturn $this->fund_date;\n\t}", "public function run()\n {\n $paidtimeoffs = [\n 'Aaron Hall' => [\n ['start_time' => '2017-01-25', 'end_time' => '2017-01-25'],\n ['start_time' => '2017-02-24', 'end_time' => '2017-02-24'],\n ],\n 'Ben Stout' => [\n ['start_time' => '2017-02-20', 'end_time' => '2017-02-20'],\n ['start_time' => '2017-03-20', 'end_time' => '2017-03-24'],\n ['start_time' => '2017-04-17', 'end_time' => '2017-04-17'],\n ['start_time' => '2017-06-09', 'end_time' => '2017-06-09'],\n ['start_time' => '2017-07-10', 'end_time' => '2017-07-14'],\n ['start_time' => '2017-12-20', 'end_time' => '2017-12-29'],\n ],\n 'Craig Knowles' => [\n ],\n 'Dillon Formo' => [\n ['start_time' => '2017-04-17', 'end_time' => '2017-04-17'],\n ['start_time' => '2017-06-02', 'end_time' => '2017-06-02'],\n ['start_time' => '2017-07-05', 'end_time' => '2017-07-05'],\n ['start_time' => '2017-11-27', 'end_time' => '2017-11-27'],\n ['start_time' => '2017-12-22', 'end_time' => '2017-12-27'],\n ],\n 'Jeff Kolesnikowicz' => [\n ],\n 'Laura Kimpel-Matthews' => [\n ['start_time' => '2017-05-24', 'end_time' => '2017-05-31'],\n ['start_time' => '2017-08-28', 'end_time' => '2017-08-31'],\n ['start_time' => '2017-11-20', 'end_time' => '2017-11-22'],\n ['start_time' => '2017-12-27', 'end_time' => '2017-12-29'],\n ],\n 'Lyle Smart' => [\n ['start_time' => '2017-05-30', 'end_time' => '2017-05-31'],\n ['start_time' => '2017-06-01', 'end_time' => '2017-06-09'],\n ['start_time' => '2017-12-20', 'end_time' => '2017-12-29'],\n ],\n 'Mark Vince' => [\n ['start_time' => '2017-01-25', 'end_time' => '2017-01-25'],\n ['start_time' => '2017-03-23', 'end_time' => '2017-03-24'],\n ['start_time' => '2017-04-03', 'end_time' => '2017-04-07'],\n ['start_time' => '2017-10-09', 'end_time' => '2017-10-13'],\n ['start_time' => '2017-11-22', 'end_time' => '2017-11-22'],\n ['start_time' => '2017-12-21', 'end_time' => '2017-12-29'],\n ],\n 'Nick Baker' => [\n ['start_time' => '2017-02-20', 'end_time' => '2017-02-21'],\n ['start_time' => '2017-03-01', 'end_time' => '2017-03-01'],\n ['start_time' => '2017-05-25', 'end_time' => '2017-05-31'],\n ['start_time' => '2017-08-11', 'end_time' => '2017-08-14'],\n ['start_time' => '2017-12-18', 'end_time' => '2017-12-29'],\n ],\n 'Rachelle Zani' => [\n ['start_time' => '2017-02-09', 'end_time' => '2017-02-09'],\n ['start_time' => '2017-07-05', 'end_time' => '2017-07-14'],\n ['start_time' => '2017-08-21', 'end_time' => '2017-08-21'],\n ['start_time' => '2017-09-21', 'end_time' => '2017-09-21'],\n ['start_time' => '2017-11-22', 'end_time' => '2017-11-22'],\n ['start_time' => '2017-12-27', 'end_time' => '2017-12-29'],\n ],\n 'Travis Reddell' => [\n ['start_time' => '2017-02-03', 'end_time' => '2017-02-03'],\n ['start_time' => '2017-02-24', 'end_time' => '2017-02-24'],\n ['start_time' => '2017-03-15', 'end_time' => '2017-03-15'],\n ['start_time' => '2017-04-07', 'end_time' => '2017-04-07'],\n ['start_time' => '2017-04-28', 'end_time' => '2017-04-28'],\n ['start_time' => '2017-05-19', 'end_time' => '2017-05-19'],\n ['start_time' => '2017-06-09', 'end_time' => '2017-06-09'],\n ['start_time' => '2017-09-11', 'end_time' => '2017-09-15'],\n ['start_time' => '2017-10-20', 'end_time' => '2017-10-20'],\n ['start_time' => '2017-12-21', 'end_time' => '2017-12-29'],\n ],\n 'Tyler Shaw' => [\n ['start_time' => '2017-02-09', 'end_time' => '2017-02-14'],\n ['start_time' => '2017-07-05', 'end_time' => '2017-07-07'],\n ['start_time' => '2017-11-20', 'end_time' => '2017-11-22'],\n ['start_time' => '2017-12-27', 'end_time' => '2017-12-29'],\n ],\n ];\n\n foreach ($paidtimeoffs as $employee_name => $ptos) {\n $id = Employee::where('name', $employee_name)->getField('id');\n foreach ($ptos as $pto) {\n $pto['employee_id'] = $id;\n $pto['is_approved'] = true;\n PaidTimeOff::create($pto);\n }\n }\n }", "public function getPaymentDate();", "public function testCalculateIssTest()\n {\n foreach ($this->testCasesData() as $tesCase => $data) {\n $rota = 'strategyPattern/calculateIssTax?'.http_build_query($data['input']);\n $response = $this->call('GET', $rota);\n\n $response->assertJsonFragment(\n $data['output']['data']\n );\n\n $response->assertStatus($data['output']['status']);\n }\n }", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }" ]
[ "0.71868205", "0.60074663", "0.5864244", "0.56839275", "0.565424", "0.55694556", "0.5542698", "0.5508828", "0.5493599", "0.549301", "0.5481352", "0.54376054", "0.54351556", "0.54348385", "0.53937876", "0.53693855", "0.5354962", "0.5335611", "0.53247607", "0.5320745", "0.5314891", "0.53130317", "0.5300889", "0.5272726", "0.52389824", "0.52349764", "0.521183", "0.5199887", "0.5183161", "0.5182991" ]
0.63760084
1
Test it prints Fizz for multiples of 3, Buzz for multiples of 5, FizzBuzz? for multiples of both 3 and 5
public function test_it_prints() { // ADDED: check if the number contains the value as "string" (ie 13 is Fizz, 53 is Buzz etc) $expected = '1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Fizz 14 FizzBuzz? 16 17 Fizz 19 Buzz Fizz 22 Fizz Fizz Buzz '; $this->assertEquals($expected, $this->kata->printFizzBuzzRange(1, 25)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testFizz() {\n\t\t$testFizzBuzz = new FizzBuzz();\n\n\t\t//pass in a vlalue that should return Fizz\n\t\t$expected = 'Fizz';\n\t\t$response = $testFizzBuzz->evaluate(3);\n\n\t\t//assert that you got the correct response.\n\t\t$this->assertEquals($expected, \n\t\t\t\t\t\t\t$response, \n\t\t\t\t\t\t\t'Did not get Fizz as expected');\n\n\t}", "function getFizzBuzz($value) {\n\t\n\t$modThree = $value%3;\n\t$modFive = $value%5;\n\treturn (($modThree == 0 || $modFive == 0) ? (($modThree == 0 ? 'Fizz' : '') . ($modFive == 0 ? 'Buzz' : '') ) : $value);\n}", "function fb($x){\n for($i = 1; $i < $x; $i++){\n switch($i){\n case ($i % 3 == 0)&&($i % 5 == 0)://if number is a multiple of 3 and 5\n echo \"fizzbuzz \";\n break;\n case $i % 3 == 0://if number is a multiple of 3\n echo \"fizz \";\n break;\n case $i % 5 == 0://if number is a multiple of 5\n echo \"buzz \";\n break;\n default:\n echo $i.\" \";\n break; \n }\n }\n}", "public function testCheckForFizzBuzzOneFifty() : void\n {\n $fizz = new FizzBuzz();\n $this->assertEquals(\"fizzbuzz\", $fizz->checkForFizzBuzz(150));\n }", "public function testCheckForFizzBuzzFifteen() : void\n {\n $fizz = new FizzBuzz();\n $this->assertEquals(\"fizzbuzz\", $fizz->checkForFizzBuzz(15));\n }", "function fizzbuzz($fb) {\n\tif($fb<1 || !is_numeric($fb)){\n\t\treturn \"\";\n\t}else if($fb % 15 == 0){\n\t\treturn \"FizzBuzz\";\n\t}else if($fb % 3 == 0){\n\t\treturn \"Fizz\";\n\t}else if($fb %5 == 0){\n\t\treturn \"Buzz\";\n\t}else{\n\t\treturn $fb;\n\t}\t\n}", "public function testCheckForFizzBuzzTwentySeven() : void\n {\n $fizz = new FizzBuzz();\n $this->assertEquals(\"fizz\", $fizz->checkForFizzBuzz(27));\n }", "public function testCheckForFizzBuzzTen() : void\n {\n $fizz = new FizzBuzz();\n $this->assertEquals(\"buzz\", $fizz->checkForFizzBuzz(10));\n }", "public static function getFizzBuzz($num)\n {\n if ($num % 3 == 0 && $num % 5 == 0) {\n return 'FizzBuzz';\n } elseif ($num % 3 == 0) {\n return 'Fizz';\n } elseif ($num % 5 == 0) {\n return 'Buzz';\n }\n return $num;\n }", "public function runPhoneBuzz($num)\n {\n if(empty($num))\n return [0, \"You didn't enter any number. \"];\n if(!is_int($num))\n return [0, \"What you entered was not a number. \"];\n if($num < 1)\n return [0, \"Please enter a number above zero. \"];\n if($num > 50)\n return [0, \"That number is too big for me. Please enter a number between 1 and 50. \"];\n\n $response = \"\";\n\n //count from 1 and check for fizz and buzzes\n for($i = 1; $i <= $num; $i++) {\n if($this->isDivisibleByThreeAndFive($i)){\n $response .= \"Fizz Buzz, \";\n } else if($this->isDivisibleByThree($i)) {\n $response .= \"Fizz, \";\n } else if($this->isDivisibleByFive($i)) {\n $response .= \"Buzz, \";\n } else {\n $response .= $i . \", \";\n }\n }\n\n return [1,$response]; //if no error, output with result 1 and response message in array\n }", "public function fizzBuzzScenarios($expected, $testvalue) {\n\t\t$testFizzBuzz = new FizzBuzz();\n\t\t$response = $testFizzBuzz->evaluate($testvalue);\n\t\t$this->assertEquals($expected, \n\t\t\t\t\t\t \t$response, \n\t\t\t\t\t\t \t'Did not get ' . $expected . ' as expected: ' . $response);\n\t}", "function pre_fizz(int $n)\n{\n // INITIAL SOLUTION\n // $output = [];\n // $start = 1;\n\n // for($x = 5 - $n; $x < 5; $x++) {\n // $output[] = $start++;\n // }\n\n // return $output;\n\n // REFACTORED SOLUTION\n return range(1, $n);\n}", "public function example6()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "public function testExample()\n {\n echo \" testing numbers \";\n $isbnNumbers = [\n \"807229654X\", \"807229654\", \"978 032 640 615-1\", \"978032640615\", \"0072296542\",\n \"176041640615766\", \"0072296552\", \"007-229-654 2\", \"2460323406152\"\n ];\n $results = [1,0,1,0,1,0,0,1,1];\n\n $evaluated = [];\n foreach ($isbnNumbers as $isbn) {\n $evaluated[$isbn] = Helpers\\ISBN::isValidISBN($isbn);\n }\n $index = 0;\n $true = true;\n\n foreach($evaluated as $number => $output) {\n $true = $true && ($results[$index] == $output['valid']);\n if(!$true) {\n echo $results[$index].\" true: \".($true? \"1 \":\"0 \");\n print_r($output);\n }\n $index++;\n }\n\n $this->assertTrue($true);\n }", "public function fizzBuzzProvider() {\n\t\treturn array(\n\t\t\t\tarray('Fizz', 3),\n\t\t\t\tarray('Buzz', 5),\n\t\t\t\tarray('FizzBuzz', 15),\n\t\t\t\tarray(7, 7)\n\t\t\t);\n\t}", "function Factor($n){\n while($n%2==0){\n echo \"2 \\n\";\n $n=$n/2;\n }\n for($i=3;$i<=sqrt($n);$i=$i+2){\n while($n%$i==0){\n echo \"$i \\n\";\n $n=$n/$i;\n }\n }\n if($n>2){\n echo \"$n\\n\";\n }\n }", "public function example5()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "public function testNumbersContaining3OutputLucky()\n {\n // Create a new instance of Step2\n $step2 = new Step2;\n\n // Test random numbers containing 3 output 'lucky'\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(35262));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(15783));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(26353));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(896653));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(453665));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(513));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(68373));\n $this->assertSame('lucky', $step2->outputLuckyForNumbersContaining3(300));\n }", "public function example10()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}", "public function example3()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "public function example9()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "public function example11()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "public function testIsEvenPassTwo()\n {\n \t$this->assertTrue(isEven(2));\n }", "public function example7()\n {\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n if ($a == $b) {\n if ($a1 == $b1) {\n fiddle();\n } else {\n if ($a2 == $b2) {\n fiddle();\n } else {\n fiddle();\n }\n }\n } else {\n if ($c == $d) {\n while ($c == $d) {\n fiddle();\n }\n } else {\n if ($e == $f) {\n for ($n = 0; $n < $h; $n++) {\n fiddle();\n }\n } else {\n switch ($z) {\n case 1:\n fiddle();\n break;\n case 2:\n fiddle();\n break;\n case 3:\n fiddle();\n break;\n default:\n fiddle();\n break;\n }\n }\n }\n }\n\n // Just to make sure the class method is very long\n abc();\n xyz();\n\n abc();\n xyz();\n abc();\n xyz();\n abc();\n xyz();\n }", "function p3_ex2() {\n $rand = mt_rand(1, 100); // mt_rand is very better\n for ($i = 0; $i <= 20; $i++) {\n if ($i % 5 == 0 && $i != 0)\n $return .= 'resultat : '.($i * $rand).'<br />';\n else\n $return .= 'resultat : '.($i * $rand).', ';\n }\n\n return $return;\n}", "public function calculateFactor($number){\n\n //Variables that define the multiples of three and five\n $ofThree = $number%3 === 0;\n $ofFive = $number%5 === 0;\n $ofBoth = $ofThree && $ofFive;\n\n //Push all the answers to the container\n $container = [];\n array_push($container, $ofThree, $ofFive, $ofBoth, false);\n $size = 3;\n \n $count = 0;\n $count_true = 0;\n $index = 0;\n \n //Finds the first true, add 1 to the end to match the values later\n while($container[$index] !== true && $index < $size){\n $index++;\n }\n $index++;\n\n //Counts the total number of trues\n while($count < $size){\n $count_true += $container[$count];\n $count++;\n }\n\n //Array that contains the map for the answer\n $arr_values = [0 => $number, 1 => 'Linio', 2 => 'IT', 3 => 'Linianos'];\n\n //Only if that evaluate if there is one true and gives the value with $index\n if($count_true == 1){\n return $arr_values[$index];\n }\n\n //Return the arr value in case there is less or more than one true\n return $arr_values[$count_true];\n }", "function TestNumber($N) {\t\r\n\t\tglobal $DecentNumber, $Max5s, $Max3s, $SolutionFound;\r\n\t\tswitch ($N) {\r\n\t\t// Too small to start\r\n\t\t\tCase ($N <= 2):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 3 - early success exit\r\n\r\n\t\t\tCase ($N == 3):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = 1;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"555\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for 4 - Fail\r\n\t\r\n\t\t\tCase ($N == 4):\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\t$Max5s = 0;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = \"-1\";\r\n\t\t\t\tbreak;\r\n\t\r\n\t\t// Check for Special Success MOD 3 = 0, If this is true, then we found a special case of all 5's.\r\n\t\t\r\n\t\t\tCase (($N % 3) == 0):\r\n\t\t\t\t$SolutionFound = TRUE;\r\n\t\t\t\t$Max5s = $N / 3;\r\n\t\t\t\t$Max3s = 0;\r\n\t\t\t\t$DecentNumber = AssembleString($Max5s, $Max3s);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\t$SolutionFound = FALSE;\r\n\t\t\t\tGeneralCase ($N);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}", "function test(Array $number)\n\t{\n\t\t$replace = [\n\t\t\t'Linio' => 3,\n\t\t\t'IT' => 5,\n\t\t\t'Linianos' => [3,5]\n\t\t];\n\n\t\tforeach ($number as $key => $value) {\n\t\t\tif (!is_numeric($value) && array_key_exists($value, $replace)) {\n\n\t\t\t\t$test = (!is_array($replace[$value])) ? ($key % $replace[$value] == 0) : ($key % $replace[$value][0] == 0 && $key % $replace[$value][1] == 0);\n\t\t\t\t\n\t\t\t\tif (!$test) {\n\t\t\t\t\techo \"Failure\";\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \">>>>>>>>>>>>>>>>>>>>>>> Test Success <<<<<<<<<<<<<<<<<<<<<<<<<<<<\";\n\t}", "public static function test(){\n\t\t//It takes in no arguments and doesn't return anything.\n\t\t//It prints out a bunch of permutations.\n\t\t$testArray = explode(' ', Adams::getTestString());\n\t\t$testArray = Adams::raiseAll($testArray);\n\t\t$permutations = Adams::getPermutations($testArray);\t\n\t\t//print_r($permutations);\n\t\tforeach($permutations as $permutation){\n\t\t\t$outputString .= implode(' ',$permutation).\"\\n\";\t\n\t\t}\n\t\tprint $outputString;\n\t}" ]
[ "0.7165587", "0.7119616", "0.71095306", "0.64468217", "0.63495094", "0.6283529", "0.62743455", "0.6052282", "0.57791924", "0.5682514", "0.56733114", "0.56232566", "0.54784524", "0.54673094", "0.5435781", "0.5435165", "0.53490114", "0.5329325", "0.5319659", "0.5306297", "0.5252336", "0.5236429", "0.5218967", "0.5209075", "0.5208447", "0.5208144", "0.5193177", "0.515117", "0.51343256", "0.5120399" ]
0.714626
1
calls the searchByISBN method from Patron class,gets the result and calls the controlSearch
function executeSearchByISBN($patron, $bookISBN){ $result = $patron->searchByISBN($bookISBN); $res=$this->controlSearch($result); return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function controlSearch($result){\n\t\t$bookIDs = $this->getBookIDs($result);\n\t\t$bookObjects = array();\n\n\t\tfor($i = 0; $i < count($bookIDs); $i++){\n\t\t\t$bookObject = constructBook($bookIDs[$i]);\n\t\t\t$bookObjects[$i] = $bookObject;\n\t\t}\n\t\t\n\t\t$currentPatronID = $_SESSION['currentPatronID'];\n\t\t$currentPatron = constructPatron($currentPatronID);\n\t\t$patronDep = $currentPatron->getDepartment();\n\n\t\t$suggestedBooks = $this->executeSuggestion($patronDep);\n\t\t\n\t\t$result_one=$this->displaySearch($bookObjects, $suggestedBooks);\n\t\t\n\t\treturn $result_one;\n\t}", "function executeSearchByTitle($patron, $bookTitle){\n\t\t$result = $patron->searchByTitle($bookTitle);\n\t\t$res=$this->controlSearch($result);\n\t\treturn $res;\n\t}", "public function search()\n\t{\t\t\n\t\t$data = array();\n\t\t\n\t\tif($this->input->get()){\n\t\t\t\n\t\t\t$post_data = $this->input->get();\n\t\t\tif(isset($post_data['isbn']) && isset($post_data['author']) && isset($post_data['title']))\n\t\t\t{\n\t\t\t\t$post_data = array('isbn' => $post_data['isbn'],\n\t\t\t\t\t\t\t\t\t'author' => $post_data['author'],\n\t\t\t\t\t\t\t\t\t'title' => $post_data['title'],\n\t\t\t\t\t\t\t\t\t'title_condition' => $post_data['title_condition'],\n\t\t\t\t\t\t\t\t\t'isbn_condition' => $post_data['isbn_condition']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$validation = true;\n\t\t\t\tif(empty($post_data['isbn']) && empty($post_data['author']) && empty($post_data['title']))\n\t\t\t\t\t$validation = $this->form_validation->set_data($post_data)\n\t\t\t\t\t\t\t->set_rules('isbn', 'ISBN or Title or Author', 'required')->run();\n\t\t\t\t\n\t\t\t\tif ($validation == TRUE)\n\t\t\t\t{\n\t\t\t\t\t$this->load->model('library/search', 'search');\n\t\t\t\t\t$data['result'] = $this->search->searchResults();\n\t\t\t\t\t$base_url = base_url(\"library/books/search\");\n\t\t\t\t\t$rows = count($data['result']);\n\t\t\t\t\t$data['post_data'] = $post_data;\n\t\t\t\t\tif($rows){\n\t\t\t\t\t\t$this->session->set_flashdata('error_msg','');\n\t\t\t\t\t\t$data['pagination'] = $this->createPageLinks($base_url,$rows);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('error_msg','Sorry the book you are looking for is not available!'); \n\t\t\t\t\t}\n\t\t\t\t\t$this->load->library('table');\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->load->template('library/search_books',$data);\n\t}", "function search_textbooks($db, $title, $isbn, $author)\n{\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \n\t\t\t\t\t\t\".$titlekey.\" LIKE :title and \".$isbnkey.\" LIKE :isbn and \n\t\t\t\t\t\t\".$authorkey.\" LIKE :author and removed=0\n\t\t\t\t\t\tORDER BY date_time DESC\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "public function getBook($isbn);", "public function searchBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t \t\t//$return = array();\n\t\t\t$book = D('Book_species');\n\t\t\t$sql = \"SELECT * FROM lib_book_species as a join\n\t\t\t\t\t(SELECT COUNT(*) as number, isbn FROM lib_book_unique \n\t\t\t \t\twhere book_id not in(select book_id from lib_remove)\n\t\t\t \t\tGROUP BY isbn) AS b using(isbn)\n\t\t\t \t\twhere {$type} like '%{$text}%' and number!=0 ORDER BY species_id DESC;\";\n\t\t\tif ($type == 1) {\n\t\t\t\t$bkid = intval($text);\n\t\t\t\t$sql = \"select * from lib_book_species join (select isbn,count(*)\n\t\t\t\t \t\tas number from lib_book_unique group by isbn) as a using(isbn) \n\t\t\t\t\t\twhere isbn in (select isbn from lib_book_unique \n\t\t\t\t\t\twhere book_id = {$bkid}) and {$bkid} not in \n\t\t\t\t\t\t(select book_id from lib_remove)\";\n\t\t\t}\n\n\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No result!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "function executeSearchByAuthor($patron, $bookAuthor){\n\t\t$result = $patron->searchByAuthor($bookAuthor);\n\t\t$res=$this->controlSearch($result);\n\t\treturn $res;\n\t\n\t}", "public function search()\n\t{\n\t\t\n\t}", "function search_inventory($db, $seller_id, $title, $isbn, $author)\n{\n\t/* Copy and pasted code from \"search_textbooks\" I can't just wrap it in another function because of how the\n\t\t\t\tprepared statement works */\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \".$titlekey.\" LIKE :title and \n\t\t\".$isbnkey.\" LIKE :isbn and \".$authorkey.\" \n\t\tLIKE :author and seller_id = :seller_id ORDER BY date_time DESC\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue, ':seller_id'=>$seller_id));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "public function search();", "public function search();", "public function searchBorrow()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t\t\t$book = D('Book_species');\n\t\t\tif($type == 'book_id'){\n\t\t\t\t$text = intval($text);\n\t\t\t\t$sql = \"SELECT * FROM lib_borrow join lib_user using(user_id)\n\t\t\t\t\t\tjoin lib_book_unique using(book_id) \n\t\t\t\t\t\tjoin lib_book_species using(isbn) \n\t\t\t\t\t\twhere {$type} = {$text} ORDER BY species_id DESC;\";\n\t\t\t}else{\n\t\t\t\t$sql = \"SELECT * FROM lib_borrow join lib_user using(user_id)\n\t\t\t\t \t\tjoin lib_book_unique using(book_id) \n\t\t\t\t \t\tjoin lib_book_species using(isbn) \n\t\t\t\t \t\twhere {$type} like '%{$text}%' ORDER BY species_id DESC;\";\n\t\t\t}\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\tfor($k=0;$k<count($return);$k++){\n\t\t\t\t\t$return[$k]['book_id'] = substr($return[$k]['book_id']+100000,1,5);\n\t\t\t\t}\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No result!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function search(){}", "function search() {}", "function results() {\n\t\t$query = $this->input->post('q');\n\t\t$type = $this->input->post('type');\n\t\t$group = $this->input->post('group');\n\t\t\n\t\t$params = $this->uri->uri_to_assoc(3);\n\t\tif ( isset($params['q']) ) $query = $params['q'];\n\t\tif ( isset( $params['page'] )\n\t\t\t&& is_int( $params['page'] ) ) {\n\t\t\t\t$page = $params['page'];\n\t\t\t} else {\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\tif ( isset( $params['size'] )\n\t\t\t&& is_int( $params['size'] ) ) {\n\t\t\t\t$page_size = $params['size'];\n\t\t\t} else {\n\t\t\t\t$page_size = 25;\n\t\t\t}\n\t\t\n\t\t$query = trim($query);\n\t\t\n\t\t// see if this looks like an ISBN \n\t\t// FIXME dunno if we should keep this ability\n\t\tif( strlen($query) == 13 && is_int($query) && substr($query,0,3) == '978' ) {\n\t\t\t$this->load->model('products_model');\n\t\t\t$res = $this->products_model->get_product_by_ean( $query );\n\t\t\tif( $res->num_rows > 0 ) {\n\t\t\t\t$row = $res->row();\n\t\t\t\tredirect('/product/view/' . $row->id );\n\t\t\t}\n\t\t} elseif( strlen( $query ) > 0 ) {\n\t\t\t$res = $this->search_model->search($query, $type, $page, $page_size );\n\t\t\t$results = $res->result();\n\t\t} else {\n\t\t\t$results = array();\n\t\t}\n\t\t\n\t\t\n\t\t$prev = $next = false;\n\t\tif( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\t\t\t$params['page'] = $prev_page;\n\t\t\t$prev = '/search/results/' . $this->assoc_to_uri($params);\n\t\t}\n\t\tif ( count($results) > $page * $page_size ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$params['page'] = $next_page;\n\t\t\t$next = '/searc/results/' . $this->assoc_to_uri($params);\n\t\t}\n\n\n\t\t$nav['main'] = 'Home';\n\t\t$nav['sub'] = '';\n\t\t$data = array(\n\t\t\t'results' => $results,\n\t\t\t'page' => $page,\n\t\t\t'page_size' => $page_size,\n\t\t\t'query_string' => $query,\n\t\t\t'prev' => $prev,\n\t\t\t'next' => $next,\n\t\t\t'nav' => $nav\n\t\t\t);\t\t\n\t\t\t\t\n\t\t$this->load->view('search/results', $data);\n\t\t\t\t\n\t}", "function search_textbook_range($db, $title, $isbn, $author, $numstart, $numresults)\n{\n\t$titlekey = \"\"; //sql colomn name\n\t$isbnkey = \"\"; //sql column name \n\t$authorkey = \"\"; //sql column name\n\t$titlevalue = \"\"; // sql column value\n\t$isbnvalue = \"\"; // sql column value\n\t$authorvalue = \"\"; // sql column value\n\n\t/* All empty strings returns nothing */\n\tif($title == \"\" && $isbn == \"\" && $author == \"\")\n\t{\n\t\t$titlekey = \"1\";\n\t\t$isbnkey = \"1\";\n\t\t$authorkey = \"1\";\n\t\t$titlevalue = \"0\";\n\t\t$isbnvalue = \"0\";\n\t\t$authorvalue = \"0\";\n\t}\n\telse // If not an empty search\n\t{\n\n\t\tif($title == \"\") // No search by title\n\t\t{\n\t\t\t$titlekey = '1';\n\t\t\t$titlevalue = '1';\n\t\t}\n\t\telse // Include search by title\n\t\t{\n\t\t\t$titlekey = 'title';\n\t\t\t$titlevalue = \"%\".$title.\"%\"; \n\t\t}\n\n\t\tif($isbn == \"\") // No search by isbn\n\t\t{\n\t\t\t$isbnkey = '1';\n\t\t\t$isbnvalue = '1';\n\t\t}\n\t\telse // include search by isbn\n\t\t{\n\t\t\t$isbnkey = 'isbn';\n\t\t\t$isbnvalue = \"%\".$isbn.\"%\";\n\t\t}\n\n\t\tif($author == \"\") // no search by author\n\t\t{\n\t\t\t$authorkey = '1';\n\t\t\t$authorvalue = '1';\n\t\t}\n\t\telse // include search by author\n\t\t{\n\t\t\t$authorkey = 'author';\n\t\t\t$authorvalue = \"%\".$author.\"%\";\n\t\t}\n\t}\n\n\t\t/* Run the query */\n\t\t$sql = \"SELECT * FROM textbooks where \n\t\t\t\t\t\t\".$titlekey.\" LIKE :title and \".$isbnkey.\" LIKE :isbn and \n\t\t\t\t\t\t\".$authorkey.\" LIKE :author and removed=0\n\t\t\t\t\t\tORDER BY date_time DESC LIMIT $numstart, $numresults\";\n\n\t\t$st = $db->prepare($sql);\n\t\t$st->execute(array(':title' => $titlevalue, ':isbn'=>$isbnvalue, ':author'=>$authorvalue));\n\t\t$us = $st->fetchAll();\n\t\treturn $us;\n}", "public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( Invoices::grid() )->search ();\n\t}", "function search()\n\t{}", "function search()\n\t{}", "private function findISBNwithBTRN($btrn){\n\t\t$db = $this->db;\n\n\t\t$query = \"SELECT isbn13, isbn10 FROM newstech_book WHERE bowker_title_record_number='$btrn'\";\n\t\t$successful = $result = $db->query($query);\t\t\n\t\tif (!$successful){\n\t\t\tthrow new Exception(sprintf(\"BookHandler.class.php: %d => No ISBNs found for BTRN: %s, DB: %s\", __LINE__, $btrn, $db->error));\t\n\t\t}\n\t\treturn $result;\t//\treturn the tuples of isbn13s and isbn10s (some of these values -- for one or the other -- will be null)\n\t}", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function getSearch () {\n\t\tif (isset ($_POST['data']) && '' !== trim ($_POST['data'])) {\n\t\t\tself::$sSearch = strtolower ($_POST['data']);\n\t\t\tif (self::$sSearch === '*') {\n\t\t\t\t$aTmp = $this -> aVilles;\n\t\t\t\tif (isset ($_POST['sort']) && in_array ($_POST['sort'], array ('0', '2'))) {\n\t\t\t\t\tasort ($aTmp);\n\t\t\t\t} else {\n\t\t\t\t\tksort ($aTmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif (is_numeric (self::$sSearch)) {\n\t\t\t\t$aTmp = array_filter (array_flip ($this -> aVilles), array ('self', 'getFirst'));\n\t\t\t\t$aTmp = array_flip ($aTmp);\n\t\t\t\tif (isset ($_POST['sort']) && in_array ($_POST['sort'], array ('0', '1'))) {\n\t\t\t\t\tksort ($aTmp);\n\t\t\t\t} else {\n\t\t\t\t\tasort ($aTmp);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$aTmp = array_filter ($this -> aVilles, array ('self', 'getFirst'));\n\t\t\t\tif (isset ($_POST['sort']) && in_array ($_POST['sort'], array ('0', '2'))) {\n\t\t\t\t\tasort ($aTmp);\n\t\t\t\t} else {\n\t\t\t\t\tksort ($aTmp);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$iCpt = 0;\n\t\t\t$this -> sResult .= '<div style=\"border: 1px solid #000000;width: 250px;background-color: #ffffff;\"><span title=\"Trier par code postal\" onclick=\"search (\\''.self::$sSearch.'\\',1);\" style=\"cursor: pointer; margin: 5px;font-weight: bold;text-align: left;width: 100px;\">Code </span><span title=\"Trier par ville\" onclick=\"search (\\''.self::$sSearch.'\\',2);\" style=\"width: 150px;cursor: pointer; margin: 5px;font-weight: bold; text-align: right;\">Ville</span></div>';\n\t\t\tforeach ($aTmp as $cp => $ville) {\n\t\t\t\t$sColor = ($iCpt%2 === 0)?'background-color: #cccccc;':'background-color: #ffffff;';\n\t\t\t\t$this -> sResult .= '<div style=\"border: 1px solid #000000;width: 250px;'.$sColor.'\"><span onclick=\"document.getElementById(\\'mySearch\\').value = this.innerHTML;\" style=\"cursor: pointer; margin: 5px;'.$sColor.'\">'.$cp.'</span><span onclick=\"document.getElementById(\\'mySearch\\').value = this.innerHTML;\" style=\"cursor: pointer; margin: 5px;'.$sColor.'\">'.$ville.'</span></div>';\n\t\t\t\t$iCpt ++;\n\t\t\t}\n\t\t\techo $this -> sResult;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function loadISBN(){\n $sqlQuery = 'SELECT I.val FROM identifiers I , books B WHERE I.type=\"ISBN\" AND B.id = I.book AND B.id='.$this->id;\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n return $row['val'];\n return \"\";\n }", "public function search($postcode);", "function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t\t$data_rows=get_temp_manage_table_data_rows1($this->Giftcard->search($search),$this);\n\t\t\techo $data_rows;\n\t}", "public function RunSearch()\n {\n BizSystem::log(LOG_DEBUG,\"FORMOBJ\",$this->m_Name.\"::RunSearch()\");\n global $g_BizSystem;\n $this->m_SearchRule = \"\";\n foreach ($this->m_RecordRow as $fldCtrl) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n if ($value) {\n $searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);\n if ($this->m_SearchRule == \"\")\n $this->m_SearchRule .= $searchStr;\n else\n $this->m_SearchRule .= \" AND \" . $searchStr;\n }\n }\n\n $this->SetDisplayMode (MODE_R);\n $this->GotoPage(1);\n $this->m_RecordId = null; // clean the current record id\n $this->m_ClearSearchRule = true;\n return $this->ReRender();\n }", "public function InitializeSearch($cn) {\r\n //SetDisplayValues($attributes) \r\n\r\n /* Campos de busqueda */\r\n $this->m_obj->GetField(\"cap_code\")->SetDisplayValues(Array(\"Name\"=>\"cap_code\", \"Label\"=>\"Capacitación Nro\", \"Type\"=>\"int\", \"IsPK\"=>true, \"IsForDB\"=>true, \"Order\"=>101, \"Presentation\"=>\"INT\", \"IsNullable\"=>false));\r\n $this->m_obj->GetField(\"mon_code\")->SetDisplayValues(Array(\"Name\"=>\"mon_code\", \"Label\"=>\"Monitoreo Nro\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>102, \"Presentation\"=>\"INT\"));\r\n $this->m_obj->GetField(\"cir_code\")->SetDisplayValues(Array(\"Name\"=>\"cir_code\", \"Label\"=>\"Circuito\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>103, \"Presentation\"=>\"CIRCUITO_ACTIVO\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"use_code_operador\")->SetDisplayValues(Array(\"Name\"=>\"use_code_operador\", \"Label\"=>\"Operador\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>104, \"Presentation\"=>\"OPERADOR\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"use_code_supervisor\")->SetDisplayValues(Array(\"Name\"=>\"use_code_supervisor\", \"Label\"=>\"Supervisor Asignado\", \"Type\"=>\"int\", \"IsForDB\"=>true, \"Order\"=>105, \"Presentation\"=>\"SUPERVISOR\", \"IsNullable\"=>false, \"IsVisible\"=>true));\r\n $this->m_obj->GetField(\"cap_status\")->SetDisplayValues(Array(\"Name\"=>\"cap_status\", \"Label\"=>\"Estado\", \"Size\"=>20, \"IsForDB\"=>true, \"Order\"=>107, \"Presentation\"=>\"CAP_STATUS\", \"InitialValue\"=>\"PENDIENTE\"));\r\n }", "function getSearchInfo()\n\t{\n\t\t//Global allows variables outside the function scope to be used here\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\t\tglobal $params_arr;\n\t\t\n\t\t\n\t\t$keyword = $params_arr[0];\n\t\t$order = $params_arr[1];\n\t\t\n\t\t$sql = \"SET @SEARCH_TERM = '%$keyword%';\";\n\t\t\n\t\tif ($conn->query($sql) === TRUE) \n\t\t{\n\t\t\t//echo \"New record created successfully\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\n\n\t\t$sql = \"SELECT books.COVER, books.TITLE, books.GENRE, books.PUBLISHER, authors.FIRST_NAME, authors.LAST_NAME, books.PUB_DATE,\n\t\t\t \t\t books.DESCRIPTION, authors.BIO, books.ISBN, books.ID\n\t\t\t\t FROM books \n\t\t\t\t JOIN authors ON books.AUTHOR = authors.ID\n\t\t\t\t WHERE authors.FIRST_NAME LIKE @SEARCH_TERM OR\n\t\t\t authors.LAST_NAME LIKE @SEARCH_TERM OR \n\t\t\t\t\t\tbooks.TITLE LIKE @SEARCH_TERM OR\n\t\t\t\t\t\tbooks.GENRE LIKE @SEARCH_TERM\n\t\t\t\tORDER BY books.TITLE $order\n\t\t\t\t\n\t\t\t\t\";\n\t\t\t\t//Limit $offset; \n\t\t\t\t//@Julian then here I have LIMIT of per page here $offset so if 10 or 20 placed here just like ASC/DESC\n\n\t\t//Executes query string\n\t\t$result = $conn->query($sql);\n\t\t//Im making the page number between 10 and 20\n\t\tif ($result->num_rows > 0) \n\t\t{\n\t\t\t$json = array();\n\t \t// convert the data into json object\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t\t\t$bus = array(\n\t\t\t\t\t\"cover\" => $row[\"COVER\"],\n\t\t\t\t\t\"title\" => $row[\"TITLE\"],\n\t\t\t\t\t\"author\" => $row[\"FIRST_NAME\"]. \" \" .$row[\"LAST_NAME\"],\n\t\t\t\t\t\"genre\" => $row[\"GENRE\"],\n\t\t\t\t\t\"publisher\" => $row[\"PUBLISHER\"],\n\t\t\t\t\t\"pub_date\" => $row[\"PUB_DATE\"],\n\t\t\t\t\t\"description\" => $row[\"DESCRIPTION\"],\n\t\t\t\t\t\"bio\" => $row[\"BIO\"],\n\t\t\t\t\t\"isbn\" => $row[\"ISBN\"],\n\t\t\t\t\t\"id\" => $row[\"ID\"]\n\t\t\t\t);\n\n\t\t\t\tarray_push($json, $bus);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$jsonstring = json_encode($json);\n\t\t\techo $jsonstring;\n\t\t}\n\t\telse\n\t\t{\n\t\t echo \"0 results\";\n\t\t}\n\n\n\n\t\t$conn->close();\n\t}", "function sbn_search($ccl_query) {\n global $_SBN;\n // let YAZ parse the query and check for error\n $result = yaz_ccl_parse($this->conn, $ccl_query, $ccl_result);\n if (!$result) {\n throw new sbn_exception(\"La query non puo' essere processata\");\n } else {\n // fetch RPN result from the parser\n $rpn = $ccl_result[\"rpn\"];\n // do the actual query\n yaz_search($this->conn, \"rpn\", $rpn);\n // wait blocks until the query is done\n yaz_wait();\n if (yaz_error($this->conn) != \"\") {\n throw new sbn_exception(\"Error: \" . yaz_error($this->conn).\"<br>\");\n }\n // yaz_hits returns the amount of found records\n /*\n $hits = yaz_hits($this->conn);\n if ($hits > 0) {\n //echo \"Found \".$hits .\" hits:<br>\";\n // yaz_record fetches a record from the current result set,\n // so far I've only seen server supporting string format\n //$result = yaz_record($this->conn, 1, \"string\");\n //print($result);\n //echo \"<br><br>\";\n // the parsing functions will be introduced later\n /*\n if ($_SBN['syntax'] == \"mab\") {\n $parsedResult = parse_mab_string($result);\n } else {\n $parsedResult = parse_usmarc_string($result);\n }\n print_r($parsedResult);\n } else {\n echo \"No records found.\";\n }\n */\n }\n }", "function search() {\n // ...\n }" ]
[ "0.7064732", "0.67656755", "0.6432695", "0.6421345", "0.62704927", "0.6166718", "0.61459535", "0.61213976", "0.610957", "0.61066437", "0.61066437", "0.6100272", "0.6095888", "0.6051537", "0.60473675", "0.60280454", "0.5897859", "0.58899283", "0.58899283", "0.58709306", "0.5820145", "0.5813776", "0.5793696", "0.57925045", "0.5777292", "0.5763568", "0.5726983", "0.5717239", "0.57026", "0.5668929" ]
0.79055
0
calls the searchByTitle method from Patron class,gets the result and calls the controlSearch
function executeSearchByTitle($patron, $bookTitle){ $result = $patron->searchByTitle($bookTitle); $res=$this->controlSearch($result); return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function controlSearch($result){\n\t\t$bookIDs = $this->getBookIDs($result);\n\t\t$bookObjects = array();\n\n\t\tfor($i = 0; $i < count($bookIDs); $i++){\n\t\t\t$bookObject = constructBook($bookIDs[$i]);\n\t\t\t$bookObjects[$i] = $bookObject;\n\t\t}\n\t\t\n\t\t$currentPatronID = $_SESSION['currentPatronID'];\n\t\t$currentPatron = constructPatron($currentPatronID);\n\t\t$patronDep = $currentPatron->getDepartment();\n\n\t\t$suggestedBooks = $this->executeSuggestion($patronDep);\n\t\t\n\t\t$result_one=$this->displaySearch($bookObjects, $suggestedBooks);\n\t\t\n\t\treturn $result_one;\n\t}", "public function search(){}", "public function search()\n\t{\n\t\t\n\t}", "public function search();", "public function search();", "public function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "function search() {}", "public function RunSearch()\n {\n BizSystem::log(LOG_DEBUG,\"FORMOBJ\",$this->m_Name.\"::RunSearch()\");\n global $g_BizSystem;\n $this->m_SearchRule = \"\";\n foreach ($this->m_RecordRow as $fldCtrl) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n if ($value) {\n $searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);\n if ($this->m_SearchRule == \"\")\n $this->m_SearchRule .= $searchStr;\n else\n $this->m_SearchRule .= \" AND \" . $searchStr;\n }\n }\n\n $this->SetDisplayMode (MODE_R);\n $this->GotoPage(1);\n $this->m_RecordId = null; // clean the current record id\n $this->m_ClearSearchRule = true;\n return $this->ReRender();\n }", "public function searchTitle($title) {\n try {\n // escape quotes\n $checkTitle = str_replace(\"'\", \"''\", $title);\n // search the database, using wildcards\n $sql = \"SELECT * FROM books WHERE title LIKE '%$checkTitle%' ORDER BY author\";\n $stmt = $this->conn->query($sql);\n \n // fetch results as numeric array\n $result = $stmt->setFetchMode(PDO::FETCH_NUM);\n // show results in a list of update forms\n echo \"<br /><div id='searchResult'><h3>Title: -$title-</h3><ul>\";\n while ($row = $stmt->fetch()) {\n // call result form function\n $this->echoResultForm($row);\n }\n echo \"</ul></div>\";\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "function search()\n\t{}", "function search()\n\t{}", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function getSearch();", "function search() {\n // ...\n }", "public function action_search()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// What can we search for?\n\t\t$subActions = array(\n\t\t\t'internal' => array($this, 'action_search_internal', 'permission' => 'admin_forum'),\n\t\t\t'online' => array($this, 'action_search_doc', 'permission' => 'admin_forum'),\n\t\t\t'member' => array($this, 'action_search_member', 'permission' => 'admin_forum'),\n\t\t);\n\n\t\t// Set the subaction\n\t\t$action = new Action('admin_search');\n\t\t$subAction = $action->initialize($subActions, 'internal');\n\n\t\t// Keep track of what the admin wants in terms of advanced or not\n\t\tif (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] != $subAction)\n\t\t{\n\t\t\t$context['admin_preferences']['sb'] = $subAction;\n\n\t\t\t// Update the preferences.\n\t\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\t\t\tupdateAdminPreferences();\n\t\t}\n\n\t\t// Setup for the template\n\t\t$context['search_type'] = $subAction;\n\t\t$context['search_term'] = $this->_req->getPost('search_term', 'trim|\\\\ElkArte\\\\Util::htmlspecialchars[ENT_QUOTES]');\n\t\t$context['sub_template'] = 'admin_search_results';\n\t\t$context['page_title'] = $txt['admin_search_results'];\n\n\t\t// You did remember to enter something to search for, otherwise its easy\n\t\tif ($context['search_term'] === '')\n\t\t{\n\t\t\t$context['search_results'] = array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action->dispatch($subAction);\n\t\t}\n\t}", "public function search()\n {\n auth_admin();\n $s_title = myUrlEncode(trim($this->input->post('s_title')));\n redirect($this->path_uri . '/main/a' . $s_title);\n }", "public function searchAction() {\n parent::searchAction();\n }", "public function searchAction(){\t\t\n\t\t\t// startup: get translater and create windowTitel\t\t\t\t \n\t\t\t$translate = $this->_owApp->translate;\n $windowTitle = $translate->_('Search results');\n $this->view->placeholder('main.window.title')->set($windowTitle);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// get search string from input field (searchbox.phtml)\n\t\t\t$nameOfPerson = $this->getParam('nameOfPerson');\n\t\t\t\t\t\t\n\t\t\tif (!empty($nameOfPerson)){\n\t\t\t\t// create query\n\t\t\t\t$query = new Erfurt_Sparql_SimpleQuery(); \n\t\t\t\t$query->setProloguePart('SELECT ?resourceUri ?Name ?yearOfBirth ?placeOfBirth ?yearOfDeath ?placeOfDeath ?labor') \n\t\t\t\t\t ->setWherePart('WHERE {'. '?resourceUri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'. '<http://drw-model.saw-leipzig.de/Person> . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://www.w3.org/2000/01/rdf-schema#label> ?Name . '.\t\t\t \t\t\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/yearOfBirth> ?yearOfBirth . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/placeOfBirth> ?placeOfBirth . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/yearOfDeath> ?yearOfDeath . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/placeOfDeath> ?placeOfDeath . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/labor> ?labor . '.\n\t\t\t\t\t\t\t\t\t\t\t'FILTER regex (?Name, \"'.$nameOfPerson.'\", \"i\" )}');\t\t\t\t\t\t\t\t\n\t\t\t\t/////////// ToDo:\n\t\t\t\t// model = DRW-Katalog\t\t\t\t\t\t\t\n\t\t\t\t$this->model = $this->_owApp->selectedModel;\n\t\t\t\t$queryResult = $this->model->sparqlQuery($query);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$header = array ();\t\t\n\t\t\t\tif (is_array($queryResult) && isset ($queryResult[0]) && is_array($queryResult[0])) {\n\t\t\t\t\t$header = array_keys($queryResult[0]);\n\t\t\t\t}else {\n\t\t\t\t\t$queryResult = 'No Person was found for \"%s\".';\n\t\t\t\t\t$queryResult = sprintf($translate->_($queryResult), $nameOfPerson);\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\t// set strings to view -> search.phtml can access strings from view\t\t\n\t\t\t\t$this->view->urlBase = $this->_config->urlBase;\t\t\t\n\t\t\t\t$this->view->header = $header;\n\t\t\t\t$this->view->queryResult = $queryResult;\n\t\t\t} else /* if empty($nameOfPerson) */{\n\t\t\t\t$this->view->queryResult = $translate->_('Please enter a search item.');\n\t\t\t}\n\t\t}", "public function onSearch()\r\n {\r\n // get the search form data\r\n $data = $this->form->getData();\r\n \r\n // clear session filters\r\n TSession::setValue('MusicaList_filter_muscodigo', NULL);\r\n TSession::setValue('MusicaList_filter_musnome', NULL);\r\n TSession::setValue('MusicaList_filter_musregistro', NULL);\r\n\r\n if (isset($data->muscodigo) AND ($data->muscodigo)) {\r\n $filter = new TFilter('muscodigo', 'like', \"%{$data->muscodigo}%\"); // create the filter\r\n TSession::setValue('MusicaList_filter_muscodigo', $filter); // stores the filter in the session\r\n }\r\n\r\n\r\n if (isset($data->musnome) AND ($data->musnome)) {\r\n $filter = new TFilter('musnome', 'like', \"%{$data->musnome}%\"); // create the filter\r\n TSession::setValue('MusicaList_filter_musnome', $filter); // stores the filter in the session\r\n }\r\n\r\n\r\n if (isset($data->musregistro) AND ($data->musregistro)) {\r\n $filter = new TFilter('musregistro', 'like', \"%{$data->musregistro}%\"); // create the filter\r\n TSession::setValue('MusicaList_filter_musregistro', $filter); // stores the filter in the session\r\n }\r\n\r\n \r\n // fill the form with data again\r\n $this->form->setData($data);\r\n \r\n // keep the search data in the session\r\n TSession::setValue('Musica_filter_data', $data);\r\n \r\n $param=array();\r\n $param['offset'] =0;\r\n $param['first_page']=1;\r\n $this->onReload($param);\r\n }", "public function search($search);", "protected static function display_results() {\n $locale = self::$locale;\n self::$composevars = \"method=\".self::get_param('method').\"&amp;datelimit=\".self::get_param('datelimit').\"&amp;fields=\".self::get_param('fields').\"&amp;sort=\".self::get_param('sort').\"&amp;order=\".self::get_param('order').\"&amp;chars=\".self::get_param('chars').\"&amp;forum_id=\".self::get_param('forum_id').\"&amp;\";\n add_to_title($locale['global_201'].$locale['408']);\n\n $search_text = explode(' ', urldecode(self::$search_text));\n $qualified_search_text = [];\n $disqualified_search_text = [];\n\n /*\n * @todo: roadmap on author\n */\n self::$fields_count = self::get_param('fields') + 1;\n for ($i = 0, $k = 0; $i < count($search_text); $i++) {\n if (strlen($search_text[$i]) >= 3) {\n $qualified_search_text[] = $search_text[$i];\n for ($j = 0; $j < self::$fields_count; $j++) {\n // It is splitting to 2 parts.\n self::$search_param[':sword'.$k.$j] = '%'.$search_text[$i].'%';\n }\n $k++;\n } else {\n $disqualified_search_text[] = $search_text[$i];\n }\n }\n unset($search_text);\n self::$swords = $qualified_search_text;\n\n self::$c_swords = count($qualified_search_text) ?: redirect(FUSION_SELF);\n self::$i_swords = count($disqualified_search_text);\n\n self::$swords_keys_for_query = array_keys(self::$search_param);\n self::$swords_values_for_query = array_values(self::$search_param);\n\n // Highlight using Jquery the words. This, can actually parse as settings.\n $highlighted_text = \"\";\n $i = 1;\n foreach ($qualified_search_text as $value) {\n $highlighted_text .= \"'\".$value.\"'\";\n $highlighted_text .= ($i < self::$c_swords ? \",\" : \"\");\n $i++;\n }\n add_to_footer(\"<script type='text/javascript' src='\".INCLUDES.\"jquery/jquery.highlight.js'></script>\");\n add_to_jquery(\"$('.search_result').highlight([\".$highlighted_text.\"],{wordsOnly:true}); $('.highlight').css({backgroundColor:'#FFFF88'});\");\n\n /*\n * Run the drivers via include.. but this method need to change to simplify the kiss concept.\n */\n if (self::get_param('stype') == \"all\") {\n $search_deffiles = [];\n $search_includefiles = makefilelist(INCLUDES.'search/', '.|..|index.php|location.json.php|users.json.php|.DS_Store', TRUE, 'files');\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n if (!empty($search_infusionfiles)) {\n foreach ($search_infusionfiles as $files_to_check) {\n if (is_dir(INFUSIONS.$files_to_check.'/search/')) {\n $search_checkfiles = makefilelist(INFUSIONS.$files_to_check.'/search/', \".|..|index.php\", TRUE, \"files\");\n $search_deffiles = array_merge($search_deffiles, $search_checkfiles);\n }\n }\n }\n $search_files = array_merge($search_includefiles, $search_deffiles);\n\n foreach ($search_files as $key => $file_to_check) {\n if (preg_match(\"/include.php/i\", $file_to_check)) {\n if (file_exists(INCLUDES.\"search/\".$file_to_check)) {\n self::__Load(INCLUDES.\"search/\".$file_to_check);\n }\n\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check)) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check);\n }\n }\n }\n }\n } else {\n if (file_exists(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\")) {\n self::__Load(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\");\n }\n\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php')) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php');\n }\n }\n }\n\n // Show how many disqualified search texts\n $c_iwords = count($disqualified_search_text);\n if ($c_iwords) {\n $txt = \"\";\n for ($i = 0; $i < $c_iwords; $i++) {\n $txt .= $disqualified_search_text[$i].($i < $c_iwords - 1 ? \", \" : \"\");\n }\n echo \"<div class='well m-t-10 text-center strong'>\".sprintf($locale['502'], $txt).\"</div><br />\";\n }\n\n /*$c_search_result_array = count(self::$search_result_array);\n\n if (self::get_param('stype') == \"all\") {\n $from = self::get_param('rowstart');\n $to = ($c_search_result_array - (self::get_param('rowstart') + 10)) <= 0 ? $c_search_result_array : self::get_param('rowstart') + 10;\n } else {\n $from = 0;\n $to = $c_search_result_array < 10 ? $c_search_result_array : 10;\n }*/\n\n /*\n * HTML output\n */\n if (self::get_param('stype') == \"all\") {\n parent::search_navigation(0);\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/>\".sprintf($locale['530'], self::$site_search_count) : \"<br/>\".self::$site_search_count.\" \".$locale['510'])\n ]);\n } else {\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/><strong>\".sprintf($locale['530'], self::$site_search_count).\"</strong>\" : (empty(self::$site_search_count) ? $locale['500'] : ''))\n ]);\n }\n\n echo \"<div class='search_result'>\\n\";\n echo \"<div class='block'>\\n\";\n foreach (self::$search_result_array as $results) {\n echo $results;\n }\n\n // Now it is by per module. Therefore rowstart does not apply\n //for ($i = $from; $i < $to; $i++) {\n // echo self::$search_result_array[$i];\n //}\n echo \"</div>\\n\";\n echo \"</div>\\n\";\n\n if (self::get_param('stype') != \"all\") {\n echo self::$navigation_result;\n }\n }", "public function search() {\n\t\t$this->ApiClass = ClassRegistry::init('ApiGenerator.ApiClass');\n\t\t$conditions = array();\n\t\tif (isset($this->params['url']['query'])) {\n\t\t\t$query = $this->params['url']['query'];\n\t\t\t$conditions = array('ApiClass.search_index LIKE' => '%' . $query . '%');\n\t\t}\n\t\t$this->paginate['fields'] = array('DISTINCT ApiClass.name', 'ApiClass.search_index');\n\t\t$this->paginate['order'] = 'ApiClass.name ASC';\n\t\t$results = $this->paginate($this->ApiClass, $conditions);\n\t\t$classIndex = $this->ApiClass->getClassIndex();\n\t\t$this->helpers[] = 'Text';\n\t\t$this->set(compact('results', 'classIndex'));\n\t}", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function searchResult()\r\n {\r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Search Results\");\r\n \r\n // Getting all the categories\r\n $categoryList = $this->Category->getCategoryList();\r\n \r\n // Passing the categories list to views\r\n $this->set('categoryList', $categoryList);\r\n \r\n // initialising the variable\r\n $whereCondition = '';\r\n $search_keyword = '';\r\n // if any search keyword then setting into variable.\r\n if (isset($this->data['Product']['keywords']) && !empty($this->data['Product']['keywords']))\r\n {\r\n $search_keyword = $this->data['Product']['keywords'];\r\n \r\n if(!empty($whereCondition))\r\n {\r\n $whereCondition .= \" AND \";\r\n }\r\n \r\n $whereCondition .= \" (Product.product_name LIKE '%\".$search_keyword.\"%') OR (Product.product_desc LIKE '%\".$search_keyword.\"%') \";\r\n }\r\n \r\n $conditions[] = $whereCondition;\r\n \r\n // Getting the products and categories list agianst search criteria\r\n $productList = $this->Product->getSearchResults($conditions);\r\n \r\n // Passing for first product images by default.\r\n $this->set('productList', $productList);\r\n \r\n // Passing the search keywords to views\r\n $this->set('search_keyword', $search_keyword);\r\n \r\n }", "function titleSearch(&$searchObj, &$searchResObj) {\r\n\ttry {\r\n\t\t$pdo = new PDO(DBCONNSTRING, DBUSER,DBPASS);\r\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\r\n\t\t$sql = \"SELECT Title, Message, PostID FROM travelpost WHERE Title LIKE '%$searchObj->searchField%'\";\r\n\t\t\r\n\t\t$result = $pdo->query($sql);\r\n\t\t\r\n\t\t$count = 0;\r\n\t\twhile ($row = $result->fetch()) {\r\n\t\t\t$searchResObj[$count] = new searchResult();\r\n\t\t\t\r\n\t\t\t$searchResObj[$count]->searchTitle = $row['Title'];\r\n\t\t\t$searchResObj[$count]->searchMessage = $row['Message'];\r\n\t\t\t$searchResObj[$count]->searchPostID = $row['PostID'];\r\n\r\n\t\t\t$count++;\r\n\t\t}\r\n\t}\r\n\tcatch (PDOexception $e) {\r\n\t\tERROR_PAGE();\r\n\t}\r\n\t\r\n}", "function Search($user_id=NULL, $module=NULL, $display=NULL, $sort=NULL, $start=NULL, $width = NULL) {\r\n ( $user_id !=\"\" ? $this->user_id = $user_id : $this->user_id = NULL );\r\n ( $module !=\"\" ? $this->module = $module : $this->module = NULL );\r\n ( $display !=\"\" ? $this->display = 60 : $this->display = 60 );\r\n ( $sort !=\"\" ? $this->sort = $sort : $this->sort = NULL );\r\n ( $start !=\"\" ? $this->start = $start : $this->start = 0 );\r\n ( $width !=\"\" ? $this->width = $width : $this->width = 750 );\r\n\r\n if (empty($this->db)) $this->db = new DB();\r\n if (empty($this->Right)) $this->Right = new Rights($this->user_id, $this->module);\r\n if (empty($this->Msg)) $this->Msg = new ShowMsg();\r\n $this->Msg->SetShowTable(TblModSearchSprTxt);\r\n if (empty($this->Form)) $this->Form = new Form('form_mod_links_set');\r\n if (empty($this->Spr)) $this->Spr = new SysSpr();\r\n $this->ip = $_SERVER['REMOTE_ADDR']; \r\n }" ]
[ "0.7028611", "0.67987436", "0.6761465", "0.67500824", "0.67500824", "0.66232157", "0.65744936", "0.6524228", "0.65228516", "0.6499335", "0.6485807", "0.64037704", "0.64037704", "0.63253295", "0.63253295", "0.62896276", "0.62815714", "0.627655", "0.6199791", "0.61980593", "0.61867714", "0.61656356", "0.61651504", "0.61513275", "0.6114685", "0.6102593", "0.60927314", "0.6089719", "0.60863644", "0.60797256" ]
0.75970006
0
calls the searchByAuthor method from Patron class,gets the result and calls the controlSearch
function executeSearchByAuthor($patron, $bookAuthor){ $result = $patron->searchByAuthor($bookAuthor); $res=$this->controlSearch($result); return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function controlSearch($result){\n\t\t$bookIDs = $this->getBookIDs($result);\n\t\t$bookObjects = array();\n\n\t\tfor($i = 0; $i < count($bookIDs); $i++){\n\t\t\t$bookObject = constructBook($bookIDs[$i]);\n\t\t\t$bookObjects[$i] = $bookObject;\n\t\t}\n\t\t\n\t\t$currentPatronID = $_SESSION['currentPatronID'];\n\t\t$currentPatron = constructPatron($currentPatronID);\n\t\t$patronDep = $currentPatron->getDepartment();\n\n\t\t$suggestedBooks = $this->executeSuggestion($patronDep);\n\t\t\n\t\t$result_one=$this->displaySearch($bookObjects, $suggestedBooks);\n\t\t\n\t\treturn $result_one;\n\t}", "function executeSearchByTitle($patron, $bookTitle){\n\t\t$result = $patron->searchByTitle($bookTitle);\n\t\t$res=$this->controlSearch($result);\n\t\treturn $res;\n\t}", "public function search(){}", "public function search()\n\t{\n\t\t\n\t}", "public function searchAuthor($author) {\n try {\n // escape quotes\n $checkAuthor = str_replace(\"'\", \"''\", $author);\n // search the database, using wildcards\n $sql = \"SELECT * FROM books WHERE author LIKE '%$checkAuthor%' ORDER BY title\";\n $stmt = $this->conn->query($sql);\n \n // fetch as numeric array\n $result = $stmt->setFetchMode(PDO::FETCH_NUM);\n \n // show results in a list of update forms\n echo \"<br /><div id='searchResult'><h3>Author: $author</h3><ul>\";\n while ($row = $stmt->fetch()) {\n // call result form function\n $this->echoResultForm($row);\n }\n echo \"</ul></div>\";\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }", "public function search();", "public function search();", "function search() {}", "private function getSearch() {\n\t\tif( $_SESSION['privilege'] != 'anon' ) {\n\n\t\t\t// If NOT anon then IS logged in so set userID to SESSION['id'] \n\t\t\t$userID = $_SESSION['id'];\n\n\t\t} else {\n\t\t\t\n\t\t\t// For this function default $userID to non-exitent user # 0 \n\t\t\t$userID = 0;\n\n\t\t}\n\n\t\t// Set search term per input OR blank\n\n\t\tif( !isset($_POST['search'])) {\n\t\t\t$_POST['search'] = \"\";\n\t\t}\n\t\t\n\t\tif(strlen($_POST['search']) === 0) {\n\t\t\t$searchTerm = \"\";\n\n\t\t} else {\n\t\t\t$result = $_POST['search'];\n\t\t\t$searchTerm = strtolower($result);\n\t\t}\n\n\t\t$this->data['searchTerm'] = $searchTerm;\n\n\t\t$sql = \"SELECT posts.id, title AS score_title, intro AS score_intro, article AS score_article\n\t\t\tFROM posts\n\t\t\tWHERE\n\t\t\t\t(title LIKE '%$searchTerm%' OR \n\t\t\t\tintro LIKE '%$searchTerm%' OR\n\t\t\t\tarticle LIKE '%$searchTerm%')\";\n\n\t\tif( $_SESSION['privilege'] != 'admin' ) {\n\n\t\t\t$sql .= \" AND (user_id = $userID\n\t\t\t\t\tOR status = 'Approved')\t\n\t\t\t\t\tORDER BY score_title ASC\";\n\t\t\n\t\t} else {\n\n\t\t\t$sql .= \" ORDER BY score_title ASC\";\t\n\n\t\t}\t\t\n\t\n\t\t$result = $this->dbc->query($sql);\n\n\t\tif( !$result || $result->num_rows == 0) {\n\t\t\t$this->data['searchResults'] = \"No results\";\n\t\t} else {\n\t\t\t$this->data['searchResults'] = $result->fetch_all(MYSQLI_ASSOC);\n\t\t}\n\t}", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "function search()\n\t{}", "function search()\n\t{}", "public function searchReader()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t\t\t//$return = array();\n\t\t\t$book = D('User');\n\n\t\t\t$sql = \"SELECT * FROM lib_user\n\t\t\t\t\t where {$type} like '%{$text}%' ORDER BY register_time DESC;\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No Result'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "function executeSearchByISBN($patron, $bookISBN){\n\t\t$result = $patron->searchByISBN($bookISBN);\n\t\t$res=$this->controlSearch($result);\n\t\treturn $res;\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('authorname', $this->authorname, true);\n return new CActiveDataProvider($this, array('criteria' => $criteria, ));\n }", "public function RunSearch()\n {\n BizSystem::log(LOG_DEBUG,\"FORMOBJ\",$this->m_Name.\"::RunSearch()\");\n global $g_BizSystem;\n $this->m_SearchRule = \"\";\n foreach ($this->m_RecordRow as $fldCtrl) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n if ($value) {\n $searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);\n if ($this->m_SearchRule == \"\")\n $this->m_SearchRule .= $searchStr;\n else\n $this->m_SearchRule .= \" AND \" . $searchStr;\n }\n }\n\n $this->SetDisplayMode (MODE_R);\n $this->GotoPage(1);\n $this->m_RecordId = null; // clean the current record id\n $this->m_ClearSearchRule = true;\n return $this->ReRender();\n }", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function getSearch();", "function search() {\n // ...\n }", "function getSearchInfo()\n\t{\n\t\t//Global allows variables outside the function scope to be used here\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\t\tglobal $params_arr;\n\t\t\n\t\t\n\t\t$keyword = $params_arr[0];\n\t\t$order = $params_arr[1];\n\t\t\n\t\t$sql = \"SET @SEARCH_TERM = '%$keyword%';\";\n\t\t\n\t\tif ($conn->query($sql) === TRUE) \n\t\t{\n\t\t\t//echo \"New record created successfully\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\n\n\t\t$sql = \"SELECT books.COVER, books.TITLE, books.GENRE, books.PUBLISHER, authors.FIRST_NAME, authors.LAST_NAME, books.PUB_DATE,\n\t\t\t \t\t books.DESCRIPTION, authors.BIO, books.ISBN, books.ID\n\t\t\t\t FROM books \n\t\t\t\t JOIN authors ON books.AUTHOR = authors.ID\n\t\t\t\t WHERE authors.FIRST_NAME LIKE @SEARCH_TERM OR\n\t\t\t authors.LAST_NAME LIKE @SEARCH_TERM OR \n\t\t\t\t\t\tbooks.TITLE LIKE @SEARCH_TERM OR\n\t\t\t\t\t\tbooks.GENRE LIKE @SEARCH_TERM\n\t\t\t\tORDER BY books.TITLE $order\n\t\t\t\t\n\t\t\t\t\";\n\t\t\t\t//Limit $offset; \n\t\t\t\t//@Julian then here I have LIMIT of per page here $offset so if 10 or 20 placed here just like ASC/DESC\n\n\t\t//Executes query string\n\t\t$result = $conn->query($sql);\n\t\t//Im making the page number between 10 and 20\n\t\tif ($result->num_rows > 0) \n\t\t{\n\t\t\t$json = array();\n\t \t// convert the data into json object\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t\t\t$bus = array(\n\t\t\t\t\t\"cover\" => $row[\"COVER\"],\n\t\t\t\t\t\"title\" => $row[\"TITLE\"],\n\t\t\t\t\t\"author\" => $row[\"FIRST_NAME\"]. \" \" .$row[\"LAST_NAME\"],\n\t\t\t\t\t\"genre\" => $row[\"GENRE\"],\n\t\t\t\t\t\"publisher\" => $row[\"PUBLISHER\"],\n\t\t\t\t\t\"pub_date\" => $row[\"PUB_DATE\"],\n\t\t\t\t\t\"description\" => $row[\"DESCRIPTION\"],\n\t\t\t\t\t\"bio\" => $row[\"BIO\"],\n\t\t\t\t\t\"isbn\" => $row[\"ISBN\"],\n\t\t\t\t\t\"id\" => $row[\"ID\"]\n\t\t\t\t);\n\n\t\t\t\tarray_push($json, $bus);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$jsonstring = json_encode($json);\n\t\t\techo $jsonstring;\n\t\t}\n\t\telse\n\t\t{\n\t\t echo \"0 results\";\n\t\t}\n\n\n\n\t\t$conn->close();\n\t}", "protected static function display_results() {\n $locale = self::$locale;\n self::$composevars = \"method=\".self::get_param('method').\"&amp;datelimit=\".self::get_param('datelimit').\"&amp;fields=\".self::get_param('fields').\"&amp;sort=\".self::get_param('sort').\"&amp;order=\".self::get_param('order').\"&amp;chars=\".self::get_param('chars').\"&amp;forum_id=\".self::get_param('forum_id').\"&amp;\";\n add_to_title($locale['global_201'].$locale['408']);\n\n $search_text = explode(' ', urldecode(self::$search_text));\n $qualified_search_text = [];\n $disqualified_search_text = [];\n\n /*\n * @todo: roadmap on author\n */\n self::$fields_count = self::get_param('fields') + 1;\n for ($i = 0, $k = 0; $i < count($search_text); $i++) {\n if (strlen($search_text[$i]) >= 3) {\n $qualified_search_text[] = $search_text[$i];\n for ($j = 0; $j < self::$fields_count; $j++) {\n // It is splitting to 2 parts.\n self::$search_param[':sword'.$k.$j] = '%'.$search_text[$i].'%';\n }\n $k++;\n } else {\n $disqualified_search_text[] = $search_text[$i];\n }\n }\n unset($search_text);\n self::$swords = $qualified_search_text;\n\n self::$c_swords = count($qualified_search_text) ?: redirect(FUSION_SELF);\n self::$i_swords = count($disqualified_search_text);\n\n self::$swords_keys_for_query = array_keys(self::$search_param);\n self::$swords_values_for_query = array_values(self::$search_param);\n\n // Highlight using Jquery the words. This, can actually parse as settings.\n $highlighted_text = \"\";\n $i = 1;\n foreach ($qualified_search_text as $value) {\n $highlighted_text .= \"'\".$value.\"'\";\n $highlighted_text .= ($i < self::$c_swords ? \",\" : \"\");\n $i++;\n }\n add_to_footer(\"<script type='text/javascript' src='\".INCLUDES.\"jquery/jquery.highlight.js'></script>\");\n add_to_jquery(\"$('.search_result').highlight([\".$highlighted_text.\"],{wordsOnly:true}); $('.highlight').css({backgroundColor:'#FFFF88'});\");\n\n /*\n * Run the drivers via include.. but this method need to change to simplify the kiss concept.\n */\n if (self::get_param('stype') == \"all\") {\n $search_deffiles = [];\n $search_includefiles = makefilelist(INCLUDES.'search/', '.|..|index.php|location.json.php|users.json.php|.DS_Store', TRUE, 'files');\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n if (!empty($search_infusionfiles)) {\n foreach ($search_infusionfiles as $files_to_check) {\n if (is_dir(INFUSIONS.$files_to_check.'/search/')) {\n $search_checkfiles = makefilelist(INFUSIONS.$files_to_check.'/search/', \".|..|index.php\", TRUE, \"files\");\n $search_deffiles = array_merge($search_deffiles, $search_checkfiles);\n }\n }\n }\n $search_files = array_merge($search_includefiles, $search_deffiles);\n\n foreach ($search_files as $key => $file_to_check) {\n if (preg_match(\"/include.php/i\", $file_to_check)) {\n if (file_exists(INCLUDES.\"search/\".$file_to_check)) {\n self::__Load(INCLUDES.\"search/\".$file_to_check);\n }\n\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check)) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check);\n }\n }\n }\n }\n } else {\n if (file_exists(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\")) {\n self::__Load(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\");\n }\n\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php')) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php');\n }\n }\n }\n\n // Show how many disqualified search texts\n $c_iwords = count($disqualified_search_text);\n if ($c_iwords) {\n $txt = \"\";\n for ($i = 0; $i < $c_iwords; $i++) {\n $txt .= $disqualified_search_text[$i].($i < $c_iwords - 1 ? \", \" : \"\");\n }\n echo \"<div class='well m-t-10 text-center strong'>\".sprintf($locale['502'], $txt).\"</div><br />\";\n }\n\n /*$c_search_result_array = count(self::$search_result_array);\n\n if (self::get_param('stype') == \"all\") {\n $from = self::get_param('rowstart');\n $to = ($c_search_result_array - (self::get_param('rowstart') + 10)) <= 0 ? $c_search_result_array : self::get_param('rowstart') + 10;\n } else {\n $from = 0;\n $to = $c_search_result_array < 10 ? $c_search_result_array : 10;\n }*/\n\n /*\n * HTML output\n */\n if (self::get_param('stype') == \"all\") {\n parent::search_navigation(0);\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/>\".sprintf($locale['530'], self::$site_search_count) : \"<br/>\".self::$site_search_count.\" \".$locale['510'])\n ]);\n } else {\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/><strong>\".sprintf($locale['530'], self::$site_search_count).\"</strong>\" : (empty(self::$site_search_count) ? $locale['500'] : ''))\n ]);\n }\n\n echo \"<div class='search_result'>\\n\";\n echo \"<div class='block'>\\n\";\n foreach (self::$search_result_array as $results) {\n echo $results;\n }\n\n // Now it is by per module. Therefore rowstart does not apply\n //for ($i = $from; $i < $to; $i++) {\n // echo self::$search_result_array[$i];\n //}\n echo \"</div>\\n\";\n echo \"</div>\\n\";\n\n if (self::get_param('stype') != \"all\") {\n echo self::$navigation_result;\n }\n }", "function Search($user_id=NULL, $module=NULL, $display=NULL, $sort=NULL, $start=NULL, $width = NULL) {\r\n ( $user_id !=\"\" ? $this->user_id = $user_id : $this->user_id = NULL );\r\n ( $module !=\"\" ? $this->module = $module : $this->module = NULL );\r\n ( $display !=\"\" ? $this->display = 60 : $this->display = 60 );\r\n ( $sort !=\"\" ? $this->sort = $sort : $this->sort = NULL );\r\n ( $start !=\"\" ? $this->start = $start : $this->start = 0 );\r\n ( $width !=\"\" ? $this->width = $width : $this->width = 750 );\r\n\r\n if (empty($this->db)) $this->db = new DB();\r\n if (empty($this->Right)) $this->Right = new Rights($this->user_id, $this->module);\r\n if (empty($this->Msg)) $this->Msg = new ShowMsg();\r\n $this->Msg->SetShowTable(TblModSearchSprTxt);\r\n if (empty($this->Form)) $this->Form = new Form('form_mod_links_set');\r\n if (empty($this->Spr)) $this->Spr = new SysSpr();\r\n $this->ip = $_SERVER['REMOTE_ADDR']; \r\n }", "function searchAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\t\t$this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t\t$inData = $this->getInputManager()->doFilter();\n\t\t$this->addInputToModel($inData, $this->getModel());\n\t\t$oView = new userView($this);\n\t\t$oView->showSearchLeaderboard();\n\t}", "function search_authors($publication_id) { \n $sql = \"SELECT * FROM people_publications INNER JOIN people ON people_publications.person_id=people.person_id WHERE people_publications.publication_id = '$publication_id' \"; \n $authors = $this->fetch($sql);\n return($authors);\n }", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.73001415", "0.69102263", "0.667388", "0.6632834", "0.65635866", "0.6556991", "0.6556991", "0.6306147", "0.6192684", "0.6191442", "0.61802083", "0.61802083", "0.615509", "0.6124594", "0.6124594", "0.61217934", "0.6074303", "0.6073879", "0.6010613", "0.5989623", "0.59701335", "0.59667605", "0.59523624", "0.59446096", "0.59096617", "0.5886758", "0.5874989", "0.5866314", "0.5865202", "0.58434737" ]
0.76581144
0
gets the queryResult and calls displaySearch after getting bookObjects
function controlSearch($result){ $bookIDs = $this->getBookIDs($result); $bookObjects = array(); for($i = 0; $i < count($bookIDs); $i++){ $bookObject = constructBook($bookIDs[$i]); $bookObjects[$i] = $bookObject; } $currentPatronID = $_SESSION['currentPatronID']; $currentPatron = constructPatron($currentPatronID); $patronDep = $currentPatron->getDepartment(); $suggestedBooks = $this->executeSuggestion($patronDep); $result_one=$this->displaySearch($bookObjects, $suggestedBooks); return $result_one; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displaySearch($bookObjects, $suggestedBooks){\n\t\t$noOfResult = count($bookObjects);\n\t\t$noOfSuggest = count($suggestedBooks);\n\t\techo \"<div class = 'RSContainer12'>\";\n\t\tif ($noOfResult <= 1){\n\t\t\t$a=$noOfResult.\" result found\";\n\t\t}\n\t\telse{\n\t\t\t$a=$noOfResult.\" results found\";\n\t\t}\n\t\techo \"</div>\";\n\t\t//the result of the book search\n\t\t$BookResult=$this->display($bookObjects);\n\n\t\t\techo \"<div class = 'RSContainer12'>\";\n\t\t\t\tif ($noOfSuggest == 0){\n\t\t\t\t\t$a=\"No Suggestions\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$a=\"Suggestions\";\n\t\t\t\t}\n\t\t\techo \"</div>\";\n\t\t\n\t\t$verified_suggestions=array();\n\t\t//to check if the book is contained is he result\n\t\t$verified=false;\n\t\t$no_of_books=count($suggestedBooks);\n\t\tif ($noOfResult>0){\n\t\tforeach ($suggestedBooks as $suggestion){\n\t\t\tforeach ($bookObjects as $bkItem){\n\t\t\t\t\n\t\t\t\tif (($suggestion->getBookID())==($bkItem->getBookID())){\n\t\t\t\t\t\t$verified=false;\n\t\t\t\t\t\tbreak ;\n\t\t\t\t}else{\n\t\t\t\t\t$verified=true;\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\tif ($verified){\n\t\t\t\t\n\t\t\t\t$verified_suggestions[]=$suggestion;\n\t\t\t\t\t;\n\t\t\t}\n\t\t}\n\t\t//get the display of suggested books\n\t\t$suggestions=$this->display($verified_suggestions);\n\t}else{\n\t\t$suggestions=$this->display($suggestedBooks);\n\t}\n\t\t\n\t\t\n\t\t\n\t\t$result=array($BookResult,$suggestions,$noOfResult);\n\t\t\n\t\treturn $result;\n\t}", "function booksList($offset, $total_records_per_page, $order, $ascdesc)\n{\n $booksManager = new ListManager();\n\n\n\n if (isset($_GET['search']) && $_GET['search']!='') {\n $search = input(addcslashes($_GET['search'], '_'));\n $search=\"%\".$search.\"%\";\n $books = $booksManager->get_search($offset, $total_records_per_page, $order, $ascdesc, $search);\n } elseif (isset($_GET['cat']) && $_GET['cat']!='') {\n $cat = input($_GET['cat']);\n $books = $booksManager-> get_cat($offset, $total_records_per_page, $order, $ascdesc, $cat);\n } else {\n $books = $booksManager->selectAll($offset, $total_records_per_page, $order, $ascdesc); // Appel la fonction qui renvoie toutes les données sur les livres en bdd\n }\n // require('view/listView.php');\n return $books;\n echo selectAll();\n}", "function getSearchInfo()\n\t{\n\t\t//Global allows variables outside the function scope to be used here\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\t\tglobal $params_arr;\n\t\t\n\t\t\n\t\t$keyword = $params_arr[0];\n\t\t$order = $params_arr[1];\n\t\t\n\t\t$sql = \"SET @SEARCH_TERM = '%$keyword%';\";\n\t\t\n\t\tif ($conn->query($sql) === TRUE) \n\t\t{\n\t\t\t//echo \"New record created successfully\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\n\n\t\t$sql = \"SELECT books.COVER, books.TITLE, books.GENRE, books.PUBLISHER, authors.FIRST_NAME, authors.LAST_NAME, books.PUB_DATE,\n\t\t\t \t\t books.DESCRIPTION, authors.BIO, books.ISBN, books.ID\n\t\t\t\t FROM books \n\t\t\t\t JOIN authors ON books.AUTHOR = authors.ID\n\t\t\t\t WHERE authors.FIRST_NAME LIKE @SEARCH_TERM OR\n\t\t\t authors.LAST_NAME LIKE @SEARCH_TERM OR \n\t\t\t\t\t\tbooks.TITLE LIKE @SEARCH_TERM OR\n\t\t\t\t\t\tbooks.GENRE LIKE @SEARCH_TERM\n\t\t\t\tORDER BY books.TITLE $order\n\t\t\t\t\n\t\t\t\t\";\n\t\t\t\t//Limit $offset; \n\t\t\t\t//@Julian then here I have LIMIT of per page here $offset so if 10 or 20 placed here just like ASC/DESC\n\n\t\t//Executes query string\n\t\t$result = $conn->query($sql);\n\t\t//Im making the page number between 10 and 20\n\t\tif ($result->num_rows > 0) \n\t\t{\n\t\t\t$json = array();\n\t \t// convert the data into json object\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t\t\t$bus = array(\n\t\t\t\t\t\"cover\" => $row[\"COVER\"],\n\t\t\t\t\t\"title\" => $row[\"TITLE\"],\n\t\t\t\t\t\"author\" => $row[\"FIRST_NAME\"]. \" \" .$row[\"LAST_NAME\"],\n\t\t\t\t\t\"genre\" => $row[\"GENRE\"],\n\t\t\t\t\t\"publisher\" => $row[\"PUBLISHER\"],\n\t\t\t\t\t\"pub_date\" => $row[\"PUB_DATE\"],\n\t\t\t\t\t\"description\" => $row[\"DESCRIPTION\"],\n\t\t\t\t\t\"bio\" => $row[\"BIO\"],\n\t\t\t\t\t\"isbn\" => $row[\"ISBN\"],\n\t\t\t\t\t\"id\" => $row[\"ID\"]\n\t\t\t\t);\n\n\t\t\t\tarray_push($json, $bus);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$jsonstring = json_encode($json);\n\t\t\techo $jsonstring;\n\t\t}\n\t\telse\n\t\t{\n\t\t echo \"0 results\";\n\t\t}\n\n\n\n\t\t$conn->close();\n\t}", "public function PerformSearch(){\r\n\t\t\r\n\t\t// get all our search requirements\r\n\t\t$query = self::get_query($mysqlSafe = true);\r\n\t\t$types = self::get_mapped_types();\r\n\t\t$filters = self::get_mapped_filters();\r\n\t\t\r\n\t\t// prepare our final result object\r\n\t\t$allResults = ArrayList::create();\r\n\t\t\r\n\t\t// loop all the records we need to lookup\r\n\t\tforeach ($types as $type){\r\n\t\t\t\r\n\t\t\t$sql = '';\r\n\t\t\t$joins = '';\r\n\t\t\t$where = '';\r\n\t\t\t$sort = '';\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Result selection\r\n\t\t\t * We only need ClassName and ID to fetch the full object (using the SilverStripe ORM)\r\n\t\t\t * once we've got our results\r\n\t\t\t **/\r\n\t\t\t$sql.= \"SELECT \\\"\".$type['Table'].\"\\\".\\\"ID\\\" AS \\\"ResultObject_ID\\\" FROM \\\"\".$type['Table'].\"\\\" \";\r\n\t\t\t\r\n\t\t\t// Join this type with any dependent tables (if applicable)\r\n\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\tforeach ($type['JoinTables'] as $joinTable){\r\n\t\t\t\t\t$joins.= \"LEFT JOIN \\\"\".$joinTable.\"\\\" ON \\\"\".$joinTable.\"\\\".\\\"ID\\\" = \\\"\".$type['Table'].\"\\\".\\\"ID\\\" \";\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Query term\r\n\t\t\t * We search each column for this type for the provided query string\r\n\t\t\t */\r\n\t\t\t$where .= ' WHERE (';\r\n\t\t\tforeach ($type['Columns'] as $i => $column){\r\n\t\t\t\t$column = explode('.',$column);\r\n\t\t\t\tif ($i > 0){\r\n\t\t\t\t\t$where .= ' OR ';\r\n\t\t\t\t}\r\n\t\t\t\t$where .= \"\\\"\".$column[0].\"\\\".\\\"\".$column[1].\"\\\" LIKE CONCAT('%','\".$query.\"','%')\";\r\n\t\t\t}\r\n\t\t\t$where.= ')';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Apply our type-level filters (if applicable)\r\n\t\t\t **/\t\t\r\n\t\t\tif (isset($type['Filters'])){\r\n\t\t\t\tforeach ($type['Filters'] as $key => $value){\r\n\t\t\t\t\t$where.= ' AND ('.$key.' = '.$value.')';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Apply filtering\r\n\t\t\t **/\r\n\t\t\t$relations_sql = '';\r\n\r\n\t\t\tif ($filters){\r\n\t\t\t\tforeach ($filters as $filter){\r\n\r\n\t\t\t\t\t// Apply filters, based on filter structure\r\n\t\t\t\t\tswitch ($filter['Structure']){\r\n\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Simple column value filter\r\n\t\t\t\t\t\t **/\r\n\t\t\t\t\t\tcase 'db':\r\n\r\n\t\t\t\t\t\t\t// Identify which table has the column which we're trying to filter by\r\n\t\t\t\t\t\t\t$table_with_column = null;\r\n\t\t\t\t\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\t\t\t\t\t$tables_to_check = $type['JoinTables'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$tables_to_check = [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$tables_to_check[] = $type['Table'];\r\n\r\n\t\t\t\t\t\t\tforeach ($tables_to_check as $table_to_check){\r\n\t\t\t\t\t\t\t\t$column_exists_query = DB::query( \"SHOW COLUMNS FROM \\\"\".$table_to_check.\"\\\" LIKE '\".$filter['Column'].\"'\" );\r\n\r\n\t\t\t\t\t\t\t\tforeach ($column_exists_query as $column){\r\n\t\t\t\t\t\t\t\t\t$table_with_column = $table_to_check;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Not anywhere in this type's table joins, so we can't search this particular type\r\n\t\t\t\t\t\t\tif (!$table_with_column){\r\n\t\t\t\t\t\t\t\tcontinue 2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t// open our wrapper\r\n\t\t\t\t\t\t\t$where.= ' AND (';\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t\t * This particular type needs to join with other parent tables to\r\n\t\t\t\t\t\t\t * form a complete, and searchable row\r\n\t\t\t\t\t\t\t **/\r\n\t\t\t\t\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\t\t\t\t\tforeach ($type['JoinTables'] as $join_table){\r\n\t\t\t\t\t\t\t\t\t//$joins.= \"LEFT JOIN \\\"\".$type['Table'].\"\\\" ON \\\"\".$join_table.\"\\\".\\\"ID\\\" = \\\"\".$type['Table'].\"\\\".\\\"ID\\\"\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (is_array($filter['Value'])){\r\n\t\t\t\t\t\t\t\t$valuesString = '';\r\n\t\t\t\t\t\t\t\tforeach ($filter['Value'] as $value){\r\n\t\t\t\t\t\t\t\t\tif ($valuesString != ''){\r\n\t\t\t\t\t\t\t\t\t\t$valuesString.= ',';\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$valuesString.= \"'\".$value.\"'\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$valuesString = $filter['Value'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$where.= \"\\\"\".$table_with_column.\"\\\".\\\"\".$filter['Column'].\"\\\" \".$filter['Operator'].\" '\".$valuesString .\"'\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// close our wrapper\r\n\t\t\t\t\t\t\t$where.= ')';\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Simple relational filter (ie Page.Author)\r\n\t\t\t\t\t\t **/\r\n\t\t\t\t\t\tcase 'has_one':\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Identify which table has the column which we're trying to filter by\r\n\t\t\t\t\t\t\t$table_with_column = null;\r\n\t\t\t\t\t\t\tif (isset($type['JoinTables'])){\r\n\t\t\t\t\t\t\t\t$tables_to_check = $type['JoinTables'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$tables_to_check = [];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$tables_to_check[] = $type['Table'];\r\n\r\n\t\t\t\t\t\t\tforeach ($tables_to_check as $table_to_check){\r\n\t\t\t\t\t\t\t\t$column_exists_query = DB::query( \"SHOW COLUMNS FROM \\\"\".$table_to_check.\"\\\" LIKE '\".$filter['Column'].\"'\" );\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\tforeach ($column_exists_query as $column){\r\n\t\t\t\t\t\t\t\t\t$table_with_column = $table_to_check;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// Not anywhere in this type's table joins, so we can't search this particular type\r\n\t\t\t\t\t\t\tif (!$table_with_column){\r\n\t\t\t\t\t\t\t\tcontinue 2;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t// join the relationship table to our record(s)\r\n\t\t\t\t\t\t\t$joins.= \"LEFT JOIN \\\"\".$filter['Table'].\"\\\" ON \\\"\".$filter['Table'].\"\\\".\\\"ID\\\" = \\\"\".$table_with_column.\"\\\".\\\"\".$filter['Column'].\"\\\"\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(!empty($filter['Value'])){\r\n\t\t\t\t\t\t\t\tif (is_array($filter['Value'])){\r\n\t\t\t\t\t\t\t\t\t$ids = '';\r\n\t\t\t\t\t\t\t\t\tforeach ($filter['Value'] as $id){\r\n\t\t\t\t\t\t\t\t\t\tif ($ids != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t$ids.= ',';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t$ids.= \"'\".$id.\"'\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$ids = $filter['Value'];\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$where.= ' AND ('.\"\\\"\".$table_with_column.\"\\\".\\\"\".$filter['Column'].\"\\\" IN (\". $ids .\")\".')';\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**\r\n\t\t\t\t\t\t * Complex relational filter (ie Page.Tags)\r\n\t\t\t\t\t\t **/\r\n\t\t\t\t\t\tcase 'many_many':\r\n\r\n\t\t\t\t\t\t\t// Make sure this type has a relationship to this filter object\r\n\t\t\t\t\t\t\tif (isset($filter['JoinTables'][$type['Key']])){\r\n\r\n\t\t\t\t\t\t\t\t$filter_join = $filter['JoinTables'][$type['Key']];\r\n\r\n\t\t\t\t\t\t\t\t$joins.= \"LEFT JOIN \\\"\".$filter_join['Table'].\"\\\" ON \\\"\".$type['Table'].\"\\\".\\\"ID\\\" = \\\"\".$filter_join['Table'].\"\\\".\\\"\".$filter_join['Column'].\"\\\"\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(!empty($filter['Value'])){\r\n\t\t\t\t\t\t\t\t\tif (is_array($filter['Value'])){\r\n\t\t\t\t\t\t\t\t\t\t$ids = '';\r\n\t\t\t\t\t\t\t\t\t\tforeach ($filter['Value'] as $id){\r\n\t\t\t\t\t\t\t\t\t\t\tif ($ids != ''){\r\n\t\t\t\t\t\t\t\t\t\t\t\t$ids.= ',';\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t$ids.= \"'\".$id.\"'\";\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t$ids = $filter['Value'];\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tif ($relations_sql !== ''){\r\n\t\t\t\t\t\t\t\t\t\t$relations_sql.= \" AND \";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$relations_sql.= \"\\\"\".$filter_join['Table'].\"\\\".\\\"\".$filter['Table'].\"ID\\\" IN (\". $ids .\")\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Append any required relations SQL\r\n\t\t\t\tif ($relations_sql !== ''){\r\n\t\t\t\t\t$where.= ' AND ('.$relations_sql.')';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Compile our sql string\r\n\t\t\t$sql.= $joins;\r\n\t\t\t$sql.= $where;\r\n\r\n\t\t\t// Debugging\r\n\t\t\t//echo '<h3 style=\"position: relative; padding: 20px; background: #EEEEEE; z-index: 999;\">'.str_replace('\"', '`', $sql).'</h3>';\r\n\r\n\t\t\t// Eexecutioner enter stage left\r\n\t\t\t$results = DB::query($sql);\r\n\t\t\t$resultIDs = array();\r\n\r\n\t\t\t// Add all the result ids to our array\r\n\t\t\tforeach ($results as $result){\r\n\r\n\t\t\t\t// Make sure we're not already a result\r\n\t\t\t\tif (!isset($resultIDs[$result['ResultObject_ID']])){\r\n\t\t\t\t\t$resultIDs[$result['ResultObject_ID']] = $result['ResultObject_ID'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Convert our SQL results into SilverStripe objects of the appropriate class\r\n\t\t\tif ($resultIDs){\r\n\t\t\t\t$resultObjects = $type['ClassName']::get()->filter(['ID' => $resultIDs]);\r\n\t\t\t\t$allResults->merge($resultObjects);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sort = false;\r\n\t\t// Sorting applied throug form submission\r\n\t\tif(isset(self::get_mapped_sort()['Sort'])){\r\n\t\t\t$sort = self::get_mapped_sort()['Sort'];\t\t\r\n\t\t\t$sort = str_replace(\"'\", \"\\'\", $sort);\r\n\t\t\t$sort = str_replace('\"', '\\\"', $sort);\r\n\t\t\t$sort = str_replace('`', '\\`', $sort);\r\n\t\t}\r\n\t\t// Default sort defined in config\r\n\t\telseif(isset(self::get_mapped_defaults()['sort'])){\r\n\t\t\t$sort = self::get_mapped_defaults()['sort'];\r\n\t\t}\r\n\t\tif($sort){\r\n\t\t\t$allResults = $allResults->Sort($sort);\r\n\t\t}\r\n\r\n\t\t// Remove duplicates\r\n\t\t$allResults->removeDuplicates('ID');\r\n\r\n\t\t// filter by permission\r\n\t\tif($allResults) foreach($allResults as $result) {\r\n\t\t\tif(!$result->canView()) $allResults->remove($result);\r\n\t\t}\r\n\t\t\r\n\t\t// load into a paginated list. To change the items per page, set via the template (ie Results.setPageLength(20))\r\n\t\t$paginatedItems = PaginatedList::create($allResults, $this->request);\r\n\t\t\r\n\t\treturn $paginatedItems;\r\n\t}", "function topSearchInfo()\n\t{\n\t\t//Global allows variables outside the function scope to be used here\n\t\tglobal $conn;\n\t\tglobal $myObj;\n\t\tglobal $params_arr;\n\t\t\n\t\t\n\t\t$keyword = $params_arr[0];\n\t\t\n\t\t$sql = \"SET @SEARCH_TERM = '%$keyword%';\";\n\t\t\n\t\tif ($conn->query($sql) === TRUE) \n\t\t{\n\t\t\t//echo \"New record created successfully\";\n\t\t} \n\t\telse \n\t\t{\n\t\t\techo \"Error: \" . $sql . \"<br>\" . $conn->error;\n\t\t}\n\n\t\t\t\n\t\t$sql = \"SELECT books.COVER, books.TITLE, books.GENRE, books.PUBLISHER, authors.FIRST_NAME, authors.LAST_NAME, books.PUB_DATE,\n\t\t\t \t\t books.DESCRIPTION, authors.BIO, books.ISBN, books.ID\n\t\t\t\t FROM books \n\t\t\t\t JOIN authors ON books.AUTHOR = authors.ID\n\t\t\t\t WHERE authors.FIRST_NAME LIKE @SEARCH_TERM OR\n\t\t\t authors.LAST_NAME LIKE @SEARCH_TERM OR \n\t\t\t\t\t\tbooks.TITLE LIKE @SEARCH_TERM OR\n\t\t\t\t\t\tbooks.GENRE LIKE @SEARCH_TERM\n\t\t\t\tORDER BY books.TITLE \n\t\t\t\tLIMIT 3\";\n\t\t\t\t//Only d\n\t\t\n\n\t\t//Executes query string\n\t\t$result = $conn->query($sql);\n\t\t//Im making the page number between 10 and 20\n\t\tif ($result->num_rows > 0) \n\t\t{\n\t\t\t$json = array();\n\t \t// convert the data into json object\n\t \twhile($row = $result->fetch_assoc()) \n\t \t{\n\t\t\t\t$bus = array(\n\t\t\t\t\t\"cover\" => $row[\"COVER\"],\n\t\t\t\t\t\"title\" => $row[\"TITLE\"],\n\t\t\t\t\t\"author\" => $row[\"FIRST_NAME\"]. \" \" .$row[\"LAST_NAME\"],\n\t\t\t\t\t\"genre\" => $row[\"GENRE\"],\n\t\t\t\t\t\"publisher\" => $row[\"PUBLISHER\"],\n\t\t\t\t\t\"pub_date\" => $row[\"PUB_DATE\"],\n\t\t\t\t\t\"description\" => $row[\"DESCRIPTION\"],\n\t\t\t\t\t\"bio\" => $row[\"BIO\"],\n\t\t\t\t\t\"isbn\" => $row[\"ISBN\"],\n\t\t\t\t\t\"id\" => $row[\"ID\"]\n\t\t\t\t);\n\n\t\t\t\tarray_push($json, $bus);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t$jsonstring = json_encode($json);\n\t\t\techo $jsonstring;\n\t\t}\n\t\telse\n\t\t{\n\t\t echo \"0 results\";\n\t\t}\n\n\n\t\t$conn->close();\n\t}", "public function get_results()\n {\n }", "public function get_results()\n {\n }", "function results() {\n\t\t$query = $this->input->post('q');\n\t\t$type = $this->input->post('type');\n\t\t$group = $this->input->post('group');\n\t\t\n\t\t$params = $this->uri->uri_to_assoc(3);\n\t\tif ( isset($params['q']) ) $query = $params['q'];\n\t\tif ( isset( $params['page'] )\n\t\t\t&& is_int( $params['page'] ) ) {\n\t\t\t\t$page = $params['page'];\n\t\t\t} else {\n\t\t\t\t$page = 1;\n\t\t\t}\n\t\tif ( isset( $params['size'] )\n\t\t\t&& is_int( $params['size'] ) ) {\n\t\t\t\t$page_size = $params['size'];\n\t\t\t} else {\n\t\t\t\t$page_size = 25;\n\t\t\t}\n\t\t\n\t\t$query = trim($query);\n\t\t\n\t\t// see if this looks like an ISBN \n\t\t// FIXME dunno if we should keep this ability\n\t\tif( strlen($query) == 13 && is_int($query) && substr($query,0,3) == '978' ) {\n\t\t\t$this->load->model('products_model');\n\t\t\t$res = $this->products_model->get_product_by_ean( $query );\n\t\t\tif( $res->num_rows > 0 ) {\n\t\t\t\t$row = $res->row();\n\t\t\t\tredirect('/product/view/' . $row->id );\n\t\t\t}\n\t\t} elseif( strlen( $query ) > 0 ) {\n\t\t\t$res = $this->search_model->search($query, $type, $page, $page_size );\n\t\t\t$results = $res->result();\n\t\t} else {\n\t\t\t$results = array();\n\t\t}\n\t\t\n\t\t\n\t\t$prev = $next = false;\n\t\tif( $page > 1 ) {\n\t\t\t$prev_page = $page - 1;\n\t\t\t$params['page'] = $prev_page;\n\t\t\t$prev = '/search/results/' . $this->assoc_to_uri($params);\n\t\t}\n\t\tif ( count($results) > $page * $page_size ) {\n\t\t\t$next_page = $page + 1;\n\t\t\t$params['page'] = $next_page;\n\t\t\t$next = '/searc/results/' . $this->assoc_to_uri($params);\n\t\t}\n\n\n\t\t$nav['main'] = 'Home';\n\t\t$nav['sub'] = '';\n\t\t$data = array(\n\t\t\t'results' => $results,\n\t\t\t'page' => $page,\n\t\t\t'page_size' => $page_size,\n\t\t\t'query_string' => $query,\n\t\t\t'prev' => $prev,\n\t\t\t'next' => $next,\n\t\t\t'nav' => $nav\n\t\t\t);\t\t\n\t\t\t\t\n\t\t$this->load->view('search/results', $data);\n\t\t\t\t\n\t}", "public function get_results() {\n\n\t\t\tif(!isset($_GET['wpusquery'])) {\n\t\t\t\tdie(); // if no data has been entered, quit\n\t\t\t} else {\n\t\t\t\t$searcharray = $_GET['wpusquery'];\n\t\t\t}\n\n\t\t\t$nonce = $_GET['searchNonce'];\n\t\t\tif(!wp_verify_nonce($nonce, 'search-nonce')) // make sure the search nonce matches the nonce generated earlier\n\t\t\t{\n\t\t\t\tdie ('Busted!');\n\t\t\t}\n\n\t\t\tif(class_exists(\"WPUltimateSearchPro\")) {\n\t\t\t\t$this->pro_class->execute_query_pro($searcharray);\n\t\t\t} else {\n\t\t\t\t$this->execute_query_basic($searcharray);\n\t\t\t}\n\t\t}", "public function searchResult()\r\n {\r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Search Results\");\r\n \r\n // Getting all the categories\r\n $categoryList = $this->Category->getCategoryList();\r\n \r\n // Passing the categories list to views\r\n $this->set('categoryList', $categoryList);\r\n \r\n // initialising the variable\r\n $whereCondition = '';\r\n $search_keyword = '';\r\n // if any search keyword then setting into variable.\r\n if (isset($this->data['Product']['keywords']) && !empty($this->data['Product']['keywords']))\r\n {\r\n $search_keyword = $this->data['Product']['keywords'];\r\n \r\n if(!empty($whereCondition))\r\n {\r\n $whereCondition .= \" AND \";\r\n }\r\n \r\n $whereCondition .= \" (Product.product_name LIKE '%\".$search_keyword.\"%') OR (Product.product_desc LIKE '%\".$search_keyword.\"%') \";\r\n }\r\n \r\n $conditions[] = $whereCondition;\r\n \r\n // Getting the products and categories list agianst search criteria\r\n $productList = $this->Product->getSearchResults($conditions);\r\n \r\n // Passing for first product images by default.\r\n $this->set('productList', $productList);\r\n \r\n // Passing the search keywords to views\r\n $this->set('search_keyword', $search_keyword);\r\n \r\n }", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('t.book_id',$this->book_id,true);\r\n\t\tif(isset($_GET['type']) && $_GET['type'] == 'publish') {\r\n\t\t\t$criteria->compare('t.publish',1);\r\n\t\t} elseif(isset($_GET['type']) && $_GET['type'] == 'unpublish') {\r\n\t\t\t$criteria->compare('t.publish',0);\r\n\t\t} elseif(isset($_GET['type']) && $_GET['type'] == 'trash') {\r\n\t\t\t$criteria->compare('t.publish',2);\r\n\t\t} else {\r\n\t\t\t$criteria->addInCondition('t.publish',array(0,1));\r\n\t\t\t$criteria->compare('t.publish',$this->publish);\r\n\t\t}\r\n\t\tif(isset($_GET['publisher'])) {\r\n\t\t\t$criteria->compare('t.publisher_id',$_GET['publisher']);\r\n\t\t} else {\r\n\t\t\t$criteria->compare('t.publisher_id',$this->publisher_id);\r\n\t\t}\r\n\t\t$criteria->compare('t.isbn',$this->isbn,true);\r\n\t\t$criteria->compare('t.title',$this->title,true);\r\n\t\t$criteria->compare('t.description',$this->description,true);\r\n\t\t$criteria->compare('t.cover',$this->cover,true);\r\n\t\t$criteria->compare('t.edition',$this->edition,true);\r\n\t\t$criteria->compare('t.publish_city',$this->publish_city,true);\r\n\t\t$criteria->compare('t.publish_year',$this->publish_year,true);\r\n\t\t$criteria->compare('t.paging',$this->paging,true);\r\n\t\t$criteria->compare('t.sizes',$this->sizes,true);\r\n\t\tif($this->creation_date != null && !in_array($this->creation_date, array('0000-00-00 00:00:00', '0000-00-00')))\r\n\t\t\t$criteria->compare('date(t.creation_date)',date('Y-m-d', strtotime($this->creation_date)));\r\n\t\t$criteria->compare('t.creation_id',$this->creation_id,true);\r\n\t\tif($this->modified_date != null && !in_array($this->modified_date, array('0000-00-00 00:00:00', '0000-00-00')))\r\n\t\t\t$criteria->compare('date(t.modified_date)',date('Y-m-d', strtotime($this->modified_date)));\r\n\t\t$criteria->compare('t.modified_id',$this->modified_id,true);\r\n\t\t\r\n\t\t// Custom Search\r\n\t\t$criteria->with = array(\r\n\t\t\t'publisher' => array(\r\n\t\t\t\t'alias'=>'publisher',\r\n\t\t\t\t'select'=>'publisher_name'\r\n\t\t\t),\r\n\t\t\t'creation' => array(\r\n\t\t\t\t'alias'=>'creation',\r\n\t\t\t\t'select'=>'displayname'\r\n\t\t\t),\r\n\t\t\t'modified' => array(\r\n\t\t\t\t'alias'=>'modified',\r\n\t\t\t\t'select'=>'displayname'\r\n\t\t\t),\r\n\t\t);\r\n\t\t$criteria->compare('publisher.publisher_name',strtolower($this->publisher_search), true);\r\n\t\t$criteria->compare('creation.displayname',strtolower($this->creation_search), true);\r\n\t\t$criteria->compare('modified.displayname',strtolower($this->modified_search), true);\r\n\r\n\t\tif(!isset($_GET['BookMasters_sort']))\r\n\t\t\t$criteria->order = 't.book_id DESC';\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t\t'pagination'=>array(\r\n\t\t\t\t'pageSize'=>30,\r\n\t\t\t),\r\n\t\t));\r\n\t}", "public function results() {\n // $books = Book::whereRaw('name like ', Input::get('search'), array(25))->get();\n\n $search = Input::get('search');\n $query = '%'.$search.'%';\n\n // $books = Book::where('name', 'like', $query)\n // ->orWhere('author', 'like', $query)\n // ->orWhere('isbn', 'like', $query)\n // ->orWhere('faculty', 'like', $query)->get();\n\n // return View::make('results')->with('books', $books);\n\n $information = DB::table('students')\n ->select('students.*', 'books.*', 'contracts.*')\n ->join('books', 'students.student_id', '=', 'books.student_id')\n ->join('contracts', function($join) use($query) {\n $join->on('books.book_id', '=', 'contracts.book_id')\n ->where('books.name', 'like', $query)\n ->orWhere('books.author', 'like', $query)\n ->orWhere('books.isbn', 'like', $query)\n ->orWhere('books.faculty', 'like', $query);\n })\n ->get();\n return View::make('results')->with('information', $information);\n }", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "public function search()\n\t{\t\t\n\t\t$data = array();\n\t\t\n\t\tif($this->input->get()){\n\t\t\t\n\t\t\t$post_data = $this->input->get();\n\t\t\tif(isset($post_data['isbn']) && isset($post_data['author']) && isset($post_data['title']))\n\t\t\t{\n\t\t\t\t$post_data = array('isbn' => $post_data['isbn'],\n\t\t\t\t\t\t\t\t\t'author' => $post_data['author'],\n\t\t\t\t\t\t\t\t\t'title' => $post_data['title'],\n\t\t\t\t\t\t\t\t\t'title_condition' => $post_data['title_condition'],\n\t\t\t\t\t\t\t\t\t'isbn_condition' => $post_data['isbn_condition']\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$validation = true;\n\t\t\t\tif(empty($post_data['isbn']) && empty($post_data['author']) && empty($post_data['title']))\n\t\t\t\t\t$validation = $this->form_validation->set_data($post_data)\n\t\t\t\t\t\t\t->set_rules('isbn', 'ISBN or Title or Author', 'required')->run();\n\t\t\t\t\n\t\t\t\tif ($validation == TRUE)\n\t\t\t\t{\n\t\t\t\t\t$this->load->model('library/search', 'search');\n\t\t\t\t\t$data['result'] = $this->search->searchResults();\n\t\t\t\t\t$base_url = base_url(\"library/books/search\");\n\t\t\t\t\t$rows = count($data['result']);\n\t\t\t\t\t$data['post_data'] = $post_data;\n\t\t\t\t\tif($rows){\n\t\t\t\t\t\t$this->session->set_flashdata('error_msg','');\n\t\t\t\t\t\t$data['pagination'] = $this->createPageLinks($base_url,$rows);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('error_msg','Sorry the book you are looking for is not available!'); \n\t\t\t\t\t}\n\t\t\t\t\t$this->load->library('table');\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t$this->load->template('library/search_books',$data);\n\t}", "private function get_results() {\n $cache = new SearchCache();\n\n if ($this->cache and $cache->can_cache()) {\n if (!($resultdocs = $cache->cache($this->term))) {\n $resultdocs = $this->process_results();\n //cache the results so we don't have to compute this on every page-load\n $cache->cache($this->term, $resultdocs);\n //print \"Using new results.\";\n } else {\n //There was something in the cache, so we're using that to save time\n //print \"Using cached results.\";\n } \n } else {\n //no caching :(\n //print \"Caching disabled!\";\n $resultdocs = $this->process_results();\n } \n return $resultdocs;\n }", "public function listLentBooks()\n {\n if (!$this->isLogged()) {\n header('Location: index.php');\n }\n\n $idUser = $this->user['id_user'];\n\n if (isset($_GET['page']) AND !empty($_GET['page'])) {\n $currentPage = (int) $this->cleanParam($_GET['page']);\n }\n else {\n $currentPage = 1;\n }\n\n $lentBookCount = $this->bookManager->lentBookCount($idUser);\n\n $perPage = 12;\n\n $pages = ceil($lentBookCount / $perPage);\n\n $first = ($currentPage * $perPage) - $perPage;\n\n if (isset($_GET['f']) AND !empty($_GET['f'])) {\n $filter = $this->cleanParam($_GET['f']);\n if($filter === \"title\") {\n $sortKey = \"title_book\";\n } else if ($filter === \"author\") {\n $sortKey = \"author_book\";\n } else if ($filter === \"all\") {\n $sortKey = \"date_add_book\";\n } else {\n $sortKey = \"date_add_book\";\n }\n }\n else {\n $sortKey = \"date_add_book\";\n }\n\n if(isset($_POST['button_search_engine'])) {\n if(isset($_POST['content_search']) && !empty($_POST['content_search'])) {\n $wishBook = 0;\n $lendBook = 1;\n $content = $this->cleanParam($_POST['content_search']);\n\n $searchBooks = $this->bookManager->listSearchBooks($idUser, $wishBook, $lendBook, $content);\n $countedBooksSearch = count($searchBooks);\n } \n } \n\n $listLentBooks = $this->bookManager->listLentBooks($idUser, $sortKey, $first, $perPage);\n\n if ($listLentBooks === false) {\n header('Location: index.php?action=error404');\n }\n\n require('App/View/listLentBooks.php');\n }", "protected static function display_results() {\n $locale = self::$locale;\n self::$composevars = \"method=\".self::get_param('method').\"&amp;datelimit=\".self::get_param('datelimit').\"&amp;fields=\".self::get_param('fields').\"&amp;sort=\".self::get_param('sort').\"&amp;order=\".self::get_param('order').\"&amp;chars=\".self::get_param('chars').\"&amp;forum_id=\".self::get_param('forum_id').\"&amp;\";\n add_to_title($locale['global_201'].$locale['408']);\n\n $search_text = explode(' ', urldecode(self::$search_text));\n $qualified_search_text = [];\n $disqualified_search_text = [];\n\n /*\n * @todo: roadmap on author\n */\n self::$fields_count = self::get_param('fields') + 1;\n for ($i = 0, $k = 0; $i < count($search_text); $i++) {\n if (strlen($search_text[$i]) >= 3) {\n $qualified_search_text[] = $search_text[$i];\n for ($j = 0; $j < self::$fields_count; $j++) {\n // It is splitting to 2 parts.\n self::$search_param[':sword'.$k.$j] = '%'.$search_text[$i].'%';\n }\n $k++;\n } else {\n $disqualified_search_text[] = $search_text[$i];\n }\n }\n unset($search_text);\n self::$swords = $qualified_search_text;\n\n self::$c_swords = count($qualified_search_text) ?: redirect(FUSION_SELF);\n self::$i_swords = count($disqualified_search_text);\n\n self::$swords_keys_for_query = array_keys(self::$search_param);\n self::$swords_values_for_query = array_values(self::$search_param);\n\n // Highlight using Jquery the words. This, can actually parse as settings.\n $highlighted_text = \"\";\n $i = 1;\n foreach ($qualified_search_text as $value) {\n $highlighted_text .= \"'\".$value.\"'\";\n $highlighted_text .= ($i < self::$c_swords ? \",\" : \"\");\n $i++;\n }\n add_to_footer(\"<script type='text/javascript' src='\".INCLUDES.\"jquery/jquery.highlight.js'></script>\");\n add_to_jquery(\"$('.search_result').highlight([\".$highlighted_text.\"],{wordsOnly:true}); $('.highlight').css({backgroundColor:'#FFFF88'});\");\n\n /*\n * Run the drivers via include.. but this method need to change to simplify the kiss concept.\n */\n if (self::get_param('stype') == \"all\") {\n $search_deffiles = [];\n $search_includefiles = makefilelist(INCLUDES.'search/', '.|..|index.php|location.json.php|users.json.php|.DS_Store', TRUE, 'files');\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n if (!empty($search_infusionfiles)) {\n foreach ($search_infusionfiles as $files_to_check) {\n if (is_dir(INFUSIONS.$files_to_check.'/search/')) {\n $search_checkfiles = makefilelist(INFUSIONS.$files_to_check.'/search/', \".|..|index.php\", TRUE, \"files\");\n $search_deffiles = array_merge($search_deffiles, $search_checkfiles);\n }\n }\n }\n $search_files = array_merge($search_includefiles, $search_deffiles);\n\n foreach ($search_files as $key => $file_to_check) {\n if (preg_match(\"/include.php/i\", $file_to_check)) {\n if (file_exists(INCLUDES.\"search/\".$file_to_check)) {\n self::__Load(INCLUDES.\"search/\".$file_to_check);\n }\n\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check)) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/'.$file_to_check);\n }\n }\n }\n }\n } else {\n if (file_exists(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\")) {\n self::__Load(INCLUDES.\"search/search_\".self::get_param('stype').\"_include.php\");\n }\n\n $search_infusionfiles = makefilelist(INFUSIONS, '.|..|index.php', TRUE, 'folders');\n foreach ($search_infusionfiles as $inf_files_to_check) {\n if (file_exists(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php')) {\n self::__Load(INFUSIONS.$inf_files_to_check.'/search/search_'.self::get_param('stype').'_include.php');\n }\n }\n }\n\n // Show how many disqualified search texts\n $c_iwords = count($disqualified_search_text);\n if ($c_iwords) {\n $txt = \"\";\n for ($i = 0; $i < $c_iwords; $i++) {\n $txt .= $disqualified_search_text[$i].($i < $c_iwords - 1 ? \", \" : \"\");\n }\n echo \"<div class='well m-t-10 text-center strong'>\".sprintf($locale['502'], $txt).\"</div><br />\";\n }\n\n /*$c_search_result_array = count(self::$search_result_array);\n\n if (self::get_param('stype') == \"all\") {\n $from = self::get_param('rowstart');\n $to = ($c_search_result_array - (self::get_param('rowstart') + 10)) <= 0 ? $c_search_result_array : self::get_param('rowstart') + 10;\n } else {\n $from = 0;\n $to = $c_search_result_array < 10 ? $c_search_result_array : 10;\n }*/\n\n /*\n * HTML output\n */\n if (self::get_param('stype') == \"all\") {\n parent::search_navigation(0);\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/>\".sprintf($locale['530'], self::$site_search_count) : \"<br/>\".self::$site_search_count.\" \".$locale['510'])\n ]);\n } else {\n echo strtr(Search::render_search_count(), [\n '{%search_count%}' => self::$items_count,\n '{%result_text%}' => ((self::$site_search_count > 100 || parent::search_globalarray(\"\")) ? \"<br/><strong>\".sprintf($locale['530'], self::$site_search_count).\"</strong>\" : (empty(self::$site_search_count) ? $locale['500'] : ''))\n ]);\n }\n\n echo \"<div class='search_result'>\\n\";\n echo \"<div class='block'>\\n\";\n foreach (self::$search_result_array as $results) {\n echo $results;\n }\n\n // Now it is by per module. Therefore rowstart does not apply\n //for ($i = $from; $i < $to; $i++) {\n // echo self::$search_result_array[$i];\n //}\n echo \"</div>\\n\";\n echo \"</div>\\n\";\n\n if (self::get_param('stype') != \"all\") {\n echo self::$navigation_result;\n }\n }", "public function searchAction(){\t\t\n\t\t\t// startup: get translater and create windowTitel\t\t\t\t \n\t\t\t$translate = $this->_owApp->translate;\n $windowTitle = $translate->_('Search results');\n $this->view->placeholder('main.window.title')->set($windowTitle);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// get search string from input field (searchbox.phtml)\n\t\t\t$nameOfPerson = $this->getParam('nameOfPerson');\n\t\t\t\t\t\t\n\t\t\tif (!empty($nameOfPerson)){\n\t\t\t\t// create query\n\t\t\t\t$query = new Erfurt_Sparql_SimpleQuery(); \n\t\t\t\t$query->setProloguePart('SELECT ?resourceUri ?Name ?yearOfBirth ?placeOfBirth ?yearOfDeath ?placeOfDeath ?labor') \n\t\t\t\t\t ->setWherePart('WHERE {'. '?resourceUri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>'. '<http://drw-model.saw-leipzig.de/Person> . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://www.w3.org/2000/01/rdf-schema#label> ?Name . '.\t\t\t \t\t\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/yearOfBirth> ?yearOfBirth . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/placeOfBirth> ?placeOfBirth . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/yearOfDeath> ?yearOfDeath . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/placeOfDeath> ?placeOfDeath . '.\n\t\t\t\t\t\t\t\t\t\t\t'?resourceUri <http://drw-model.saw-leipzig.de/labor> ?labor . '.\n\t\t\t\t\t\t\t\t\t\t\t'FILTER regex (?Name, \"'.$nameOfPerson.'\", \"i\" )}');\t\t\t\t\t\t\t\t\n\t\t\t\t/////////// ToDo:\n\t\t\t\t// model = DRW-Katalog\t\t\t\t\t\t\t\n\t\t\t\t$this->model = $this->_owApp->selectedModel;\n\t\t\t\t$queryResult = $this->model->sparqlQuery($query);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$header = array ();\t\t\n\t\t\t\tif (is_array($queryResult) && isset ($queryResult[0]) && is_array($queryResult[0])) {\n\t\t\t\t\t$header = array_keys($queryResult[0]);\n\t\t\t\t}else {\n\t\t\t\t\t$queryResult = 'No Person was found for \"%s\".';\n\t\t\t\t\t$queryResult = sprintf($translate->_($queryResult), $nameOfPerson);\t\t\t\t\t\n\t\t\t\t}\t\t\n\t\t\t\t// set strings to view -> search.phtml can access strings from view\t\t\n\t\t\t\t$this->view->urlBase = $this->_config->urlBase;\t\t\t\n\t\t\t\t$this->view->header = $header;\n\t\t\t\t$this->view->queryResult = $queryResult;\n\t\t\t} else /* if empty($nameOfPerson) */{\n\t\t\t\t$this->view->queryResult = $translate->_('Please enter a search item.');\n\t\t\t}\n\t\t}", "public function searchBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t \t\t//$return = array();\n\t\t\t$book = D('Book_species');\n\t\t\t$sql = \"SELECT * FROM lib_book_species as a join\n\t\t\t\t\t(SELECT COUNT(*) as number, isbn FROM lib_book_unique \n\t\t\t \t\twhere book_id not in(select book_id from lib_remove)\n\t\t\t \t\tGROUP BY isbn) AS b using(isbn)\n\t\t\t \t\twhere {$type} like '%{$text}%' and number!=0 ORDER BY species_id DESC;\";\n\t\t\tif ($type == 1) {\n\t\t\t\t$bkid = intval($text);\n\t\t\t\t$sql = \"select * from lib_book_species join (select isbn,count(*)\n\t\t\t\t \t\tas number from lib_book_unique group by isbn) as a using(isbn) \n\t\t\t\t\t\twhere isbn in (select isbn from lib_book_unique \n\t\t\t\t\t\twhere book_id = {$bkid}) and {$bkid} not in \n\t\t\t\t\t\t(select book_id from lib_remove)\";\n\t\t\t}\n\n\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No result!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "function bookSearch( $userQuery ) {\n $userQuery.=\"%\";\n global $db;\n $sqlQuery = \"SELECT bid, title, description, coverimage FROM books WHERE title LIKE ? ORDER by title ASC\";\n $stmt = mysqli_prepare( $db, $sqlQuery );\n mysqli_stmt_bind_param( $stmt ,'s', $userQuery);\n mysqli_execute( $stmt );\n mysqli_stmt_bind_result( $stmt, $bid, $title, $des, $img);\n while ( mysqli_stmt_fetch( $stmt ) ) {\n $books[] = [ 'title' => $title, 'bid' => $bid, 'description' => $des, 'img' => $img ];\n }\n if ( empty( $books ) ) {\n return false;\n }\n else {\n return $books ;\n }\n }", "public function execute()\n\t{\n\t\t$searchQuery = $this->searchPhrase ? '\"' . $this->searchPhrase . '\"' : '';\n\t\t$queryParams['attributesToRetrieve']\t= '*';\n\t\t$queryParams['maxValuesPerFacet']\t\t= '100';\n\t\t$queryParams['attributesToHighlight']\t= array();\n\t\t$queryParams['filters']\t\t\t\t\t= $this->filters;\n\t\t$queryParams['facetFilters']\t\t\t= $this->facetFilters;\n\t\t$queryParams['offset']\t\t\t\t\t= $this->start;\n\t\t$queryParams['length']\t\t\t\t\t= $this->limit;\n\n\t\t$queryParams['facets']\t\t\t\t\t= array($this->facetField);\n\n\t\t// We need to pass this query by setRawQueryParams for advsearch frontent.\n\t\t$queryParams['advancedSyntax']\t\t\t= 'true';\n\n\t\tif (count($this->rawQueryParams))\n\t\t{\n\t\t\t$queryParams = array_merge($queryParams, $this->rawQueryParams);\n\t\t}\n\n\t\t// This is something Juggad related to Osianama requirement.\n\t\tif (isset($queryParams['restrictSearchableAttributes']))\n\t\t{\n\t\t\t$searchQuery = $this->searchPhrase ? $this->searchPhrase : '';\n\t\t}\n\n\t\t$Data = $this->algoliaIndex->search($searchQuery, $queryParams);\n\n\t\tif (count($Data['hits']) > 0)\n\t\t{\n\t\t\t$this->total\t= $Data['nbHits'];\n\t\t\t$this->count\t= $Data['hitsPerPage'];\n\t\t\t$this->records\t= '';\n\n\t\t\tforeach ($Data['hits'] as $key => $row)\n\t\t\t{\n\t\t\t\tunset($row['_highlightResult']);\n\n\t\t\t\t$row['id']\t\t\t\t\t\t= $row['objectID'];\n\t\t\t\t$this->records['data'][$key]\t= (object) $row;\n\t\t\t}\n\n\t\t\tif ($this->facetField)\n\t\t\t{\n\t\t\t\t$this->records['facets'] = $Data['facets'];\n\t\t\t}\n\t\t}\n\t}", "public function search() {\n\t\t$data = $this->model->getSearchData($this->table->getFilterNames());\n\t\t$this->table->setData($data);\n\t\t// Store the user/object ids in the session so the report() can reuse them\n\t\t$this->storeIdsInSession($data);\n\t\t$this->tpl->setContent($this->table->getHTML());\n\t}", "public function searchAction() {\n\t\n\t if($this->getRequest()->isXmlHttpRequest()){\n\t\n\t $term = $this->getParam('term');\n\t $id = $this->getParam('id');\n\t\n\t if(!empty($term)){\n\t $term = \"%$term%\";\n\t $records = Invoices::findbyCustomFields(\"formatted_number LIKE ? OR number LIKE ?\", array($term, $term));\n\t die(json_encode($records));\n\t }\n\t\n\t if(!empty($id)){\n\t $records = Invoices::find($id);\n\t if($records){\n\t $records = $records->toArray();\n\t }\n\t die(json_encode(array($records)));\n\t }\n\t\n\t $records = Invoices::getAll();\n\t die(json_encode($records));\n\t }else{\n\t die();\n\t }\n\t}", "function show_results()\n\t{\n\t\tglobal $ibforums, $std;\n\n\t\t$this->result_type = $ibforums->input['result_type'];\n\t\t$this->search_in = $ibforums->input['search_in'];\n\n\t\t//------------------------------------------------\n\t\t// We have a search ID, so lets get the parsed results.\n\t\t//------------------------------------------------\n\n\t\t$this->unique_id = $ibforums->input['searchid'];\n\n\t\tif (!$this->unique_id)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$stmt = $ibforums->db->query(\"SELECT *\n\t\t\t\t FROM ibf_search_results\n\t\t\t\t WHERE id='{$this->unique_id}'\");\n\n\t\t$sr = $stmt->fetch();\n\n\t\t$tmp_topics = $sr['topic_id'];\n\t\t$topic_max_hits = \"\"; //$sr['topic_max'];\n\t\t$tmp_posts = $sr['post_id'];\n\t\t$post_max_hits = \"\"; //$sr['post_max'];\n\n\t\t$this->sort_order = $sr['sort_order'];\n\t\t$this->sort_key = $sr['sort_key'];\n\n\t\t//------------------------------------------------\n\t\t// Remove duplicates from the topic_id and post_id\n\t\t//------------------------------------------------\n\n\t\t$topic_max_hits = self::unique_string_items($tmp_topics);\n\t\t$post_max_hits = self::unique_string_items($tmp_posts);\n\n\t\t$topics = $tmp_topics;\n\t\t$posts = $tmp_posts;\n\n\t\t//-------------------------------------\n\n\t\tif (!$topics and !$posts)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$url_words = $this->convert_highlite_words($ibforums->input['highlite']);\n\n\t\t$count = 0;\n\n\t\tif ($this->result_type == 'topics')\n\t\t{\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t FROM\n\t\t\t\t\t\tibf_topics t, ibf_forums f\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND f.id=t.forum_id\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY t.pinned DESC,\";\n\n\t\t\t\t// search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t//--------------------------------------------\n\t\t\t\t// we have tid and pid to sort out, woohoo NOT\n\t\t\t\t//--------------------------------------------\n\n\t\t\t\t// Array for forum id of each message\n\t\t\t\t$forum_posts = array();\n\n\t\t\t\tif ($posts)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tforum_id,\n\t\t\t\t\t\ttopic_id\n\t\t\t\t\tFROM ibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tpid IN({$posts})\n\t\t\t\t\t\tAND queued != 1\");\n\n\t\t\t\t\tif ($topics)\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = explode(',', $topics);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$topics = array();\n\t\t\t\t\t}\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!in_array($pr['topic_id'], $topics))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$topics[] = $pr['topic_id'];\n\t\t\t\t\t\t\t$topic_max_hits++;\n\n\t\t\t\t\t\t\t$forum_posts[$pr['topic_id']] = $pr['forum_id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$topics = implode(',', $topics);\n\t\t\t\t}\n\t\t\t\t$this->fill_read_arrays($topics);\n\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits);\n\n\t\t\t\t$query = \"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t \t FROM ibf_topics t\n\t\t\t\t\t LEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\t WHERE\n\t\t\t\t\t\tt.tid IN(\" . $topics . \")\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\t ORDER BY\n\t\t\t\t\t\tt.pinned DESC,\";\n\n\t\t\t\t// Search new topics of user\n\t\t\t\tif ($ibforums->input['new'])\n\t\t\t\t{\n\t\t\t\t\t$query .= \"f.id ASC,\";\n\t\t\t\t}\n\n\t\t\t\t$query .= \"t.\" . $this->sort_key . \" \" . $this->sort_order . \" LIMIT \" . $this->first . \",25\";\n\n\t\t\t\t$stmt = $ibforums->db->query($query);\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\tif ($stmt->rowCount())\n\t\t\t{\n\t\t\t\twhile ($row = $stmt->fetch())\n\t\t\t\t{\n\t\t\t\t\t// club tool\n\t\t\t\t\tif ($row['club'] and $std->check_perms($ibforums->member['club_perms']) == FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$count++;\n\n\t\t\t\t\t$row['keywords'] = $url_words;\n\n\t\t\t\t\tif ($row['pinned'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderPinnedRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->output .= View::make(\"search.RenderRow\", ['Data' => $this->parse_entry($row)]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$std->Error(array(\n\t\t\t\t 'LEVEL' => 1,\n\t\t\t\t 'MSG' => 'no_search_results'\n\t\t\t\t ));\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\n\t\t\t$this->output .= View::make(\n\t\t\t\t\"search.end\",\n\t\t\t\t[\n\t\t\t\t\t'Data' => array(\n\t\t\t\t\t\t'SHOW_PAGES' => $this->links,\n\t\t\t\t\t\t'modform_close' => ($this->modfunctions)\n\t\t\t\t\t\t\t? View::make(\"search.modform_close\")\n\t\t\t\t\t\t\t: \"\"\n\t\t\t\t\t)\n\t\t\t\t]\n\t\t\t);\n\n\t\t} else // ( $this->result_type == 'posts' )\n\t\t{\n\n\t\t\t$this->parser = new PostParser();\n\n\t\t\tif ($this->search_in == 'titles')\n\t\t\t{\n\t\t\t\t$this->output .= $this->start_page($topic_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.name as forum_name\n\t\t\t\t\tFROM ibf_topics t\n\t\t\t\t\tLEFT JOIN ibf_posts p\n\t\t\t\t\t\tON (t.tid=p.topic_id\n\t\t\t\t\t\t AND p.new_topic=1\n\t\t\t\t\t\t AND p.use_sig=0)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=t.forum_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tt.tid IN({$topics})\n\t\t\t\t\t\tAND p.queued != 1\n\t\t\t\t\t\tAND t.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\n\t\t\t} else // ( $this->search_in == 'posts' )\n\t\t\t{\n\t\t\t\t$this->parser->prepareIcons();\n\n\t\t\t\tif ($topics)\n\t\t\t\t{\n\t\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tpid\n\t\t\t\t\tFROM\n\t\t\t\t\t\tibf_posts\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttopic_id IN({$topics}) AND\n\t\t\t\t\t\tnew_topic=1 AND\n\t\t\t\t\t\tqueued != 1\");\n\n\t\t\t\t\twhile ($pr = $stmt->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!preg_match(\"/,\" . $pr['pid'] . \",/\", $posts))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$posts .= $pr['pid'] . \",\";\n\t\t\t\t\t\t\t$post_max_hits++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$posts = str_replace(\",,\", \",\", $posts);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= $this->start_page($post_max_hits, 1);\n\n\t\t\t\t$stmt = $ibforums->db->query(\"SELECT\n\t\t\t\t\t\tt.*,\n\t\t\t\t\t\tp.pid,\n\t\t\t\t\t\tp.author_id,\n\t\t\t\t\t\tp.author_name,\n\t\t\t\t\t\tp.post_date,\n\t\t\t\t\t\tp.post,\n\t\t\t\t\t\tp.use_emo,\n\t\t\t\t\t\tf.id as forum_id,\n\t\t\t\t\t\tf.forum_highlight,\n\t\t\t\t\t\tf.highlight_fid as hid,\n\t\t\t\t\t\tf.name as forum_name,\n\t\t\t\t\t\tf.use_html,\n\t\t\t\t\t\tg.g_dohtml,\n\t\t\t\t\t\tp.ip_address\n\t\t\t\t\tFROM ibf_posts p\n\t\t\t\t\tLEFT JOIN ibf_topics t\n\t\t\t\t\t\tON (t.tid=p.topic_id)\n\t\t\t\t\tLEFT JOIN ibf_forums f\n\t\t\t\t\t\tON (f.id=p.forum_id)\n\t\t\t\t\tLEFT JOIN ibf_members m\n\t\t\t\t\t\tON (m.id=p.author_id)\n\t\t\t\t\tLEFT JOIN ibf_groups g\n\t\t\t\t\t\tON (m.mgroup=g.g_id)\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tp.pid IN({$posts}) AND\n\t\t\t\t\t\tp.use_sig=0 AND\n\t\t\t\t\t\tp.queued != 1 AND\n\t\t\t\t\t\tt.approved=1\n\t\t\t\t\tORDER BY p.post_date DESC\n\t\t\t\t\tLIMIT {$this->first},25\");\n\t\t\t}\n\n\t\t\twhile ($row = $stmt->fetch())\n\t\t\t{\n\t\t\t\tif ($ibforums->member['g_is_supmod'])\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"( <a href='{$ibforums->base_url}&act=modcp&CODE=ip&incoming={$row['ip_address']}' target='_blank'>{$row['ip_address']}</a> )\";\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\t$row['ip_address'] = \"\";\n\t\t\t\t}\n\n\t\t\t\tif ($row['club'] and\n\t\t\t\t $std->check_perms($ibforums->member['club_perms']) == FALSE\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$count++;\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'TEXT' => $row['post'],\n\t\t\t\t\t'SMILIES' => $row['use_emo'],\n\t\t\t\t\t'CODE' => 1,\n\t\t\t\t\t'SIGNATURE' => 0,\n\t\t\t\t\t'HTML' => 1,\n\t\t\t\t\t'HID' => ($row['forum_highlight'])\n\t\t\t\t\t\t? $row['hid']\n\t\t\t\t\t\t: -1,\n\t\t\t\t\t'TID' => $row['topic_id'],\n\t\t\t\t\t'MID' => $row['author_id'],\n\t\t\t\t);\n\n\t\t\t\t$row['post'] = $this->parser->prepare($data);\n\n\t\t\t\tif (!trim($row['post']))\n\t\t\t\t{\n\t\t\t\t\t$count--;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$row['keywords'] = $url_words;\n\t\t\t\t$row['post_date'] = $std->get_date($row['post_date']);\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Parse HTML tag on the fly\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($row['use_html'] == 1)\n\t\t\t\t{\n\t\t\t\t\t// So far, so good..\n\n\t\t\t\t\tif (stristr($row['post'], '[dohtml]'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// [doHTML] tag found..\n\n\t\t\t\t\t\t$parse = ($row['use_html'] AND $row['g_dohtml'])\n\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t: 0;\n\n\t\t\t\t\t\t$row['post'] = $this->parser->post_db_parse($row['post'], $parse);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//--------------------------------------------------------------\n\t\t\t\t// Do word wrap?\n\t\t\t\t//--------------------------------------------------------------\n\n\t\t\t\tif ($ibforums->vars['post_wordwrap'] > 0)\n\t\t\t\t{\n\t\t\t\t\t$row['post'] = $this->parser->my_wordwrap($row['post'], $ibforums->vars['post_wordwrap']);\n\t\t\t\t}\n\n\t\t\t\t$this->output .= View::make(\"search.RenderPostRow\", ['Data' => $this->parse_entry($row, 1)]);\n\t\t\t}\n\n\t\t\t$this->output .= View::make(\"search.end_as_post\", ['Data' => array('SHOW_PAGES' => $this->links)]);\n\t\t}\n\n\t\tif ($count <= 0)\n\t\t{\n\t\t\t$std->Error(array(\n\t\t\t 'LEVEL' => 1,\n\t\t\t 'MSG' => 'no_search_results'\n\t\t\t ));\n\t\t}\n\n\t\t$this->page_title = $ibforums->lang['search_results'];\n\n\t\tif ($ibforums->input['nav'] == 'lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'my_lv')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['my_nav_since_lv']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'lt')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_lt']);\n\n\t\t} elseif ($ibforums->input['nav'] == 'au')\n\t\t{\n\t\t\t$this->nav = array($ibforums->lang['nav_au']);\n\t\t} else\n\t\t{\n\t\t\t$this->nav = array(\n\t\t\t\t\"<a href='{$this->base_url}&act=Search'>{$ibforums->lang['search_form']}</a>\",\n\t\t\t\t$ibforums->lang['search_title']\n\t\t\t);\n\t\t}\n\t}", "public static function search() {\n if(isset($_GET['q']) AND !empty($_GET['q'])) {\n $q = htmlspecialchars($_GET['q']);\n $contacts = \\Phonebook\\Models\\ContactsModel::findByNameAndNum($q);\n return $contacts;\n } else {\n $q = Null;\n $contacts = \\Phonebook\\Models\\ContactsModel::findByEmptySearch($q);\n return $contacts;\n }\n echo $this->templates->render('home');\n }", "public function search(){\r\n\t\t//Test if the POST parameters exist. If they don't present the user with the\r\n\t\t//search controls/form\r\n\t\tif(!isset($_POST[\"search\"])){\r\n\t\t\t$this->template->display('search.html.php');\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//Get the recipe from the database\r\n\t\t$recipes = Recipe::search($_POST[\"search\"]);\r\n\t\t//If successful and the count is equal to one (as desired)\r\n\t\t//set the recipe object in the template to be displayed\r\n\t\t$this->template->recipes = $recipes;\r\n\t\r\n\t\t$this->template->display('results.html.php');\r\n\t}", "public function ajaxSearch()\r\n {\r\n $this->load->model('book_model', 'bookManager');\r\n\r\n $books = array();\r\n $search = $this->input->get('search');\r\n $idCustomer = $this->session->userdata('member-id');\r\n $dataBooks = $this->bookManager->getBooksSearch($search);\r\n \r\n $k = 0;\r\n foreach ($dataBooks as $data) {\r\n if (stripos($data->author, trim($search))) {\r\n $books['list'][$k]['name'] = $data->author;\r\n $k++;\r\n }\r\n if (stripos($data->title, trim($search))) {\r\n $books['list'][$k]['name'] = $data->title;\r\n $k++;\r\n }\r\n if (stripos($data->genre, trim($search))) {\r\n $books['list'][$k]['name'] = $data->genre;\r\n $k++;\r\n }\r\n \r\n if ($k > 7) {\r\n break;\r\n }\r\n }\r\n\r\n echo json_encode($books);\r\n die;\r\n }", "public static function search_books_general($books, $search) {\n\t\t$books_filter = $books;\n\t\t// dd($result);\n\t\tif ($search->year != '0') {\n\t\t\t$books_filter = BooksBModel::filter_books_by_year($books_filter, $search->year);\n\t\t\t// dd($books_filter);\n\t\t} \n\t\tif ($search->status != '0') {\n\t\t\t$search->status = (int)$search->status;\n\t\t\t$search->status = $search->status - 1;\n\t\t\t$books_filter = BooksBModel::filter_books_by_status($books_filter, $search->status);\n\t\t\t// dd($books_filter);\n\t\t}\n\t\tif ($search->chap != '0') {\n\t\t\t$search->chap = (int)$search->chap;\n\t\t\t$books_filter = BooksBModel::filter_books_by_chap($books_filter, $search->chap);\n\t\t\t// dd($books_filter);\n\t\t}\n\t\tif ($search->author != '') {\n\t\t\t$books_filter = BooksBModel::filter_books_by_author($books_filter, $search->author);\n\t\t\t// dd($books_filter);\n\t\t}\n\t\tif ($search->character != '') {\n\t\t\t$books_filter = BooksBModel::filter_books_by_character($books_filter, $search->character);\n\t\t\t// dd($books_filter);\n\t\t}\n\t\tif ($search->trans != '') {\n\t\t\t$books_filter = BooksBModel::filter_books_by_trans($books_filter, $search->trans);\n\t\t\t// dd($books_filter);\n\t\t}\n\t\tif ($search->sort == '0'){\n\t\t\tif ($search->order == '0')\n\t\t\t\t$books_filter = collect($books_filter)->sortBy('update_at')->toArray();\n\t\t\telseif ($search->order == '1')\n\t\t\t\t$books_filter = collect($books_filter)->sortBy('update_at')->reverse()->toArray();\n\t\t}\n\t\telseif ($search->sort == '1'){\n\t\t\tif ($search->order == '0')\n\t\t\t\t$books_filter = collect($books_filter)->sortBy('name')->toArray();\n\t\t\telseif ($search->order == '1')\n\t\t\t\t$books_filter = collect($books_filter)->sortBy('name')->reverse()->toArray();\n\t\t}\n\t\telseif ($search->sort == '2') {\n\t\t\tif ($search->order == '0')\n\t\t\t\t$books_filter = collect($books_filter)->sortBy('view')->toArray();\n\t\t\telseif ($search->order == '1')\n\t\t\t\t$books_filter = collect($books_filter)->sortBy('view')->reverse()->toArray();\n\t\t}\n\t\t$result = [];\n\t\tif (count($books_filter)>12) {\n\t\t\tfor ($i=0; $i < 12; $i++) { \n\t\t\t\t$result[$i] = $books_filter[$i];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $books_filter;\n\t}", "public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }" ]
[ "0.6768391", "0.65706915", "0.65238774", "0.6344322", "0.63364303", "0.6286292", "0.6286275", "0.6260877", "0.6242725", "0.62202054", "0.6198047", "0.61036855", "0.6099593", "0.6089794", "0.60334677", "0.59971875", "0.59771603", "0.59742594", "0.59606254", "0.5912823", "0.5905125", "0.5899807", "0.5898518", "0.5867075", "0.58578384", "0.585481", "0.5854796", "0.5850065", "0.58372724", "0.58250684" ]
0.72020805
0
returns array of BookIds later used to construct book Objects
function getBookIDs($queryResult){ $num_results = $queryResult->num_rows; $arrayOfBookIDs = array(); for($i = 0; $i < $num_results; $i++){ $row = $queryResult->fetch_assoc(); $arrayOfBookIDs[$i] = $row['BookID']; } return $arrayOfBookIDs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdManifest(): array\n {\n return $this->books->getIdDict();\n }", "public abstract function get_ids();", "public function getIds();", "public function getIds();", "public function getAllIds(): array;", "public function getBookList() {\n\n $booklist = array();\n\n foreach ($this->db-> query(\"SELECT * FROM book\") as $row) {\n \n array_push($booklist, new Book($row['title'], $row['author'], $row['description'], $row['id']));\n }\n\n return $booklist;\n }", "function getIds( array $Objects );", "function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function getObjectIds();", "public function getIdentities(): array\n {\n $identities = [];\n\n foreach ($this->customerBooks() as $customerBook) {\n $identities = array_merge($customerBook->getIdentities(), $identities);\n }\n \n return $identities;\n }", "public function getBookList()\n\t{\n\t\treturn array(\n\t\t\t\"1\" => new Book(\"Être et Temps\", \"9782070707393\", 1, 1, 1),\n\t\t\t\"2\" => new Book(\"Finnegans Wake\", \"9782070402250\", 2, 2, 2),\n\t\t\t\"3\" => new Book(\"Critique de la raison pure\", \"9782070325757\", 3, 3, 3)\n\t\t);\n\t}", "function getEventIDs() {\n\t\t$return = array();\n\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$return[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "public function getItemIds();", "public function getIds()\n {\n\n }", "public function getAllIds();", "public static function getPrimaryKeys()\n {\n return array('bookId');\n }", "public function getIds(): array\n {\n return $this->ids;\n }", "public function getBookList() \n {\n return array( \n \"Balagurusamy\" => new Book(\"Balagurusamy\", \"Balagurusamy\", \"C programming\"), \n \"CMM in Practice\" => new Book(\"CMM in Practice\", \"Pankaj Jalote\", \"\"), \n \"PHP for Dummies\" => new Book(\"PHP for Dummies\", \"Some Smart Guy\", \"\") \n ); \n }", "public function getItemIds()\n {\n $this->loadItems();\n $items = [];\n foreach ($this->items as $item) {\n $items[] = $item->getId();\n }\n return $items;\n }", "static function findBookList($id1, $id2) {\n $search_book_list = $GLOBALS['DB']->query(\"SELECT * FROM book_list WHERE author_id = {$id1} AND book_id = {$id2}\");\n $found_books = array();\n $found_book = $search_book_list->fetchAll(PDO::FETCH_ASSOC);\n foreach ($found_book as $book){\n $author_id = $book['author_id'];\n $book_id = $book['book_id'];\n $due_date = $book['due_date'];\n $checkout_patron_id = $book['checkout_patron_id'];\n $id = $book['id'];\n $new_book = new BookList($author_id, $book_id, $due_date, $checkout_patron_id, $id);\n array_push($found_books, $new_book);\n }\n return $found_books;\n }" ]
[ "0.70754516", "0.7040359", "0.68828154", "0.68828154", "0.6692486", "0.66098523", "0.6585005", "0.6579276", "0.65656066", "0.6552998", "0.65242594", "0.65051824", "0.6486124", "0.64849406", "0.64849406", "0.64849406", "0.64849406", "0.64849406", "0.64849406", "0.64849406", "0.64849406", "0.643387", "0.64321715", "0.6375122", "0.6371058", "0.6370976", "0.636631", "0.6344744", "0.6304692", "0.62511307" ]
0.7256911
0
Show a certain reservation resource
function show( $resource ){ $where = "reservation_status <> 'Pending' AND id = {$resource}"; $reservation = where( 'reservations', $where ); $reservation = $reservation[0]; return view('admin/reservation/preview_reservation', compact( 'reservation' )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Reservation $reservation)\n {\n }", "public function show(Reservation $reservation)\n {\n \n }", "public function show(Reservation $reservation)\n {\n //\n }", "public function show(Reservation $reservation)\n {\n //\n }", "public function show(Reservation $reservation)\n {\n //\n }", "public function show(Reserve $reserve)\n {\n //\n }", "function view(){\n global $DOPBSP;\n \n /*\n * Check if reservations have expired each time you open the reservations page.\n */\n $this->clean();\n \n /*\n * Display reservations template.\n */\n $DOPBSP->views->backend_reservations->template();\n }", "public function show($id){\n $getR = Reservation::query()->orderby('id', 'DESC')->where('restaurant_id', $id)->get();\n return view('admin/manage-reservation', compact('getR'));\n }", "public function show($id)\n {\n return Reservation::find($id);\n }", "public function showAction(Reserver $reserver)\n {\n $evennement = new Evennement();\n $evennement = $reserver->getIdev();\n $user = new User();\n $user = $reserver ->getIduser();\n\n\n return $this->render('reserver/show.html.twig', array(\n 'reserver' => $reserver,\n 'user' => $user,\n 'evenement' => $evennement,\n ));\n }", "public function showAction(Reservation $reservation)\n {\n $deleteForm = $this->createDeleteForm($reservation);\n\n return $this->render('reservation/show.html.twig', array(\n 'reservation' => $reservation,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function preservationAction() {\n\tif($this->_getParam('id',false)) {\n\t$preserves = new Preservations();\n\t$this->view->preserves = $preserves->getPreservationDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function show()\n {\n return view('reservationok');\n }", "public function show(TenisReserva $tenisReserva)\n {\n //\n }", "public function show(Reserve $reserve) {\n return $reserve;\n }", "public function actionReservationView($id)\n {\n return $this->render('reservationview', [\n 'model' => $this->findModel($id,'app\\models\\ServicesReservation'),\n ]);\n }", "public function if_show_time_found()\n {\n $reservation = \\App\\Models\\Reservation::factory()->create();\n\n $reponse = $this->withHeaders(['Authorization'=> 'Bearer '.$this->userLogin()])->json('GET', 'api/reservations/'.$reservation->id);\n $reponse\n ->assertStatus(201)\n ->assertJsonStructure(\n [\n 'data' => [\n 'id', \n 'receptionist'=> ['name', 'email', 'created_at'], \n 'show_time'=> [\n 'id', \n 'date', \n 'start_time', \n 'end_time', \n \"created_at\",\n 'movie' => [\n \"id\",\n \"movie_name\",\n \"movie_duration\",\n \"release_date\",\n \"created_at\"\n ],\n \"hall\" => [\n \"id\",\n \"hall_name\",\n \"price\",\n \"created_at\"\n ]\n ],\n \"num_of_seats\",\n \"total_cost\",\n \"created_at\"\n ]\n ] \n );\n }", "public function inforeservations($id_reservations){\n $reservation = \\App\\reservation::where('ID_RESERVATION','=',$id_reservations)->get()->first();\n if(!$reservation){return redirect('/');}\n $prestation = \\App\\pristation::where('id_prestation','=',$reservation->id_prestation)->get()->first();\n $coiffeur = \\App\\coiffeur::where('NOM_COIFFEUR','=',$prestation->NOM_COIFFEUR)->get()->first();\n $salon = \\App\\salon::where('NAME_SALON','=',$coiffeur->NAME_SALON)->get()->first();\n \n return view('Inforeservation',compact('prestation','coiffeur','salon','reservation'));\n \n }", "public function show(Resena $resena)\n {\n }", "public function show(Resource $resource)\n {\n //\n }", "public function show(Reservoir $reservoir)\n {\n //\n }", "public function reservation()\n\t{\n\n\t}", "public function reservations() {\n $this->template->content = View::instance(\"v_reservations_reservations\");\n $this->template->title = \"Reservations\";\n\n # Build the query to get all the users\n // $q = \"SELECT * FROM reservations\";\n\n\t $q = \"SELECT *\n FROM reservations\n WHERE user_id = \".$this->user->user_id.\" order by reservation_id desc\";\n\n # Execute the query to get all the users.\n # Store the result array in the variable $users\n $reservations = DB::instance(DB_NAME)->select_rows($q);\n\n # Build the query to figure out what reservations does this user already have?\n # I.e. who are they following\n $q = \"SELECT *\n FROM reservations\n WHERE user_id = \".$this->user->user_id;\n\n\n\n # Pass data (reservations) to the view\n $this->template->content->reservations = $reservations;\n\n\n # Render the view\n echo $this->template;\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit(Reservation $reservation)\n {\n \n\t\t\n }", "public function open($reservation_id) {\n $this->template->content = View::instance(\"v_reservations_index\");\n $this->template->title = \"Reservations\";\n\n # Build the query to get all the users\n // $q = \"SELECT * FROM reservations \";\n\n\t\t$q = \"SELECT *\n FROM reservations\n WHERE reservation_id = \".$reservation_id;\n\n # Execute the query to get all the users.\n # Store the result array in the variable $users\n $reservations = DB::instance(DB_NAME)->select_rows($q);\n\n # Build the query to figure out what reservation does this user already have?\n # I.e. who are they following\n $q = \"SELECT *\n FROM reservations\n WHERE reservation_id = \".$reservation_id;\n\n\n # Pass data (reservation) to the view\n $this->template->content->reservations = $reservations;\n\n\n # Render the view\n echo $this->template;\n\n\n\n}", "public function edit(Reservation $reservation)\n {\n //\n }", "public function edit(Reservation $reservation)\n {\n //\n }", "public function edit(Reservation $reservation)\n {\n //\n }" ]
[ "0.7899342", "0.7890413", "0.78833014", "0.78833014", "0.78833014", "0.73021346", "0.6822746", "0.67211705", "0.6600088", "0.6584223", "0.65509945", "0.6497486", "0.6471546", "0.64575887", "0.6445756", "0.64301246", "0.6402467", "0.6365312", "0.636353", "0.6360391", "0.6345811", "0.6343038", "0.63414216", "0.63364357", "0.63225967", "0.63187957", "0.6312317", "0.62417215", "0.62417215", "0.62417215" ]
0.81634784
0
Save Categoriees to Reservation category database
function savecat(){ $data =[ 'reservation_category' => $_POST['reservation_category'], 'category_description' => $_POST['category_description'], 'reservation_duration' => $_POST['reservation_duration'] ]; insert( 'reservation_categories', $data ); redirect( route('dashboard/reservation/categories') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function ActualizarCategorias()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codcategoria\"]) or empty($_POST[\"nomcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select nomcategoria from categorias where codcategoria != ? and nomcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codcategoria\"], $_POST[\"nomcategoria\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update categorias set \"\n\t\t\t.\" nomcategoria = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codcategoria = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $nomcategoria);\n\t\t\t$stmt->bindParam(2, $codcategoria);\n\n\t\t\t$codcategoria = strip_tags(strtoupper($_POST[\"codcategoria\"]));\n\t\t\t$nomcategoria = strip_tags(strtoupper($_POST[\"nomcategoria\"]));\n\t\t\t$stmt->execute();\n\n\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<span class='fa fa-check-square-o'></span> LA CATEGORIA DE PRODUCTO FUE ACTUALIZADA EXITOSAMENTE\";\n\t\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}", "public function store(CategoryCreateRequest $request)\n {\n $datoscategoria = request()->all();\n categoria::create($datoscategoria);\n /* Envia mensaje */\n toast('¡Categoria guardada!','success');\n return redirect()->action('productoscrud@create');\n }", "public function store(SousCategorie2Request $request)\n\t{\n\t\t// Enregistrement dans la table sous_categorie\n\t\tfor ($i=1; $i<5 ; $i++) {\n\t\t\t$sous_categorie = new \\App\\Sous_categorie;\n\t\t\t$sous_categorie->produit_categorie_id \t= $request->categorie;\n\t\t\t$sous_categorie->langue_id \t \t\t\t= $i;\n\t\t\t$sous_categorie->nom \t\t \t\t\t= $request->{'nom_'.$i};\n\t\t\t$sous_categorie->description \t\t\t= $request->{'description_'.$i};\n\t\t\t$sous_categorie->save();\n\t\t}\n\n\t\treturn redirect('/admin/sous_categorie')->withFlashMessage(\"Création de la sous catégorie effectuée avec succès\");\n\t}", "public function store(StoreCategoriaRequest $request)\r\n {\r\n try {\r\n $categoria = new Categoria();\r\n $categoria->nombre = $request->input('nombre');\r\n $categoria->save();\r\n } catch (\\Exception $error) {\r\n // manejar\r\n }\r\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function store(CategoriesRequest $request)\n {\n $categorie_product = new Categorie;\n $categorie_product->name = input::get('name');\n $categorie_product->description = input::get('description');\n if (input::get('warranty') == \"on\") {\n $categorie_product->warranty = 1;\n }\n $categorie_product->type = 0;\n $categorie_product->save();\n Session::flash('message', 'Categoria insertada correctamente');\n return Redirect::to('categorie_product');\n }", "public function save() {\n if (self::getCategoryById($this->id) == null) {\n // should create\n $sql = \"INSERT INTO category (name) VALUES ('%s') RETURNING id;\";\n $auth_user = User::getUserById(1);\n $sql = sprintf($sql, pg_escape_string($this->name));\n $results = self::$connection->execute($sql);\n $this->id = $results[0][\"id\"];\n } else {\n // should update\n $sql = \"UPDATE category SET name='%s' WHERE id=%d\";\n $sql = sprintf($sql, pg_escape_string($this->name), addslashes($this->id));\n self::$connection->execute($sql);\n }\n }", "public function createCategory();", "public function store(CategoriaRequest $request)\n {\n //\n $input = $request->all();\n Tbl_Categoria::create($input);\n return redirect('admin/categoria');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\"nomCat\"=>\"required|unique:categories,nomCat\"\n ,\"status\"=>\"required\"]);\n //store data\n \n $nomCat=$request->nomCat;\n $status=$request->status;\n categorie::create([\n \"nomCat\"=>$nomCat ,\n \"status\"=>$status\n ]); \n return redirect()->route('categorie.index')->with([\"succes\"=>\"categorie ajoutee avec succes\"]) ;\n \n }", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "public function store($categoria)\n {\n $this->db->insert('categorias', $categoria);\n }", "public function run(){\n DB::table('categorias')->insert([\n [\n 'categoria' => 'rol',\n 'valor' => 'superAdmin'\n ],\n [\n 'categoria' => 'rol',\n 'valor' => 'admin'\n ],\n [\n 'categoria' => 'rol',\n 'valor' => 'operador'\n ],\n [\n 'categoria' => 'tipoDocumento',\n 'valor' => 'cedula'\n ],\n [\n 'categoria' => 'tipoDocumento',\n 'valor' => 'ruc'\n ],\n [\n 'categoria' => 'estado',\n 'valor' => 'activo'\n ],\n [\n 'categoria' => 'estado',\n 'valor' => 'inactivo'\n ]\n ]);\n }", "static public function ControllerIngresarCategorias(){\n if(isset($_POST[\"nuevaCategoria\"])){//si vienen datos\n //solo datos permitidos \n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t$tabla = \"categorias\";//a la tabla categorias\n\n\t\t\t\t$datos = $_POST[\"nuevaCategoria\"];//enviamos la nueva categoria\n\n\t\t\t\t$respuesta = ModeloCategorias::ModelIngresarCategorias($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La categoría ha sido guardada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n //en caso de que vaya vacia o caracteres especiales\n echo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\t\t\t}\n\n\t\t}\n\n }", "public function run()\n {\n $category_data = [\n 'name' => 'Celulares'\n ];\n $category = new Category($category_data);\n $category->save();\n\n $category_data = [\n 'name' => 'Computadores'\n ];\n $category = new Category($category_data);\n $category->save();\n\n $category_data = [\n 'name' => 'Televisores'\n ];\n $category = new Category($category_data);\n $category->save();\n }", "public function store(CategoryRequest $request)\n {\n //\n $cates = new Category();\n $cates->name = $request->input('name');\n $cates->role = $request->input('role');\n $cates->status = 1;\n $cates->slug = Str::slug($request->name,\"-\");\n $datetime = Carbon::now('Asia/Ho_Chi_Minh');\n $cates->created_at = $datetime;\n $cates->updated_at = null;\n $cates->save();\n return redirect('admin/danh-muc');\n }", "public function store(categorieFournisseurFormResquest $request)\n {\n //Avant tout d'abord on verifie si la categorie du fournisseur n'existe pas dans la table avant d'inserer\n //Si elle existe on ramene un message d'erreur\n //Dans le cas contraire on passe pour l'insertion\n $categorieFournisseur = CategorieFournisseur::where('libelleCategorieFournisseur',$request->input('categorie'))->first();\n if ($categorieFournisseur){\n Session::flash('warning');\n return back();\n }\n\n //geneation automatique du categorie fournisseur\n $cats=CategorieFournisseur::select(DB::raw(\"CONCAT('CF0', MAX(CAST(RIGHT(codeCategorieFournisseur,LENGTH(codeCategorieFournisseur)-3) AS UNSIGNED))+1) AS categorie\"))\n ->get();\n $cf=\"CF01\";\n foreach ($cats as $cat){\n if ($cat->categorie){\n $cf=$cat->categorie;\n }\n }\n $date = new DateTime();\n $categorie = new CategorieFournisseur();\n $categorie->codeCategorieFournisseur =$cf;\n $categorie->libelleCategorieFournisseur = $request->input('categorie');\n $categorie->slug = $request->input('categorie').$date->format('YmdHis');\n $categorie->save();\n Flashy::success('Categorie fournisseur enregistrer avec succes');\n return redirect()->route('categorieFournisseur.index');\n }", "public function postAccion(RequestCategoria $request)\n\t{\n\t\tif($request->has(\"accion\")) {\n\t\t\tif($request->input(\"accion\") == \"Agregar\") {\n\t\t\t\tif(Auth::user()->permitirFuncion(\"Crear\",\"Categorias\",\"configuracion\") || Auth::user()->perfil->nombre == \"superadministrador\") {\n\t\t\t\t\t$categoria = new Categoria();\n\t\t\t\t\t$categoria->fill($request->all());\n\n\t\t\t\t\t$categoria->usuario_creador_id = Auth::user()->id;\n\n\t\t\t\t\tif (Auth::user()->perfil->nombre == \"superadministrador\")$categoria->negocio = \"si\";\n\t\t\t\t\telse $categoria->negocio = \"no\";\n\t\t\t\t\t\n\t\t\t\t\tif (Auth::user()->perfil->nombre == \"usuario\") {\n\t\t\t\t\t\t$categoria->usuario_id = Auth::user()->usuario_creador_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$categoria->usuario_id = Auth::user()->id;\n\t\t\t\t\t}\n\n\t\t\t\t\t$categoria->save();\n\n\t\t\t\t\t$data_url = explode(\"/\",explode($_SERVER['SERVER_NAME'], URL::previous())[1]);\n\t\t\t\t\t$data = [\"success\" => true,\"location\"=>$data_url[1], \"mensaje\" => \"La categoria ha sido registrada con éxito.\"];\n\t\t\t\t\tif($data_url[1] == \"productos\"){\n\t\t\t\t\t\t$data[\"id_anterior\"]=$categoria->id;\n\t\t\t\t\t\t$data[\"valores\"] = Categoria::permitidos()->get();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSession::flash(\"mensaje\", \"La categoria ha sido creada con éxito\");\n\t\t\t\t\t}\n\t\t\t\t\treturn $data;\n\t\t\t\t}else{\n\t\t\t\t\treturn response([\"Error\",\"Usted no tiene permisos para realizar esta tarea.\"],401);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif($request->input(\"accion\") == \"Editar\") {\n\t\t\t\t\tif(Auth::user()->permitirFuncion(\"Editar\",\"Categorias\",\"configuracion\") || Auth::user()->perfil->nombre == \"superadministrador\") {\n\t\t\t\t\t\t$categoria = Categoria::find($request->input(\"categoria\"));\n\t\t\t\t\t\tif($categoria) {\n\t\t\t\t\t\t\t$categoria->fill($request->all());\n\t\t\t\t\t\t\t$categoria->save();\n\t\t\t\t\t\t\tSession::flash(\"mensaje\", \"La categoria ha sido editada con éxito\");\n\t\t\t\t\t\t\treturn [\"success\" => true, \"mensaje\" => \"La categoria ha sido editada con éxito.\"];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\treturn response([\"Error\",\"La información enviada es incorrecta.\"],422);\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn response([\"Error\",\"Usted no tiene permisos para realizar esta tarea.\"],401);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn reponse([\"error\"=>[\"La información enviada es incorrecta\"]],422);\n\t}", "public function store(CategoryRequest $request){\n DB::beginTransaction();\n try {\n $objProduct = new Product();\n $objProduct->product_name = $request->product_name;\n $objProduct->save();\n \n $categories = $request->category;\n foreach($categories as $value){\n $objProductCategory = new CategoryProduct();\n $objProductCategory->product_id = $objProduct->id;\n $objProductCategory->category_id = $value;\n $objProductCategory->save();\n }\n DB::commit();\n return redirect()->route('products')->with('success', 'Product created successfully');\n } catch (\\Exception $e) {\n DB::rollBack();\n Log::info($e);\n return redirect()->back()->with('error', 'Something went wrong');\n }\n }", "public function store(Request $request)\n {\n //\n \n // dd($request);\n $createCategorie=Category::create($request->only(['name_category']));\n $IdCategorie = $createCategorie->id;\n $nb_op = intval($request->tab_option);\n \n for($i=0;$i<$nb_op;$i++){\n \n $x = 'name_option_'.$i;\n $y = 'description_option_'.$i;\n $option = new Option();\n $option->name = $request->$x;\n $option->description = $request->$y;\n $option->category_id = $IdCategorie;\n $option->save();\n // Option::create($request->only(['name'=>'name-option-'.$i, 'description'=>'description-option-'.$i]))->attach($IdCategorie);\n \n }\n \n //dd($option);\n return redirect(route('categoryIndex'));\n }", "public function run()\n {\n $category = [\n [\n \t'name' => 'Household'\n ],\n [\n 'name' => 'Construction'\n ],\n [\n 'name' => 'Personel'\n ],\n [\n 'name' => 'Maintenance'\n ]\n ];\n\n DB::table('categories')->insert($category);\n }", "public function run()\n {\n $categorie = config('database.categories');\n\n foreach ($categorie as $value) {\n $nuova_categoria = new Category();\n $nuova_categoria->name = $value['name'];\n $nuova_categoria->slug = Str::slug($value['slug']);\n //$nuovo_libro->fill($value);\n $nuova_categoria->save();\n }\n }", "public function store(CategoriesRequest $request)\n {\n $categorie = new Categorie($request->except('_token'));\n $categorie->save();\n return redirect(route('categorie.index'));\n }", "public function store(CategoryCreateRequest $request)\n {\n //v1:\n //$request->validate(['name'=>'required']); // поле обязательно к заполнению , v2: валидация в папке \\request\\CategoryCreateRequest\n\n //dd($request->all());\n //dd($request->input('name'));\n //dd($request->only('name','desc'));\n //dd($request->except('name','desc'));\n //dd($request->has('name')); //=true\n //dd($request->path());\n //dd($request->url());\n //dd($request->fullurl());\n //dd($request->query('гет парам'));\n //dd($request->get('гет парам'));\n //$newsKat[] = ['id'=>intval(array_key_last( $this->newsKat))+2,'nameKat'=>$request->input('name')];\n //print_r($this->newsKat);\n\n //v1:\n //$id = DB::table('categ')->insertGetId(['name' => $request->input('name'), 'desc' => $request->input('desc')] );\n\n /*v2:\n $id = Categ::query()->insertGetId(['name' => $request->input('name'), 'desc' => $request->input('desc')] );\n\n if (!empty($id)) {$o='сохранено ';}\n else {$o='не сохранено';}\n $o .='<br><br> <a href=\"/adminc\">Управление Категориями</a><br>' ;\n //return redirect()->route('admin');\n return response($o);\n //return response->view('view.any');\n //return response->download('file.any');\n */\n\n //v3:\n $ctg= new Categ();\n\n if($request->isMethod('post')){\n $ctg->fill($request->all());\n $ctg->save();\n return redirect()->route('adminCateg');\n }\n return view('news.admin.categ.add');\n\n }", "public function store(CategoryRequest $request)\n {\n /*Guardar Datos en la DB con el metodo all que envia todos los campos establecidos\n en el modelo en el campo protected $fillable*/\n Category::create($request->all());\n //Redireccionar al index\n return redirect()->route('category.index');\n }", "public function save() {\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$this->setLast_modified($date);\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql = 'update cart_categories set ';\n\t\t} else {\n\t\t\t$sql = 'insert into cart_categories set ';\n\t\t\t$this->setDate_added($date);\n\t\t}\n\t\tif (!is_null($this->getImage())) {\n\t\t\t$sql .= '`categories_image`=\"' . e($this->getImage()->getId()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getParent_id())) {\n\t\t\t$sql .= '`parent_id`=\"' . e($this->getParent_id()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getSort_order())) {\n\t\t\t$sql .= '`sort_order`=\"' . e($this->getSort_order()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getDate_added())) {\n\t\t\t$sql .= '`date_added`=\"' . e($this->getDate_added()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getLast_modified())) {\n\t\t\t$sql .= '`last_modified`=\"' . e($this->getLast_modified()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getStatus())) {\n\t\t\t$sql .= '`categories_status`=\"' . e($this->getStatus()) . '\", ';\n\t\t}\n\t\tif (!is_null($this->getId())) {\n\t\t\t$sql .= 'categories_id=\"' . e($this->getId()) . '\" where categories_id=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql = trim($sql, ', ');\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t$catId = Database::singleton()->lastInsertedID();\n\t\t$new = false;\n\t\tif (is_null($this->getId())) {\n\t\t\t$this->setId($catId);\n\t\t\t$new = true;\n\t\t\t$sql = 'insert into cart_categories_description set ';\n\t\t} else {\n\t\t\t$sql = 'update cart_categories_description set ';\n\t\t}\n\t\t$sql .= '`language_id`=\"' . 1 . '\", ';\n\t\t$sql .= '`categories_name`=\"' . e($this->getName()) . '\", ';\n\t\t$sql .= '`categories_description`=\"' . e($this->getDescription()) . '\"';\n\t\t\n\t\tif ($new) {\n\t\t\t$sql .= ', `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t} else {\n\t\t\t$sql .= ' where `categories_id`=\"' . e($this->getId()) . '\"';\n\t\t}\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\tself::__construct($this->getId());\n\t}", "public function RegistrarCategorias()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"nomcategoria\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select nomcategoria from categorias where nomcategoria = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"nomcategoria\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into categorias values (null, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $nomcategoria);\n\n\t\t$nomcategoria = strip_tags(strtoupper($_POST[\"nomcategoria\"]));\n\t\t$stmt->execute();\n\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA CATEGORIA DE PRODUCTO FUE REGISTRADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "public function run() {\n AvailableRecipeCategory::create([\n 'category' => 'Supe si Ciorbe'\n ]);\n }", "public function store(CategoriesRequest $request)\n {\n //\n }" ]
[ "0.651499", "0.64502376", "0.6448187", "0.63526577", "0.6329293", "0.6319965", "0.6315014", "0.63062763", "0.6251471", "0.6223836", "0.62140614", "0.619677", "0.6180901", "0.61664253", "0.615516", "0.61475575", "0.6133232", "0.61306876", "0.61100316", "0.610856", "0.6083685", "0.60833937", "0.60780174", "0.60580385", "0.6049045", "0.60381424", "0.602724", "0.6026403", "0.60193974", "0.60140777" ]
0.6701003
0
Return whether env is production or not.
function is_prod() { return env() === 'production'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_production() {\n\treturn ENV == PRODUCTION;\n}", "public static function isProductionEnv() {\n return getenv('ENVIRONMENT') !== false && strtolower(getenv('ENVIRONMENT')) === \"production\";\n }", "public function isProduction(): bool\n {\n return $this->env === 'production';\n }", "protected function isProduction()\n {\n return $this->getEnvironment()->isProd();\n }", "public function isProduction() {\n return !empty($this->configuration['production']);\n }", "public static function inProduction(): bool\n {\n $env = env('APP_ENV');\n\n return $env === 'production' || $env === 'prod';\n }", "public function IsProduction () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::PRODUCTION];\n\t}", "public static function isProductionMode()\n {\n return (self::getEnvMode() == PaylineSDK::ENV_PROD);\n }", "public function isProd() {\n\t\tif ($this->checkEnv(array('prod', 'product', 'production'))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isProductionMode(): bool;", "function is_production(){\r\n if(ENVIRONMENT == 'production'){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "public static function isProdEnvironment()\r\n {\r\n return in_array($_SERVER['HTTP_HOST'], static::getProdDomains());\r\n }", "public function isProduction()\r\n {\r\n return (bool) $this->productionMode;\r\n }", "public function isInProductionMode()\n {\n return $this->_appState->getMode() === \\Magento\\Framework\\App\\State::MODE_PRODUCTION;\n }", "public function isProduction()\n {\n return $this->transbankConfig->isProduction();\n }", "public function isProduction() {}", "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "function is_dev()\n{\n return env('APP_ENV') === 'local' ? true : false;\n}", "public function isProduction();", "public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'prod'));\n }\n\n // Pantheon.\n if (defined('PANTHEON_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'live'));\n }\n\n return FALSE;\n }", "public static function isDev()\n {\n return isset($_SERVER['ENV']) && $_SERVER['ENV'] == 'dev';\n }", "public static function isDev(){\n if (isset($_GET['env']))\n return false;\n return (env('APP_ENV') == 'dev');\n }", "public function inDevelopment() {\n try {\n return Config::get()->environment === 'dev';\n } catch (Throwable $e) {\n return false;\n }\n }", "function is_dev() {\n return env() === 'development';\n}", "function is_dev(){\n return ENVIRONMENT == 'development';\n}", "function isDevOrBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV || $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public function isDev()\n {\n return ($this->_environment === 'development');\n }", "public static function isDebug() \n {\n if (array_key_exists(self::APPLICATION_ENV_KEY, $_SERVER))\n {\n return strtolower($_SERVER[self::APPLICATION_ENV_KEY]) == self::DEV_ENV_VALUE;\n }\n }", "function is_staging() {\n return env() === 'staging';\n}", "function detectEnvironment($env = 'local') {\n\treturn (env('APP_ENV', 'production') == $env) ? true : false;\n}" ]
[ "0.91954964", "0.89817804", "0.8956651", "0.8786681", "0.86842465", "0.8605008", "0.8582791", "0.85158914", "0.8398841", "0.83440757", "0.8332403", "0.8257692", "0.8246422", "0.8143468", "0.8115966", "0.80501974", "0.80416745", "0.8003937", "0.79955316", "0.79729277", "0.7966121", "0.7904878", "0.78151304", "0.77849454", "0.77554333", "0.7687048", "0.7675546", "0.7667921", "0.7643881", "0.76315045" ]
0.900192
1
Return whether env is staging or not.
function is_staging() { return env() === 'staging'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "public function inDevelopment() {\n try {\n return Config::get()->environment === 'dev';\n } catch (Throwable $e) {\n return false;\n }\n }", "function is_dev()\n{\n return env('APP_ENV') === 'local' ? true : false;\n}", "public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'prod'));\n }\n\n // Pantheon.\n if (defined('PANTHEON_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'live'));\n }\n\n return FALSE;\n }", "function isDevOrBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV || $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public static function isDev()\n {\n return isset($_SERVER['ENV']) && $_SERVER['ENV'] == 'dev';\n }", "public function isDevelopmentEnvironment() {\n\t\treturn in_array($this->getKernel()->getEnvironment(), array('test', 'dev'));\n\t}", "public static function isProductionEnv() {\n return getenv('ENVIRONMENT') !== false && strtolower(getenv('ENVIRONMENT')) === \"production\";\n }", "public static function isDev(){\n if (isset($_GET['env']))\n return false;\n return (env('APP_ENV') == 'dev');\n }", "function is_dev() {\n return env() === 'development';\n}", "public function IsDevelopment () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::DEVELOPMENT];\n\t}", "public static function inDevelopment(): bool\n {\n $env = env('APP_ENV');\n\n return $env === 'development' || $env === 'dev' || $env === 'local';\n }", "public function isDev()\n {\n return ($this->_environment === 'development');\n }", "public function IsProduction () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::PRODUCTION];\n\t}", "function is_production() {\n\treturn ENV == PRODUCTION;\n}", "function is_prod() {\n return env() === 'production';\n}", "public function isProduction(): bool\n {\n return $this->env === 'production';\n }", "function is_dev(){\n return ENVIRONMENT == 'development';\n}", "public function hasDevEnv()\n {\n // if not set abort\n if (empty($this->objEnvironmentSettings->environment)) {\n return false;\n }\n\n // determine if it's development\n return 'development' == $this->objEnvironmentSettings->environment;\n }", "protected function isProduction()\n {\n return $this->getEnvironment()->isProd();\n }", "function isNotLive(){ return $_ENV['CURRENT_ENVIRONMENT'] != ENVIRONMENT_LIVE; }", "function detectEnvironment($env = 'local') {\n\treturn (env('APP_ENV', 'production') == $env) ? true : false;\n}", "function themeIsDev() {\n if( defined( 'WP_DEV' ) || wp_get_environment_type() === 'development' ) {\n return true;\n } else {\n return false;\n }\n}", "public function isProduction() {\n return !empty($this->configuration['production']);\n }", "public function isDevEnv()\n {\n // if set to dev stop here\n if ($this->blnIsDev) {\n return true;\n }\n\n if ($this->hasDevEnv()) {\n return true;\n }\n\n return false;\n }", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "function isLive(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_LIVE; }", "public function isProductionMode(): bool;", "public function is_test_environment() {\n\n if(empty($this->production_site_url))\n return true;\n else\n return get_site_url() === $this->production_site_url ? false : true;\n }", "public static function isProductionMode()\n {\n return (self::getEnvMode() == PaylineSDK::ENV_PROD);\n }" ]
[ "0.76748675", "0.7580123", "0.7546528", "0.7530555", "0.7526153", "0.744025", "0.7399078", "0.73750705", "0.73685217", "0.73070115", "0.7305181", "0.730027", "0.7293459", "0.72865105", "0.72363687", "0.723184", "0.7173596", "0.7158384", "0.7146758", "0.7126769", "0.7125726", "0.70101196", "0.6985749", "0.6984446", "0.69832754", "0.69714826", "0.69603264", "0.6959273", "0.69518524", "0.693982" ]
0.9197006
0
Return whether env is development or not.
function is_dev() { return env() === 'development'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function inDevelopment() {\n try {\n return Config::get()->environment === 'dev';\n } catch (Throwable $e) {\n return false;\n }\n }", "public static function isDev()\n {\n return isset($_SERVER['ENV']) && $_SERVER['ENV'] == 'dev';\n }", "public function isDev()\n {\n return ($this->_environment === 'development');\n }", "public function isDevelopmentEnvironment() {\n\t\treturn in_array($this->getKernel()->getEnvironment(), array('test', 'dev'));\n\t}", "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "function is_dev()\n{\n return env('APP_ENV') === 'local' ? true : false;\n}", "public static function inDevelopment(): bool\n {\n $env = env('APP_ENV');\n\n return $env === 'development' || $env === 'dev' || $env === 'local';\n }", "function is_dev(){\n return ENVIRONMENT == 'development';\n}", "public static function isDev(){\n if (isset($_GET['env']))\n return false;\n return (env('APP_ENV') == 'dev');\n }", "public static function is_development()\n {\n return Kohana::$environment == Kohana::DEVELOPMENT;\n }", "public function hasDevEnv()\n {\n // if not set abort\n if (empty($this->objEnvironmentSettings->environment)) {\n return false;\n }\n\n // determine if it's development\n return 'development' == $this->objEnvironmentSettings->environment;\n }", "public function is_development_environment()\n {\n }", "public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'prod'));\n }\n\n // Pantheon.\n if (defined('PANTHEON_ENVIRONMENT')) {\n return !in_array(PANTHEON_ENVIRONMENT, array('test', 'live'));\n }\n\n return FALSE;\n }", "public static function isDebug() \n {\n if (array_key_exists(self::APPLICATION_ENV_KEY, $_SERVER))\n {\n return strtolower($_SERVER[self::APPLICATION_ENV_KEY]) == self::DEV_ENV_VALUE;\n }\n }", "public function IsDevelopment () {\n\t\tif ($this->name === NULL) $this->GetName();\n\t\treturn $this->values[\\MvcCore\\IEnvironment::DEVELOPMENT];\n\t}", "public function isDevEnv()\n {\n // if set to dev stop here\n if ($this->blnIsDev) {\n return true;\n }\n\n if ($this->hasDevEnv()) {\n return true;\n }\n\n return false;\n }", "public function isDevelopment() {}", "function _is_development_mode() {\n\t\treturn IMFORZA_Utils::is_development_mode();\n\t}", "private function isDev()\n {\n $is_localhost = (@$_SERVER['HTTP_HOST'] == 'localhost');\n $is_dev_server = (isset($GLOBALS['is_development_server']) && $GLOBALS['is_development_server'] == '1');\n $debug_enabled = $this->getSystemSetting('enable-js-debug-logging');\n $is_dev = ($is_localhost || $is_dev_server || $debug_enabled) ? 1 : 0;\n return $is_dev;\n }", "function is_development(): bool\n{\n return stripos(getenv('HTTP_HOST'), 'sunshine') != 0;\n}", "private function isCurrentEnvironmentDev() {\n return (getenv(\"HOME\") == \"/Users/BB\");\n }", "public static function is_development_mode() {\n\t\t\t$development_mode = false;\n\t\t\tif ( defined( 'IMFORZA_DEBUG' ) ) {\n\t\t\t\t$development_mode = IMFORZA_DEBUG;\n\t\t\t} elseif ( site_url() && false === strpos( site_url(), '.' ) ) {\n\t\t\t\t$development_mode = true;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter the imforza development mode.\n\t\t\t *\n\t\t\t * @param bool $development_mode Is imforza development mode active.\n\t\t\t */\n\t\t\treturn apply_filters( 'imforza_development_mode', $development_mode );\n\t\t}", "public static function isDevMode()\n\t{\n\t\treturn self::$app_mode === self::MODE_DEVELOPMENT;\n\t}", "public function isDev(): bool;", "function is_production() {\n\treturn ENV == PRODUCTION;\n}", "function themeIsDev() {\n if( defined( 'WP_DEV' ) || wp_get_environment_type() === 'development' ) {\n return true;\n } else {\n return false;\n }\n}", "function isDevOrBeta(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV || $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_BETA; }", "public static function isDebug(): bool\n {\n return !empty(getenv('DEBUG'));\n }", "function in_development(callable $callback = null): bool\n {\n if (app()->environment('dev', 'development', 'local')) {\n value($callback);\n return true;\n }\n\n return false;\n }", "public static function isProductionEnv() {\n return getenv('ENVIRONMENT') !== false && strtolower(getenv('ENVIRONMENT')) === \"production\";\n }" ]
[ "0.90092945", "0.8847917", "0.87833214", "0.8780316", "0.8767585", "0.8741018", "0.8690957", "0.8610205", "0.86090136", "0.85923016", "0.8567077", "0.856207", "0.8455687", "0.84478235", "0.8409347", "0.8300692", "0.8258994", "0.822494", "0.8201635", "0.8068385", "0.8061002", "0.79848975", "0.79703474", "0.793991", "0.7927513", "0.78953356", "0.7784108", "0.77099824", "0.7705069", "0.76944953" ]
0.90173423
0
determins whether loggedin user is an admin
function is_admin() { //is a user logged in? //if so, check admin status //returns true/false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isAdminUser() {}", "private function isAdmin() {\n\t\tif (Auth::user()->user == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function is_user_admin()\n {\n }", "public function isAdmin()\n {\n return ($this->username === \"admin\");\n }", "function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function isUserAdmin() {\r\n $user = $_SESSION['user'];\r\n return checkAdminStatus($user);\r\n }", "protected function isCurrentUserAdmin() {}", "protected function isCurrentUserAdmin() {}", "public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}", "public function isAdminLoggedIn() {\n\t\t$user = $this->getLoggedInUser();\n\t\treturn $user && $user->isAdmin();\n\t}", "function isAdmin() {\n return ($this->userType == 'admin');\n }", "function isAdmin(){\n\t\treturn ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME);\n\t}", "public function checkIsAdmin()\n {\n return $this->user_admin;\n }", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "function isAdmin() {\n return !$this->isLoggedIn ? FALSE : ($this->member->adminID !== NULL ? TRUE : FALSE);\n }", "public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }", "public function isAdmin()\n {\n return ((string) strtoupper($this->data->user_role) === \"ADMIN\") ? true : false;\n }", "function getIsAdmin(){\n\t\treturn ( $this->user && $this->user->access_level >= User::LEVEL_ADMIN );\n\t}", "function is_admin()\n\t{\n\t\treturn strtolower($this->ci->session->userdata('DX_role_name')) == 'admin';\n\t}", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }", "public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}", "function is_admin_logged_in()\n{\n global $current_user;\n return ($current_user != NULL && $current_user['un'] == 'admin');\n}", "public function isAdmin(){\n if($this->role==\"admin\"){\n return true;\n }\n return false;\n }", "function is_admin()\n{\n global $app;\n if (is_authenticated()) {\n $user = $app->auth->getUserData();\n return ($user['role'] === '1');\n } else {\n return false;\n }\n}", "public function isAdmin()\n {\n return $this->isSuperUser() || $this->isMemberOf('admin');\n }", "public function is_admin()\n\t{\n\t\t$user = $this->get_current_user();\n\t\tif($user !== NULL)\n\t\t{\n\t\t\tif($user['auth'] == 255)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function user_AuthIsAdmin() {\n\tglobal $AUTH;\n\t\n\treturn isset($AUTH['admin']) && ($AUTH['admin'] === 1);\n}", "public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }" ]
[ "0.8694181", "0.8573152", "0.856735", "0.8557797", "0.85452276", "0.85357547", "0.85109293", "0.85100454", "0.8496684", "0.84932864", "0.84784436", "0.84620965", "0.8455575", "0.84384304", "0.84166634", "0.83944213", "0.8393615", "0.83757454", "0.83740205", "0.8367474", "0.83514476", "0.83514476", "0.83466375", "0.83382237", "0.8336295", "0.83291924", "0.832873", "0.830834", "0.8306405", "0.8298877" ]
0.8955718
0
delete project (flag) (update)
public function delete_project ($project_id) { //$this->where($whereProp, $whereValue); //$this->update($tableName, $tableData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n $sql = sprintf(\"DELETE FROM project WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "function delete_project( $user, $project )\n {\n //Unimplemented\n }", "public function deleteProject($projectId)\n {\n $registry = Zend_Registry::getInstance();\n\t\t$DB = $registry['DB'];\n\n\t\tif($projectId > 0){\n\t\t\t$data = array('deleted' => 1 ); \n\t\t\t$DB->update('tbl_projects', $data,\" project_id = $projectId\");\n\t\t}\n\t\t\n\t\treturn $result;\n }", "function delete_project(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\tif (client_get_role() != \"ec_admin\") {\n\t\t\t// The user is not an admin and isn't allowed to create projects\n\t\t\t$this->add_error(\"Current user does not have permission to create projects.\");\n\t\t\t$status = 403;\n\t\t}\n\t\tif (empty($params->id)) {\n\t\t\t$this->add_error(\"No id given for project.\");\n\t\t\t$status = 400;\n\t\t}\n\t\tif (!$this->has_errors()) {\n\t\t\t$result = $this->dbconn->update(\n\t\t\t\t$this->project_table,\n\t\t\t\tarray(\n\t\t\t\t\t'deleted' => 1,\n\t\t\t\t),\n\t\t\t\tarray(\"id\" => $params->id),\n\t\t\t\tarray(\n\t\t\t\t\t'%d'\n\t\t\t\t)\n\t\t\t);\n\t\t\tif ($result === false) {\n\t\t\t\t$this->add_error(\"Undetermined error deleting project.\");\n\t\t\t\t$status = 500;\n\t\t\t} else {\n\t\t\t\t$return_obj->id = $this->dbconn->insert_id;\n\t\t\t}\n\t\t}\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}", "public function delete (Request $request){\n \t$project = Project::find($request->id)->softDelete();\n \t$project -> save();\n }", "public function destroy(tbl_project $tbl_project)\n {\n //\n }", "public function deleted(Project $project)\n {\n //\n }", "function deleteProject($id) {\n\t\t//$sql = \"UPDATE project SET status = 1 WHERE id = '{$projectId}'\";\n\t\t//alternative: delete record from project table\n\t\t$sql = \"DELETE from project WHERE id = :id\";\n\t\t\n\n\t\ttry {\n\n\t\t\t$stmt = $this->conn->prepare($sql);\n\t\t\t$stmt->bindParam(\":id\", $id);\n\n\t\t} catch (PDOException $pdoe) {\n\t\t\tthrow new DatabaseException(\"Projects cannot be found!\");\n\t\t}\n\n\n\t\treturn $stmt->execute();\n\t}", "function delete_projects( $id ) {\n\t\treturn $this->db->delete( 'projects', array( 'id' => $id ) );\n\t}", "public function deleteProject($project_id, $db)\r\n {\r\n $sql = \"UPDATE projects\r\n set is_deleted = 1\r\n WHERE id = :project_id\";\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_id', $project_id);\r\n $count = $pst->execute();\r\n return $count;\r\n }", "function deleteProject(&$bean, $event, $arguments) {\n\t\tglobal $db, $current_user;\n\t\tif($arguments['related_module'] == 'Project'){\n\t\t\t$beanID = $bean->id;\n\t\t\t$bean->account_id1_c = '';\n\t\t\t$bean->project_start_date_c = '';\n\t\t\t$bean->project_end_date_c = '';\n\t\t\t$bean->rolloff_date = '';\n\t\t\t$bean->po_end_date_c = '';\n\t\t\t$query=\"UPDATE vedic_profiles_cstm vpc JOIN vedic_profiles vp ON vp.id = vpc.id_c SET vpc.project_start_date_c =NULL ,vpc.account_id1_c = NULL ,vp.rolloff_date=NULL,vpc.po_end_date_c=NULL WHERE vp.deleted='0' AND id='$beanID'\";\n\t\t\t$result = $db->query($query);\n\t\t}\n\t}", "private function deleteProject() {\r\n $this->clientOwnsProject();\r\n\r\n $q = $this->db->select('code')\r\n ->from('landingpage_collection')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->get();\r\n $code = $q->row()->code;\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('mvt_level_to_page');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('mvt_level');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('mvt_factor');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('collection_goals');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('collection_goal_conversions');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('page_group');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('landing_page');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('landingpage_collection');\r\n\r\n $this->syncCollectionGoals();\r\n $this->optimisation->flushCollectionCacheByCode($code);\r\n return $this->successResponse(200);\r\n }", "public function a_user_can_delete_project()\n {\n $project = factory(Project::class)->create();\n\n $this->delete('/api/projects/' . $project->id)->assertStatus(200);\n $this->assertDatabaseMissing('projects', [\n 'id' => $project->id,\n ]);\n }", "public function deleteProjectById(int $projectId) : void;", "function deleteProject($id)\n {\n \n $this->db->where('Id', $id);\n\t\t$this->db->delete('projectdetails');\n\n \n return $this->db->affected_rows();\n }", "function manageProjectDestroy(Project $project)\n {\n $project->delete();\n\n return redirect('admin/projects');\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function destroy(Project $project)\n {\n //\n }", "public function projects_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteProject($id);\n $this->response($result); \n }", "public static function delete(Project $project)\n {\n $project->eliminate();\n }", "public function delete_project($id = 0)\n {\n $query = 'SELECT 1 FROM '.$this->Tbl['cal_project'].' WHERE `id`='.doubleval($id).' AND `uid`='.$this->uid.' LIMIT 1';\n list ($result) = $this->fetchrow($this->query($query));\n if (!$result) {\n return false;\n }\n return ($this->query('DELETE FROM '.$this->Tbl['cal_project'].' WHERE id='.doubleval($id))\n && $this->query('ALTER TABLE '.$this->Tbl['cal_project'].' ORDER BY id ASC'));\n }", "public function delete()\n {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n Project::delete($_GET['id']);\n\n $this->index();\n }", "function delete()\n{\n $data = [$_GET['id']];\n $succes = changeDB('DELETE FROM projecten WHERE id = ?', $data);\n if ($succes) {\n return page_show(\"project verwijderen gelukt\");\n }\n\n return page_show(\"project verwijderen gefaald\");\n\n\n}" ]
[ "0.7927244", "0.7809106", "0.74298686", "0.7425521", "0.7410738", "0.7352987", "0.7327835", "0.7290202", "0.7183213", "0.71527284", "0.71237016", "0.7114173", "0.70665795", "0.7065376", "0.7061413", "0.7058735", "0.6989879", "0.6989879", "0.6989879", "0.6989879", "0.6989879", "0.6989879", "0.6989879", "0.6989879", "0.6989879", "0.69657665", "0.6943552", "0.6907012", "0.6891686", "0.6864968" ]
0.7891412
1
get projects by owner
public function get_projects_by_owner ($project_owner_id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function getAllByOwner($uid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE owner = :uid\n\t\t\t\tLIMIT 0,9999\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':uid' => $uid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\t$i = 0;\n\n\t\twhile($row = $statement->fetch())\t{\n\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\n\t\t\t$projects[$i++] = Project::serialize($project);\n\n\t\t}\n\n\t\treturn $projects;\n\n\t}", "public static function getProjectSmallDetail($owner){\n\t\t$db = DemoDB::getConnection();\n\t\t$sql = \"SELECT id, name, description, created_at\n\t\t\t\tFROM project\n\t\t\t\tWHERE administrator_id = :id\";\n\t\t$stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $owner);\n\t\t$ok = $stmt->execute();\n\t\tif ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "function GetOwnedProjects($conn, $userID){\n\t\t$query = \"SELECT p.ID FROM Project p, Users u WHERE p.OwnerUser = $userID\";\n\n\t\t$results = $conn->query($query);\n\t\treturn $results;\n\t}", "function getProjects() {\n\n\tglobal $db;\n\treturn $db->getProjectsByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function findByOwner($owner);", "public function getProjects();", "public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function projects()\n {\n return $this->request('get', 'api/teams/'.Helpers::config('team').'/projects');\n }", "function get_projects( $user )\n {\n //Unimplemented\n }", "protected function getprojects($userId)\n\t{\n\t\treturn Project::where('created_by', '=', $userId)\n\t\t\t->orderBy('id', 'DESC')\n\t\t\t->select(['id', 'website_url'])\n\t\t\t->limit(20)\n\t\t\t->get();\n\t}", "public function owned($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT, $params = array())\n {\n $params = array_merge($params, array(\n 'page' => $page,\n 'per_page' => $per_page,\n 'order_by' => $order_by,\n 'sort' => $sort\n ));\n return $this->get('projects/owned', $params);\n }", "public function listProjects()\n {\n\n\t\t$data = ProjectsRepository::findByUser($_SESSION[\"uuid\"]);\n\t\treturn array(\"data\" => $data);\n\n }", "function getProjects() {\n if($this->projects === false) {\n if($this->isAdministrator() || $this->isProjectManager()) {\n $this->projects = Projects::findAll();\n } else {\n $this->projects = Projects::findByUser($this);\n } // if\n } // if\n return $this->projects;\n }", "public function listProjectsDef($params)\n {\n $cusId = $this->db->real_escape_string($params['cusId']);\n\n $qry = \"SELECT cuo_id,cus_id,cus_parent \n FROM ctt_customers_owner \n WHERE cus_id = $cusId OR cus_parent = $cusId;\";\n return $this->db->query($qry);\n }", "static function getAllByMember($uid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id IN (\n\t\t\t\tSELECT id_proj\n\t\t\t\tFROM project_group\n\t\t\t\tWHERE id_usr = :uid)\n\t\t\t\tLIMIT 0 , 99999\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':uid' => $uid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\t$i = 0;\n\n\t\twhile($row = $statement->fetch())\t{\n\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\n\t\t\t$projects[$i++] = Project::serialize($project);\n\n\t\t}\n\n\t\treturn $projects;\n\n\t}", "public function projects()\n {\n $query = 'project';\n return json_decode($this->client->request('GET', $query, $this->options)->getBody(), true);\n }", "public static function get_projects()\n {\n \tif( UserRoleController::isStudent() )\n \t{\n \t\t$current_user = wp_get_current_user();\n \t\t$author = $current_user->ID ;\n \t}\n \telse\n \t{\n\t\t\t$author = null ;\n \t}\n\n \treturn get_posts( array(\n \t\t'author' => $author,\n \t\t'post_type' => ProjectCustomTypeCreator::CPT,\n \t\t'numberposts' => 100,\n \t\t'orderby' => 'date',\n \t\t'order' => 'DESC',\n \t\t'post_status' => 'any',\n \t\t//'category' => 0,\n \t\t//'include' => array(),\n \t\t//'exclude' => array(),\n \t\t//'meta_key' => '',\n \t\t//'meta_value' =>'',\n \t\t//'suppress_filters' => true\n \t));\n }", "public static function retrieveProjectsFromUser($usr) {\n $projects = R::find('project', 'username = \"' . $usr . '\"');\n\n if (empty($projects)) {\n throw new Exception(\"User '$usr' has no units assigned.\");\n }\n\n return $projects;\n }", "public function getOwner($Primowner) {\n $conn = $this->getConnection();\n $Primowner = \"%$Primowner%\";\n $getQuery = \"SELECT * FROM parcels where Primowner like :Primowner\";\n $q = $conn->prepare($getQuery);\n $q->bindParam(\":Primowner\", $Primowner);\n $q->execute();\n return $q->fetchAll();\n }", "public function getProjects()\n {\n }", "public function indexUserProjectAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n $user=$this->getUser();\n $projects = $em->getRepository('MyAppJobOwnerBundle:Project')->findBy(array(\"jobowner\"=>$user));\n $paginator = $this->get('knp_paginator');\n\n $result= $paginator->paginate(\n $projects,\n $request->query->getInt('page',1),\n $request->query->getInt('limit',5)\n\n );\n return $this->render('MyAppJobOwnerBundle:project:index.html.twig', array(\n 'projects' => $result,\n ));\n }", "public function getProjectsAction(){\n\n $projects = $this->getDoctrine()->getRepository(\"GithubProjectsBundle:Project\")->findAll();\n return array('projects' => $projects);\n }", "private function getAllProjects()\n {\n $url = $this->base_uri.'project?expand=description,lead,issueTypes,url,projectKeys';\n $projects = $this->request($url);\n return $projects;\n }", "public function getCustomerProjects($uid)\n {\n $sql = \"SELECT pid, price, first_name, last_name \n FROM project \n natural join purchase_project \n natural join user\n WHERE uid = :uid;\";\n//\n// $query = $this->db->prepare($sql);\n//\n// $sql = \"SELECT pid\n// FROM purchase_project\n// WHERE uid = :uid;\";\n $parameters = array(':uid' => $uid);\n $query = $this->db->prepare($sql);\n $query->execute($parameters);\n return $query->fetchAll();\n }", "public function get_employer_own_projects() {\n\t\t$form_data = $_POST;\n\n\t\t$args = array(\n\t\t\t'post_type' => 'project',\n\t\t\t'post_status' => $form_data['project-status'] != '' ? $form_data['project-status'] : 'any',\n\t\t\t'author' => $form_data['currentUserId'],\n\t\t\t'posts_per_page' => 10,\n\t\t\t'paged' => $form_data['page'],\n\t\t);\n\n\t\tif ( $form_data['project-search'] != '' ) {\n\t\t\t$args['s'] = $form_data['project-search'];\n\t\t}\n\n\t\t$query = new WP_Query( $args );\n\n\t\tob_start();\n\t\t?>\n <div class=\"projects-wrapper-content\">\n\t\t\t<?php\n\t\t\tif ( $query->posts ) {\n\t\t\t\tforeach ( $query->posts as $project ) {\n\t\t\t\t\tinclude( locate_template( 'template-parts/components/employer-project-item.php' ) );\n\t\t\t\t}\n\t\t\t\techo Custom::pagination( $query );\n\t\t\t} else {\n\t\t\t\tget_template_part( 'template-parts/components/project', 'empty' );\n\t\t\t}\n\t\t\t?>\n </div>\n\n\t\t<?php\n\t\techo ob_get_clean();\n\n\t\tdie();\n\t}", "public function index()\n {\n return Project::where('user', auth()->user()->id)->paginate(10);\n }", "public function getProjectsDetails()\n {\n $em = $this->getEntityManager();\n $qb = $em->createQueryBuilder();\n $qb->select('p.pid,n.name,c.clientName,pp.phaseName,p.lifeCycleStatus,'\n . 'p.billingStatus,pu.userName,pu.id,p.createDate,p.startDate,'\n . 'p.endDate,p.projectStatus');\n $qb->from('Vlreleases\\UserBundle\\Entity\\Projects', 'p');\n $qb->leftJoin('p.user', 'pu');\n $qb->leftJoin('p.projectName', 'n');\n $qb->leftJoin('p.client', 'c');\n $qb->leftJoin('p.phase', 'pp');\n $result = $qb->getQuery()->getResult();\n \n return $result;\n }", "public function actionGetUserClientProjects()\n {\n if (Yii::app()->request->isAjaxRequest && isset($_POST['userId']) && isset($_POST['clientId'])) {\n $userId = intval($_POST['userId']);\n $clientId = intval($_POST['clientId']);\n\n $userProjects = Projects::getUserProjects($userId, $clientId);\n\n $list = $this->renderPartial('user_client_projects' , array(\n 'userProjects' => $userProjects,\n ), true);\n\n $projectID = 0;\n $projectName = 'No projects';\n if (count($userProjects) > 0) {\n foreach ($userProjects as $id => $project) {\n $projectID = $id;\n $projectName = $project;\n break;\n }\n }\n\n $result = array(\n 'list' => $list,\n 'projectID' => $projectID,\n 'projectName' => $projectName,\n );\n\n echo CJSON::encode($result);\n }\n }", "public static function getGithubContributors($owner,$reponame) {\n $PASSWORD = '';\n $username = '';\n\n $page = 1;\n $base_url = 'https://api.github.com';\n $url = '/repos/'.$owner.'/'.$reponame.'/contributors?per_page=100&page=';\n\n // this could be done async, and having websockets on the frontend\n // create curl resource\n $goToNextPage = True;\n $contributors = array();\n // get all the pages\n do {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $base_url.$url.$page);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch,CURLOPT_HEADER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $username . \":\" . $PASSWORD);\n $user_agent = \"Mozilla/5.0 (Windows; U; Windows NT 5.1;\".\n \" en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6\";\n curl_setopt($ch,CURLOPT_USERAGENT,$user_agent);\n $output = curl_exec($ch);\n $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n curl_close($ch);\n\n $header = substr($output, 0, $header_size);\n $body = substr($output, $header_size);\n $json = json_decode($body,true);\n\n $contributors = array_merge($contributors,$json);\n ++$page;\n $goToNextPage = (count($json) > 99);\n } while($goToNextPage);\n return $contributors;\n }", "public function myManagedProjects()\n {\n $user = Auth::user();\n $projects = Project::whereManagerId($user->id)->get();\n return view('users.projects.index', compact('projects'));\n }" ]
[ "0.7649363", "0.7518689", "0.7052439", "0.6708711", "0.6657363", "0.66305506", "0.6532051", "0.64964193", "0.6493181", "0.6457399", "0.6349091", "0.6299494", "0.6265213", "0.626446", "0.6218517", "0.6214902", "0.6148556", "0.6136886", "0.6103394", "0.60757065", "0.6074616", "0.60299444", "0.6024952", "0.6024386", "0.60206246", "0.60192364", "0.5997392", "0.5937994", "0.5902852", "0.58805865" ]
0.85964656
0
sort projects??? (date, priority, status) (different functions)
public function sort_projects_by_date () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProjects(){\n $projects = Project::all()->sortBy('dead');\n return $projects;\n }", "public function Sorting_projectID($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.id ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function _datesort($a,$b){\n $da = $this->_meta($a,'cdate');\n $db = $this->_meta($b,'cdate');\n if($da < $db) return -1;\n if($da > $db) return 1;\n return strcmp($a['file'],$b['file']);\n }", "public function Sorting_DateCreate($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.date_create ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "function add_buildgroup_sortlist($groupname)\n{\n // This information can be provided as a query string, otherwise we apply\n // some default ordering here. Default sort ordering for a group is based\n // on the groupname.\n //\n // Sort settings should probably be definable/overrideable by the user as wel\n // on the users page, or perhaps by the project admin on the project page.\n //\n $st = '';\n $xml = '';\n\n if(isset($_GET[\"sort\"]))\n {\n $xml .= add_XML_value(\"sortlist\", \"{sortlist: \" . $_GET[\"sort\"] . \"}\");\n return $xml;\n }\n\n $gn = strtolower($groupname);\n\n if (strpos($gn, 'nightly') !== FALSE)\n {\n $st = 'SortAsNightly';\n }\n else if ((strpos($gn, 'continuous') !== FALSE) || (strpos($gn, 'experimental') !== FALSE))\n {\n $st = 'SortByTime';\n }\n\n switch($st)\n {\n case 'SortAsNightly':\n $xml .= add_XML_value(\"sortlist\", \"{sortlist: [[4,1],[7,1],[11,1],[10,1],[5,1],[8,1]]}\");\n // Theoretically, most important to least important:\n // configure errors DESC, build errors DESC, tests failed DESC, tests not run DESC,\n // configure warnings DESC, build warnings DESC\n break;\n\n case 'SortByTime':\n $xml .= add_XML_value(\"sortlist\", \"{sortlist: [[14,1]]}\");\n // build time DESC\n break;\n\n // By default, no javascript-based sorting. Accept the ordering naturally as it came from\n // MySQL and the php processing code...\n }\n\n return $xml;\n}", "private static function sort()\n\t{\n\t\t//Setup order of importantance\n\t\t$changefreqs = array(\n\t\t\t'hourly' => 5,\n\t\t\t'daily' => 4,\n\t\t\t'weekly' => 3,\n\t\t\t'monthly' => 2,\n\t\t\t'yearly' => 1,\n\t\t\t'never' => 0\n\t\t);\n\n\t\t//Setup invidual arrays to sort by\n\t\tforeach(static::$links as $index => $link)\n\t\t{\n\t\t\t$priority[$index] = $link->priority ? $link->priority : 0;\n\t\t\t$changefreq[$index] = $link->changefreq ? $changefreqs[$link->changefreq] : 0;\n\t\t\t$loc[$index] = $link->loc;\n\t\t}\n\n\t\tarray_multisort($priority, SORT_DESC, $changefreq, SORT_DESC, $loc, SORT_ASC, static::$links);\n\t}", "protected function sortAndSavePackageStates() {}", "protected function sortAndSavePackageStates() {}", "protected function sortAndSavePackageStates() {}", "function action_sort($a, $b) {\r return $a['priority'] > $b['priority'] ? 1 : -1;\r}", "public function Sorting_DateUpdate($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.date_update ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}", "protected function sortPackages()\n {\n $sortPriority = $this->sortPriority;\n $getPriorityValue = function (Entry $object) use ($sortPriority) {\n $result = 100;\n if (isset($sortPriority[$object->getPackageName()])) {\n $result = $sortPriority[$object->getPackageName()];\n } elseif ($object->getDeployStrategy() instanceof Copy) {\n $result = 101;\n }\n return $result;\n };\n usort(\n $this->packages,\n function ($a, $b) use ($getPriorityValue) {\n /** @var Entry $a */\n /** @var Entry $b */\n $aVal = $getPriorityValue($a);\n $bVal = $getPriorityValue($b);\n if ($aVal == $bVal) {\n return 0;\n }\n return ($aVal > $bVal) ? -1 : 1;\n }\n );\n }", "public static function sortByStatus(){\n $db = Db::getConnection();\n \n $result = $db->query('SELECT * FROM task ORDER BY status DESC');\n \n return $result->fetchAll();\n }", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function cmp($a, $b){\n if ((int)$a->date[0] == (int)$b->date[0]) {\n return 0;\n }\n return ((int)$a->date[0] > (int)$b->date[0]) ? -1 : 1;\n}", "function getProjects($db, $userId, $sort_col, $sort_dir, $proj_id = NULL) {\n /* set ORDER BY column based on row number */\n switch ($sort_col) {\n case \"2\":\n $ob = \"p.name\";\n break;\n case \"3\":\n $ob = \"p.description\";\n break;\n default:\n $ob = \"p.proj_id\";\n }\n\n $query = \"SELECT DISTINCT p.proj_id, p.name, p.description \".\n \"FROM Projects p \".\n \"LEFT JOIN Users_Projects up ON p.proj_id = up.proj_id \".\n \"WHERE (EXISTS (SELECT * FROM Users WHERE user_id = ? AND admin = 1) \".\n \"OR up.user_id = ?) \".\n (is_null($proj_id) ? \"\" : \"AND p.proj_id = ? \").\n \"ORDER BY $ob $sort_dir;\";\n $stmt = prepareQuery($db, $query);\n if (is_null($proj_id)) {\n bindParam($stmt, \"ii\", $userId, $userId);\n } else {\n bindParam($stmt, \"iii\", $userId, $userId, $proj_id);\n }\n executeStatement($stmt);\n $results = $stmt->get_result();\n $projects = array();\n while ($row = $results->fetch_assoc()) {\n $projects[] = $row;\n }\n return $projects;\n}", "public function asort() {}", "private function sortOptions()\r\n {\r\n $pageActions = array(); // For the result\r\n // Sort changes by file\r\n usort($this->changeAr, \"cmp\");\r\n\r\n foreach ($this->changeAr as $line) {\r\n $file = $line['file'];\r\n $action = $line['action'];\r\n if (array_key_exists($file, $pageActions)) {\r\n continue;\r\n }\r\n $pageActions[$file] = $action;\r\n }\r\n// print_r($pageActions);\r\n return $pageActions;\r\n }", "public function sortBy(){\n global $SnickerPlugin;\n\n if($SnickerPlugin->getValue(\"frontend_order\") === \"date_asc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] > $b[\"date\"];\n });\n } else if($SnickerPlugin->getValue(\"frontend_order\") === \"date_desc\"){\n uasort($this->db, function($a, $b){\n return $a[\"date\"] < $b[\"date\"];\n });\n }\n return true;\n }", "function priority($demand_id, $sort)\n {\n }", "function get_all($project_id,$order_by=\"date\") {\r\n $f3 = \\Base::instance();\r\n\r\n if($order_by==\"date\") $_order_by = array('order'=>'timestamp DESC');\r\n if($order_by==\"alpha\") $_order_by = array('order'=>'version_name ASC');\r\n\r\n $versions_db=new DB\\SQL\\Mapper($f3->get('DB'),'versions');\r\n $versions=$versions_db->find(array('project_id=?',$project_id),$_order_by);\r\n\r\n $out = array();\r\n foreach($versions as $version)\r\n {\r\n $out[] = $this->get(NULL,$version);\r\n }\r\n\r\n return $out;\r\n\r\n }", "function reorder($order, $project = null) {\n $order = array_flip($order);\n //$sorted_items = array_intersect_key($this->parsed_items, $order);\n $sorted_items = array_merge($order, $this->parsed_items);\n //$sorted_items = array_merge($this->parsed_items, $sorted_items);\n\n // deal with sorting one project by itself\n if ($project !== null) {\n $pos = array_search($project, $this->project_index);\n $this->parsed_items = \\tpp\\array_insert($this->parsed_items, $pos, $sorted_items, 1, true);\n } else {\n $this->parsed_items = $sorted_items;\n }\n }", "function extSortUpcoming($aItem,$bItem){\n $aBegin = $aItem['mday'] ? $aItem['mday'] : $aItem['begin'];\n $bBegin = $bItem['mday'] ? $bItem['mday'] : $bItem['begin'];\n\n if($aBegin>$bBegin){\n return 1;\n }elseif($aBegin<$bBegin){\n return -1;\n }\n\n if($aItem['uid']<$bItem['uid']){\n return -1;\n }elseif($aItem['uid']>$bItem['uid'])\n return 1;\n return 0;\n }", "function usort_reorder($a,$b){\r\r\n $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'chat_date'; //If no sort, default to title\r\r\n $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc\r\r\n $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order\r\r\n return ($order==='asc') ? $result : -$result; //Send final sort direction to usort\r\r\n }", "public function sort();", "function tab_project(){\n\tglobal $t_project_ids;\n\tglobal $f_version_id;\n\tglobal $t_version_type;\n\tstatic $i = 0;\n\n\n\t$f_columns = bug_list_columns('bug_list_columns_versions');\n\n\t$t_project_id = $t_project_ids[$i];\n\t$i++;\n\n\t/* get all project versions */\n\t$t_version_rows = version_get_all_rows($t_project_id, true, true);\n\n\tif($t_version_type == 'target_version')\n\t\t$t_version_rows = array_reverse($t_version_rows);\n\t\t\n\t$t_is_first_version = true;\n\n\t/* print sectin per version */\n\tforeach($t_version_rows as $t_version_row){\n\t\t$t_version_name = $t_version_row['version'];\n\t\t$t_released = $t_version_row['released'];\n\t\t$t_obsolete = $t_version_row['obsolete'];\n\n\t\t/* only show either released or unreleased versions */\n\t\tif(($t_version_type == 'target_version' && ($t_released || $t_obsolete)) || ($t_version_type != 'target_version' && !$t_released && !$t_obsolete))\n\t\t\tcontinue;\n\n\t\t/* Skip all versions except the specified one (if any) */\n\t\tif($f_version_id != -1 && $f_version_id != $t_version_row['id'])\n\t\t\tcontinue;\n\n\t\t/* query issue list */\n\t\t$t_issues_resolved = 0;\n\t\t$t_issue_ids = db_query_roadmap_info($t_project_id, $t_version_name, $t_version_type, $t_issues_resolved);\n\t\t$t_num_issues = count($t_issue_ids);\n\t\n\t\t/* print section */\n\t\tsection_begin('Version: ' . $t_version_name, !$t_is_first_version);\n\t\t\t/* print version description and progress */\n\t\t\tcolumn_begin('6-left');\n\n\t\t\t$t_progress = 0;\n\n\t\t\tif($t_num_issues > 0)\n\t\t\t\t$t_progress = (int)($t_issues_resolved * 100 / $t_num_issues);\n\n\t\t\t$t_release_date = date(config_get('short_date_format'), $t_version_row['date_order']);\n\n\t\t\tif(!$t_obsolete){\n\t\t\t\tif($t_released)\t$t_release_state = format_label('Released (' . $t_release_date . ')', 'label-success');\n\t\t\t\telse\t\t\t$t_release_state = format_label('Planned Release (' . $t_release_date . ')', 'label-info');\n\t\t\t}\n\t\t\telse\n\t\t\t\t$t_release_state = format_label('Obsolete (' . $t_release_date . ')', 'label-danger');\n\n\n\t\t\ttable_begin(array());\n\t\t\ttable_row(\n\t\t\t\tarray(\n\t\t\t\t\t$t_release_state,\n\t\t\t\t\tformat_progressbar($t_progress),\n\t\t\t\t\tformat_button_link($t_issues_resolved . ' of ' . $t_num_issues . ' issue(s) resolved', 'filter_apply.php', array('type' => 1, 'temporary' => 'y', FILTER_PROPERTY_PROJECT_ID => $t_project_id, FILTER_PROPERTY_TARGET_VERSION => $t_version_name), 'input-xxs')\n\t\t\t\t),\n\t\t\t\t'',\n\t\t\t\tarray('', 'width=\"100%\"', '')\n\t\t\t);\n\t\t\ttable_end();\n\n\t\t\t$t_description = $t_version_row['description'];\n\n\t\t\tif(!is_blank($t_description))\n\t\t\t\talert('warning', string_display($t_description));\n\n\t\t\tcolumn_end();\n\n\t\t\t/* print issues */\n\t\t\tcolumn_begin('6-right');\n\t\t\tactionbar_begin();\n\t\t\t\techo '<div class=\"pull-right\">';\n\t\t\t\t\t$t_menu = array(\n\t\t\t\t\t\tarray('label' => 'Select Columns', 'data' => array('link' => format_href('columns_select_page.php', column_select_input('bug_list_columns_versions', $f_columns, false, true, basename(__FILE__))), 'class' => 'inline-page-link')),\n\t\t\t\t\t);\n\n\t\t\t\t\tdropdown_menu('', $t_menu, '', '', 'dropdown-menu-right');\n\t\t\t\techo '</div>';\n\t\t\tactionbar_end();\n\n\t\t\tbug_list_print($t_issue_ids, $f_columns, 'table-condensed table-hover table-datatable no-border');\n\t\t\tcolumn_end();\n\t\tsection_end();\n\n\t\t$t_is_first_version = false;\n\t}\n\n\t/* print message if no versions have been shown */\n\tif($t_is_first_version){\n\t\techo '<p class=\"lead\">';\n\t\techo 'No Roadmap information available. Issues are included once projects have versions and issues have \"target version\" set.';\n\t\techo '</p>';\n\t}\n}", "function sort_posts_by_date($posts) {\n\n\tusort($posts, function($a, $b) {\n\n\t\t// if the values are the same don't re-order\n\t\tif ( $a == $b ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// re-order the preferred larger value\n\t\treturn ( strtotime($a->post_date) > strtotime($b->post_date) ) ? -1 : 1;\n\n\t});\n\n\treturn $posts;\n\n}", "function publisher_getOrderBy($sort)\r\n{\r\n if ($sort == \"datesub\") {\r\n return \"DESC\";\r\n } else if ($sort == \"counter\") {\r\n return \"DESC\";\r\n } else if ($sort == \"weight\") {\r\n return \"ASC\";\r\n }\r\n}", "function index(){\n\t\t$user = $this->Auth->user('id');\n\t\t\n\t\t$user = $this->Auth->user('id');\n\t\t//get user's projects.\n\t\t$result = $this->Project->find('all', array(\n\t\t\t'recursive' => -1,\n\t\t\t'fields' => array('Project.id', 'Project.name'),\n\t\t\t'joins' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'table' => 'admins_projects',\n\t\t\t\t\t'alias' => 'AdminProject',\n\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t'foreignKey' => false,\n\t\t\t\t\t'conditions'=> array('Project.id = AdminProject.project_id','AdminProject.user_id =' . $user) \n\t\t\t\t)\n\t\t\t)\n\t\t));\n\t\t$list = Set::classicExtract($result,'{n}.Project.id');\n\t\t\n\t\t//set all other projects.\n\t\t$currProjects = $this->Project->find('all', array(\n\t\t\t'recursive' => -1,\n\t\t\t'conditions' => array(\n\t\t\t\t'Project.status NOT' => array(PROJECT_SEED, PROJECT_ARCHIVE),\n\t\t\t\t'Project.id' => $list\t\t\t\t\n\t\t\t)\n\t\t));\n\t\t$projects = Set::combine($currProjects, '{n}.Project.id', '{n}.Project', '{n}.Project.status');\n\t\t\t\n\t\t//sort phase 2 projects by their cut-off date\n\t\tif(array_key_exists(PROJECT_COLLECT, $projects))\n\t\t\t$projects[PROJECT_COLLECT] = Set::sort(array_values($projects[PROJECT_COLLECT]), '{n}.collection_end', 'asc');\n\t\t\t\n\t\t//sort phase 3 projects by their cut-off date\n\t\tif(array_key_exists(PROJECT_FEEDBACK, $projects))\n\t\t\t$projects[PROJECT_FEEDBACK] = Set::sort(array_values($projects[PROJECT_FEEDBACK]), '{n}.feedback_end', 'asc');\n\t\t\n\t\t//set archived projects.\n\t\t$this->Project->recursive = 0;\n\t\t$this->paginate['Project']['order'] = \"Project.feedback_end DESC\";\n\t\t$projects[PROJECT_ARCHIVE] = $this->paginate(array('Project.status' => PROJECT_ARCHIVE, 'Project.id' => $list));\n\t\t\n\t\t$this->set(compact('projects'));\n\t}", "public function Sorting_company($desc = false) {\r\n\t\treturn array(\r\n\t\t\t'order'\t=> array(\r\n\t\t\t\t'ext_project_project.id_company ' . self::getSortDir($desc)\r\n\t\t\t)\r\n\t\t);\r\n\t}" ]
[ "0.61348593", "0.60477847", "0.59888655", "0.58978623", "0.5878903", "0.587457", "0.5867446", "0.5867446", "0.58651793", "0.58571887", "0.5857053", "0.5828148", "0.5794306", "0.5786594", "0.5786594", "0.5679771", "0.56378764", "0.5636776", "0.5636511", "0.5635997", "0.56096673", "0.56069314", "0.5572912", "0.5539738", "0.55310893", "0.55270153", "0.5496885", "0.5496529", "0.5494728", "0.54838157" ]
0.8324421
0
Escapes the specified text so it can be safely inserted into an HTML attribute. It's UTF8 safe. Since it's meant for displaying stuff in HTML this function removes invalid UTF8 code points. This can cause security problems if you output commands or data with it. That is used by other systems. See `ENT_IGNORE` flag of PHPs `htmlspecialchars()` function. `ENT_SUBSTITUTE` would be more suitable here but requires PHP 5.4. This is a shortcut mimicing the Ruby on Rails "h" helper.
function ha($text_to_escape){ return htmlspecialchars($text_to_escape, ENT_QUOTES | ENT_IGNORE, 'UTF-8'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }", "function attribute_escape($text)\n {\n }", "function escape($html) {\n return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\");\n}", "public function escape($text);", "function h($text){\n\treturn htmlspecialchars($text, ENT_QUOTES, Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "function h($text)\n{\n return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);\n}", "static public function esc($txt) {\n return htmlspecialchars($txt);\n }", "public function escape($text, $flags = ENT_COMPAT, $charset = null, $doubleEncode = true);", "function h($text) {\r\n echo(htmlspecialchars($text, ENT_QUOTES));\r\n }", "function esc_attr( $text ) {\n\t$safe_text = wp_check_invalid_utf8( $text );\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n\t/**\n\t * Filter a string cleaned and escaped for output in an HTML attribute.\n\t *\n\t * Text passed to esc_attr() is stripped of invalid or special characters\n\t * before output.\n\t *\n\t * @since 2.0.6\n\t *\n\t * @param string $safe_text The text after it has been escaped.\n \t * @param string $text The text prior to being escaped.\n\t */\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\n}", "function escape($text) {\n\t$text = htmlspecialchars($text, ENT_QUOTES);\n\t$text = addslashes($text);\n\treturn $text;\n}", "function esc_html($text) {\n return htmlspecialchars($text);\n }", "function html($text)\n{\n\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n}", "function esc_attr( $text ) {\r\n\t$safe_text = wp_check_invalid_utf8( $text );\r\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\r\n\t/**\r\n\t * Filters a string cleaned and escaped for output in an HTML attribute.\r\n\t *\r\n\t * Text passed to esc_attr() is stripped of invalid or special characters\r\n\t * before output.\r\n\t *\r\n\t * @since 2.0.6\r\n\t *\r\n\t * @param string $safe_text The text after it has been escaped.\r\n\t * @param string $text The text prior to being escaped.\r\n\t */\r\n\treturn apply_filters( 'attribute_escape', $safe_text, $text );\r\n}", "public function encode($text) {\n\t\treturn htmlspecialchars($text, ENT_QUOTES, 'UTF-8');\n\t}", "function htmlSpecialChars( $text )\n\t{\n\t\t//return preg_replace(\"/&amp;/i\", '&', htmlspecialchars($text, ENT_QUOTES));\n\t\treturn preg_replace(array(\"/&amp;/i\", \"/&nbsp;/i\"), array('&', '&amp;nbsp;'), htmlspecialchars($text, ENT_QUOTES));\n\t}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function escape($value) {\n return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false);\n}", "function html_escape($var, bool $double_encode = true)\n {\n if ($double_encode === false) {\n throw new NotSupportedException(\n '$double_encode = false is not supported.'\n );\n }\n\n return esc($var, 'html');\n }", "protected function _(string $text, bool $escapeHtml = true): string\n {\n $text = $this->t->translate($text);\n\n return $escapeHtml ? \\htmlspecialchars($text) : $text;\n }", "abstract public function escapeString($value);", "public abstract function escapeString($value);", "function e(string $s): string\n{\n return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');\n}", "public function escapeHtmlAttr($string, $escapeSingleQuote = true)\n {\n if ($escapeSingleQuote) {\n return $this->getEscaper()->escapeHtmlAttr((string) $string);\n }\n return htmlspecialchars((string)$string, ENT_COMPAT, 'UTF-8', false);\n }", "public abstract function escape($string);", "function ailyak_facebook_group_feed_html_escape(&$text) {\n $text = htmlspecialchars($text);\n}", "function _twig_escape_html_attr_callback($matches)\n{\n /*\n * While HTML supports far more named entities, the lowest common denominator\n * has become HTML5's XML Serialisation which is restricted to the those named\n * entities that XML supports. Using HTML entities would result in this error:\n * XML Parsing Error: undefined entity\n */\n static $entityMap = array(\n 34 => 'quot', /* quotation mark */\n 38 => 'amp', /* ampersand */\n 60 => 'lt', /* less-than sign */\n 62 => 'gt', /* greater-than sign */\n );\n $chr = $matches[0];\n $ord = ord($chr);\n /**\n * The following replaces characters undefined in HTML with the\n * hex entity for the Unicode replacement character.\n */\n if (($ord <= 0x1f && $chr != \"\\t\" && $chr != \"\\n\" && $chr != \"\\r\") || ($ord >= 0x7f && $ord <= 0x9f)) {\n return '&#xFFFD;';\n }\n /**\n * Check if the current character to escape has a name entity we should\n * replace it with while grabbing the hex value of the character.\n */\n if (strlen($chr) == 1) {\n $hex = strtoupper(substr('00'.bin2hex($chr), -2));\n } else {\n $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');\n $hex = strtoupper(substr('0000'.bin2hex($chr), -4));\n }\n $int = hexdec($hex);\n if (array_key_exists($int, $entityMap)) {\n return sprintf('&%s;', $entityMap[$int]);\n }\n /**\n * Per OWASP recommendations, we'll use hex entities for any other\n * characters where a named entity does not exist.\n */\n return sprintf('&#x%s;', $hex);\n}" ]
[ "0.7130358", "0.6980376", "0.6872403", "0.67447376", "0.6723672", "0.6644355", "0.6612385", "0.6585486", "0.6585486", "0.649946", "0.64522105", "0.63402516", "0.6328795", "0.63213325", "0.623655", "0.6167781", "0.61080045", "0.6094013", "0.6063256", "0.6046208", "0.60196745", "0.6019105", "0.6003668", "0.59911525", "0.59756476", "0.5975503", "0.5957812", "0.5953676", "0.59398705", "0.59297943" ]
0.6980546
1
General localization helper to lookup entries from a language file. The argument list is processed by the function itself. Some things to keep in mind: If the key resolves to something else than a string in the language file (e.g. an array) the data from the language file is returned as it is. No `printf` string substitution is performed. This allows you to fetch arrays directly from the language file (used for the list of suggestions shown on error pages). If no format arguments are specified even strings are returned without processing. This way you can fetch the raw strings out of a language file. This is used to pass them to JavaScript.
function l(){ global $_LOCALE; $entry = $_LOCALE; $args = func_get_args(); for($i = 0; $i < count($args); $i++){ $key = $args[$i]; if ( array_key_exists($key, $entry) ) { $entry = $entry[$key]; if ( ! is_array($entry) ) break; } else { $entry = 'Missing entry in language file: ' . join(' → ', array_slice($args, 0, $i + 1)); break; } } $format_args = array_slice($args, $i + 1); return (is_string($entry) and count($format_args) > 0) ? vsprintf($entry, $format_args) : $entry; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lang_parse($key, $args)\n{\n\tglobal $lang;\n\t\n\t// Make sure the key is uppercase\n\t$key = strtoupper($key);\n\t\n\t// Does that key exist?\n\tif(!$lang[$key])\n\t{\n\t\t// So we know it needs to be translated.\n\t\treturn '{' . $key . '}';\n\t}\n\telse\n\t{\n\t\treturn mb_vsprintf($lang[$key], $args, $lang['ENCODING']);\n\t}\n}", "function lang($key, $params = NULL)\n\t{\n\t\t$ci = &get_instance();\n\n\t\tif (is_array($params)){\n\t\t\tif (F::is_array_assoc($params))\n\t\t\t\treturn F::sprintfx($ci->lang->line($key), $params);\n\t\t\telse\n\t\t\t\treturn vsprintf($ci->lang->line($key), $params);\n\t\t}\n\t\telse\n\t\t\treturn sprintf($ci->lang->line($key), $params);\n\t}", "public static function lang($key, $args = array())\n {\n // Extract the main group from the key\n $group = explode('.', $key, 2);\n $group = $group[0];\n\n // Get locale name\n $locale = self::config('locale.language.0');\n\n if (! isset(self::$internal_cache['language'][$locale][$group])) {\n // Messages for this group\n $messages = array();\n\n if ($files = self::find_file('i18n', $locale.'/'.$group)) {\n foreach ($files as $file) {\n include $file;\n\n // Merge in configuration\n if (! empty($lang) and is_array($lang)) {\n foreach ($lang as $k => $v) {\n $messages[$k] = $v;\n }\n }\n }\n }\n\n if (! isset(self::$write_cache['language'])) {\n // Write language cache\n self::$write_cache['language'] = true;\n }\n\n self::$internal_cache['language'][$locale][$group] = $messages;\n }\n\n // Get the line from cache\n $line = self::key_string(self::$internal_cache['language'][$locale], $key);\n\n if ($line === null) {\n self::log('error', 'Missing i18n entry '.$key.' for language '.$locale);\n\n // Return the key string as fallback\n return $key;\n }\n\n if (is_string($line) and func_num_args() > 1) {\n $args = array_slice(func_get_args(), 1);\n\n // Add the arguments into the line\n $line = vsprintf($line, is_array($args[0]) ? $args[0] : $args);\n }\n\n return $line;\n }", "function L($key)\n{\n global $language;\n if (empty($key)) {\n return '';\n }\n if (isset($language[$key])) {\n return $language[$key];\n }\n return \"[[$key]]\";\n}", "function lang($key,$markers = NULL) // this is everywhere\r\n// key would be something like ACCOUNT_USER_OR_PASS_INVALID => Username or password is invalid\r\n{ \r\n\r\n\tglobal $lang;\r\n\r\n\tif($markers == NULL)\r\n\r\n\t{\r\n\r\n\t\t$str = $lang[$key]; // this would be something like \"Permission level name changed to `%m1%`\"\r\n\r\n\t}\r\n\r\n\telse // markers is not NULL\r\n\r\n\t{\r\n\r\n\t\t//Replace any dynamic markers\r\n\r\n\t\t$str = $lang[$key]; // this would be something like \"Permission level name changed to `%m1%`\"\r\n\r\n\t\t$iteration = 1;\r\n\r\n\t\tforeach($markers as $marker)\r\n\r\n\t\t{\r\n\r\n\t\t\t$str = str_replace(\"%m\".$iteration.\"%\",$marker,$str);\r\n\r\n\t\t\t$iteration++;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t//Ensure we have something to return\r\n\r\n\tif($str == \"\")\r\n\r\n\t{\r\n\r\n\t\treturn (\"No language key found\");\r\n\r\n\t}\r\n\r\n\telse\r\n\r\n\t{\r\n\r\n\t\treturn $str;\r\n\r\n\t}\r\n\r\n}", "function __($key, $values = null) {\n global $lang;\n return $lang->get($key, $values);\n}", "function lang($key,$markers = NULL)\r\n{\r\n\tglobal $lang;\r\n\tif($markers == NULL)\r\n\t{\r\n\t\t$str = $lang[$key];\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//Replace any dyamic markers\r\n\t\t$str = $lang[$key];\r\n\t\t$iteration = 1;\r\n\t\tforeach($markers as $marker)\r\n\t\t{\r\n\t\t\t$str = str_replace(\"%m\".$iteration.\"%\",$marker,$str);\r\n\t\t\t$iteration++;\r\n\t\t}\r\n\t}\r\n\t//Ensure we have something to return\r\n\tif($str == \"\")\r\n\t{\r\n\t\treturn (\"No language key found\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn $str;\r\n\t}\r\n}", "function lang($key, $markers = NULL) {\n global $lang;\n if ($markers == NULL) {\n $str = $lang[$key];\n } else {\n //Replace any dyamic markers\n $str = $lang[$key];\n $iteration = 1;\n foreach ($markers as $marker) {\n $str = str_replace(\"%m\" . $iteration . \"%\", $marker, $str);\n $iteration++;\n }\n }\n //Ensure we have something to return\n if ($str == \"\") {\n return (\"No language key found\");\n } else {\n return $str;\n }\n}", "function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "public static function get( $key = null, $file = null )\n\t\t{\n\t\t\tif ( $key === null )\n\t\t\t{\n\t\t\t\treturn self::$locale;\n\t\t\t}\n\t\t\tif ($file && !isset(self::$file[$file]))\n\t\t\t{\n\t\t\t\tself::load($file);\n\t\t\t}\n\t\t\t$data = $file ? self::$file[$file] : self::$data;\n\t\t\tif ($key === true)\n\t\t\t{\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\tif ( isset( $data[ $key ] ) )\n\t\t\t{\n\t\t\t\treturn $data[ $key ];\n\t\t\t}\n\t\t\t$testMode = self::$TEST_MODE;\n\t\t\treturn $testMode ? (self::$locale.'['.$key.']') : $key;\n\t\t}", "public function get($key, array $replace = array(), $locale = null, $fallback = true)\n {\n list($namespace, $group, $item) = $this->parseKey($key);\n // Here we will get the locale that should be used for the language line. If one\n // was not passed, we will use the default locales which was given to us when\n // the translator was instantiated. Then, we can load the lines and return.\n\n// dd($this->parseLocale($locale));\n foreach ($this->parseLocale($locale) as $locale)\n {\n $this->load($namespace, $group, $locale);\n $line = $this->getLine(\n $namespace, $group, $locale, $item, $replace\n );\n// // If we cannot find the translation group in the database nor as a file\n// // an entry in the database will be added to the translations.\n// // Keep in mind that a file cannot be used from that point.\n// if(!self::isNamespaced($namespace) && is_null($line)) {\n//// dd($item);\n// throw new \\Exception($line);\n//\n// throw new \\Exception(12);\n// // Database stuff\n// $this->database->addTranslation($locale, $group, $key);\n// }\n if ( ! is_null($line)) break;\n }\n // If the line doesn't exist, we will return back the key which was requested as\n // that will be quick to spot in the UI if language keys are wrong or missing\n // from the application's language files. Otherwise we can return the line.\n if ( ! isset($line)) return $key;\n return $line;\n }", "function _t($str/*[, mixed $args [, mixed $... ]]*/)\n{\n global $lc_lang;\n global $lc_translation;\n global $lc_translationEnabled;\n\n $args = func_get_args();\n $str = array_shift($args);\n $str = trim($str);\n\n if ($lc_translationEnabled == false) {\n return (count($args)) ? vsprintf($str, $args) : $str;\n }\n\n $po = session_get('po');\n if (!is_array($po)) {\n $po = array();\n }\n $po[$str] = '';\n\n if (isset($lc_translation[$lc_lang])) {\n # check with lowercase\n $lowerStr = strtolower($str);\n if (isset($lc_translation[$lc_lang][$lowerStr]) && !empty($lc_translation[$lc_lang][$lowerStr])) {\n $translated = $lc_translation[$lc_lang][$lowerStr];\n $str = (is_array($translated)) ? $translated[0] : $translated;\n }\n }\n\n if (isset($translated)) {\n $po[$str] = $translated;\n }\n return (count($args)) ? vsprintf($str, $args) : $str;\n}", "function _tc($fileName, $args = array())\n{\n global $lc_defaultLang;\n global $lc_lang;\n\n $langs = array($lc_lang, $lc_defaultLang);\n foreach ($langs as $lng) {\n $file = I18N . 'ctn/' . $lng . '/' . $fileName . '.' . $lng;\n if (is_file($file) && file_exists($file)) {\n $content = file_get_contents($file);\n if (count($args)) {\n foreach ($args as $key => $value) {\n $regex = '/'.$key.'\\b/i';\n $content = preg_replace($regex, $value, $content);\n }\n }\n return $content;\n }\n }\n return '';\n}", "function lang($key,$markers = NULL){\n\tglobal $lang;\n\tif($markers == NULL){\n\t\t$str = $lang[$key];\n\t}else{\n\t//Replace any dyamic markers\n\t$str = $lang[$key];\n\t$iteration = 1;\n\t\tforeach($markers as $marker){\n\t\t\t$str = str_replace(\"%m\".$iteration.\"%\",$marker,$str);\n\t\t\t$iteration++;\n\t\t}\n\t}\n\t//Ensure we have something to return\n\tif($str == \"\"){\n\t\treturn (\"No language key found\");\n\t}else{\n\t\treturn $str;\n\t}\n}", "function lang()\n\t{\n\t\t$args = func_get_args();\n\t\t$key = $args[0];\n\n\t\t$context_vars = $this->context->get_root_ref();\n\n\t\tif (isset($context_vars['L_' . $key]))\n\t\t{\n\t\t\treturn $context_vars['L_' . $key];\n\t\t}\n\n\t\t// LA_ is transformed into lang(\\'$1\\')|escape('js'), so we should not\n\t\t// need to check for it\n\n\t\treturn call_user_func_array(array($this->language, 'lang'), $args);\n\t}", "function __t($key, $values = null)\n{\n // Get current locale\n $locale = cache()->rememberForever('language', function () {\n try {\n return get_setting('language') ?? 'en';\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return 'en';\n }\n });\n\n // Get language strings\n $strings = cache()->rememberForever(\"language-translations-$locale\", function () use ($locale) {\n try {\n return Language::whereLocale($locale)->firstOrFail()->languageTranslations;\n } catch (QueryException | ModelNotFoundException $e) {\n return null;\n }\n }) ?? get_default_language_translations();\n\n // Find the string by key\n $string = $strings->firstWhere('key', $key)->value ?? $strings->get($key);\n\n if ($values) {\n return replace_occurrence($string, collect($values));\n }\n\n return $string;\n}", "function _T(/*$arg1, $arg2...$argN*/) {\n\tglobal $language,$langloaded;\n\tif (!$langloaded){ // language file is not loaded\n\t\tLoadLanguage(PIXMICAT_LANGUAGE); $langloaded = true;\n\t}\n\tif (!func_num_args()) // called with no arg\n\t\treturn '';\n\t$arg_list = func_get_args();\n\t$arg_list[0] = isset($language[$arg_list[0]]) ? $language[$arg_list[0]] : $arg_list[0];\n\treturn call_user_func_array('sprintf',$arg_list);\n}", "function codepress_get_lang($filename)\n {\n }", "function lang($key, $params = NULL)\n\t{\n\t\t$ci = get_instance()->load->helper('mylanguage');\n\t\treturn mylang($key, $params);\n\t}", "public function get($key, array $replace = [], $locale = null, $fallback = true) {\n list($namespace, $group, $item) = $this->parseKey($key);\n\n // Here we will get the locale that should be used for the language line. If one\n // was not passed, we will use the default locales which was given to us when\n // the translator was instantiated. Then, we can load the lines and return.\n $locales = $fallback ? $this->localeArray($locale)\n : [$locale ?: $this->locale];\n\n foreach ($locales as $locale) {\n if (!is_null($line = $this->getLine(\n $namespace, $group, $locale, $item, $replace\n ))\n ) {\n break;\n }\n }\n\n // If the line doesn't exist, we will return back the key which was requested as\n // that will be quick to spot in the UI if language keys are wrong or missing\n // from the application's language files. Otherwise we can return the line.\n if (isset($line)) {\n if (Auth::guard(config('provision_administration.guard'))->check() && !\\ProVision\\Administration\\Facades\\Administration::routeInAdministration() && Settings::get('live_translate')) {\n return '<span style=\"border:1px dashed gray;\" class=\"translate-item\" data-namespace=\"' . $namespace . '\" data-item=\"' . $item . '\" data-group=\"' . $group . '\" data-key=\"' . $key . '\" data-locale=\"' . $locale . '\" contenteditable=\"true\">' . $line . '</span>';\n } else {\n return $line;\n }\n }\n\n return $key;\n }", "function lang($key)\n{\n\tglobal $lang;\n\t\n\t// Make sure the key is uppercase\n\t$key = strtoupper($key);\n\t\n\t// Does that key exist?\n\tif(!$lang[$key])\n\t{\n\t\t// So we know it needs to be translated.\n\t\treturn '{' . $key . '}';\n\t}\n\telse\n\t{\n\t\treturn $lang[$key];\n\t}\n}", "function lang($key = '')\r\n{\r\n\t$CI =& get_instance();\r\n\t$line = $CI->lang->line($key);\r\n\t$line = ($line == '') ? $key : $line;\r\n\treturn $line;\r\n}", "public function translate($key, $arg = NULL) {\n\t\tif (isset($this->dictionary[$key])) {\n\t\t\t$message = $this->dictionary[$key];\n\t\t} else {\n\t\t\t$message = $key;\n\t\t}\n\t\tif ($arg !== null) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tforeach($arg as $name=>$value) {\n\t\t\t\t\t$message = str_replace('{'.$name.'}', $value, $message);\n\t\t\t\t}\n\t\t\t\treturn $message;\n\t\t\t} else {\n\t\t\t\t$args = func_get_args();\n\t\t\t\tarray_shift($args);\n\t\t\t\treturn vsprintf($message, $args);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $message;\n\t\t}\n\t}", "public function get($key, $values = null) {\n // get the configured language\n $lang = $this->lang;\n\n // for each separation, seek for nested arrays\n foreach(explode('.', $key) as $current_key) {\n if(array_key_exists($current_key, $lang)) {\n // if found, keep going\n $lang = $lang[$current_key];\n } else {\n // if not, return the key\n return $key;\n }\n }\n \n // if the value is invalid (it's an array), return the key\n if(is_array($lang)) {\n return $key;\n }\n\n if(is_array($values)) {\n foreach($values as $key => $val) {\n $lang = preg_replace('/{{\\s*(.*?)\\s*}}/i', $val, $lang);\n }\n }\n \n // return the found value\n return $lang;\n }", "function getLang($index,$params) {\t\n\t\tglobal $lang;\n\t\t\n\t\t$output = $lang[$index];\n\t\t\n\t\tforeach ($params as $key => $value) {\n\t\t\t$output = str_replace('%'.$key.'%',$value,$output);\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "public function get($key, array $replace = [], $locale = null, $fallback = true)\n {\n list($namespace, $group, $item) = $this->parseKey($key);\n\n // Here we will get the locale that should be used for the language line. If one\n // was not passed, we will use the default locales which was given to us when\n // the translator was instantiated. Then, we can load the lines and return.\n $locales = $fallback ? $this->parseLocale($locale) : [$locale ?: $this->locale];\n\n foreach ($locales as $locale) {\n $this->load($namespace, $group, $locale);\n\n $line = $this->getLine($namespace, $group, $locale, $item, $replace);\n\n if (!is_null($line)) {\n break;\n }\n }\n\n // If the line doesn't exist, we will return back the key which was requested as\n // that will be quick to spot in the UI if language keys are wrong or missing\n // from the application's language files. Otherwise we can return the line.\n if (!isset($line)) {\n\n $this->insertKey($key, $group, $locales[0]);\n\n return $key;\n }\n\n return $line;\n }", "function __($section, $key, $default = null) {\n return LanguageManager::getValue($section, $key, $default);\n}", "function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)\n {\n if (Lang::has($key, $locale)) {\n return __($key, $replace, $locale);\n }\n if ($default) {\n if (Str::contains($default, [' ', '.', ':'])) {\n return __($default, $replace, $locale);\n }\n // is probably single word\n return $default;\n }\n return $key;\n }", "public function localize($key) {\n\t\tif (!isset($this->_phrases[strtoupper($key)])) return $key;\n\n\t\t$match = $this->_phrases[strtoupper($key)];\n\n\t\tif (func_num_args() == 1) return $match;\n\n\t\t$args = func_get_args();\n\t\t$args[0] = $match;\n\n\t\treturn call_user_func_array('sprintf', $args);\n\t}", "function &getLocalizedData($key) {\n\t\t$localePrecedence = AppLocale::getLocalePrecedence();\n\t\tforeach ($localePrecedence as $locale) {\n\t\t\t$value =& $this->getData($key, $locale);\n\t\t\tif (!empty($value)) return $value;\n\t\t\tunset($value);\n\t\t}\n\n\t\t// Fallback: Get the first available piece of data.\n\t\t$data =& $this->getData($key, null);\n\t\tif (!empty($data)) {\n\t\t\t// WARNING: Collapsing the following into a single line causes PHP 5.0.5 to die.\n\t\t\t$locales = array_keys($data);\n\t\t\t$firstLocale = array_shift($locales);\n\t\t\treturn $data[$firstLocale];\n\t\t}\n\n\t\t// No data available; return null.\n\t\tunset($data);\n\t\t$data = null;\n\t\treturn $data;\n\t}" ]
[ "0.7279577", "0.6540411", "0.6520563", "0.6399052", "0.63652545", "0.63652295", "0.62738055", "0.6249757", "0.6221519", "0.61775416", "0.6134317", "0.6119666", "0.6086963", "0.60842663", "0.60628957", "0.6046162", "0.5997787", "0.5970214", "0.5904781", "0.5892247", "0.58879924", "0.5862939", "0.58339065", "0.5709334", "0.5708159", "0.5697764", "0.5669278", "0.5655534", "0.56253767", "0.5567804" ]
0.787046
0
A small helper function that pipes the output of `l()` though `h()`. This makes sure the output can be safely inserted as HTML tag content.
function lh(){ return h( call_user_func_array('l', func_get_args()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function h($text) {\n\t\tif (is_array($text)) {\n\t\t\treturn array_map('h', $text);\n\t\t}\n\t\treturn htmlspecialchars($text);\n\t}", "function efSidebarHeadingRenderH1( $input, $argv, $parser ) {\n return extraTags::headerTagsCommon(\"h1\",$input,$argv,$parser);\n }", "function H($num = 1, $title = '', $pref = 0, $extra = '')\n{\n /**\n * H tag - this is an HTML Document Header line.\n *\n * Args:\n * $num (int): the header number (1-6) default is 1\n * $title (str): the text in the header line\n * $pref (int): number of tabs for indentation, default is 0\n * $extra (str): extra data in the tag - used for adding class / ID etc.\n */\n Tab($pref) ;\n echo '<h' . $num ;\n if ($extra != '') {\n echo ' ' . $extra ;\n }\n echo '>' . $title ;\n close_tag('h' . $num, '', true) ;\n}", "function h($string = '')\n{\n return htmlspecialchars($string);\n}", "function renderVerbatim( $input ) {\n return str_replace(\"\\n\",'',wfMsg(trim($input)));\n}", "function h(/* as many as you want! */) {\n\n $count = func_num_args();\n\n switch($count) {\n\n case 0: return '';\n\n case 1:\n\n $arg = func_get_arg(0);\n\n if (is_array($arg)) {\n $result = array();\n _h_array($arg, $result);\n return $result;\n } else {\n return htmlspecialchars($arg, ENT_QUOTES, 'UTF-8');\n }\n\n }\n\n $result = array();\n for($i = 0; $i < $count; $i++) {\n $arg = func_get_arg($i);\n $result[] = htmlspecialchars($arg, ENT_QUOTES, 'UTF-8');\n }\n\n return implode('', $result);\n }", "function h($s) {\n return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');\n}", "function h($string=\"\") {\n\t\treturn htmlspecialchars($string);\n\t}", "function htmlout($text)\n{\n\techo html($text);\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}", "function h($text) {\r\n echo(htmlspecialchars($text, ENT_QUOTES));\r\n }", "function hi($hi) {\n if(is_string($hi)) {\n $hi = array($hi);\n }\n\n $hi = $this->hiArray($hi);\n $result = $this->generate($hi);\n ob_start();\n echo '<pre style=\"background-color: #f9f9f9;\">';\n if(sizeof($hi)) {\n echo $result;\n } else {\n echo \"<span style='background-color: \" . $this->colors[\"seq\"] . \"; border-right: 1px solid #949494;'>1.&nbsp;</span>&nbsp;\" . \n \"<span style='color: green;'>Query list is empty</span>\";\n }\n echo '</pre>';\n $result = ob_get_contents();\n ob_end_clean();\n \n return $result;\n }", "function heading( $data = '', $h = '1', $attributes = '' )\n\t{\n\t\treturn '<h' . $h . _stringify_attributes( $attributes ) . '>' . $data . '</h' . $h . '>';\n\t}", "function obishortcodes_break_worker($hr = false) {\n $output = '<br/>';\n\n if ($hr == true) {\n $output .= '<hr/><br/>';\n }\n\n return $output;\n}", "function wrapper ($template, $out) {\n\tglobal $CFG,$STD;\n\t\n\t$output = $template->html_head();\n\t$output .= $template->site_header( $CFG['root_url'].'/index.php' );\n\t\n\t$output .= $template->site_menu( $STD->global_template_ui->modq_menu() );\n\t$output .= $template->content_header();\n\t\n\t$output .= $out;\n\t\n\t$output .= $template->content_footer();\n\t$output .= $template->site_footer();\n\t\n\treturn $output;\n}", "function venus_structural_wrap( $output, $original_output ) {\n\n\tswitch ( $original_output ) {\n\t\tcase 'open':\n\t\t\t$output = '<div class=\"container\"><div class=\"row\">';\n\t\t\tbreak;\n\t\tcase 'close':\n\t\t\t$output = '</div></div>';\n\t\t\tbreak;\n\t}\n\n\treturn $output;\n}", "function ob_tidyhandler($input, $mode = null) {}", "function get_sanitized_heading($text) {\n\n $tags = [\n '<a>', '<b>', '<i>', '<u>', '<strong>', '<em>', '<sup>', '<sub>'\n ];\n\n $text = strip_tags($text,implode('',$tags));\n\n $raw = preg_split('#(<[^>]+>)#ismu',$text);\n\n foreach($raw as $replace) {\n $text = str_replace($replace,esc_html($replace),$text);\n }\n\n return nl2br($text);\n}", "function h( $s ) {\n return htmlspecialchars($s, ENT_QUOTES, 'utf-8');\n}", "function h($str) {\n\tif (func_num_args()>1) {\n\t\t$str = call_user_func_array('sprintf', func_get_args());\n\t}\n\tprint htmlspecialchars($str);\n}", "function lha(){\n\treturn ha( call_user_func_array('l', func_get_args()) );\n}", "function dev_wrap_li( $entry ) {\n\n\tif ( is_array( $entry ) ) {\n\t\t$entry = dev_array_to_ul( $entry );\n\t}\n\n\t$entry = htmlentities( $entry );\n\n\treturn \"<li>$entry</li>\";\n}", "function h($value){\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function h($text_to_escape){\n\treturn htmlspecialchars($text_to_escape, ENT_NOQUOTES | ENT_IGNORE, 'UTF-8');\n}", "function headingify($to_headingify, $level) {\r\n\t\t$to_headingify = preg_replace('/<(h[1-6])([^<>]*?)>(.*?)<\\/\\1>/is', '<p$2>$3</p>', $to_headingify);\r\n\t\tpreg_match('/<(\\w+)/is', $to_headingify, $tagname_matches, PREG_OFFSET_CAPTURE, 0);\r\n\t\t$pre_heading_OString_offset = $tagname_matches[0][1];\r\n\t\t$tagname = $tagname_matches[1][0];\r\n\t\twhile($tagname === \"div\") {\r\n\t\t\tpreg_match('/<(\\w+)/is', $to_headingify, $tagname_matches, PREG_OFFSET_CAPTURE, $pre_heading_OString_offset + strlen($tagname) + 1);\r\n\t\t\t$pre_heading_OString_offset = $tagname_matches[0][1];\r\n\t\t\t$tagname = $tagname_matches[1][0];\r\n\t\t}\r\n\t\t$pre_heading_OString = substr($to_headingify, 0, $pre_heading_OString_offset);\r\n\t\t$heading_OString = OM::getOString($to_headingify, \"<\" . $tagname, \"</\" . $tagname . \">\");\r\n\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t$strlen_heading_OString = strlen($heading_OString);\r\n\t\tif(is_numeric($level) && $level > 0 && $level < 7) {\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t\t$heading_OString = preg_replace('/<(\\w+)([^<>]*?)>/is', '<h' . $level . '$2>', $heading_OString, 1);\r\n\t\t\t$heading_OString = ReTidy::remove_tags($heading_OString, \"strong\");\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t\t$heading_OString = substr($heading_OString, 0, strlen($heading_OString) - strlen($tagname) - 1) . \"h\" . $level . \">\";\r\n\t\t\t//print('$heading_OString: ');var_dump($heading_OString);\r\n\t\t} else {\r\n\t\t\t$pos_lt = strpos($heading_OString, '>');\r\n\t\t\t$pos_gt = ReTidy::strpos_last($heading_OString, '<');\r\n\t\t\t$heading_OString = substr($heading_OString, 0, $pos_lt + 1) . '<strong>' . substr($heading_OString, $pos_lt + 1, $pos_gt - ($pos_lt + 1)) . '</strong>' . substr($heading_OString, $pos_gt);\r\n\t\t}\r\n\t\t$headingified = $pre_heading_OString . $heading_OString . substr($to_headingify, strlen($pre_heading_OString) + $strlen_heading_OString);\r\n\t\treturn $headingified;\r\n\t}", "function wp_html_split($input)\n {\n }", "function sanitize_output($buffer) {\n $search = ['/\\>[^\\S ]+/s', '/[^\\S ]+\\</s', '/(\\s)+/s'];\n $replace = ['>', '<', '\\\\1'];\n $buffer = preg_replace($search, $replace, $buffer);\n return $buffer;\n }", "public function breadcrumbs($h)\n {\n if ($h->pageName == 'edit_post') {\n $post_link = \"<a href='\" . $h->url(array('page'=>$h->post->id)) . \"'>\";\n $post_link .= $h->post->title . \"</a>\";\n $h->pageTitle = $h->pageTitle . \" / \" . $post_link;\n }\n }", "function h($var, $charset = 'UTF-8')\n{\n\tif ($var === FALSE) return '';\n\n\tif (is_array($var))\n\t{\n\t\treturn array_map('h', $var);\n\t}\n\telse\n\t{\n\t\treturn htmlspecialchars($var, ENT_QUOTES, $charset);\n\t}\n}", "function formatHelp($output)\n{\n $output = preg_replace('/_[\\b](.)/is', \"<u>$1</u>\", $output);\n // Highlight backslash words with *0x08* symbols.\n $output = preg_replace('/.[\\b](.)/is', \"<strong>$1</strong>\", $output);\n return $output;\n}" ]
[ "0.56554633", "0.53085077", "0.53049105", "0.5251895", "0.51553017", "0.5106195", "0.50797224", "0.50396633", "0.5027726", "0.49731374", "0.49653935", "0.49413902", "0.49313313", "0.49101636", "0.48944756", "0.4859114", "0.4844101", "0.48274562", "0.48247313", "0.48060423", "0.48015344", "0.4800074", "0.47981006", "0.47688794", "0.47666344", "0.47202346", "0.46949273", "0.4691434", "0.4679979", "0.4652371" ]
0.6449813
0
A small helper function that pipes the output of `l()` though `ha()`. This makes sure the output can be safely inserted as an HTML attribute value.
function lha(){ return ha( call_user_func_array('l', func_get_args()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lh(){\n\treturn h( call_user_func_array('l', func_get_args()) );\n}", "function qa_sanitize_html_hook_tag($element, $attributes = null)\n{\n\tglobal $qa_sanitize_html_newwindow;\n\n\tif (!isset($attributes)) // it's a closing tag\n\t\treturn '</' . $element . '>';\n\n\tif ($element == 'param' && trim(strtolower(@$attributes['name'])) == 'allowscriptaccess')\n\t\t$attributes['name'] = 'allowscriptaccess_denied';\n\n\tif ($element == 'embed')\n\t\tunset($attributes['allowscriptaccess']);\n\n\tif ($element == 'a' && isset($attributes['href']) && $qa_sanitize_html_newwindow)\n\t\t$attributes['target'] = '_blank';\n\n\t$html = '<' . $element;\n\tforeach ($attributes as $key => $value)\n\t\t$html .= ' ' . $key . '=\"' . $value . '\"';\n\n\treturn $html . '>';\n}", "function h($value){\n return htmlspecialchars($value, ENT_QUOTES);\n }", "public function moveHtmlAttributesToAdditionalArguments() {}", "function studiare_get_inline_attr($value, $attr, $glue = '') {\n\tif(!empty($value)) {\n\n\t\tif(is_array($value) && count($value)) {\n\t\t\t$properties = implode($glue, $value);\n\t\t} elseif($value !== '') {\n\t\t\t$properties = $value;\n\t\t}\n\n\t\treturn $attr.'=\"'.esc_attr($properties).'\"';\n\t}\n\n\treturn '';\n}", "function le ($value) {\n return '<= '.$value;\n }", "public function lnParse($ln) {\n $html = FALSE;\n if (isset($ln[$this->indt])) {\n $ln_attrib_sym = $ln[$this->indt];\n if ($html = $this->lnAttribChk($ln, $ln_attrib_sym, TRUE)) {\n # Placeholder...\n } elseif ($ln[$this->indt] === self::HAML_ELE) {\n $ln = trim(substr_replace($ln, NULL, $this->indt, 1));\n $line_ws_pos = strpos($ln, ' '); # IDK if this is even needed at the moment...\n # This is temporary & uber hacky...\n $ln_ele_nme = $ln;\n\n $cur_attrib_str = $cur_attrib_nme = FALSE;\n if ($attrib_ar = $this->lnAttribParse($ln)) {\n $cur_attrib_sym = $attrib_ar['attrib_str'][0];\n $cur_attrib_nme = $this->haml_ele_attribs_ar[$cur_attrib_sym];\n $cur_attrib_val = ltrim(substr_replace($attrib_ar['attrib_str'], NULL, 0, 1));\n $cur_attrib_str = $cur_attrib_nme . '=\"' . $cur_attrib_val . '\"';\n $ln_ele_nme = ltrim(substr_replace($ln_ele_nme, NULL, stripos($ln_ele_nme, $cur_attrib_sym)));\n }\n if (in_array($ln_ele_nme, $this->haml_ele_autoclose_ar)) {\n $html .= '<' . $ln_ele_nme . ($cur_attrib_str? ' ' . $cur_attrib_str : NULL) . '>' . (self::EOL());\n } else {\n # The string one space after the detected element is the content wrapped inside...\n $html .= '<' . $ln_ele_nme . ($cur_attrib_str? ' ' . $cur_attrib_str : NULL) . '>' . '<' . $ln_ele_nme . '>' . (self::EOL());\n }\n }\n }\n return $html;\n }", "public function overlayUserdefinedHtmlAttributeValues() {}", "function h($string = '')\n{\n return htmlspecialchars($string);\n}", "function _filter_xss_split($m, $store = FALSE) {\n static $allowed_html;\n\n if ($store) {\n $allowed_html = array_flip($m);\n return;\n }\n\n $string = $m[1];\n\n if (substr($string, 0, 1) != '<') {\n // We matched a lone \">\" character.\n return '&gt;';\n }\n elseif (strlen($string) == 1) {\n // We matched a lone \"<\" character.\n return '&lt;';\n }\n\n if (!preg_match('%^<\\s*(/\\s*)?([a-zA-Z0-9]+)([^>]*)>?|(<!--.*?-->)$%', $string, $matches)) {\n // Seriously malformed.\n return '';\n }\n\n $slash = trim($matches[1]);\n $elem = &$matches[2];\n $attrlist = &$matches[3];\n $comment = &$matches[4];\n\n if ($comment) {\n $elem = '!--';\n }\n\n if (!isset($allowed_html[strtolower($elem)])) {\n // Disallowed HTML element.\n return '';\n }\n\n if ($comment) {\n return $comment;\n }\n\n if ($slash != '') {\n return \"</$elem>\";\n }\n\n // Is there a closing XHTML slash at the end of the attributes?\n $attrlist = preg_replace('%(\\s?)/\\s*$%', '\\1', $attrlist, -1, $count);\n $xhtml_slash = $count ? ' /' : '';\n\n // Clean up attributes.\n $attr2 = implode(' ', _filter_xss_attributes($attrlist));\n $attr2 = preg_replace('/[<>]/', '', $attr2);\n $attr2 = strlen($attr2) ? ' ' . $attr2 : '';\n\n return \"<$elem$attr2$xhtml_slash>\";\n}", "public function hattr($attributes)\n {\n // http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#boolean-attributes\n // We implement only a subset for now that is used in Bolt.\n $booleans = ['checked', 'disabled', 'multiple', 'readonly', 'required', 'selected'];\n $return = '';\n\n $add = function ($name, $value = null) use (&$return) {\n $return .= ' ' . $name . ($value === null ? '' : '=\"' . htmlspecialchars($value) . '\"');\n };\n\n foreach ($attributes as $name => $value) {\n // Force outputting of empty non booleans.\n $force = substr($name, -1) === '!';\n $name = rtrim($name, '!');\n\n // Check for being a boolean attribute.\n $isBoolean = in_array($name, $booleans);\n\n // Assume integer 0, float 0.0 and string \"0\" as not empty on non booleans.\n $set = !empty($value) || !$isBoolean && (string) $value === '0';\n\n if ($set || !$isBoolean && $force) {\n if ($isBoolean) {\n $add($name);\n } elseif ($name === 'name+id') {\n $add('name', $value);\n $add('id', $value);\n } elseif ($name === 'class') {\n $add($name, $this->hclass($value, true));\n } elseif (is_array($value)) {\n $add($name, Json::dump($value));\n } else {\n $add($name, $value);\n }\n }\n }\n\n return $return;\n }", "function esc_attr($value) {\n return htmlspecialchars($value, ENT_QUOTES);\n }", "function attributesToHtml($attributes) {\n $html='';\n if (is_array($attributes))\n foreach ($attributes as $attrName=>$attrValue) {\n $html.=' '.$attrName.'=\"'.$attrValue.'\"';\n } elseif(is_string($attributes))\n \t$html=$attributes;\n return $html;\n }", "function block_core_home_link_build_li_wrapper_attributes($context)\n {\n }", "static function login_html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function esc_html($value) {\n return $value;\n}", "function html_escape($value)\n{\n return apply_filters('html_escape', $value);\n}", "function anchor_li($uri = '', $title = '', $attributes = '', $li_attributes = '') {\r\n $return = '<li ' . $li_attributes . '>';\r\n $return .= anchor($uri, $title, $attributes);\r\n $return .= '</li>';\r\n return $return;\r\n}", "function wrapHtml($data = '', $tag, $attrs = null, $single_tag = false)\n{\n\t$ret = '<'.$tag;\n\tif (is_array($attrs) && !empty($attrs))\n\t{\n\t\t$ret .= ' ';\n\t\tforeach($attrs as $attr => $val)\n\t\t$ret .= $attr .'=\"'.$val .'\" ';\n\t}\n\t\n\tif ($single_tag)\n\t\t$ret .= ' />';\n\telse\n\t\t$ret .= '>'. $data. '</'.$tag.'>';\n\treturn $ret;\n}", "function h($string=\"\") {\n\t\treturn htmlspecialchars($string);\n\t}", "function studiare_get_inline_attrs($attrs) {\n\t$output = '';\n\n\tif(is_array($attrs) && count($attrs)) {\n\t\tforeach($attrs as $attr => $value) {\n\t\t\t$output .= ' '.studiare_get_inline_attr($value, $attr);\n\t\t}\n\t}\n\n\t$output = ltrim($output);\n\n\treturn $output;\n}", "function h($text) {\n\t\tif (is_array($text)) {\n\t\t\treturn array_map('h', $text);\n\t\t}\n\t\treturn htmlspecialchars($text);\n\t}", "function theHTML($attributes) {\n ob_start(); ?>\n <h3>Today the sky is <?php echo esc_html($attributes['skyColor']); ?>, and grass is <?php echo esc_html($attributes['grassColor']); ?></h3> \n <?php return ob_get_clean();\n\n }", "function _filter_xss_attributes($attr) {\n $attrarr = array();\n $mode = 0;\n $attrname = '';\n\n while (strlen($attr) != 0) {\n // Was the last operation successful?\n $working = 0;\n\n switch ($mode) {\n case 0:\n // Attribute name, href for instance.\n if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {\n $attrname = strtolower($match[1]);\n $skip = ($attrname == 'style' || substr($attrname, 0, 2) == 'on');\n $working = $mode = 1;\n $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr);\n }\n break;\n\n case 1:\n // Equals sign or valueless (\"selected\").\n if (preg_match('/^\\s*=\\s*/', $attr)) {\n $working = 1;\n $mode = 2;\n $attr = preg_replace('/^\\s*=\\s*/', '', $attr);\n break;\n }\n\n if (preg_match('/^\\s+/', $attr)) {\n $working = 1;\n $mode = 0;\n if (!$skip) {\n $attrarr[] = $attrname;\n }\n $attr = preg_replace('/^\\s+/', '', $attr);\n }\n break;\n\n case 2:\n // Attribute value, a URL after href= for instance.\n if (preg_match('/^\"([^\"]*)\"(\\s+|$)/', $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname=\\\"$thisval\\\"\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace('/^\"[^\"]*\"(\\s+|$)/', '', $attr);\n break;\n }\n\n if (preg_match(\"/^'([^']*)'(\\s+|$)/\", $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname='$thisval'\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace(\"/^'[^']*'(\\s+|$)/\", '', $attr);\n break;\n }\n\n if (preg_match(\"%^([^\\s\\\"']+)(\\s+|$)%\", $attr, $match)) {\n $thisval = filter_xss_bad_protocol($match[1]);\n\n if (!$skip) {\n $attrarr[] = \"$attrname=\\\"$thisval\\\"\";\n }\n $working = 1;\n $mode = 0;\n $attr = preg_replace(\"%^[^\\s\\\"']+(\\s+|$)%\", '', $attr);\n }\n break;\n }\n\n if ($working == 0) {\n // Not well formed; remove and try again.\n $attr = preg_replace('/\n ^\n (\n \"[^\"]*(\"|$) # - a string that starts with a double quote, up until the next double quote or the end of the string\n | # or\n \\'[^\\']*(\\'|$)| # - a string that starts with a quote, up until the next quote or the end of the string\n | # or\n \\S # - a non-whitespace character\n )* # any number of the above three\n \\s* # any number of whitespaces\n /x', '', $attr);\n $mode = 0;\n }\n }\n\n // The attribute list ends with a valueless attribute like \"selected\".\n if ($mode == 1 && !$skip) {\n $attrarr[] = $attrname;\n }\n return $attrarr;\n}", "function present_list($attr)\n{\n if (is_array($attr) && count($attr) > 1) {\n $str = '<ul>';\n foreach ($attr as $value) {\n $str .= '<li>'.htmlspecialchars($attr).'</li>';\n }\n $str .= '</ul>';\n return $str;\n } else {\n return htmlspecialchars($attr[0]);\n }\n}", "function html($data) {\n $data = htmlspecialchars($data, ENT_QUOTES); // <>\n return $data;\n }", "static function get_html_attributes( $attributes ) {\n $attr = '';\n foreach ( $attributes as $key => $value ) {\n if ( !is_null( $value ) ) {\n $attr .= \" data-$key='$value'\";\n }\n }\n return $attr;\n }", "static function html_sanitization($input)\r\n {\r\n return strip_tags($input);\r\n }", "function esc_attr($value) {\n return $value;\n}", "function h($str)\n{\n return htmlspecialchars($str, ENT_QUOTES, 'UTF-8');\n}" ]
[ "0.54097027", "0.53002656", "0.52393806", "0.5167591", "0.5146034", "0.5137127", "0.50863564", "0.5031772", "0.4930918", "0.4930331", "0.49295044", "0.49032077", "0.49031445", "0.4894927", "0.48398635", "0.48310485", "0.48268795", "0.4824614", "0.48227358", "0.48180836", "0.48125964", "0.48086718", "0.48024487", "0.47945017", "0.47678563", "0.4758432", "0.47490776", "0.473779", "0.47265977", "0.47176623" ]
0.5494254
0
Helper to support possible localized text. If the text is an array the key with the name of the current locale is returned. If no key matches the current locale the first array element is returned. If `$text_or_array` is not an array it is returned as it is.
function lt($text_or_array){ global $CONFIG; if ( is_array($text_or_array) ){ if ( isset($text_or_array[$CONFIG['lang']]) ) return $text_or_array[$CONFIG['lang']]; else return reset($text_or_array); } return $text_or_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getLocalized($array) {\n\t\tif (!is_array($array)) {\n\t\t\treturn $array;\n\t\t}\n\t\t$default = \\AppLocale::getPrimaryLocale();\n\t\treturn isset($array[$default]) ? $array[$default] : array_pop($array);\n\t}", "function lng($text, $lng = '') {\n\tglobal $_base_path_cms, $_lang_cms, $_lang_array;\n\n\tif(empty($lng)) {\n\t\tif($_lang_cms == \"\") $_lang_cms = \"ro\";\n\t\t$return = lng($text, $_lang_cms);\n\n\t\tif(!empty($return)) {\n\t\t\treturn $_lang_array[$return];\n\t\t}\n\n\t\treturn $text;\n\t} else {\n\t\t/*\n\t\tinclude $_base_path_cms.'lang/'.$lng.'.php';\n\t\tif(is_file($_base_path_cms . 'lang/extra/'.$lng.'.php')){\n\t\t\tinclude $_base_path_cms . 'lang/extra/'.$lng.'.php';\n\t\t}\n\t\t*/\n\t\tif(isset($_lang_array[$text])) return $text;\n\n\t\t$key = array_search($text, $_lang_array);\n\t\tif(!empty($key)) return $key;\n\t}\n}", "protected function fastLookup($text) {\n\t\t$lookup = array($text, trim($text));\n\n\t\tforeach ($lookup as $key) {\n\t\t\tif (isset($this->definitions[$key])) {\n\t\t\t\treturn $this->definitions[$key]->getTranslation();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function get_translation_name (string $key, string $lang, array $data, $customNotFoundText = null)\n {\n if (is_array ($data)) {\n $data = collect ($data);\n }\n\n $item = $data->where ('language_code', $lang)->first ();\n\n if (is_null ($item)) {\n $name = array_get ($data, '0.' . $key);\n } else {\n $name = array_get ($item, $key);\n }\n\n if (is_null ($name)) {\n if (is_null ($customNotFoundText)) {\n $name = trans ('HCTranslations::core.no_translation');\n } else {\n $name = $customNotFoundText;\n }\n }\n\n return $name;\n }", "static function getTranslation($text)\r\n\t{\r\n\t\tglobal $user;\r\n\t\t\r\n\t\tif($user && $user->hasField(\"language\") && $user->language)\r\n\t\t\t$language = $user->language;\r\n\t\telse\r\n\t\t\t$language = Settings::getValue(\"text_lookup\", \"language\");\t\r\n\t\t\r\n\t\tif(!$language || $language == \"English\")\r\n\t\t\treturn $text;\r\n\t\telse\r\n\t\t{\r\n\t\t\t$translations = Query::create(TextTranslation, \"WHERE text_id=:text_id AND language=:language\")\r\n\t\t\t\t->bind(\":text_id\", $text->text_id, \":language\", $language)\r\n\t\t\t\t->execute();\r\n\t\t\t\t\r\n\t\t\tif(count($translations) > 0 && $translations[0]->text)\r\n\t\t\t{\r\n\t\t\t\t$text->text = $translations[0]->text;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\treturn $text;\r\n\t}", "public static function getTranslation($text) {\n if (!is_array(self::$cachedTranslations)) {\n self::$cachedTranslations = CachedConferenceApi::getTranslations();\n }\n\n $textMD5 = md5($text);\n if (is_array(self::$cachedTranslations) && isset(self::$cachedTranslations[$textMD5])) {\n return self::$cachedTranslations[$textMD5];\n }\n else {\n return $text;\n }\n }", "function atktext($string, $module=\"\",$node=\"\", $lng=\"\", $firstfallback=\"\", $nodefaulttext=false, $modulefallback=false)\n{\n\t\n\t// alcal: user can specify language on pdf's\n\tif(!is_array($string) && substr($string, 0, 4)=='pdf_'){\n\t\t$rawdata = atkGetUser('customlang');\n\t\t$unserialized = unserialize(base64_decode($rawdata));\n\t\t\n\t\tif($unserialized[$string]) return $unserialized[$string];\n\t}\n\n\tatkimport(\"atk.atklanguage\");\n\treturn atkLanguage::text($string, $module, $node, $lng, $firstfallback, $nodefaulttext,$modulefallback);\n}", "public function getTextByLanguage($text) {\n\t\tif(in_array($this->language, $this->availableLanguages)) {\n\t\t\t$output = \"\";\n\t\t\t$fix = explode('{['.$this->language.']}', $text);\n\t\t\tfor($b=0; $b<count($fix); $b++) {\n\t\t\t\t$tmp = explode('{[', $fix[$b]);\n\t\t\t\t$output .= $tmp[0];\n\t\t\t}\n\t\t\treturn $output;\n\t\t} elseif(!empty($this->availableLanguages)) {\n\t\t\t// if the string contains language tags but not the selected language\n\t\t\t// so get another language. Otherwise it wont print an output.\n\t\t\t$output = \"\";\n\t\t\t$language =$this->availableLanguages[0];\n\t\t\t$fix = explode('{['.$language.']}', $text);\n\t\t\tfor($b=0; $b<count($fix); $b++) {\n\t\t\t\t$tmp = explode('{[', $fix[$b]);\n\t\t\t\t$output .= $tmp[0];\n\t\t\t}\n\t\t\treturn $output;\n\t\t} else {\n\t\t\treturn $text;\n\t\t}\n\t}", "public function getLocalizedTextByLocale(string $locale): ?LocalizedEntity\n {\n $criteria = Criteria::create()->where(Criteria::expr()->eq(\"locale\", $locale));\n $first = $this->localizedTexts->matching($criteria)->first();\n return $first === false ? null : $first;\n }", "private function getPhraseByJson($keyString, $subKey = [])\n {\n $return = null;\n\n $useLanguageArray = $this->preloadedLanguage;\n\n if (is_array($subKey)) {\n foreach (array_change_key_case($subKey, CASE_LOWER) as $keyName) {\n if (isset($useLanguageArray[$keyName])) {\n $useLanguageArray = array_change_key_case($useLanguageArray[$keyName], CASE_LOWER);\n }\n }\n }\n\n $keyStringVariant = strtolower(preg_replace('/_/', '', $keyString));\n\n foreach ($useLanguageArray as $translationType => $translationItem) {\n if (is_array($translationItem)) {\n if (is_array($useLanguageArray) &&\n (isset($useLanguageArray[$keyString]) || isset($useLanguageArray[$keyStringVariant]))\n ) {\n // Either one of these should be returned since it has landed here properly.\n if (isset($useLanguageArray[$keyString])) {\n $return = $useLanguageArray[$keyString];\n } elseif (isset($useLanguageArray[$keyStringVariant])) {\n $return = $useLanguageArray[$keyStringVariant];\n }\n break;\n }\n foreach ($translationItem as $translationCategory => $translationCategoryItem) {\n if ((is_string($translationCategoryItem) && strtolower($translationCategoryItem) === strtolower($keyString)) ||\n $translationCategory === $keyString\n ) {\n $return = $translationCategoryItem;\n break;\n }\n\n if (is_string($translationType) && strtolower($translationType) === strtolower($keyString)) {\n $return = $translationItem;\n break;\n }\n }\n if (!empty($return)) {\n break;\n }\n } elseif ($translationType === $keyString) {\n $return = $translationItem;\n break;\n }\n }\n\n return $return;\n }", "function get_localized_value($localized, string $localeCode, string $textColumn = 'text')\n {\n if (!$localized || is_string($localized)) return $localized;\n\n return collect($localized)->where('localeCode', $localeCode)->first()[$textColumn];\n }", "public function getContentTextforLocale($locale)\n {\n if (!empty($this->content)) {\n foreach ($this->content as $translation) {\n if ($translation['locale'] === $locale) {\n return $translation['text'];\n }\n }\n }\n\n return 'no match found for key'.$this->getIdentifier().' with locale '.$locale;\n }", "private static function _getTextFromRowset($lang, $textRowset)\n {\n foreach ($textRowset as $textRow) {\n if ($textRow->lang == $lang) {\n return $textRow;\n }\n }\n return null;\n }", "public function formatMessage(string $path, array $data = []): ?string\n {\n /** @var String $message */\n $message = $this->plugin->getLang()->getNested($path);\n return $message !== null ? TextFormat::colorize(self::replaceTags($message, $data)): null;\n }", "public static function getTranslatedText($id, $itemType, $lang, $type, $exceptionOnNull = true)\n {\n $table = new self();\n\n if (empty($id) && !$exceptionOnNull) {\n return null;\n }\n\n $where = \"id = $id AND itemType='$itemType' and type='$type'\";\n $textRowset = $table->fetchAll($where);\n if (empty($textRowset)) {\n if ($exceptionOnNull) {\n throw new Lib_Exception(\"Could not find any translated text '\" . $type . \"' for id='$id', itemType='$itemType', lang='$lang', type='$type'\");\n } else {\n return null;\n }\n }\n\n $textRow = self::_getTextFromRowset($lang, $textRowset);\n if (!empty($textRow)) {\n return $textRow;\n }\n\n if ($lang == GLOBAL_LANG_DEFAULT) {\n /**\n * The default language was not found.\n * We pick the first language available.\n */\n $textRow = $textRowset->rewind()->current();\n return $textRow;\n }\n\n /**\n * A non-default language was not found.\n * Let's try to find the text in the default language.\n */\n $textRow = self::_getTextFromRowset(GLOBAL_LANG_DEFAULT, $textRowset);\n if (!empty($textRow)) {\n return $textRow;\n }\n\n // Nothing has worked, no text was found.\n if ($exceptionOnNull) {\n throw new Lib_Exception(\"Could not find translated text '\" . $type . \"' for id='$id', itemType='$itemType', lang='$lang', type='$type'\");\n }\n\n return null;\n }", "function multilang_locale_name($key) {\n $list = multilang_locales_list();\n if (isset($list[ $key ])){\n return $list[ $key ];\n } else {\n return $key;\n }\n}", "public function getPreferredLanguage(array $locales = null): ?string\n {\n $preferredLanguages = $this->getLanguages();\n\n if (empty($locales)) {\n return $preferredLanguages[0] ?? null;\n }\n\n if (!$preferredLanguages) {\n return $locales[0];\n }\n\n $extendedPreferredLanguages = [];\n foreach ($preferredLanguages as $language) {\n $extendedPreferredLanguages[] = $language;\n if (false !== $position = strpos($language, '_')) {\n $superLanguage = substr($language, 0, $position);\n if (!\\in_array($superLanguage, $preferredLanguages)) {\n $extendedPreferredLanguages[] = $superLanguage;\n }\n }\n }\n\n $preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales));\n\n return $preferredLanguages[0] ?? $locales[0];\n }", "function get_text($id, $language = '', $default = '')\n{\n if (empty($language))\n $language = get_config('language', 'main');\n\n $__langs__ = $GLOBALS[\"__LANGUAGE__{$language}__\"];\n\n return isset($__langs__[strtolower($id)]) ? __replace_cfgs($__langs__[strtolower($id)], 0, $language) : $default;\n}", "function get_text_in_user_selected_language($user_id=0,$text=\"\"){\n\t\t$user=$this->UserModel->get_user_data(array('member_id'=>$user_id));\n\t\t$user_language=$user[0]['language'];\n\n\n\t\t#fetch text according to user selected language\n\t\t$language_text_arr=$this->UserModel->get_language_text(array('language'=>$user_language,'text_code'=>$text));\n\n\t\tif(count($language_text_arr)<=0){\n\t\t\t$language_text=$this->UserModel->get_language_text(array('language'=>'en','text_code'=>$text));\n\t\t\t$language_code=$user_language;\n\n\t\t\t$this->load->library('Languagetranslator'); # load language translate library\n\t\t\t$source = 'en';\t\t#source language\n\t\t\t$target = $language_code;\t#target language\n\t\t\t#Covert text language in target language\n\t\t\tforeach($language_text as $text){\n\t\t\t\t$sourceData = $text['text'];\n\t\t\t\t$targetData = $this->languagetranslator->translate($sourceData,$target, $source);\n\t\t\t\t$input_array=array('language'=>strtolower($language_code),'text_code'=>$text['text_code'],'text'=>$targetData);\n\t\t\t\t#update text in language table\n\t\t\t\t$this->UserModel->create_language($input_array);\n\t\t\t\treturn $targetData;\n\t\t\t}\n\t\t}else{\n\t\t\treturn $language_text_arr[0]['text'];\n\t\t}\n\t}", "public function get($key, $values = null) {\n // get the configured language\n $lang = $this->lang;\n\n // for each separation, seek for nested arrays\n foreach(explode('.', $key) as $current_key) {\n if(array_key_exists($current_key, $lang)) {\n // if found, keep going\n $lang = $lang[$current_key];\n } else {\n // if not, return the key\n return $key;\n }\n }\n \n // if the value is invalid (it's an array), return the key\n if(is_array($lang)) {\n return $key;\n }\n\n if(is_array($values)) {\n foreach($values as $key => $val) {\n $lang = preg_replace('/{{\\s*(.*?)\\s*}}/i', $val, $lang);\n }\n }\n \n // return the found value\n return $lang;\n }", "function getLanguageId($text) {\n\tglobal $languagesToDrupalTaxonomyIds;\n\t$text = trim($text);\n\t$text = strtolower($text);\n\t$result = $languagesToDrupalTaxonomyIds[$text];\n\tif (!$result) {\n\t\t$result = $languagesToDrupalTaxonomyIds['english'];\n\t}\n\treturn $result;\n}", "public function negotiateLanguage()\n {\n $matches = $this->getMatchesFromAcceptedLanguages();\n foreach ($matches as $key => $q) {\n\n $key = ($this->configRepository->get('laravellocalization.localesMapping')[$key]) ?? $key;\n\n if (!empty($this->supportedLanguages[$key])) {\n return $key;\n }\n\n if ($this->use_intl) {\n $key = Locale::canonicalize($key);\n }\n\n // Search for acceptable locale by 'regional' => 'af_ZA' or 'lang' => 'af-ZA' match.\n foreach ( $this->supportedLanguages as $key_supported => $locale ) {\n if ( (isset($locale['regional']) && $locale['regional'] == $key) || (isset($locale['lang']) && $locale['lang'] == $key) ) {\n return $key_supported;\n }\n }\n }\n // If any (i.e. \"*\") is acceptable, return the first supported format\n if (isset($matches['*'])) {\n reset($this->supportedLanguages);\n\n return key($this->supportedLanguages);\n }\n\n if ($this->use_intl && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $http_accept_language = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n\n if (!empty($this->supportedLanguages[$http_accept_language])) {\n return $http_accept_language;\n }\n }\n\n if ($this->request->server('REMOTE_HOST')) {\n $remote_host = explode('.', $this->request->server('REMOTE_HOST'));\n $lang = strtolower(end($remote_host));\n\n if (!empty($this->supportedLanguages[$lang])) {\n return $lang;\n }\n }\n\n return $this->defaultLocale;\n }", "public function getTranslation(string $key, string $locale): ?string\n {\n if (!\\array_key_exists($key, $this->translations)\n || !\\array_key_exists($locale, $this->translations[$key])) {\n return null;\n }\n\n return $this->translations[$key][$locale];\n }", "function &getLocalizedData($key) {\n\t\t$localePrecedence = AppLocale::getLocalePrecedence();\n\t\tforeach ($localePrecedence as $locale) {\n\t\t\t$value =& $this->getData($key, $locale);\n\t\t\tif (!empty($value)) return $value;\n\t\t\tunset($value);\n\t\t}\n\n\t\t// Fallback: Get the first available piece of data.\n\t\t$data =& $this->getData($key, null);\n\t\tif (!empty($data)) {\n\t\t\t// WARNING: Collapsing the following into a single line causes PHP 5.0.5 to die.\n\t\t\t$locales = array_keys($data);\n\t\t\t$firstLocale = array_shift($locales);\n\t\t\treturn $data[$firstLocale];\n\t\t}\n\n\t\t// No data available; return null.\n\t\tunset($data);\n\t\t$data = null;\n\t\treturn $data;\n\t}", "function l(){\n\tglobal $_LOCALE;\n\t\n\t$entry = $_LOCALE;\n\t$args = func_get_args();\n\t\n\tfor($i = 0; $i < count($args); $i++){\n\t\t$key = $args[$i];\n\t\tif ( array_key_exists($key, $entry) ) {\n\t\t\t$entry = $entry[$key];\n\t\t\tif ( ! is_array($entry) )\n\t\t\t\tbreak;\n\t\t} else {\n\t\t\t$entry = 'Missing entry in language file: ' . join(' → ', array_slice($args, 0, $i + 1));\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t$format_args = array_slice($args, $i + 1);\n\treturn (is_string($entry) and count($format_args) > 0) ? vsprintf($entry, $format_args) : $entry;\n}", "function make_text($arr, $key, $default='')\n{\n\tif ( isset($arr[$key]) )\n\t{\n\t\treturn trim($arr[$key]);\n\t}\n\n\treturn trim($default);\n}", "private function retun_key_value($text)\n\t{\n\tpreg_match(\"/([^:]+)[:]([\\w\\W]+)/\", $text, $matches);\n\n\tif (empty($matches))\n\t{\n\t\treturn [false, $text];\n\t}\n\telse\n\t{\n\t\t$matches = array_splice($matches, 1, 2);\n\t\treturn $matches;\n\t}\n\t}", "function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)\n {\n if (Lang::has($key, $locale)) {\n return __($key, $replace, $locale);\n }\n if ($default) {\n if (Str::contains($default, [' ', '.', ':'])) {\n return __($default, $replace, $locale);\n }\n // is probably single word\n return $default;\n }\n return $key;\n }", "function lang()\n\t{\n\t\t$args = func_get_args();\n\t\tif (is_array($args) && count($args) == 1 && is_array($args[0]))\n\t\t\t$args = $args[0];\n\t\treturn CmsLanguage::translate($args[0], array_slice($args, 1), $this->get_name(), '', $this->default_language());\n\t}", "public function getCurrentOrDefaultLocale();" ]
[ "0.57694566", "0.5694082", "0.5636375", "0.55659413", "0.5489294", "0.52232456", "0.51335824", "0.51238286", "0.5081681", "0.506863", "0.5019618", "0.4966296", "0.49639627", "0.4948821", "0.49237633", "0.49128842", "0.48961136", "0.4892686", "0.48845595", "0.48761043", "0.4857032", "0.4854346", "0.4853873", "0.48403147", "0.4828774", "0.47878513", "0.47461876", "0.47444725", "0.47417876", "0.47276232" ]
0.681337
0
Converts the specified number of bytes into a more human readable format like KiByte or MiByte. The function name is inspired by Rails but the implementation is was written completely from scratch.
function number_to_human_size($bytes){ $border = 1024 * 1.5; if ($bytes < $border) return sprintf('%u Byte', $bytes); $bytes /= 1024; if ($bytes < $border) return sprintf('%u KiByte', $bytes); $bytes /= 1024; return sprintf('%.1f MiByte', $bytes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format_bytes($a_bytes) {\n if ($a_bytes < 1024) {\n return $a_bytes .' B';\n } elseif ($a_bytes < 1048576) {\n return round($a_bytes / 1024, 2) .' Kb';\n } elseif ($a_bytes < 1073741824) {\n return round($a_bytes / 1048576, 2) . ' Mb';\n } elseif ($a_bytes < 1099511627776) {\n return round($a_bytes / 1073741824, 2) . ' Gb';\n } elseif ($a_bytes < 1125899906842624) {\n return round($a_bytes / 1099511627776, 2) .' Tb';\n } elseif ($a_bytes < 1152921504606846976) {\n return round($a_bytes / 1125899906842624, 2) .' Pb';\n } elseif ($a_bytes < 1180591620717411303424) {\n return round($a_bytes / 1152921504606846976, 2) .' Eb';\n } elseif ($a_bytes < 1208925819614629174706176) {\n return round($a_bytes / 1180591620717411303424, 2) .' Zb';\n } else {\n return round($a_bytes / 1208925819614629174706176, 2) .' Yb';\n }\n}", "private static function toFormattedBytes(int $bytes) : string\n {\n $precision = 2;\n $base = log($bytes, 1024);\n $suffixes = array('', 'K', 'M', 'G', 'T');\n\n return round(1024 ** ($base - floor($base)), $precision) . $suffixes[floor($base)];\n }", "function bytes_to_human($bytes)\n {\n $base = log($bytes) / log(1024);\n\n $suffix = ['', 'KB', 'MB', 'GB', 'TB'];\n\n $f_base = floor($base);\n\n return round(pow(1024, $base - floor($base)), 1).$suffix[$f_base];\n }", "function format_bytes ( $size ) {\n\t\tswitch ( $size ) {\n\t\t\tcase $size > 1000000:\n\t\t\t\treturn number_format(ceil($size / 1000000)) . \"mb\";\n\t\t\t\tbreak;\n\t\t\tcase $size > 1000:\n\t\t\t\treturn number_format(ceil($size / 1000)) . \"k\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn number_format($size) . \"b\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "function bytesToHumanReadable (int $size, int $decimals = 2): string {\n\tif ($size >= 1 << 40)\n\t\treturn number_format($size / (1 << 40), $decimals).\"TB\";\n\tif ($size >= 1 << 30)\n\t\treturn number_format($size / (1 << 30), $decimals).\"GB\";\n\tif ($size >= 1 << 20)\n\t\treturn number_format($size / (1 << 20), $decimals).\"MB\";\n\tif ($size >= 1 << 10)\n\t\treturn number_format($size / (1 << 10), $decimals).\"KB\";\n\treturn number_format($size, $decimals).\"B\";\n}", "function formatBytes($intSize) {\n\t\treturn sprintf('%0.2f', ($intSize/1000)). ' Kb';\n\t}", "function convertToNotation(int $bytes) {\n\n\t$units = array('B', 'KB', 'MB', 'GB', 'TB'); \n\n\t$bytes = max($bytes, 0); \n\t$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n\t$pow = min($pow, count($units) - 1);\n\t$bytes /= pow(1024, $pow);\n\n return round($bytes, 2).$units[$pow]; \n\n}", "function formatBytes( $bytes, $precision = 2 )\n{\n $units = array('b', 'Kb', 'Mb', 'Gb', 'Tb');\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n $bytes /= pow(1024, $pow);\n return round($bytes, $precision) . ' ' . $units[$pow];\n}", "protected function _formatHumanFileSize($iBytes) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($iBytes) - 1) / 3);\n return str_replace(array('B', 'K', 'M', 'G', 'T', 'P'), array('Byte', 'Kb', 'Mb', 'Gb', 'Tb', 'Pb'), sprintf(\"%.2f\", $iBytes / pow(1024, $factor)).' '.@$sz[intval($factor)]);\n }", "function bytes_to_human_size($size, $decimals = 1)\n {\n $suffix = array('Bytes','KB','MB','GB','TB','PB','EB','ZB','YB','NB','DB');\n $i = 0;\n\n while ($size >= 1024 && ($i < count($suffix) - 1)) {\n $size /= 1024;\n $i++;\n }\n\n return round($size, $decimals) . ' ' . $suffix[$i];\n }", "function readable_bytes($bytes) {\n\t$units = array(\"B\", \"KiB\", \"MiB\", \"GiB\");\n\tfor ($i = (count($units) - 1) * 10; $i >= 0; $i -= 10) {\n\t\tif (!$i || $bytes >> $i) {\n\t\t\treturn round($bytes / (1 << $i), 2).\" \".$units[$i/10];\n\t\t}\n\t}\n}", "function formatBytes($bytes) {\n\t\tif ($bytes < 1024) return $bytes.' B';\n\t\telseif ($bytes < 1048576) return round($bytes / 1024, 2).' KB';\n\t\telseif ($bytes < 1073741824) return round($bytes / 1048576, 2).' MB';\n\t\telseif ($bytes < 1099511627776) return round($bytes / 1073741824, 2).' GB';\n\t\telse return round($bytes / 1099511627776, 2).' TB';\n\t}", "function formatBytes($size) {\n $units = array(' B', ' KB', ' MB', ' GB', ' TB');\n for ($i = 0; $size >= 1024 && $i < 4; $i++) $size /= 1024;\n return round($size, 2).$units[$i];\n}", "function show_bytes($bytes)\n{\n if ($bytes > 1073741824)\n {\n $gb = $bytes/1073741824;\n $str = sprintf($gb>=10 ? \"%d \" : \"%.1f \", $gb) . crystal_label('GB');\n }\n else if ($bytes > 1048576)\n {\n $mb = $bytes/1048576;\n $str = sprintf($mb>=10 ? \"%d \" : \"%.1f \", $mb) . crystal_label('MB');\n }\n else if ($bytes > 1024)\n $str = sprintf(\"%d \", round($bytes/1024)) . crystal_label('KB');\n else\n $str = sprintf('%d ', $bytes) . crystal_label('B');\n\n return $str;\n}", "public function formatBytes(int $size): string\n {\n $units = ['B', 'KB', 'MB', 'GB', 'TB'];\n $base = \\log($size) / \\log(1024);\n\n return \\round(1024 ** ($base - \\floor($base)), 1) . ' ' . $units[(int)\\floor($base)];\n }", "function formatRawSize($bytes) {\n if(!empty($bytes)) {\n\n $s = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');\n $e = floor(log($bytes)/log(1024));\n\n $output = sprintf('%.2f '.$s[$e], ($bytes/pow(1024, floor($e))));\n\n return $output;\n }\n}", "function cs_format_bytes($bytes, $decimals = 2)\r\n{\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%d Bytes', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f KiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f MiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\tif ($bytes < 1024)\r\n\t{\r\n\t\treturn sprintf('%.'.$decimals.'f GiB', $bytes);\r\n\t}\r\n\t$bytes /= 1024.0;\r\n\treturn sprintf('%.'.$decimals.'f TiB', $bytes);\r\n}", "function formatBytes($size, $precision = 2)\n {\n $base = log($size, 1024);\n $suffixes = array('', 'K', 'M', 'G', 'T'); \n\n return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)];\n }", "function format_toSizeInBytes_shortForm($size_in_bytes) {\n\t\t//\n\t\t// Data sizes are normally specified in KB - powers of 1024, so return KB rather than kB\n\n\t\tif ($size_in_bytes < (1024 * 1024)) {\n\t\t\t$unit = \"K\";\n\t\t\t$unitSize = $size_in_bytes / 1024;\n\t\t} else if ($size_in_bytes < (1024 * 1024 * 1024)) {\n\t\t\t$unit = \"M\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024);\n\t\t} else {\n\t\t\t$unit = \"G\";\n\t\t\t$unitSize = $size_in_bytes / (1024 * 1024 * 1024);\n\t\t}\n\n\t\t$showDecimalPlace = $unitSize < 10 && round($unitSize, 1) != round($unitSize);\n\n\t\treturn sprintf($showDecimalPlace ? \"%1.1f\" : \"%1.0f\", $unitSize) . $unit;\n\t}", "function byteSizeConvert($size){\n $unit=array('b','kb','mb','gb','tb','pb');\n return @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i];\n}", "function sizeFormat($b = 0){\r\n\t\tif($b < 1024){\r\n\t\t\treturn $b . 'bytes';\r\n\t\t}elseif($b < 1048576){\r\n\t\t\treturn round($b / 1024 * 100 ) / 100 . 'KB';\r\n\t\t}elseif($b < 130023424){\r\n\t\t\treturn round($b / 1048576 * 100 ) / 100 . 'MB';\r\n\t\t}elseif($b < 133143986176){\r\n\t\t\treturn round($b / 130023424 * 100) / 100 . 'GB';\r\n\t\t}else{\r\n\t\t\treturn round($b / 133143986176 * 100) / 100 . 'TB';\r\n\t\t}\r\n\t}", "function formatBytes($size, $precision = 1)\n{\n $base = log($size, 1024);\n $suffixes = array('B', 'KB', 'MB', 'GB', 'TB');\n return round(pow(1024, $base - floor($base)), $precision) . ' ' . $suffixes[floor($base)];\n}", "function transByte($size){\n\t$arr = array(\"B\",\"KB\",\"MB\",\"GB\",\"TB\",\"EB\");\n\t$i = 0;\n\twhile($size>1024){\n\t\t$size/=1024;\n\t\t$i++;\n\t}\n\treturn round($size,2).$arr[$i];\n}", "function human_filesize($bytes, $decimals = 2) {\n $sz = 'BKMGTP';\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$sz[$factor];\n}", "function formatBytes($size, $precision = 2)\n {\n if($size != 0){\n $base = log($size, 1024);\n $suffixes = array('kB', 'MB', 'GB', 'TB'); \n return round(pow(1024, $base - floor($base)), $precision) .''. $suffixes[floor($base)];\n }\n return 0;\n }", "protected function formatBytes($bytes)\n {\n if ((int)$bytes < 1) {\n return '';\n }\n\n $units = ['B', 'K', 'M', 'G']; // G since PHP 5.1.x so we are good!\n\n $bytes = (int)$bytes;\n $base = log($bytes) / log(1000);\n $pow = pow(1000, $base - floor($base));\n\n return round($pow, 0) . $units[(int)floor($base)];\n }", "function formatBytes($bytes, $precision = 2) { \n $units = array('B', 'KB', 'MB', 'GB', 'TB'); \n $bytes = max($bytes, 0); \n $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); \n $pow = min($pow, count($units) - 1); \n $bytes /= pow(1024, $pow); \n return round($bytes, $precision) . ' ' . $units[$pow]; \n }", "private function bytesToString(int $bytes): string\n {\n $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB'];\n\n if ($bytes === 0) {\n return '0 B';\n }\n\n $index = min(count($units) -1, floor(log($bytes, 1024)));\n $size = round($bytes / pow(1024, $index), 2);\n\n return $size . ' ' . $units[$index];\n }", "function humanReadableToBytes (string $size): int {\n\t$unitIndex = 0;\n\n\t$chars = str_split($size);\n\t$charsLen = count($chars);\n\n\t$multipliers =\n\t\t[\n\t\t\t'B' => 1,\n\t\t\t'KB' => 1 << 10,\n\t\t\t'MB' => 1 << 20,\n\t\t\t'GB' => 1 << 30,\n\t\t\t'TB' => 1 << 40\n\t\t];\n\n\tfor ($i = 0; $i < $charsLen; $i++) {\n\t\tif (!is_numeric($size[$i]) and $size[$i] != '.') {\n\t\t\t$unitIndex = $i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$sizeN = floatval(substr($size, 0, $unitIndex));\n\t$sizeU = substr($size, $unitIndex, $charsLen - $unitIndex);\n\n\treturn round($sizeN * $multipliers[$sizeU]);\n}", "function human_filesize($bytes, $decimals = 0)\n{\n $size = ['B','KB','MB','GB','TB','PB','EB','ZB','YB'];\n $factor = floor((strlen($bytes) - 1) / 3);\n return sprintf(\"%.{$decimals}f\", $bytes / pow(1024, $factor)) . @$size[$factor];\n}" ]
[ "0.7012805", "0.6907971", "0.6894629", "0.68690646", "0.6838405", "0.67738885", "0.6735905", "0.6632421", "0.6607589", "0.66063565", "0.6600233", "0.6581037", "0.6559254", "0.65476817", "0.65440226", "0.6541024", "0.65246475", "0.64672637", "0.64318246", "0.643092", "0.6426066", "0.6416188", "0.64159214", "0.6405183", "0.64028645", "0.6399097", "0.63975453", "0.6378332", "0.63558453", "0.6335469" ]
0.7140833
0
Returns a element that displays $date in the specified $format (see The element also contains additional information so the timezoneconverter.js script can convert the date to the users local timezone. Since the users timezone can only be queried via JavaScript this has to be done on the client side. If the script fails the date is displayed in the timezone specified in the date itself and a timezone abbreviation is added ('T' format of PHPs date() function). This ensures that users can always read the date correctly.
function timezone_aware_date($date, $format){ return sprintf('<time dateTime="%s" data-format="%s">%s %s</time>', ha($date->format('c')), ha($format), h($date->format($format)), h($date->format('T'))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#[@xslmethod]\n public function format($date, $format, $timezone= NULL) {\n $timezone= empty($timezone) ? NULL : $timezone;\n return create(new Date($date))->toString($format, new TimeZone($timezone));\n }", "function cjpopups_local_date($format, $date = null){\n\tif($date == null){\n\t\t$datetime = strtotime(date('Y-m-d H:i:s'));\n\t}else{\n\t\t$datetime = strtotime(date('Y-m-d H:i:s', $date));\n\t}\n\t$timezone_string = get_option('timezone_string');\n\tif($timezone_string != ''){\n\t\tdate_default_timezone_set($timezone_string);\n\t\t$return = date($format, $datetime);\n\t}else{\n\t\t$return = date($format, $datetime);\n\t}\n\treturn $return;\n}", "public function formatDate(\n $date = null,\n $format = \\Magento\\Framework\\Stdlib\\DateTime\\TimezoneInterface::FORMAT_TYPE_SHORT,\n $showTime = false\n );", "public function formatDate($date, $format = 'd/m/Y', $timeZone = 'America/Argentina/Cordoba'){\n date_default_timezone_set($timeZone);\n return date($format, strtotime($date));\n }", "function dateFormat($date, $format=\"m/d/Y h:i:s A\") {\n if (empty($date)) {\n return \"\";\n }\n Zend_Date::setOptions(array('format_type' => 'php'));\n $zdate = new Zend_Date(strtotime($date));\n $str_date = $zdate->toString($format);\n Zend_Date::setOptions(array('format_type' => 'iso'));\n return $str_date;\n }", "public function getDateByFormat( $date = 'now', $format = '' )\n {\n if ( empty( $date ) ) \n return '';\n\n $_format = empty( $format ) ? 'Y-m-d H:i:s' : $format;\n\n $d = new \\DateTime( $date );\n return $d->format( $_format );\n }", "public function toString($date_format = 'short',$time_format = 'medium') {\n // NONE, NONE : 20150522 09:39 AM\n // Time Format :\n // SHORT : 09:39\n // MEDIUM : 09:39:59\n // LONG : 09:39:59 UTC-07:00\n // FULL : 09:39:59 heure avancée du Pacifique\n // Date Format :\n // SHORT : 22/05/15\n // MEDIUM : 22 mai 2015\n // LONG : 22 mai 2015\n // FULL : vendredi 22 mai 2015\n return static::getFormatter($date_format,$time_format)->format($this);\n }", "function getLocalDate($strdate,$format='%Y-%m-%d %H:%M:%S') {\r\n\r\n\t jimport('joomla.utilities.date');\r\n\t $user =& JFactory::getUser();\r\n\r\n//\t if we have an anonymous user, then use global config, instead of the user params\r\n\t if($user->get('id')) {\r\n\t\t$tz = $user->getParam('timezone');\r\n\t } else {\r\n\t\t$conf =& JFactory::getConfig();\r\n\t\t$tz = $conf->getValue('config.offset');\r\n\t }\r\n\r\n\t $jdate = new JDate($strdate);\r\n\t $jdate->setOffset($tz);\r\n\t $formatDate = $jdate->toFormat($format);\r\n\t return $formatDate;\r\n\t}", "public function get($format = null)\n {\n \t$format = $format ? $format : self::$_format;\n \treturn date($format, $this->_date);\n }", "function outputDateFormat($date, $format = null) {\n if(empty($date)){\n return '';\n }\n if(!$format){\n $format = 'm/d/Y';\n }\n if ($date == config('custom.null_date') || $date == '0000-00-00') {\n return '';\n }\n if(!($date instanceof Carbon)) {\n if(is_numeric($date)) {\n // Assume Timestamp\n $date = Carbon::createFromTimestamp($date);\n } else {\n $date = Carbon::parse($date);\n }\n return Carbon::parse($date)->format($format);\n }\n return $date->setTimezone('US/Eastern')->format($format);\n }", "function FormatTime($format, $date) {\n global $LANG;\n $translate = [];\n $locale = SYSTEM::get('locale');\n if ($locale !== 'en') {\n $datetime = 'datetime'.$locale;\n foreach($LANG[$datetime] as $match => $replace) {\n $translate[$match] = $replace;\n }\n }\n $tz = USER::getUser('tz');\n return empty($translate) ? gmdate($format, $date + (3600 * $tz)) : strtr(gmdate($format, $date + (3600 * $tz)), $translate);\n}", "function pzdc_answer_created_at($echo = TRUE, $format = NULL) {\n global $PraizedCommunity;\n $out = $PraizedCommunity->tpt_attribute_helper('answer', 'created_at', FALSE);\n if ( strstr($format, '%'))\n $out = pzdc_date($out, $format);\n if ( $echo )\n echo $out;\n return $out;\n}", "public function getDate($format = \"d/m/Y\")\n {\n return date_i18n($format, strtotime($this->registered));\n }", "public function formatDate(\n $date = null,\n $format = \\IntlDateFormatter::SHORT,\n $showTime = false\n );", "function format_date($date, $format = Zend_Date::DATE_MEDIUM)\n{\n if (is_int($date)) {\n $sourceFormat = Zend_Date::TIMESTAMP;\n } else {\n $sourceFormat = Zend_Date::ISO_8601;\n }\n $dateObj = new Zend_Date($date, $sourceFormat);\n return $dateObj->toString($format);\n}", "public function date($format = null)\n {\n $date = get_post_time($format ?? get_option('date_format'), false, $this->wpPost, true);\n\n return $this->setAttribute(__METHOD__, $date);\n }", "public function date($date, $format = Zend_Date::DATE_LONG)\n {\n $date = new Zend_Date($date);\n return $date;\n }", "function helper_format_date($date, $format = APP_DATE_TIME_FORMAT){\n return date( $format, strtotime($date) );\n }", "public static function date($format = null)\n\t{\n\t\t$date = new Tiramizoo_Shipping_Model_Date();\n\t\treturn $date->get($format);\n\t}", "public function Format( $format ){\r\n\t\t\t$timestamp = $this->GetAsTimestamp();\r\n\t\t\t$date = null;\r\n\t\t\tif( $timestamp !== null ){\r\n\t\t\t\t$date = date( $format, $timestamp );\r\n\t\t\t}\r\n\t\t\treturn $date;\r\n\t\t}", "public static function __getFormatDate($date, $format = false, $style = \"d-m-Y\")\r\n\t{\r\n\t\t$style = ($style) ? $style : \"d-m-Y\" ;\r\n\t\tswitch ($format)\r\n\t \t{\r\n\t \t\tdefault:\r\n\t \t\t\t$new_date = ($date) ? date($style, $date) : date($style, mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\t\r\n\t \t\tcase \"time\":\r\n\t \t\t\t$new_date = ($date) ? date(\"H:i:s\", $date) : date(\"H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t \t\t\r\n\t\t\tcase \"with_time\":\r\n\t \t\t\t$new_date = ($date) ? date($style . \" H:i:s\", $date) : date($style . \" H:i:s\", mktime());\r\n\t \t\t\tbreak;\r\n\t\t\t\r\n\t \t\tcase \"short\":\r\n\t\t\t\t$new_date[\"d\"] = date(\"d\", $date);\r\n\t\t\t\t$new_date[\"m\"] = date(\"m\", $date);\r\n\t\t\t\t$new_date[\"y\"] = date(\"Y\", $date);\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t \t}\r\n\t return $new_date;\r\n\t}", "function date_i18n($format, $timestamp_with_offset = \\false, $gmt = \\false)\n {\n }", "public function formatDate($date = null);", "public static function format_date($date,$format) {\n \n return Yii::app()->dateFormatter->format($format, $date);\n }", "function date_format($date = \"\", $format = \"\") {\n if ($format == \"\")\n $format = \"Y-m-d H:i:s\";\n\n if ($date == \"\")\n return \"\";\n\n $converted = strtotime($date);\n\n if ($converted === false)\n return date($format, $date);\n else\n return date($format, $converted);\n }", "protected function _date4View($date, $format = 'd/m/Y') {\n if (!empty($date))\n return date($format, strtotime($date));\n else\n return null;\n }", "function format_date($format, $timestamp, $timezone, $lang = LANG_NO)\n{\n\tglobal $_date_translations, $_default_date_translations, $_lang;\n\t\n\t$translations = $_default_date_translations;\n\tif (is_valid_lang($lang) && $lang != $_lang)\n\t{\n\t\t$lang_code = get_lang_code($lang);\n\t\tif (!isset($_date_translations[$lang_code]))\n\t\t{\n\t\t\t$_date_translations[$lang_code] = include(__DIR__ . '/languages/' . $lang_code . '/date.php');\n\t\t}\n\t\t$translations = $_date_translations[$lang_code];\n\t}\n\n\tdate_default_timezone_set($timezone);\n\t$row = date($format, $timestamp);\n\tforeach ($translations as $eng => $localized)\n\t{\n\t\t$row = str_replace($eng, $localized, $row);\n\t}\n\treturn $row;\n}", "function userdate($date, $format='', $fixday = false) { // TBD: false???\n $timezone = 99;\n if ($user_record = get_record('user', 'id', $this->userid)) {\n //determine the user's timezone\n $timezone = php_report::get_user_timezone($user_record, $user_record->timezone);\n }\n\n //perform the formatting\n return userdate($date, $format, $timezone, $fixday);\n }", "function wp_date($format, $timestamp = \\null, $timezone = \\null)\n {\n }", "public function date_format_func($date,$format)\n\t{\n\t\t$date = str_replace(\"/\",\"-\",$date);\n\t\t$date_output = date($format,strtotime($date));\n\t\treturn $date_output;\n\t}" ]
[ "0.7029795", "0.686546", "0.66377497", "0.64296293", "0.6333258", "0.62527645", "0.6164469", "0.6120645", "0.6111242", "0.61034757", "0.6090205", "0.60514086", "0.6050627", "0.59989536", "0.59812903", "0.5976918", "0.5969996", "0.5947739", "0.59021217", "0.589873", "0.5893695", "0.58851445", "0.585695", "0.5840967", "0.58051497", "0.57952535", "0.57763684", "0.5775526", "0.5768302", "0.57599336" ]
0.7360215
0
hide all the additional fields
public function hideExtraField() { $this->houses=false; $this->jobs_training=false; $this->motorcycles =false; $this->cars = false; $this->offices=false; $this->lands_plots=false; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function hideFieldsForAddEdit()\n\t{\n\t\tif ($this->isAdd() || $this->isCopy() || $this->isGridAdd())\n\t\t\t$this->document_sequence->Visible = FALSE;\n\t}", "function block_editor_meta_box_hidden_fields()\n {\n }", "public function disableHideMetaboxes()\n\t\t{\n\t\t\techo \"<style type='text/css'>label[for='\" . $this->_id . \"-hide'] { display: none; }</style>\";\n\t\t}", "function drush_hide_output_fields($fields_to_hide = array()) {\n $already_hidden = drush_get_context('DRUSH_HIDDEN_OUTPUT_FIELDS');\n if (!is_array($fields_to_hide)) {\n $fields_to_hide = array($fields_to_hide);\n }\n $result = array_merge($already_hidden, $fields_to_hide);\n drush_set_context('DRUSH_HIDDEN_OUTPUT_FIELDS', $result);\n return $result;\n}", "function add_specific_form_fields() {\n\t\treturn false;\n\t}", "public function setHidden(){\n $this->_hidden = true;\n }", "function hideField($fieldName){\n\n\t\t$this->hidden[$fieldName] = \"hide\";\n\n\t}", "public function addHidden() {\n parent::createHiddenWithValidator(\"id\");\n }", "public function addHidden() {\n parent::createHiddenWithValidator(\"id\");\n }", "function hide()\n {\n $this->_hidden = true;\n }", "function extraFields() {\n\t\n\t\t$file_id = JRequest::getVar('id');\n\t\t$filename = JRequest::getVar('filename');\n\t\t\n\t\tif (!$filename) {\n\t\t\texit();\n\t\t}\n\t\t\n\t\t$model = $this->getModel();\n\t\t$form = $model->getFieldForm($file_id, 'bulk');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\">';\n\t\techo '<legend>Edit '.$filename.'</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function withHidden($hidden=true);", "public function extra_form_fields() {\n\t?>\n\t\t<tr valign=\"top\">\n\t\t\t<th scope=\"row\"><?php _e( 'Make slider featured randomly?', $this->textdomain ); ?></th>\n\t\t\t<td><input type=\"checkbox\" name=\"slider_featured\" value=\"1\" checked=\"checked\" /></td>\n\t\t</tr>\n\t<?php\n\t}", "function ssep_hide_meta_field( $fields ) {\n\n\t$fields[] = array(\n\t\t'id' => '_ss_hide_meta',\n\t\t'name' => __( 'Hide Meta' ),\n\t\t'type' => 'checkbox',\n\t\t'desc' => __( 'Hide meta info for this post.', 'shoestrap' )\n\t);\n\n\treturn $fields;\n}", "public function getHiddenFields()\n {\n return [\n 'createdAt',\n 'updatedAt',\n 'version',\n 'locale'\n ];\n }", "function marco_comment_form_hidden_fields()\n {\n comment_id_fields();\n if ( current_user_can( 'unfiltered_html' ) )\n {\n wp_nonce_field( 'unfiltered-html-comment_' . get_the_ID(), '_wp_unfiltered_html_comment', false );\n }\n }", "public function transactionFormGetHiddenFields ();", "function hideField($fieldname)\n\t{\n\t\tif (is_array($fieldname))\n\t\t{\n\t\t\tforeach($fieldname as $name)\n\t\t\t{\n\t\t\t\t$this->hideField($fieldname);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($this->table->fields[$fieldname]))\n\t\t\t{\n\t\t\t\t$this->table->fields[$fieldname]->listshow = false;\n\t\t\t\t$this->table->fields[$fieldname]->formshow = false;\n\t\t\t}\n\t\t\telse\n\t\t\t\ttrigger_error(\"No field exists with the name: $fieldname\");\n\t\t}\n\t}", "function the_block_editor_meta_box_post_form_hidden_fields($post)\n {\n }", "function wpvideocoach_hide_introduction_disable_fields()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 1){\r\n\t\techo \"disabled='disabled'\";\r\n\t}\r\n}", "public function hide() {\n\t\treturn true;\n\t}", "public function hide() {\n\t\treturn true;\n\t}", "private function getHiddenFieldsWithoutAccess(): array\n\t{\n\t\treturn [\n\t\t\t'STORE_TO',\n\t\t\t'STORE_TO_INFO',\n\t\t\t'STORE_TO_TITLE',\n\t\t\t'STORE_TO_AMOUNT',\n\t\t\t'STORE_TO_RESERVED',\n\t\t\t'STORE_TO_AVAILABLE_AMOUNT',\n\t\t\t'STORE_FROM',\n\t\t\t'STORE_FROM_INFO',\n\t\t\t'STORE_FROM_TITLE',\n\t\t\t'STORE_FROM_AMOUNT',\n\t\t\t'STORE_FROM_RESERVED',\n\t\t\t'STORE_FROM_AVAILABLE_AMOUNT',\n\t\t\t'PURCHASING_PRICE',\n\t\t\t'BASE_PRICE',\n\t\t\t'TOTAL_PRICE',\n\t\t\t'AMOUNT',\n\t\t];\n\t}", "public function isHidden() {\n return false;\n }", "public function getModlogOmitFields();", "public function updateEditableFields() {\n\t\t$allowedFields = $this->config()->allowed_field_types;\n\t\tif ($allowedFields) {\n\t\t\t$fieldClasses = singleton('EditableFormField')->getEditableFieldClasses();\n\t\t\tforeach($fieldClasses as $fieldClass => $fieldTitle) {\n\t\t\t\tif (!in_array($fieldClass, $allowedFields)) {\n\t\t\t\t\tConfig::inst()->update($fieldClass, 'hidden', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Explicitely allow fields, so subclasses show up\n\t\t\tforeach($allowedFields as $fieldClass) {\n\t\t\t\tConfig::inst()->update($fieldClass, 'hidden', false);\n\t\t\t}\n\t\t}\n\t}", "public function useAllFields() {\n $this->__onlyFields = array();\n }", "public function extraFields()\n {\n return [\n 'modals',\n 'modal_windows',\n ];\n }", "public function hideFromDetail(): Field\n {\n $this->showOnDetail = false;\n\n return $this;\n }", "function osa_form_alter_group_class_node_form(&$form, &$form_state) {\r\n \r\n // hide fields that are auto populated\r\n hide($form['field_event_summary']);\r\n hide($form['body']);\r\n}" ]
[ "0.78019714", "0.7149522", "0.6889631", "0.6883819", "0.684302", "0.6729229", "0.66946036", "0.6664629", "0.6664629", "0.66048455", "0.655331", "0.6448749", "0.644795", "0.6430207", "0.64134943", "0.64083785", "0.6375005", "0.6307153", "0.62356997", "0.6203117", "0.6179247", "0.6179247", "0.6178295", "0.6148884", "0.6102531", "0.6100188", "0.60794294", "0.6076475", "0.606152", "0.6055409" ]
0.8430341
0
Creates a new Ora model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Ora(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->ora_id]); } return $this->render('create', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Ocorrencia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Avisa_rotina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Alocacao;\n $modelAmbienteUso = new Ambiente_Uso();\n $modelAmbienteRecurso = new Ambiente_Recurso();\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $model->HR_INI = intval(str_replace(':', '', $model->HR_INI));\n $model->HR_FIM = intval(str_replace(':', '', $model->HR_FIM));\n if ($model->HR_INI < $model->HR_FIM) {\n //verificar se está disponível\n if ($model->validate()) {\n $existAlocacao = Alocacao::model()->isEmpty($model->DT_DIA, $model->ID_AMBIENTE, $model->HR_INI, $model->HR_FIM);\n if ($existAlocacao == false) {\n\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }else {\n //senão apresentar flash\n MethodUtils::setMsgErro(false, 'horário não disponível', get_class($model));\n }\n }\n } else {\n MethodUtils::setMsgErro(false, 'Hora inicial maior que hora final', get_class($model));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelUsuario,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio,\n 'modelAR' => $modelAmbienteRecurso\n ));\n }", "public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new OperaPlanes;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['OperaPlanes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['OperaPlanes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n$this->layout='//layouts/column2';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new IhubAbsence();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'idOpr' => $model->idOpr, 'tglabsence' => $model->tglabsence, 'ibadah' => $model->ibadah]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Razas();\n\n if (Yii::$app->request->isAjax) {\n \\Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n $especie_id = Yii::$app->request->post('especie_id');\n $nombre_raza = Yii::$app->request->post('raza');\n Razas::find()->where(['especie_id' => $especie_id])->andWhere(['raza' => $nombre_raza])->one();\n if (Razas::find()->where(['especie_id' => $especie_id])->andWhere(['raza' => $nombre_raza])->one() === null) {\n $model->especie_id = $especie_id;\n $model->raza = $nombre_raza;\n $model->save();\n return $this->renderAjax('/razas/_listaRazas', [\n 'items' => (Especies::findOne($especie_id))->razas,\n ]);\n }\n throw new Exception('Ya existe una raza con ese nombre.');\n }\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'especies' => Especies::todas(),\n ]);\n }", "public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new ARTICULOS;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ARTICULOS']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ARTICULOS'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Rents();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Apresentacao();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction() {\n $model = new Application_Model_Compromisso();\n //persisto os dados no banco\n $model->insert($this->_getAllParams());\n //redireciono para o index\n $this->_redirect('compromisso/index');\n }", "public function actionCreate() {\n $model = new Aviso;\n if (isset($_POST['Aviso'])) {\n $model->attributes = $_POST['Aviso'];\n #$nombre = $model->titulo;\n $fecha = Aviso::model()->getFechaRegistro();\n $model->fecha_publicacion = $fecha->readColumn(0);\n $adjuntos = $_FILES;\n $temp=$adjuntos['adjunto']['tmp_name'];\n if ($model->save()) {\n if (count($adjuntos['adjunto']['name']) > 0) { \n $this->guardarAdjuntos($adjuntos['adjunto']['name'], $model,$temp);\n }\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate()\n\t{\n\t\t$model=new AutoChores;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t$dataProvider = new CActiveDataProvider('AutoChores',array('sort'=>array('defaultOrder'=>'description ASC, farm_herd asc')));\n\t\t$dataProvider->setPagination(false);\n\t\tif(isset($_POST['AutoChores']))\n\t\t{\n\t\t\t$model->attributes=$_POST['AutoChores'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('create'));\n\t\t}\n\n\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t 'dataProvider'=>$dataProvider,\n\t\t));\n\t}", "public function actionCreate()\n {\n if(\\Yii::$app->user->can('gerenciamento-cadastros-basicos')){\n $model = new Pessoa();\n $alerta = \"Pessoa já cadastrada\";\n \n \n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $validacpf = Pessoa::find()->where(['cpf' => $model->cpf])->one();\n if($validacpf == true){\n return $this->redirect(['create',\n 'model' => $model, 'alerta' => $alerta\n ]);\n }else{\n\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n }else{\n return $this->render('create', [\n 'model' => $model, \n ]);\n }\n }else {\n throw new \\yii\\web\\ForbiddenHttpException('Você não está autorizado a realizar essa ação.');\n }\n \n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new OaPosition();\n $oaposition=OaSchool::find()->andWhere(['school_softdel'=>'1'])->all();\n $oadepartment=OaDepartment::find()->andWhere(['dep_softdel'=>'1'])->all();\n //获取当前控制器和action名称\n $controller = Yii::$app->controller->id;\n $action = Yii::$app->controller->action->id;\n $not=$this->whether($controller,$action);\n if($not!='yes')\n {\n \\Yii::$app->getSession()->setFlash('success', '对不起,您没有删除校区的权限'); \n return $this->redirect(['index']);\n }\n if ($model->load(Yii::$app->request->post()) && $model->validate() ) {\n $tree=new OaTree();\n $tree->name=Yii::$app->request->post('OaPosition')['pos_name'];\n $scid=Yii::$app->request->post('OaPosition')['dep_id'];\n $scname=OaTree::find()->select('id')->where(['dep_id'=>$scid])->asarray()->one();\n if($model->save())\n { \n $ww=$model->primaryKey;\n $tree->fid=$scname['id']; \n $tree->pos_id=$ww;\n $tree->status='1';\n $tree->save();\n \\Yii::$app->getSession()->setFlash('success', '添加成功'); \n }\n else\n {\n \\Yii::$app->getSession()->setFlash('error', '添加失败'); \n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'oaposition'=>$oaposition,\n 'oadepartment'=>$oadepartment,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new RefJkel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n $id_livro = $_REQUEST['id_livro'];\n\n $model=new emprestimo;\n\n if(isset($_POST['emprestimo']))\n {\n $emprestimo = $_POST['emprestimo'];\n $emprestimo['id_livro'] = $id_livro;\n $emprestimo['data_retirada'] = date('Y-m-d',strtotime(str_replace('/', '-', $emprestimo['data_retirada'])));\n $emprestimo['data_devolucao'] = date('Y-m-d',strtotime(str_replace('/', '-', $emprestimo['data_devolucao'])));\n \n $model->attributes=$emprestimo;\n \n if($model->save())\n $this->redirect(array('/bibliotecas/livro/view','id'=>$model->id_livro));\n }\n\n $aluno = aluno::model()->findByPk($model->id_aluno);\n $livro = livro::model()->findByPk($id_livro);\n \n $biblioteca = biblioteca::model()->findByPk($livro->id_biblioteca);\n\n $this->render('create',array(\n 'model'=>$model, 'aluno'=>$aluno,'livro'=>$livro,'biblioteca'=>$biblioteca,\n ));\n\t}", "public function actionCreate()\n\t{\n\t\t$this->layout='//layouts/column2';\n\t\t$model=new RekruitmenMaba;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['RekruitmenMaba']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RekruitmenMaba'];\n\t\t\tif($model->save()){\n\t\t\t\tif($model->lampiran){\n\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_rmaba));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'manajemen'=>'manajemen',\n\t\t));\n\t}", "public function actionCreate()\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest) {\n\t\t\t\t$modelTopografi = new Topografi;\n\n\t\t\t\tif ($_POST) {\n\t\t\t\t\t$modelTopografi['datar']=$_POST['datar'];\n\t\t\t\t\t$modelTopografi['bergelombang']=$_POST['bergelombang'];\n\t\t\t\t\t$modelTopografi['curam']=$_POST['curam'];\n\t\t\t\t\t$modelTopografi['sgtcuram']=$_POST['sgtcuram'];\n\t\t\t\t\t$modelTopografi['tinggidpl']=$_POST['tinggidpl'];\n\t\t\t\t\t$modelTopografi->save();\n\t\t\t\t}\n\n\t\t\t\t$this->render('create');\n\t\t\t}\n\t\t}", "public function actionCreate()\n {\n $model = new Producto();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_prodcto]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model = new Route();\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->save();\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new TaPeriode();\n $pemda = \\common\\models\\TaPemdaUmum::find()->where('ID = (SELECT(MAX(ID)) FROM ta_pemda_umum)')->one();\n $model->ID_Tahun = (\\common\\models\\TaPeriode::find()->select('MAX(ID_Tahun) AS ID_Tahun')->one()['ID_Tahun']) + 1;\n $model->Kd_Prov = $pemda->Kd_Prov;\n $model->Kd_Kab_Kota = $pemda->Kd_Kab_Kota;\n //var_dump($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'ID_Tahun' => $model->ID_Tahun, 'Kd_Prov' => $model->Kd_Prov, 'Kd_Kab_Kota' => $model->Kd_Kab_Kota]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.7379511", "0.7269288", "0.724252", "0.7242053", "0.720272", "0.7155753", "0.71260834", "0.7086938", "0.7065825", "0.7060445", "0.7054933", "0.7049293", "0.7040371", "0.70306695", "0.70282245", "0.6992228", "0.6941502", "0.6924051", "0.69131786", "0.6911839", "0.6897251", "0.68771785", "0.68739176", "0.68509614", "0.682414", "0.68178624", "0.6814975", "0.68118376", "0.6803296", "0.6796315" ]
0.8534152
0
/ Name: Power of K Description: Check if a given number is a power of k. Date: 20181003
function isPowerOf($number, $k) { $check = false; while($number > 0) { $digit = $number % $k; if($digit > 1) return false; if($digit == 1) { if($check) return false; $check = true; } $number /= $k; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function power($base,$n){\r\n $x=pow($base,$n);\r\n return $x;\r\n}", "function elevaralcubo($num1){\n \n $res=pow($num1,3);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }", "static function powerOfTwo($n)\n { \n if ($n >= 0 && $n < 31) {\n $pow = 2**$n;\n $all = 0; $count = 1;\n while($all != $pow)\n {\n $all = 2** $count;\n echo $all.\"\\n\";\n $count++;\n }\n } else {\n echo \"enter value between 0 to 31\".\"\\n\";\n Utility::powerOfTwo();\n }\n \n }", "function elevaralcuadrado($num1){\n \n $res=pow($num1,2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }", "function elevar($num1,$num2){\n \n $res=pow($num1,$num2);\n \n print \"El resultado es \".$res.\"<br>\";\n \n }", "function next_pow($number)\n{\n if($number < 2) return 1;\n for($i = 0 ; $number > 1 ; $i++)\n {\n $number = $number >> 1;\n }\n return 1<<($i+1);\n}", "function isPowerOfTwo($num2)\n {\n if ($num2 === 0) {\n $return = 0;\n }\n while ($num2 != 1) {\n if ($num2 % 2 != 0)\n $return = 0;\n $num2 = $num2 / 2;\n }\n $return = 1;\n }", "protected function hasExponent() {}", "public function hasPower(){\n return $this->_has(4);\n }", "function variant_pow($left, $right) {}", "function power($num1, $num2){\n if($num2 == 0){\n return 1;\n }\n if($num2 == 1){\n return $num1;\n }\n // echo \" return $num1 * power($num1, $num2-1)<br>\"; //Debug Info\n return $num1 * power($num1, $num2-1);\n }", "public static function powm($a, $x, $p) {\n $result = 1;\n $c = $a;\n while($x) {\n if ($x & 1) {\n $result = $result * $c % $p;\n }\n $x >>= 1;\n $c = $c * $c % $p;\n }\n return $result;\n }", "public function exponent();", "function checkRecursive($x, $n, $curr_num = 1,$curr_sum = 0)\n{\n // Initialize number of ways to express\n // x as n-th powers of different natural\n // numbers\n $results = 0;\n \n // Calling power of 'i' raised to 'n'\n $p = power($curr_num, $n);\n $p + $curr_sum;\n while ($p + $curr_sum < $x)\n {\n // Recursively check all greater values of i\n $results += checkRecursive($x, $n, $curr_num+1,$p+$curr_sum);\n $curr_num++;\n $p = power($curr_num, $n);\n }\n \n // If sum of powers is equal to x\n // then increase the value of result.\n echo $p + $curr_sum;\n echo \"\\n\";\n if ($p + $curr_sum == $x)\n $results++;\n \n // Return the final result\n return $results;\n}", "public function intMultiply( $k, $base = 0 );", "function modpow($a, $b, $m){\n\t\tif ($b == 0) return 1%$m;\n\t\t$tmp = modpow($a,$b/2,$m);\n\t\tif ($b%2 == 0) return $tmp*$tmp%$m;\n\t\treturn (($tmp*$tmp%$m)*$a)%$m;\n\t}", "function kpk($a,$b){\n\t\treturn ($a / fpb($a,$b)) * $b;\n\t}", "public function pow($base, $exponent);", "public function getPower() {\r\n // TODO\r\n return 1;\r\n }", "function power($base,$exp)\n {\n\n if (($exp < 0) || ($base < 0)){\n\n\n throw new Exception('n and p should be non-negative');\n }\n return pow($base,$exp);\n }", "final public function rabin_miller_primality_test($number, $k = 100)\n {\n $number = (int) $number;\n /* base cases - order matters - working with numbers greater than 3 */\n if ($number < 2) {\n return false;\n }\n\n if ($number === 2 || $number === 3) {\n return true;\n }\n\n if ($number % 2 === 0) {\n return false;\n }\n\n /* array for memoization */\n $verified = [];\n list($t, $u) = $this->rabin_miller_vars($number - 1);\n $r = $t - 1;\n do {\n if (count($verified) == $number - 2) {\n /* break do loop */\n $k = 0;\n } else {\n /* get a new unique base */\n do {\n $base = Math::random(2, $number - 1);\n } while (in_array($base, $verified));\n /* memoize the base and get another unique base */\n $verified[] = $base;\n $witness = Math::mod_pow($base, $u, $number);\n if ($witness != 0 && $witness !== 1 && $witness !== $number - 1) {\n for ($i = 1; $i <= $t; $i++) {\n $prev_witness = $witness;\n $witness = Math::mod_pow($witness, 2, $number);\n if ($witness == 1) {\n /* Determine if Non-trivial square root */\n if ($prev_witness != 1 && $prev_witness != $number - 1) {\n /* composite */\n return false;\n } else {\n /* loop again for accuracy */\n $i = $t;\n }\n } else if ($i == $t && $witness != 1) {\n /* composite */\n return false;\n }\n }\n }\n }\n } while (--$k > 0);\n /* most likely a prime */\n return true;\n }", "function calculate_pow($min, $max) {\n for($count = $min; $count <= $max; $count++) {\n echo \"Val : $count , $count<sup>2</sup> : \" . pow($count, 2) . \"<br>\";\n }\n}", "public static function powerOfTwo($num)\n {\n $pow = pow(2, $num);\n $res = 0;\n echo \"powers of 2 are \\n\";\n\n /**power's of 2 upto given input */\n for ($i = 0; $i <= $num; $i++) {\n echo pow(2, $i) . \"\\n\";\n }\n\n }", "function verteilung2($n) {\n return (powInt($n, 7/4));\n}", "function sumOfNth($nPower,$num)\n{\n\t$digitsArr = str_split((string)$num);\n\t$nthPower = function($n) use ($nPower){return pow($n,$nPower);};\n\treturn array_sum(array_map($nthPower,$digitsArr));\n}", "public static function isPowerOfTwo($number) {\n return ($number & ($number - 1)) == 0;\n }", "function candies($n, $m) {\n $result = 0; \n $result = intval($m/$n); \n $result = $n * $result; \n return $result;\n}", "function nonDivisibleSubset($k, $s) {\n $set = array_map(function($item) use($k) {return $item % $k;}, $s);\n $numbers = array_pad([], $k, 0);\n foreach($s as $item)\n {\n $numbers[$item % $k]++;\n }\n\n ksort($numbers);\n $hasEvenlyDivisible = $numbers[0] ? 1 : 0;\n $result = 0;\n unset($numbers[0]);\n foreach($numbers as $item => $itemsCount)\n {\n if($item > floor($k / 2))\n {\n break;\n }\n if($item == $k - $item)\n {\n $result += $itemsCount ? 1 : 0;\n }\n else\n {\n $result += max($itemsCount, $numbers[$k - $item]);\n }\n }\n\n return $result ? $result + $hasEvenlyDivisible : 0;\n\n}", "function isKrishnamurthyNumber($n) \r\n{ \r\n $sum = 0; \r\n \r\n // Storing the value in \r\n // other variable \r\n $temp = $n; \r\n \r\n while($temp != 0) \r\n { \r\n // calculate factorial of last digit \r\n // of temp and add it to sum \r\n $sum = $sum + factorial($temp % 10); \r\n \r\n // Integer Division \r\n // replace value of temp by temp/10 \r\n $temp = intdiv($temp, 10); \r\n } \r\n \r\n // Check if number is krishnamurthy \r\n return $sum == $n; \r\n}", "function testFunction($n) {\n\treturn ($n * $n * $n);\n}" ]
[ "0.6677741", "0.6453918", "0.643831", "0.63851243", "0.63441986", "0.6291515", "0.62561446", "0.6187342", "0.6181521", "0.6160313", "0.611166", "0.5981184", "0.59737355", "0.5945893", "0.5941851", "0.5928495", "0.59120536", "0.5875188", "0.58676165", "0.58524734", "0.58121467", "0.57997406", "0.5763544", "0.5692183", "0.5660235", "0.5636196", "0.5604542", "0.56008697", "0.5533088", "0.5494359" ]
0.8458784
0
Adds as nameValueList Each NameValueList container will contain one aspect of a motor vehicle that is compatible with the motor vehicle part or accessory. For example, the allowed names might include 'Year', 'Make', and 'Model', 'Trim', and 'Engine'.
public function addToNameValueList(\Nogrod\eBaySDK\Shopping\NameValueListType $nameValueList) { $this->nameValueList[] = $nameValueList; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToVariationSpecifics(\\Nogrod\\eBaySDK\\Shopping\\NameValueListType $nameValueList)\n {\n $this->variationSpecifics[] = $nameValueList;\n return $this;\n }", "public function setNameValueList(array $nameValueList)\n {\n $this->nameValueList = $nameValueList;\n return $this;\n }", "public function getNameValueList()\n {\n return $this->nameValueList;\n }", "function addSelectListArrays($name, $val_list, $txt_list, $selected_value = NULL, $header = NULL, $attr_ar = array() ) { \n $option_list = array_combine( $val_list, $txt_list ); \n $str = $this->addSelectList($name, $option_list, true, $selected_value, $header, $attr_ar ); \n return $str; \n }", "public function addMultiValue($strName, $value, $valueName=\"\")\r\n {\r\n $oldval = $this->getValue($strName);\r\n $oldvalName = $this->getValueNames($strName);\r\n\r\n if (!isset($this->values[$strName]))\r\n $this->values[$strName] = array();\r\n\r\n // Check to make sure we do not already have this value added\r\n for ($i = 0; $i < count($this->values[$strName]); $i++)\r\n {\r\n \tif (!empty($this->values[$strName][$i]) && $value == $this->values[$strName][$i])\r\n \t{\r\n \t\t// The value was already added and they need to be unique\r\n\r\n \t\t// Update valueName just in case it has changed\r\n \t\tif ($valueName)\r\n \t\t\t$this->fkeysValues[$strName][$value] = $valueName;\r\n\r\n \t\t// Do not add an additional value\r\n \t\treturn;\r\n \t}\r\n }\r\n \r\n // Set the value\r\n $this->values[$strName][] = $value;\r\n\r\n if ($valueName)\r\n {\r\n // Make sure we initialize the arrays if not already set\r\n if (!isset($this->fkeysValues[$strName]))\r\n $this->fkeysValues[$strName] = array();\r\n\r\n if (!isset($this->fkeysValues[$strName][$value]))\r\n $this->fkeysValues[$strName][$value] = array();\r\n\r\n $this->fkeysValues[$strName][$value] = $valueName;\r\n }\r\n\r\n // Log changes\r\n $this->logFieldChanges($strName, $this->values[$strName], $oldval, $oldvalName);\r\n }", "public function attributeValueLists()\r\n {\r\n throw new NotSupportedException('attributeValueLists Method should be overidded');\r\n }", "public function addItem($name, $value)\n {\n $this->elements[] = ['name' => $name, 'value' => $value];\n }", "protected function addNamesLabelsValues() {\n foreach ($this->__fields() as $field) {\n $this->$field->__name = $field;\n if (!$this->$field->label && $this->$field->label !== '') $this->$field->label = strtoupper($field[0]) . substr ($field, 1);\n $this->setFieldValue($field);\n $this->$field->setForm($this);\n }\n }", "function appendMetadataValueList(&$md, $onlyActive = true) {\n if(is_a($md, 'Docman_ListMetadata')) {\n $mdLoveFactory = new Docman_MetadataListOfValuesElementFactory();\n $mdLoveArray = $mdLoveFactory->getListByFieldId($md->getId(), $md->getLabel(), $onlyActive);\n $md->setListOfValueElements($mdLoveArray);\n }\n }", "function listjs_prepare_list_value_names($list_id, array $value_names) {\n $listjs_list_value_names = &drupal_static('listjs_list_value_names', []);\n\n // We make sure that value names settings are not overridden, new settings are\n // only appended.\n // This fixes the problem of settings getting overridden if there are multiple\n // listjs widgets in a single page.\n if (empty($listjs_list_value_names[$list_id])) {\n $listjs_list_value_names[$list_id] = $value_names;\n }\n\n return $listjs_list_value_names;\n}", "function ajan_core_add_illegal_names() {\n\tupdate_site_option( 'illegal_names', get_site_option( 'illegal_names' ), array() );\n}", "private function registerUsableFields(): void\n {\n $this->attributeList = $this->filterSystemControlFields(\n \\get_object_vars($this)\n );\n }", "public function addAttribute($name, $value)\n {\n if (is_scalar($value)) {\n $value = explode(' ', (string) $value);\n }\n $name = htmlspecialchars($name, ENT_QUOTES);\n if (false==$this->hasAttribute($name)) {\n $this->attributes[$name] = array();\n }\n foreach ($value as $v) {\n if (!in_array($v, $this->attributes[$name])) {\n $this->attributes[$name][] = $v;\n }\n }\n }", "public static function byName($name, $primaryList = self::LIST_AGL) {}", "public function setNames($names) {}", "public function merge_validater_value_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_value_arr[$k] = $v;\n }\n }", "public function rules()\n {\n $namesArr = [];\n if($this->vote_id){\n $vote = Vote::find($this->vote_id);\n if($vote){\n $input = $this->all();\n $input['name'] = trim($input['name']);\n $this->merge($input);\n\n $existedVoteItems = $vote->voteitems()->get()->toArray();\n foreach ($existedVoteItems as $voteItem){\n $namesArr[] = $voteItem['name'];\n }\n }\n\n };\n $stringOfVoteItemsNames = implode(\",\", $namesArr);\n $rules = [\n 'vote_id' => 'required|exists:votes,id|integer',\n 'name' => 'required',\n 'user_id' => 'required|integer',\n ];\n if($stringOfVoteItemsNames){\n $rules['name'] .= '|not_in:' . $stringOfVoteItemsNames;\n }\n return $rules;\n }", "static function renderListField($name, $values = null, $attributes = null, $acOptions = null, $suggest_label = null)\n {\n echo '<li>';\n $literalValue = (is_array($values)) ? implode('|', $values) : null;\n self::renderHiddenField($name, $literalValue, array('id' => $name));\n if (!is_array($attributes)) $attributes = array();\n $attributes['onkeydown'] = '_wcmAddElement(this, \\'' . $name . '\\', event);';\n $attributes['type'] = 'text';\n\n $css_clear = '';\n if (is_array($acOptions) && isset($acOptions['css_clear']))\n {\n $css_clear = ' style=\"clear:'.$acOptions['css_clear'].'\"';\n unset($acOptions['css_clear']);\n }\n\n if (is_array($acOptions) && isset($acOptions['url']))\n {\n // generate auto-completed field\n $url = $acOptions['url'];\n unset($acOptions['url']);\n self::renderAutoCompletedField($url, '_acf_'.uniqid(), '', null, $attributes, $acOptions, true);\n }\n else\n {\n // standard input text\n self::renderSingleTag('input', $attributes); \n }\n \n echo '<a href=\"#\" onclick=\"_wcmAddElement($(this).previous(\\'input\\'), \\'' . $name . '\\', null); return false;\" class=\"list-builder\"><span>' . _BIZ_ADD . '</span></a>';\n if($suggest_label)\n echo '<a id=\"'.$name.'_link\" href=\"#\" onclick=\"openmodal(\\'' . $suggest_label . '\\'); modalPopup(\\'tme\\',\\''.$name.'\\', \\'\\', null, \\''.$name.'\\'); return false;\" class=\"list-builder\"><span>'._BIZ_SUGGEST.'</span></a>';\n \n echo '<ul class=\"tags\">';\n if (is_array($values))\n {\n foreach ($values as $value)\n {\n if (trim($value) != '')\n {\n echo '<li'.$css_clear.'><a href=\"#\" onclick=\"_wcmDeleteElement($(this).up(), \\'' . $name . '\\'); return false;\"><span>' . _DELETE . '</span></a> <em>' . $value . '</em></li>';\n }\n }\n } \n echo '</ul>';\n echo '</li>';\n }", "function ProcessEnumList($Name, $ValidValues, $List) //Check enum values and return as stringified list\n{\n\tif(is_string($List)) //Turn a string into an array with 1 item\n\t\t$List=Array($List);\n\tif(count(array_intersect($List, $ValidValues))==count($List)) //If all items are valid, return the stringified list\n\t\treturn implode(',', $List);\n\texit('Invalid values in \"'.$Name.'\" enum: '.implode(', ', $List));\n}", "public function _getAllowedValueList()\n {\n return self::$valueList;\n }", "function addDisplayValues($valueList){\n\t\t \n\t\t $vocabTerms = $this->vocabTerms;\n\t\t if(is_array($vocabTerms) && is_array($valueList)){\n\t\t\t\t$newValueList = array();\n\t\t\t\tforeach($valueList as $valArray){\n\t\t\t\t\t foreach($vocabTerms as $term){\n\t\t\t\t\t\t if($valArray[\"value\"] == $term[\"value\"]){\n\t\t\t\t\t\t\t\tif($term[\"displayValue\"] != false){\n\t\t\t\t\t\t\t\t\t $valArray[\"displayValue\"] = $term[\"displayValue\"];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t $newValueList[] = $valArray;\n\t\t\t\t}\n\t\t\t\tunset($valueList);\n\t\t\t\t$valueList = $newValueList;\n\t\t\t\tunset($newValueList);\n\t\t }\n\t\t \n\t\t return $valueList;\n\t }", "public function setLegAirlinesNames(array $value): self\n {\n $this->LegAirlinesNames = $value;\n\n return $this;\n }", "public function action_addList() {\n $data = Arr::extract($_POST, array('listname', 'rating', 'description', 'typelist'));\n //Arr::_print($data);\n //$data['name'] = trim($this->request->post('listname'));\n// $rating = trim($this->request->post('rating'));\n// $description = trim($this->request->post('description'));\n// $type = $this->reques->post('type');\n if(!$this->user->id) exit('error - action_addList - not user');\n \n $list_id = Model::factory('ElectList')->add($this->user->id, $data);\n\n $res = Model::factory('ElectUserList')->add($this->user->id, $list_id);\n if(!$res) exit('error - action_addList');\n else $this->redirect('/');\n }", "public function setLegOperatingAirlinesNames(array $value): self\n {\n $this->LegOperatingAirlinesNames = $value;\n\n return $this;\n }", "protected function addName()\n {\n $this->add(array(\n 'name' => 'name',\n 'required' => true,\n 'validators' => array(\n array(\n 'name' => 'Zend\\Validator\\StringLength',\n 'options' => array(\n 'min' => 4,\n 'max' => 128,\n ),\n ),\n ),\n 'filters' => array(\n array('name' => 'Zend\\Filter\\HtmlEntities'),\n array('name' => 'Zend\\Filter\\StringTrim'),\n array('name' => 'Zend\\Filter\\StripTags'),\n ),\n ));\n \n return $this;\n }", "public function getServiceNameAllowableValues()\n {\n return [\n self::SERVICE_NAME_BOUNTY_MISSIONS,\n self::SERVICE_NAME_ASSASSINATION_MISSIONS,\n self::SERVICE_NAME_COURIER_MISSIONS,\n self::SERVICE_NAME_INTERBUS,\n self::SERVICE_NAME_REPROCESSING_PLANT,\n self::SERVICE_NAME_REFINERY,\n self::SERVICE_NAME_MARKET,\n self::SERVICE_NAME_BLACK_MARKET,\n self::SERVICE_NAME_STOCK_EXCHANGE,\n self::SERVICE_NAME_CLONING,\n self::SERVICE_NAME_SURGERY,\n self::SERVICE_NAME_DNA_THERAPY,\n self::SERVICE_NAME_REPAIR_FACILITIES,\n self::SERVICE_NAME_FACTORY,\n self::SERVICE_NAME_LABORATORY,\n self::SERVICE_NAME_GAMBLING,\n self::SERVICE_NAME_FITTING,\n self::SERVICE_NAME_PAINTSHOP,\n self::SERVICE_NAME_NEWS,\n self::SERVICE_NAME_STORAGE,\n self::SERVICE_NAME_INSURANCE,\n self::SERVICE_NAME_DOCKING,\n self::SERVICE_NAME_OFFICE_RENTAL,\n self::SERVICE_NAME_JUMP_CLONE_FACILITY,\n self::SERVICE_NAME_LOYALTY_POINT_STORE,\n self::SERVICE_NAME_NAVY_OFFICES,\n self::SERVICE_NAME_SECURITY_OFFICE,\n ];\n }", "public function setAddressListHeader($name, $value)\n {\n /** @var AbstractAddressList $header */\n $header = $this->getHeader($name);\n $addresslist = new AddressList();\n $addresslist->addFromString($value);\n $header->setAddressList($addresslist);\n }", "public function makeFieldList() {}", "function fill_in_additional_list_fields()\r\n\t{\r\n\t}", "protected static function _byName($name, $primaryList = self::LIST_AGL) {}" ]
[ "0.62470245", "0.58686453", "0.5650229", "0.5255624", "0.5217573", "0.50035304", "0.4817537", "0.47952327", "0.47827446", "0.47824395", "0.47639996", "0.4762729", "0.4738813", "0.47280136", "0.47238076", "0.4712732", "0.46954393", "0.46932048", "0.4690789", "0.46863458", "0.46782398", "0.46420214", "0.46374947", "0.46287856", "0.4606014", "0.45699847", "0.4538235", "0.45363003", "0.45289588", "0.45255357" ]
0.6080847
1
unset nameValueList Each NameValueList container will contain one aspect of a motor vehicle that is compatible with the motor vehicle part or accessory. For example, the allowed names might include 'Year', 'Make', and 'Model', 'Trim', and 'Engine'.
public function unsetNameValueList($index) { unset($this->nameValueList[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeMultiValue($strName, $value)\r\n {\r\n // TODO: remove the value from the multi-value array\r\n }", "public function setNameValueList(array $nameValueList)\n {\n $this->nameValueList = $nameValueList;\n return $this;\n }", "public function unsetName(): void\n {\n $this->name = [];\n }", "public function unsetName(): void\n {\n $this->name = [];\n }", "public function unsetName(): void\n {\n $this->name = [];\n }", "public function unsetName(): void\n {\n $this->name = [];\n }", "public function remove($name)\n {\n unset($this->values[$name]);\n\t}", "public function offsetUnset($name)\n {\n if (array_key_exists($name, $this->values)) {\n unset($this->values[$name], $this->raw[$name], $this->factories[$name]);\n }\n }", "public function __unset( string $name ) {\n\t\t$this->data = array_diff_key( $this->data, [ $name => $this->data[ $name ] ] );\n\t}", "public function __unset($name)\n {\n // Dont' allow to unset attributes Ruts\n }", "public function unique($names, $value, array $tags = []);", "public function reset()\n {\n $this->values[self::NAME] = null;\n $this->values[self::VALUE] = array();\n $this->values[self::OPTIONS] = null;\n $this->values[self::RESERVED_RANGE] = array();\n $this->values[self::RESERVED_NAME] = array();\n }", "public function __unset($_name);", "function __unset($name)\n {\n unset($this->item[$name]);\n }", "public function removeValue(string $name): bool;", "public function __unset($name)\n {\n \tunset($this->_data[$name]);\n }", "public function cleanTanks($list=[])\n {\n $option = $this->rules()->getCleaningRule();\n $inventory = $this->inventory;\n\n $warmDeposits = collect($inventory->tanks)->each(function($item, $key) use ($list, $option){\n if (in_array($key, $list) || ($option == 'optimized' && ($item->contains == 'warmSoda' || $item->contains == 'damagedSoda')) || $item->quantity == 0)\n {\n $item->contains = 'water';\n $item->quantity = 0;\n } \n return;\n });\n\n $this->inventory = $inventory;\n }", "public function rmFromListRemovesElementsFromCommaSeparatedListDataProvider() {}", "public function unsetStringValue(): void\n {\n $this->stringValue = [];\n }", "private function unset_members() {\n unset($this->id);\n unset($this->label);\n unset($this->controlGroup);\n unset($this->versionable);\n unset($this->state);\n unset($this->mimetype);\n unset($this->format);\n unset($this->size);\n unset($this->checksum);\n unset($this->checksumType);\n unset($this->createdDate);\n unset($this->content);\n unset($this->url);\n unset($this->location);\n unset($this->logMessage);\n }", "public function __unset($name);", "public function getNameValueList()\n {\n return $this->nameValueList;\n }", "public function __unset($name)\n {\n echo \"Unsetting '$name'<br>\";\n unset($this->data[$name]);\n }", "public function remove_list_from_table($list){\n\t\t$query = \"DELETE * FROM \" . $this->table . \" WHERE \" . $this->column_name . \"=\";\n\t\t$list = commas_to_array($list);\n\t\t$just_added = array();\n\t\tif($old_list = Database::get_results_as_numerical_array($query, $this->column_name)){\n\t\t\t//var_dump($old_list); echo \"<br>\";\n\t\t\t\n\t\t\tforeach($list as $list_item){\n\t\t\t\t\n\t\t\t\tif(!in_array($list_item, $old_list) &&\n\t\t\t\t !in_array($list_item, $just_added)){\n\t\t\t\t\t$this->add_to_table($list_item);\n\t\t\t\t\t$just_added[] = $list_item;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{ //if there is nothing in the organizations table\n\t\t\tforeach($list as $list_item){\n\t\t\t\tif(!in_array($list_item, $just_added)){\n\t\t\t\t\t$this->add_to_table($list_item);\n\t\t\t\t\t$just_added[] = $list_item;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}", "private function undef(string $name): void\n {\n $path = $name !== '' ? explode('/', $name) : [];\n if (!$path) {\n return;\n }\n\n $var = array_pop($path);\n $current = &$this->items;\n\n foreach ($path as $field) {\n if (!is_array($current) || !isset($current[$field])) {\n return;\n }\n $current = &$current[$field];\n }\n\n unset($current[$var]);\n $this->updated = true;\n }", "protected function cleanUpValue( $value ) {\n\t\t$cleanValue = [];\n\t\tif ( !is_array( $value ) ) {\n\t\t\treturn $cleanValue;\n\t\t}\n\t\tforeach ( $value as $singleValue ) {\n\t\t\t$singleValue = parent::cleanUpValue( $singleValue );\n\t\t\t// Remove options that we don't have here\n\t\t\tif ( !isset( $this->fields[ $singleValue ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$cleanValue[] = $singleValue;\n\t\t}\n\t\treturn $cleanValue;\n\t}", "public function __unset($name)\n {\n if (array_key_exists($name, $this->_attributes)) {\n unset($this->_attributes[$name]);\n }\n }", "public function __unset($name)\n\t{\n\t\tif ($field = $this->field($name, TRUE))\n\t\t{\n\t\t\t// We don't want to unset the keys, because \n\t\t\t// they are assumed to exist. Just set them back to defaults\n\t\t\t$this->_original[$field] = $this->meta()->defaults[$field];\n\t\t\t\n\t\t\t// Ensure changed and retrieved data is cleared\n\t\t\t// This effectively clears the cache and any changes\n\t\t\tif (array_key_exists($name, $this->_changed))\n\t\t\t{\n\t\t\t\tunset($this->_changed[$name]);\n\t\t\t}\n\t\t\t\n\t\t\tif (array_key_exists($name, $this->_retrieved))\n\t\t\t{\n\t\t\t\tunset($this->_retrieved[$name]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// This doesn't matter\n\t\tif (array_key_exists($name, $this->_unmapped))\n\t\t{\n\t\t\tunset($this->_unmapped[$name]);\n\t\t}\n\t}", "public function unsetAttributes($names=null)\n {\n if($names===null)\n $names=$this->attributeLabels();\n foreach($names as $key => $name)\n $this->$key=null;\n }", "public function __unset(string $name) {\n\t\tunset($this->data[$name]);\n\t}" ]
[ "0.6177232", "0.54535854", "0.52232", "0.52232", "0.52232", "0.52232", "0.51094586", "0.5079398", "0.49869925", "0.4947916", "0.49454504", "0.48860008", "0.4803926", "0.48015726", "0.48004034", "0.4785574", "0.47834277", "0.47465613", "0.47319844", "0.46868512", "0.46823344", "0.46817636", "0.4678781", "0.46549678", "0.4650741", "0.46260253", "0.46229035", "0.46114895", "0.4611149", "0.46071172" ]
0.6651746
0
Gets as nameValueList Each NameValueList container will contain one aspect of a motor vehicle that is compatible with the motor vehicle part or accessory. For example, the allowed names might include 'Year', 'Make', and 'Model', 'Trim', and 'Engine'.
public function getNameValueList() { return $this->nameValueList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _getAllowedValueList()\n {\n return self::$valueList;\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(2);\n }", "public function getNameList() {\n return $this->_get(1);\n }", "public function getNameList() {\n return $this->_get(3);\n }", "public function getNameList() {\n return $this->_get(3);\n }", "public function getNameList() {\n return $this->_get(3);\n }", "public function getCapacityValueUomNameAllowableValues()\n {\n return [\n self::CAPACITY_VALUE_UOM_NAME_CM,\n self::CAPACITY_VALUE_UOM_NAME_M,\n self::CAPACITY_VALUE_UOM_NAME_MI,\n self::CAPACITY_VALUE_UOM_NAME_CM3,\n self::CAPACITY_VALUE_UOM_NAME_M3,\n self::CAPACITY_VALUE_UOM_NAME_LI,\n self::CAPACITY_VALUE_UOM_NAME_KG,\n self::CAPACITY_VALUE_UOM_NAME_PD,\n self::CAPACITY_VALUE_UOM_NAME_AMOUNT,\n self::CAPACITY_VALUE_UOM_NAME_MM,\n self::CAPACITY_VALUE_UOM_NAME_MM3,\n self::CAPACITY_VALUE_UOM_NAME_DM,\n self::CAPACITY_VALUE_UOM_NAME_DM3,\n self::CAPACITY_VALUE_UOM_NAME_G,\n self::CAPACITY_VALUE_UOM_NAME_MG,\n self::CAPACITY_VALUE_UOM_NAME_CG,\n self::CAPACITY_VALUE_UOM_NAME_DG,\n ];\n }", "public function getManufacturersForDropdown() {\n $manufacturers = $this->orderby('name','ASC')->get();\n $manufacturers_for_dropdown = [];\n foreach($manufacturers as $manufacturer) {\n $manufacturers_for_dropdown[$manufacturer->id] = $manufacturer->name;\n }\n return $manufacturers_for_dropdown;\n }", "public function get_list_of( $name ) {\n\t\t$data = [];\n\t\tswitch ( $name ) {\n\t\t\tcase 'volume':\n\t\t\t\tforeach ( $this->data as $datum ) {\n\t\t\t\t\t$data[] = [\n\t\t\t\t\t\t'id' => $datum['id'],\n\t\t\t\t\t\t'name' => $datum['name'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'devices':\n\t\t\tcase 'device':\n\t\t\t\t$data = $this->get_devices();\n\t\t\t\tbreak;\n\t\t\tcase 'products':\n\t\t\t\t$data = $this->get_products();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn apply_filters( 'THESPA_data_list_of', $data, $name );\n\t}", "public function getUnitValuesUomNameAllowableValues()\n {\n return [\n self::UNIT_VALUES_UOM_NAME_CM,\n self::UNIT_VALUES_UOM_NAME_M,\n self::UNIT_VALUES_UOM_NAME_MI,\n self::UNIT_VALUES_UOM_NAME_CM3,\n self::UNIT_VALUES_UOM_NAME_M3,\n self::UNIT_VALUES_UOM_NAME_LI,\n self::UNIT_VALUES_UOM_NAME_KG,\n self::UNIT_VALUES_UOM_NAME_PD,\n self::UNIT_VALUES_UOM_NAME_AMOUNT,\n self::UNIT_VALUES_UOM_NAME_MM,\n self::UNIT_VALUES_UOM_NAME_MM3,\n self::UNIT_VALUES_UOM_NAME_DM,\n self::UNIT_VALUES_UOM_NAME_DM3,\n self::UNIT_VALUES_UOM_NAME_G,\n self::UNIT_VALUES_UOM_NAME_MG,\n self::UNIT_VALUES_UOM_NAME_CG,\n self::UNIT_VALUES_UOM_NAME_DG,\n ];\n }", "public function getNames()\n {\n return array_keys(self::$availableManufacturers);\n }", "public function getNames() {}", "public function getNames() {}", "public function getNames() {}", "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "public function getNames();", "public function getVehicleTypes()\n {\n return $this->api->json(true, 'VEHICLE_TYPES', 'Vehicle types', [\n 'vtypes' => app('App\\Models\\VehicleType')->allTypes()->where('is_activated', true)\n ]);\n }", "public function getServiceNameAllowableValues()\n {\n return [\n self::SERVICE_NAME_BOUNTY_MISSIONS,\n self::SERVICE_NAME_ASSASSINATION_MISSIONS,\n self::SERVICE_NAME_COURIER_MISSIONS,\n self::SERVICE_NAME_INTERBUS,\n self::SERVICE_NAME_REPROCESSING_PLANT,\n self::SERVICE_NAME_REFINERY,\n self::SERVICE_NAME_MARKET,\n self::SERVICE_NAME_BLACK_MARKET,\n self::SERVICE_NAME_STOCK_EXCHANGE,\n self::SERVICE_NAME_CLONING,\n self::SERVICE_NAME_SURGERY,\n self::SERVICE_NAME_DNA_THERAPY,\n self::SERVICE_NAME_REPAIR_FACILITIES,\n self::SERVICE_NAME_FACTORY,\n self::SERVICE_NAME_LABORATORY,\n self::SERVICE_NAME_GAMBLING,\n self::SERVICE_NAME_FITTING,\n self::SERVICE_NAME_PAINTSHOP,\n self::SERVICE_NAME_NEWS,\n self::SERVICE_NAME_STORAGE,\n self::SERVICE_NAME_INSURANCE,\n self::SERVICE_NAME_DOCKING,\n self::SERVICE_NAME_OFFICE_RENTAL,\n self::SERVICE_NAME_JUMP_CLONE_FACILITY,\n self::SERVICE_NAME_LOYALTY_POINT_STORE,\n self::SERVICE_NAME_NAVY_OFFICES,\n self::SERVICE_NAME_SECURITY_OFFICE,\n ];\n }", "public function getValuesList() {\n return $this->_get(2);\n }", "public function getNames(): Collection\n {\n return $this->names;\n }", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "function FieldNameList ( ) { return $this->_FieldNameList; }", "public function attributeValueLists()\r\n {\r\n throw new NotSupportedException('attributeValueLists Method should be overidded');\r\n }", "public function getValues()\n {\n $values = [];\n foreach ($this->findScenario() as $name) {\n $values[$name] = $this->$name;\n }\n return $values;\n }" ]
[ "0.57258636", "0.5711765", "0.5711765", "0.5711765", "0.5711765", "0.5711765", "0.5711765", "0.5711765", "0.5631811", "0.5519867", "0.5519867", "0.5519867", "0.5363106", "0.53624415", "0.53597087", "0.5320408", "0.53123224", "0.52792287", "0.52792287", "0.5278116", "0.5258936", "0.52353066", "0.5206081", "0.5158777", "0.50753236", "0.5046518", "0.5045069", "0.49953365", "0.49906963", "0.4986583" ]
0.68095136
0
Sets a new nameValueList Each NameValueList container will contain one aspect of a motor vehicle that is compatible with the motor vehicle part or accessory. For example, the allowed names might include 'Year', 'Make', and 'Model', 'Trim', and 'Engine'.
public function setNameValueList(array $nameValueList) { $this->nameValueList = $nameValueList; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToNameValueList(\\Nogrod\\eBaySDK\\Shopping\\NameValueListType $nameValueList)\n {\n $this->nameValueList[] = $nameValueList;\n return $this;\n }", "public function addToVariationSpecifics(\\Nogrod\\eBaySDK\\Shopping\\NameValueListType $nameValueList)\n {\n $this->variationSpecifics[] = $nameValueList;\n return $this;\n }", "public function setNames($names) {}", "public function setNames($names) {\n $this->_names = $names;\n }", "function setUserNameList($newVal)\r\n\t{\r\n\t\t$this->UserNameList = $newVal;\r\n\t}", "public function setNames($names)\n {\n $this->names = $names;\n }", "public function getNameValueList()\n {\n return $this->nameValueList;\n }", "public function setNames(string $name)\n {\n if (is_string($name)){\n $this->_name = $name;\n }\n }", "function setValueList($valueList) {\n if ($valueList !== ($oldValueList = $this->valueList)) {\n $this->valueList = $valueList;\n }\n }", "public function setAddressListHeader($name, $value)\n {\n /** @var AbstractAddressList $header */\n $header = $this->getHeader($name);\n $addresslist = new AddressList();\n $addresslist->addFromString($value);\n $header->setAddressList($addresslist);\n }", "public function setName(?array $name): void\n {\n $this->name['value'] = $name;\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }", "public function set($name, string $value = '')\n {\n if (is_array($name)) {\n $name = array_change_key_case($name, CASE_UPPER);\n $this->items = array_merge($this->items, $name);\n return;\n }\n\n $name = strtoupper($name);\n $this->items[$name] = $value;\n }", "function setName( $value )\n {\n $this->Name = $value;\n }", "protected function _setName($name, $value) {}", "public function assignNames($names);", "function listjs_prepare_list_value_names($list_id, array $value_names) {\n $listjs_list_value_names = &drupal_static('listjs_list_value_names', []);\n\n // We make sure that value names settings are not overridden, new settings are\n // only appended.\n // This fixes the problem of settings getting overridden if there are multiple\n // listjs widgets in a single page.\n if (empty($listjs_list_value_names[$list_id])) {\n $listjs_list_value_names[$list_id] = $value_names;\n }\n\n return $listjs_list_value_names;\n}", "function setName($value) {\n $this->name = $value;\n }", "public function setName($value)\r\n {\r\n $this->name = $value;\r\n }", "public function setName($value)\r\n {\r\n $this->name = $value;\r\n }", "function setName($value) {\n $this->name = $value;\n }", "function addSelectListArrays($name, $val_list, $txt_list, $selected_value = NULL, $header = NULL, $attr_ar = array() ) { \n $option_list = array_combine( $val_list, $txt_list ); \n $str = $this->addSelectList($name, $option_list, true, $selected_value, $header, $attr_ar ); \n return $str; \n }", "public function setName($value)\n {\n $this->setItemValue('name', (string)$value);\n }", "function setName( &$value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( &$value )\r\n {\r\n $this->Name = $value;\r\n }", "public function unsetNameValueList($index)\n {\n unset($this->nameValueList[$index]);\n }" ]
[ "0.64360535", "0.63710874", "0.5956659", "0.54454404", "0.54256636", "0.54168296", "0.54070723", "0.5330376", "0.5260967", "0.5201104", "0.51572716", "0.51410294", "0.51410294", "0.51410294", "0.51410294", "0.51410294", "0.5111854", "0.50845665", "0.5073521", "0.5048008", "0.50237805", "0.50093704", "0.50080025", "0.50080025", "0.5004686", "0.49786124", "0.49616843", "0.49564213", "0.49564213", "0.4921151" ]
0.7180552
0
Gets as compatibilityNotes This field contains any notes pertaining to the compatibility being specified. This field is only returned if set for the compatible vehicle.
public function getCompatibilityNotes() { return $this->compatibilityNotes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCompatibilityNotes($compatibilityNotes)\n {\n $this->compatibilityNotes = $compatibilityNotes;\n return $this;\n }", "public function getRelationshipNotes()\n {\n return $this->getFieldArray('580');\n }", "public function getNotes()\n {\n return $this->getValue('nb_icontact_prospect_notes');\n }", "public function getCompatibility ()\r\n {\r\n return $this->_compatibility;\r\n }", "public function getContactNotes()\n\t{\n\t\treturn $this->contact_notes;\n\t}", "public static function compatibility() {\n\t\t\treturn self::$compatibility;\n\t\t}", "public function getNotes() {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes() {\n\t\treturn $this->_notes;\n\t}", "function getNotes() {\n\t\treturn $this->notes;\n\t}", "public function getBibliographyNotes()\n {\n return $this->getFieldArray('504');\n }", "public function getNotes()\n {\n $notes = \"**Support Level:**\\n\\n\";\n $notes .= \"%$this->supportLevel%\\n\\n\";\n\n if ($this->stablePlatforms) {\n $notes .= \"**Supported Platforms:**\\n\";\n $notes .= \"$this->stablePlatforms\\n\";\n }\n\n if ($this->unstablePlatforms) {\n $notes .= \"**Unsupported Platforms:**\\n\";\n $notes .= \"$this->unstablePlatforms\\n\";\n }\n\n if ($this->notes) {\n $notes .= \"**Additional Notes:**\\n\";\n $notes .= str_replace(\"- \", \"\\n- \", $this->notes) . \"\\n\";\n }\n\n $config = \\HTMLPurifier_Config::createDefault();\n $purifier = new \\HTMLPurifier($config);\n $parsedown = new \\Parsedown();\n $notes = $parsedown->text($notes);\n $notes = $purifier->purify($notes);\n return $notes;\n }", "function getNotes() {\n\t\treturn $this->_Notes;\n\t}", "function getCompatibilityLevel()\n {\n return $this->_props['CompatibilityLevel'];\n }", "public function getNotes()\n {\n if (array_key_exists(\"notes\", $this->_propDict)) {\n return $this->_propDict[\"notes\"];\n } else {\n return null;\n }\n }", "public function getNotes()\n {\n if (array_key_exists(\"notes\", $this->_propDict)) {\n return $this->_propDict[\"notes\"];\n } else {\n return null;\n }\n }", "public function get_notes() {\n return YITH_WCBK()->notes->get_booking_notes( $this->id );\n }", "public function getNotes(): ?string\n {\n return $this->notes;\n }", "public function getGeneralNotes()\n {\n return $this->getFieldArray('500');\n }", "public function getNotes()\n {\n return $this->getNodeText('/p:package/p:notes');\n }", "public function getNote()\n {\n return $this->table->note;\n }", "public function getContentNote() {\n $fields = array(\n 'contentNote' => array('contentNoteDescription', 'contentNoteElement')\n );\n $result = TingOpenformatMethods::parseFields($this->_getContent(), $fields);\n return $result;\n }", "public function getHasnotes()\n {\n return $this->hasnotes;\n }", "public function getPersonNotes()\n {\n return $this->getProperty(\"PersonNotes\");\n }", "public function getTargetAudienceNotes()\n {\n return $this->getFieldArray('521');\n }", "public function getNote()\n {\n return $this->note;\n }" ]
[ "0.64572346", "0.6265718", "0.62258565", "0.6032568", "0.6002821", "0.59488624", "0.59106076", "0.5892726", "0.5892726", "0.5892726", "0.5892726", "0.5892726", "0.5809816", "0.5791018", "0.5779749", "0.5675466", "0.5659128", "0.5605167", "0.5577785", "0.5577785", "0.55344814", "0.5401757", "0.52574986", "0.5230135", "0.51905096", "0.51794374", "0.5150868", "0.50984603", "0.5052291", "0.5047921" ]
0.80064195
0
Sets a new compatibilityNotes This field contains any notes pertaining to the compatibility being specified. This field is only returned if set for the compatible vehicle.
public function setCompatibilityNotes($compatibilityNotes) { $this->compatibilityNotes = $compatibilityNotes; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCompatibility($compatibility)\n {\n $this->compatibility = $compatibility;\n }", "public function getCompatibilityNotes()\n {\n return $this->compatibilityNotes;\n }", "public function setNotes($value) {\n\t\tif ($value == NULL) {\n\t\t\t$this->_notes = \"\";\n\t\t} else {\n\t\t\t$this->_notes = $value;\n\t\t}\n\t}", "public function setNotes($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->notes !== $v) {\n $this->notes = $v;\n $this->modifiedColumns[BiblioTableMap::COL_NOTES] = true;\n }\n\n return $this;\n }", "function setCompatibilityLevel($value)\n {\n $this->_props['CompatibilityLevel'] = $value;\n }", "public function setNotes($val)\n {\n $this->_propDict[\"notes\"] = $val;\n return $this;\n }", "public function setNotes($val)\n {\n $this->_propDict[\"notes\"] = $val;\n return $this;\n }", "public function setContactNotes($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->contact_notes !== $v) {\n\t\t\t$this->contact_notes = $v;\n\t\t\t$this->modifiedColumns[] = VpoRequestPeer::CONTACT_NOTES;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setNotes($value)\n {\n $this->setItemValue('notes', (string)$value);\n }", "public function setNotes(string $notes = null) : CNabuDataObject\n {\n $this->setValue('nb_icontact_prospect_notes', $notes);\n \n return $this;\n }", "function setNotes($inNotes) {\n\t\tif ( $inNotes !== $this->_Notes ) {\n\t\t\t$this->_Notes = $inNotes;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setNotes(array $notes)\n {\n $this->notes = $notes;\n return $this;\n }", "public static function setCompatibility($compatibility)\n {\n if (is_bool($compatibility)) {\n self::$_xmlWriterCompatibility = $compatibility;\n return true;\n }\n return false;\n }", "private function prepareProductNotes(): void\n {\n $this->_entityBehaviors['catalog_product']['notes'] =\n [\n Import::BEHAVIOR_APPEND => new Phrase('New product data is added to the existing product data for'\n . ' the existing entries in the database. All fields except sku can be updated.'),\n Import::BEHAVIOR_REPLACE => new Phrase('The existing product data is replaced with new data.'\n . ' <b>Exercise caution when replacing data because the existing product data will be completely'\n . ' cleared and all references in the system will be lost.</b>'),\n Import::BEHAVIOR_DELETE => new Phrase('Any entities in the import data that already exist in the'\n . ' database are deleted from the database.'),\n ];\n }", "public static function compatibility() {\n\t\t\treturn self::$compatibility;\n\t\t}", "public function getCompatibility ()\r\n {\r\n return $this->_compatibility;\r\n }", "public function setNotes($notes)\n {\n $this->notes = $notes;\n\n return $this;\n }", "public function setNotes(?string $notes): self\n {\n $this->initialized['notes'] = true;\n $this->notes = $notes;\n\n return $this;\n }", "function getCompatibilityLevel()\n {\n return $this->_props['CompatibilityLevel'];\n }", "public function setServiceNotes($val)\n {\n $this->_propDict[\"serviceNotes\"] = $val;\n return $this;\n }", "public function setNote($text){\r\n $this->note = $text;\r\n }", "public function setNotes($notes = null)\n {\n $this->notes = $notes;\n\n return $this;\n }", "public function setExcelCompatibility(bool $excelCompatibility): self\n {\n $this->excelCompatibility = $excelCompatibility;\n\n return $this;\n }", "public function setCustomerNotes($val)\n {\n $this->_propDict[\"customerNotes\"] = $val;\n return $this;\n }", "public function getNotes()\n {\n $notes = \"**Support Level:**\\n\\n\";\n $notes .= \"%$this->supportLevel%\\n\\n\";\n\n if ($this->stablePlatforms) {\n $notes .= \"**Supported Platforms:**\\n\";\n $notes .= \"$this->stablePlatforms\\n\";\n }\n\n if ($this->unstablePlatforms) {\n $notes .= \"**Unsupported Platforms:**\\n\";\n $notes .= \"$this->unstablePlatforms\\n\";\n }\n\n if ($this->notes) {\n $notes .= \"**Additional Notes:**\\n\";\n $notes .= str_replace(\"- \", \"\\n- \", $this->notes) . \"\\n\";\n }\n\n $config = \\HTMLPurifier_Config::createDefault();\n $purifier = new \\HTMLPurifier($config);\n $parsedown = new \\Parsedown();\n $notes = $parsedown->text($notes);\n $notes = $purifier->purify($notes);\n return $notes;\n }", "public function setPersonNotes($value)\n {\n $this->setProperty(\"PersonNotes\", $value, true);\n }", "public function setNote(array $note)\n {\n $this->note = $note;\n return $this;\n }", "public function setNote(array $note)\n {\n $this->note = $note;\n return $this;\n }", "public function setNote(array $note)\n {\n $this->note = $note;\n return $this;\n }", "public function getNotes()\n {\n return $this->getValue('nb_icontact_prospect_notes');\n }" ]
[ "0.65060246", "0.62129796", "0.52103335", "0.52076805", "0.5187977", "0.51185656", "0.51185656", "0.5071659", "0.5019787", "0.49142265", "0.4890676", "0.484247", "0.47113353", "0.47016624", "0.468077", "0.46458665", "0.46356836", "0.45696023", "0.45592895", "0.45392442", "0.4511481", "0.44842875", "0.44627014", "0.43872222", "0.43769407", "0.43682352", "0.4339403", "0.4339403", "0.4339403", "0.4274795" ]
0.72131103
0
Get selected page IDs
protected function getPageIds() { return (array)explode(',', $this->getData('pages')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSelectedPageUids() {\r\n\t\treturn $this->selectedPageUids;\r\n\t}", "function get_all_page_ids()\n {\n }", "protected function getPrintPageIds()\n\t{\n\t\tif(is_array($_POST[\"wordr\"]))\n\t\t{\n\t\t\tasort($_POST[\"wordr\"]);\t\t\t\n\t\t\t$page_ids = array_keys($_POST[\"wordr\"]);\t\n\t\t}\n\t\t// single page\n\t\telse if((int)$_GET[\"wpg_id\"])\n\t\t{\n\t\t\t$page_ids = array((int)$_GET[\"wpg_id\"]);\n\t\t}\n\t\t\n\t\treturn $page_ids;\n\t}", "public function getPageIds() {\r\n return array_keys($this->pageConfig);\r\n }", "public function getSelectedPages()\n {\n $cids = $this->getCIDs();\n if( !empty( $cids ) ){\n $pl = $this->getPageList();\n if ($pl->getItemsPerPage() > 0) {\n $pages = $pl->getPage();\n } else {\n $pages = $pl->get();\n }\n $this->set('selectedPages', $pages);\n } else {\n $this->set('selectedPages', array());\n }\n\n }", "function getStoragePageIds() ;", "public function getStoragePageIds() {}", "public function getPageEntryIds();", "public function getSelectedNodeIds()\n {\n if (!$this->getPage()->hasData('node_ids')) {\n $ids = array();\n\n foreach ($this->getNodes() as $node) {\n if (isset($node['page_exists']) && $node['page_exists']) {\n $ids[] = $node['node_id'];\n }\n }\n return implode(',', $ids);\n }\n\n return $this->getPage()->getData('node_ids');\n }", "public function getSearchRootPageIdList() {}", "public function getSearchRootPageIdList() {}", "final public function get_selected_pages($pageids) {\n\t\tglobal $DB;\n\t\t$pages = array();\n\t\tforeach ($pageids as $pageid) {\n\t\t\t$page = $DB->get_record('languagelesson_pages', array('pageid' => $pageid));\n\t\t\t$pages[$page->ordering] = $page;\n\t\t}\n\t\t\n\t\treturn $pages;\n\t}", "public function getPageIds()\n {\n $arr = array();\n foreach($this->elements as $displayElement){\n if($displayElement->getType() == 'element'){\n $page = $displayElement->getElement()->getPage();\n while($page != null) { \n $arr[] = $page->getId();\n $page = $page->getParent();\n }\n }\n if($displayElement->getType() == 'page'){\n $page = $displayElement->getPage();\n while($page != null) { \n $arr[] = $page->getId();\n $page = $page->getParent();\n }\n }\n }\n\n return array_unique($arr);\n }", "protected function get_retrieved_ids() {\n $ids = $this->parse_ids($items);\n \n $sidx = $eidx = 0;\n if (is_array($this->page_size)) {\n $sidx = $this->page_size[0];\n $eidx = $this->page_size[1];\n if ($sidx < 0)\n $sidx = 0;\n if ($eidx < $sidx)\n $eidx = $sidx;\n if ($eidx >= count($ids))\n $eidx = count($ids) - 1;\n \n $len = $eidx - $sidx + 1;\n if ($sidx >= count($ids))\n $ids = array();\n else\n $ids = array_slice($ids, $sidx, $len);\n }\n\n list($start_count, $max_count) = $this->get_page_limit($this->page_size);\n $num_to_display = $max_count - $start_count + 1;\n $ids = array_slice($ids, $start_count, $num_to_display);\n\n // This is supposed to come at the end of the retrieval, but I don't know where to put it yet.\n // This is legacy code anyway and is going byebye soon.\n //$output[\"eod\"] = $start_count < $max_count;\n //$output[\"counts\"][\"displayed\"] = $start_count;\n //if (!$output[\"eod\"])\n // $output[\"counts\"][\"displayed\"]--;\n return $ids;\n }", "function ajan_core_get_directory_page_ids() {\n\t$page_ids = ajan_get_option( 'ajan-pages' );\n\n\t// Ensure that empty indexes are unset. Should only matter in edge cases\n\tif ( !empty( $page_ids ) && is_array( $page_ids ) ) {\n\t\tforeach( (array) $page_ids as $component_name => $page_id ) {\n\t\t\tif ( empty( $component_name ) || empty( $page_id ) ) {\n\t\t\t\tunset( $page_ids[$component_name] );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn apply_filters( 'ajan_core_get_directory_page_ids', $page_ids );\n}", "public function get_page_options() {\n\t\t$pages = get_posts(array('post_type' => 'page'));\n\t\t$pages_array = array();\n\t\tforeach ($pages as $page) {\n\t\t\t$pages_array[$page->post_title] = $page->ID;\n\t\t}\n\n\t\treturn $pages_array;\n\t}", "public abstract function get_ids();", "public function getIds();", "public function getIds();", "public function applicablePages($ids)\n {\n return $ids;\n }", "function ss_get_home_ids() {\r\n\r\n\t$args = array(\r\n\t\t'post_type' => 'page',\r\n\t\t'meta_key' => '_wp_page_template',\r\n\t\t'meta_value' => 'template-home.php'\r\n\t);\r\n\r\n\t$home_pages = get_posts( $args );\r\n\t$home_pages_ids = array();\r\n\r\n\tif ( !empty( $home_pages ) ) {\r\n\t\tforeach ( $home_pages as $home_page ) {\r\n\t\t\tarray_push( $home_pages_ids, $home_page->ID );\r\n\t\t}\r\n\t\treturn $home_pages_ids;\r\n\t} else {\r\n\t\treturn $home_pages_ids; // Return empty array\r\n\t}\r\n\r\n}", "public static function get_comparison_list() {\n $config = self::get_config();\n $page = $config['page'];\n $ids = empty( $_GET['ids'] ) ? array() : esc_attr( $_GET['ids'] );\n\n if ( is_page( $page ) && ! empty( $ids ) ) {\n $ids = array_map( 'intval', explode( ',', $ids ) );\n return $ids;\n }\n\n $compare = Inventor_Visitor::get_data('compare');\n\n if ( is_array( $compare ) && ! empty( $compare ) ) {\n return $compare;\n }\n\n return array();\n }", "function getSectionsIdOption() {\r\n\t\t$database = JFactory::getDBO();\r\n\r\n\t\t$sectoptions = array();\r\n\t\t$query = \"SELECT id, title\"\r\n\t\t\t\t. \"\\n FROM \" . $database->nameQuote($this->componentSectionTable)\r\n\t\t\t\t. \"\\n WHERE published = 1\"\r\n//\t\t\t\t. \"\\n AND access >= 0\"\r\n\t\t\t\t. \"\\n ORDER BY ordering\"\r\n\t\t;\r\n\t\t$database->setQuery($query);\r\n\t\t$sectoptions = $database->loadObjectList();\r\n\r\n\t\treturn $sectoptions;\r\n\t}", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }" ]
[ "0.75358623", "0.7198504", "0.71682554", "0.6999016", "0.698778", "0.6961683", "0.67020625", "0.6681024", "0.6623196", "0.6476639", "0.6476639", "0.64423746", "0.6306155", "0.62652755", "0.6198524", "0.61918813", "0.6078848", "0.6041805", "0.6041805", "0.5932843", "0.58454865", "0.582083", "0.57979333", "0.5784151", "0.5784151", "0.5784151", "0.5784151", "0.5784151", "0.5784151", "0.5784151" ]
0.7498354
1
Stop retrieving results pages if all seeds are 0 or 1
protected function checkResultsForSeeds($html){ // Accepts only HTML file. //This is a helper function to check for seeds at results pages. If seeds are less than minimum seted seeds ( <1 ) then stop search and download of HTML files $torrents = $this->parseSearchResultsPage(file_get_contents($html)); $countTorrents=count($torrents); $countZeroSeeds=0; foreach ( $torrents as $t ){ if ( ($t['seeds'] === 0) || ($t['seeds'] === 1) ){ $countZeroSeeds++; } } if ( $countZeroSeeds === $countTorrents ){ printColor( n."[!]All ".$countTorrents." torrents in page have 0 or 1 seed: ". $countZeroSeeds."/".$countTorrents, "yellow"); printColor( n."[*]Stop saving or reading results pages", "red"); return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disableWorstResults() {\r\n\t\tforeach ($this->getRaces() as $race) {\r\n\t\t\t$race->disableWorstResults();\r\n\t\t}\r\n\t}", "public function disableBestResults() {\r\n\r\n\t\tforeach ($this->getRaces() as $race) {\r\n\t\t\t$race->disableBestResults();\r\n\t\t}\r\n\t}", "public function enableAllResults() {\r\n\r\n\t\tforeach ($this->getRaces() as $race) {\r\n\t\t\t$race->enableAllResults();\r\n\t\t}\r\n\t}", "function tc_is_no_results() {\r\n global $wp_query;\r\n return ( is_search() && 0 == $wp_query -> post_count ) ? true : false;\r\n }", "public function hasResults() {\n return 0 < count($this->getResults());\n }", "public function runTenIdenticalSearch()\n\t{\t\t\n\t\t$this->client->isLazy(); \t\t\n\t\t$time = time();\n\t\t$request = $this->client->getMessageFactory()->createRequest($this->url, 'GET');\n\t\t$request->addHeader('cookie',$this->strCookie);\n\t\t$request->setTimeout(300000000);\n\t\t$response = $this->client->getMessageFactory()->createResponse();\n\t\t$this->client->send($request, $response);\n\t\tif($response->getStatus() === 200) {\t\t\t\n\t\t\t$responseTime = time();\n\t\t\t$pageLoadTime = $responseTime-$time;\n\t\t\treturn $this->convertToSeconds($pageLoadTime);\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public function hasResults() {\n\t\treturn $this->count() >= 1;\n\t}", "public function disableBufferedResults();", "function startSafeScraping(){\n \n if($this->db_meta->fetchOne('select currentlybeingcrawled from crawllist where wid = '.$this->wid)){\n throw new AlreadyScrapingException();\n } \n \n return $this->startScraping(); \n }", "public function testNextNoResults() {\n\t\t$this->backend->expects($this->exactly(1))\n\t\t\t->method('getUsers')\n\t\t\t->with(\n\t\t\t\t\t$this->equalTo(''),\t\t\t\t\t// all users\n\t\t\t\t\t$this->equalTo(UsersIterator::LIMIT),\t// limit 500\n\t\t\t\t\t$this->equalTo(0)\t\t\t\t\t\t// at the beginning\n\n\t\t\t)\n\t\t\t->willReturn([]);\n\n\t\t$this->iterator->rewind();\n\t\t$this->assertFalse($this->iterator->valid());\n\t}", "public function hasResults();", "function results_are_paged()\n {\n }", "function register_block_core_query_no_results()\n {\n }", "protected function stopOptimizeAllAction() {\n\t\t$coreConfig = Mage::getConfig();\n\t\t$coreConfig->saveConfig(\"mageio_autosettig\", Mage::helper('core')->escapeHtml('Off'))->cleanCache();\n\t\t$this->ajaxReponse(false);\t\t\n\t}", "public function index()\n {\n $tasks = CrawlTask::where('complete',0)\n ->orderBy('rand_number', 'desc')\n ->take(8);\n $crawlTask = $tasks->get();\n $tasks->update(['complete' => 1]);\n if(count($crawlTask) == 0){\n $now = Carbon::now();\n $last = $now->subDay(2);\n $crawlTask = CrawlTask::where('complete',1)\n ->where('created_at','>',$last)\n ->orderBy('rand_number', 'desc')\n ->orderBy('id','desc')\n ->take(3)\n ->get();\n }\n foreach ($crawlTask as $task){\n $this->crawl($task);\n sleep(rand(2,5));\n }\n return 'true';\n }", "function getMissing() {\n\t\t$articleDao =& \\DAORegistry::getDAO('ArticleDAO');\n\t\t$sql = \"SELECT * FROM articles WHERE pages like '%#DFM'\";\n\t\t$blub = $articleDao->retrieve($sql);\n\t\t$result = new \\DAOResultFactory($blub, $this, '_dummy');\n\t\t$result = $result->toArray();\n\t\tforeach ($result as $record) {\n\t\t\t$this->getArticleGalleys($record['article_id']);\n\t\t}\n\t}", "function purgeSeedings() {\n\n $this->db->empty_table( \"TournamentSeeds\" );\n \n/* ... time to go */\n return;\n }", "private function resetResults() {\n $this->results = array();\n }", "public function actionIndex()\n {\n\n for ($i=0; $i < 100000000; $i++) { \n $this->success(\"Iteration: \".$i);\n $sourses = Sourse::find()->where(\n [\n 'and',\n ['type' => Sourse::TYPE_RSS],\n ['status' => Sourse::STATUS_ACTIVE] \n ]\n )->all();\n if (empty($sourses)) {\n $this->error('Sourses not found');\n return;\n }\n $this->parse($sourses); \n $this->success(\"Sleep: 30 мин.\"); \n sleep(1800);\n }\n \n }", "protected function all() {\n if (!$this->query_failed) {\n return $this->results;\n }\n\n return false;\n }", "public function indexAction() \n {\n\t\tif (!isset($this->view->flagFailedSearch)) {\n\t\t\t$this->view->flagFailedSearch = FALSE;\n\t\t}\n }", "function render_block_core_query_no_results($attributes, $content, $block)\n {\n }", "public function isHasResults();", "public function getIsValidPage(): bool\n {\n $pageCount = $this->getPageCount();\n\n if ($pageCount === 0 && $this->pageIndex === 0) {\n // If there are no results, but this is the first page,.\n return true;\n }\n\n return $this->pageIndex >= 0 && $this->pageIndex <= ($pageCount - 1);\n }", "protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}", "function has_results() {\n\t\treturn ($this->QueryID && $this->record_count() !== 0);\n\t}", "public function seed()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->seed((isset($this->request->get['limit']) ? $this->request->get['limit'] : 150));\n\n $this->response->write('OK');\n }", "public function waitForSolrBefore()\n {\n if (APP_SOLR_INDEXER == \"ON\") {\n for ($x = 0; $x<30; $x++) {\n $finished = FulltextQueue::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n }\n return;\n }", "protected function shouldRun()\n {\n return false === (bool) $this->configurationManager->getConfigurationValueByPath('FE/pageUnavailable_force');\n }", "private function searchMustEnd(): bool\n {\n return in_array($this->search->fresh()->status, [\n Search::STATUS_FINISHED,\n Search::STATUS_FAILED,\n Search::STATUS_PAUSED\n ]);\n }" ]
[ "0.617012", "0.58429784", "0.55333287", "0.5514323", "0.546796", "0.5422057", "0.5421552", "0.5376953", "0.53161776", "0.52626306", "0.5261342", "0.5217772", "0.5153791", "0.51286656", "0.5123462", "0.51173115", "0.5109511", "0.50918436", "0.5033482", "0.50316215", "0.500493", "0.49889743", "0.49871224", "0.49814445", "0.49785483", "0.49728963", "0.4957842", "0.49568626", "0.49526322", "0.49026468" ]
0.63770515
0
Set token in client cookie
function setCryostemTokenCookie() { $current_time = time(); if(isset($_SESSION['cryostemToken']) && !empty($_SESSION['cryostemToken'])) { $token = $_SESSION['cryostemToken']->access_token; $expires = $current_time + $_SESSION['cryostemToken']->expires_in -100; setcookie('cryostemToken', $token, $expires, COOKIEPATH, COOKIE_DOMAIN); } else { unset($_COOKIE['cryostemToken']); setcookie("cryostemToken", "", $current_time-3600); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTokenFromCookie($token) {\n\t\t\t$this->tokenFromCookie = $token;\n\t\t}", "private function setToken() {\n $this->admin->rememberToken = password_hash($this->admin->username.generateSalt().time().generateSalt(), PASSWORD_DEFAULT);\n\n setcookie(\"adminUsername\", $this->admin->username, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n setcookie(\"adminToken\", $this->admin->rememberToken, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n\n $_SESSION['adminRemember'] = true;\n }", "public static function authCookie(string $token) : void\n {\n setcookie('NameYourGoat_User_Token', $token, time() + 3600*24*30, '/');\n }", "public function setToken() {\n $base_uri = $this->remoteSite->get('protocol') . '://' . $this->remoteSite->get('host');\n $options = array(\n 'base_uri' => $base_uri,\n 'allow_redirects' => TRUE,\n 'timeout' => 5,\n 'connect_timeout' => 5,\n );\n\n $token = $this->httpClient->request('get', 'rest/session/token', $options)->getBody();\n return $token->__toString();\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "public function setToken($token);", "public function setRememberToken($value){\n $this->token=$value;\n }", "function set_login_cookies($id,$token,$empresa){\n setcookie('Activo',\"True\",time()+3600,'','','',TRUE);\n setcookie('Id',$id,time()+3600,'','','',TRUE);\n setcookie('token',$token,time()+3600,'','','',TRUE);\n setcookie('empresa',isset($empresa)?$empresa:0,time()+3600,'','','',TRUE);\n }", "public function setToken($token, $token_secret) {}", "private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}", "public function setRememberToken($value)\n {\n $_token = $value;\n }", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "public function set_cookie()\n {\n }", "public function setToken()\n {\n if (session()->has('drive-access-token')) {\n $accessToken = session()->get('drive-access-token');\n $this->setAccessToken($accessToken);\n if ($this->isAccessTokenExpired()) {\n $accessToken = $this->fetchAccessTokenWithRefreshToken($this->getRefreshToken());\n session()->put('drive-access-token', $accessToken);\n }\n }\n }", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "public function setToken($value)\n\t{\n\t\tif (is_array($value) && !array_key_exists('expires_in', $value) && array_key_exists('expires', $value))\n\t\t{\n\t\t\t$value['expires_in'] = $value['expires'];\n\t\t\tunset($value['expires']);\n\t\t}\n\t\t$this->setOption('accesstoken', $value);\n\n\t\treturn $this;\n\t}", "function set_laravel_passport_grant_client_token()\n {\n DB::table('oauth_clients')\n ->where('id', 2)\n ->update(['secret' => 'dLdsIf3nPMWJC4gOCNcsUn5pBSv5tTPSaU51Gu2F']);\n }", "public function setRememberToken(string $value);", "public function setOnCheckCookieRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Access-Control-Allow-Credentials: true');\n header('Content-Type: application/json');\n if($user = $this->getUserFromCookie()) {\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\",\"email\":\"' . $user['email'] . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_cookie\"))->send();\n }\n } else {\n //probably won't reach this because of Same origin policy\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set\"))->send();\n }\n }", "public function setSessionTokenFromRegistry() {}", "protected function remember($token) {\n\t\t$token = Crypter::encrypt($token.'|'.Str::random(40));\n\t\t$this->cookie($this->recaller(), $token, Cookie::forever);\n\t}", "function setSig() {\n if (sfConfig::get(\"sf_private_key\") !='') {\n \n $hash = md5(rand_str());\n $this -> context ->getLogger()->debug(\"{Theater Token Class} HASH:: \".$hash);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN HASH:: \".$hash);\n \n $expires = strtotime(now());\n $this -> context ->getLogger()->debug(\"{Theater Token Class} EXPIRES:: \".$expires);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN EXPIRES:: \".$expires);\n \n $code = setUserOrderTicket();\n $this -> seat -> setAudienceHmacKey( $code );\n $this -> seat -> save();\n $this -> context ->getLogger()->debug(\"{Theater Token Class} CODE:: \".$code);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN CODE:: \".$code);\n \n /*\n\t\t\t$enc_date = encryptCookie($code, $hash.\"=\".strtotime(now()));\n $this -> context ->getLogger()->debug(\"{Theater Token Class} HMAC_SIG:: \".$enc_date);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - TOKEN HMAC_SIG:: \".$enc_date);\n \n $this -> token_raw = $hash . \"|\" . strtotime(now()) . \"|\" . $enc_date;\n $this -> context ->getLogger()->debug(\"{Theater Token Class} Set Token:: \".$this -> token_raw);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - TOKEN RAW:: \".$this -> token_raw);\n \n $this -> token = encryptCookie($code,$this -> token_raw);\n $this -> context ->getLogger()->debug(\"{Theater Token Class} Set Coookie:: \".$this -> token);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - SET COOKIE:: \".$this -> token);\n */\n \n $this -> setCookieVar( \"csth\", $code, 7 );\n return $this -> token;\n \n }\n \n }", "function wp_set_auth_cookie($user_id, $remember = \\false, $secure = '', $token = '')\n {\n }", "public function setaccess_token($value);", "public function setAccessToken($token);", "public function set($token);", "public function setToken($token){\n $this->token = $token;\n }", "public function setToken()\n\t{\n\t\t $args = phpSmug::processArgs( func_get_args() );\n\t\t $this->oauth_token = $args['id'];\n\t\t $this->oauth_token_secret = $args['Secret'];\n\t}", "private function tasteTheCookie()\n {\n helper(\"auth\");\n\n if (isset($_COOKIE[\"token\"]))\n {\n $tokenCookie = $_COOKIE[\"token\"];\n $token = isValid($tokenCookie);\n \n if ($token != null)\n {\n if (isAuthenticated(\"Cinema\"))\n $this->userName = $token->name;\n else if (isAuthenticated(\"RUser\"))\n $this->userName = $token->firstName;\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n $this->userMail = $token->email;\n $this->userImage = ((new UserModel())->find($token->email))->image;\n }\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n }\n }", "public function setToken(string $token): void;" ]
[ "0.80971926", "0.7412908", "0.7254007", "0.70575297", "0.68581414", "0.6848265", "0.6841037", "0.67958033", "0.6785657", "0.6770088", "0.66900533", "0.6674568", "0.66610134", "0.66581374", "0.66293204", "0.66001207", "0.65938", "0.6584912", "0.6523374", "0.65193415", "0.651693", "0.6516574", "0.64793485", "0.64788187", "0.6473056", "0.6458096", "0.6427754", "0.64210963", "0.6379246", "0.63708705" ]
0.7425439
1
Adds plugin localization Domain: cynetiquelabels
function localization() { load_plugin_textdomain( 'cynetique-labels', false, dirname( plugin_basename( __FILE__ ) ) . '/language/' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function localizeLabels() {\n // (standard fields) and the artifact field table with a special flag and make sure\n // all tracker scripts handle them properly\n // For now make a big hack!! (see import.php func=showformat)\n $submitted_field = $this->art_field_fact->getFieldFromName('submitted_by');\n if (strstr($submitted_field->getLabel(),\"ubmit\")) {\n // Assume English\n $this->lbl_list['follow_ups'] = 'Follow-up Comments';\n $this->lbl_list['is_dependent_on'] = 'Depend on';\n $this->lbl_list['add_cc'] = 'CC List';\n $this->lbl_list['cc_comment'] = 'CC Comment';\n\n $this->dsc_list['follow_ups'] = 'All follow-up comments in one chunck of text';\n $this->dsc_list['is_dependent_on'] = 'List of artifacts this artifact depends on';\n $this->dsc_list['add_cc'] = 'List of persons to receive a carbon-copy (CC) of the email notifications (in addition to submitter, assignees, and commenters)';\n $this->dsc_list['cc_comment'] = 'Explain why these CC names were added and/or who they are';\n\n } else {\n // Assume French\n $this->lbl_list['follow_ups'] = 'Commentaires';\n $this->lbl_list['is_dependent_on'] = 'Depend de';\n $this->lbl_list['add_cc'] = 'Liste CC';\n $this->lbl_list['cc_comment'] = 'Commentaire CC';\n\n $this->dsc_list['follow_ups'] = 'Tout le fil de commentaires en un seul bloc de texte';\n $this->dsc_list['is_dependent_on'] = 'Liste des artefacts dont celui-ci depend';\n $this->dsc_list['add_cc'] = 'Liste des pesonnes recevant une copie carbone (CC) des notifications e-mail (en plus de la personne qui l\\'a soumis, a qui on l\\'a confie ou qui a poste un commentaire)';\n $this->dsc_list['cc_comment'] = 'Explique pourquoi ces personnes sont en CC ou qui elles sont';\n }\n }", "public function getPluginLabels() {}", "abstract function add_label();", "function plugin_cclabel_jtickets() {\n global $_CONF, $LANG_JTK;\n \n $pi_name = JTICKETS_str('admin_label');\n $admin_url = $_CONF['site_admin_url'] . '/plugins/jtickets/index.php';\n $icon_url = $_CONF['site_url'] . '/jtickets/images/jtickets.png';\n\n return array($pi_name, $admin_url, $icon_url);\n}", "function wpsl_labels() {\n\n $labels = array(\n 'search',\n 'search_btn',\n 'preloader',\n 'radius',\n 'no_results',\n 'results',\n 'more',\n 'directions',\n 'no_directions',\n 'back',\n 'street_view',\n 'zoom_here',\n 'error',\n 'phone',\n 'fax',\n 'email',\n 'url',\n 'hours',\n 'start',\n 'limit',\n 'category',\n 'category_default'\n );\n\n return $labels;\n}", "public function cpt_labels(){\n\t\t\t\n\t\t\t$a = $this->cpt_args;\n\t\t\t\n\t\t\t//build labels arguments array. \n\t\t\t\n\t\t\t$labels = array(\n\t\t\t\t'name' => _x( $a[ 'post_name' ], 'post type general name', NN_TD),\n\t\t\t\t'singular_name' => _x( $a[ 'post_name_single' ], 'post type singular name', NN_TD),\n\t\t\t\t'add_new' => _x('Add New', $a[ 'post_type' ], NN_TD),\n\t\t\t\t'add_new_item' => __('Add New '.$a[ 'post_item' ], NN_TD),\n\t\t\t\t'edit_item' => __('Edit '.$a[ 'post_item' ], NN_TD),\n\t\t\t\t'new_item' => __('New '.$a[ 'post_item' ], NN_TD),\n\t\t\t\t'all_items' => __( $a[ 'post_items' ], NN_TD),\n\t\t\t\t'view_item' => __('View '.$a[ 'post_item' ], NN_TD),\n\t\t\t\t'search_items' => __('Search '.$a[ 'post_items' ], NN_TD),\n\t\t\t\t'not_found' => __('No '.$a[ 'post_items' ].' found', NN_TD),\n\t\t\t\t'not_found_in_trash' => __('No '.$a[ 'post_items' ].' found in Trash', NN_TD), \n\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t'menu_name' => __( $a[ 'post_name' ], NN_TD)\n\t\t\t);\n\t\t\t\n\t\t\treturn $labels;\n\t\t}", "public function setLabels($labels) {\n\t\t$this -> setProperty('chl', urlencode($this->encodeData($this->getApplicableLabels($labels),\"|\")));\n\t}", "public function localization() {\n\t\t\tload_plugin_textdomain( 'bitlive-custom-codes', false, __DIR__ . '/languages/' );\n\t\t}", "public function labels()\n {\n }", "private function load_localization() {\n $plugin_i18n = new PLUGINNAME_i18n($this->getter()->get_translation_slug);\n add_action('plugins_loaded', array($plugin_i18n, 'load_plugin_textdomain'));\n }", "public function register_column_labels() {\n\n\t\t// don't load this unless required by WPML\n\t\tif ( ! isset( $_GET['page'] ) || 'wpml-string-translation/menu/string-translation.php' !== $_GET['page'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( cpac()->get_storage_models() as $storage_model ) {\n\t\t\tforeach ( $storage_model->get_stored_columns() as $column_name => $options ) {\n\t\t\t\ticl_register_string( 'Admin Columns', $storage_model->key . '_' . $column_name, stripslashes( $options['label'] ) );\n\t\t\t}\n\t\t}\n\t}", "function sn_load_text_domain() {\n\n\tload_plugin_textdomain( 'dorzki-notifications-to-slack' );\n\n}", "private function setLabels(){\n\t\t$this->labels = array(\n\t\t\t'name' => $this->name,\n\t\t\t'singular_name' => $this->nameMenuSingular,\n\t\t\t'menu_name' => $this->nameMenu,\n\t\t\t'all_items' => $this->nameAll,\n\t\t\t'add_new' => $this->nameAddNew,\n\t\t\t'add_new_item' => $this->nameNewItem,\n\t\t\t'edit_item' => $this->nameEdit,\n\t\t\t'new_item' => $this->nameNewItem,\n\t\t\t'view_item' => $this->nameView,\n\t\t\t'search_items' => $this->nameSearch,\n\t\t\t'not_found' => $this->msgNotFound,\n\t\t\t'not_found_in_trash' => $this->msgNotFoundTash,\n\t\t\t'parent_item_colon' => $this->msgParentItemColon\n\t\t);\n\t}", "protected function createJavaScriptLanguageLabelsFromFiles() {}", "function set_labels( $labels )\n\t{\n\t\t$this->labels = $labels;\n\t}", "public function get_label() {\n\t\t\treturn __( 'Costumapi', 'text-domain' );\n\t\t}", "function ind_text_domain() {\n\tload_plugin_textdomain('indizar', false, 'indizar/lang');\n}", "function glass_change_post_object_label() {\n\tglobal $wp_post_types;\n\t$labels = &$wp_post_types['post']->labels;\n\t$labels->name = 'News';\n\t$labels->singular_name = 'News';\n\t$labels->add_new = 'Add News';\n\t$labels->add_new_item = 'Add News';\n\t$labels->edit_item = 'Edit News';\n\t$labels->new_item = 'News';\n\t$labels->view_item = 'View News';\n\t$labels->search_items = 'Search News';\n\t$labels->not_found = 'No News found';\n\t$labels->not_found_in_trash = 'No News found in Trash';\n}", "public function register_strings()\n {\n if (!PLL_ADMIN) {\n return;\n }\n $return = acf_get_field_groups();\n\n foreach($return as $group) {\n\n $lang = pll_get_post_language($group['ID']);\n if ($lang != 'de') {\n continue;\n }\n pll_register_string('group_' . $group['ID'] . '_title', $group['title']);\n\n $fields = acf_get_fields($group['ID']);\n foreach($fields as $field) {\n\n pll_register_string($field['key'] . '_label', $field['label']);\n if (!isset($field['choices'])) {\n continue;\n }\n foreach($field['choices'] as $key=>$choiceValue) {\n pll_register_string($field['key'] . '_label_choice_' . $key, $choiceValue);\n }\n }\n }\n }", "protected function set_labels() {\n\n\t\t$defaults = array(\n\t\t\t'browse' => esc_html__( 'Browse:', 'boo' ),\n\t\t\t'aria_label' => esc_attr_x( 'Breadcrumbs', 'breadcrumbs aria label', 'boo' ),\n\t\t\t'home' => esc_html__( 'Home', 'boo' ),\n\t\t\t'error_404' => esc_html__( '404 Not Found', 'boo' ),\n\t\t\t'archives' => esc_html__( 'Archives', 'boo' ),\n\t\t\t'search' => esc_html__( 'Search results for &#8220;%s&#8221;', 'boo' ),\n\t\t\t'paged' => esc_html__( 'Page %s', 'boo' ),\n\t\t\t'archive_minute' => esc_html__( 'Minute %s', 'boo' ),\n\t\t\t'archive_week' => esc_html__( 'Week %s', 'boo' ),\n\n\t\t\t'archive_minute_hour' => '%s',\n\t\t\t'archive_hour' => '%s',\n\t\t\t'archive_day' => '%s',\n\t\t\t'archive_month' => '%s',\n\t\t\t'archive_year' => '%s',\n\t\t);\n\n\t\t$this->labels = wp_parse_args( $this->args['labels'], $defaults );\n\t}", "function rename_categories() {\n global $wp_taxonomies;\n $labels = &$wp_taxonomies['category']->labels;\n $labels->name = 'Groups';\n $labels->singular_name = 'Group';\n $labels->add_new = 'Add Group';\n $labels->add_new_item = 'Add Group';\n $labels->edit_item = 'Edit Group';\n $labels->new_item = 'Group';\n $labels->view_item = 'View Group';\n $labels->search_items = 'Search Groups';\n $labels->not_found = 'No Groups found';\n $labels->not_found_in_trash = 'No Groups found in Trash';\n $labels->all_items = 'All Groups';\n $labels->menu_name = 'Groups';\n $labels->name_admin_bar = 'Groups';\n}", "function dp_post_object_labels() {\n\t$custom_labels = get_option('dp_post_labels');\n\tif(!empty($custom_labels)) {\n\t\tglobal $wp_post_types;\n\t\t$labels = &$wp_post_types['post']->labels;\n\t\n\t\tforeach($custom_labels as $key => $label) {\n\t\t\tif(!empty($label))\n\t\t\t\t$labels->$key = $label;\n\t\t}\n\t}\n}", "public function localization_setup() {\n load_plugin_textdomain( 'baseplugin', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n }", "public function i18n() {\n load_plugin_textdomain( 'elementor-hubspot-bulb' );\n }", "public function setLabel($newLabel);", "function localize_plugin()\r\n{\r\n load_plugin_textdomain( 'favicon', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/');\r\n}", "public function getInlineLanguageLabels() {}", "public function load_text_domain() {\n\t\t\tload_plugin_textdomain($this->text_domain, false, dirname(plugin_basename(__FILE__)).'/lang/');\n\t\t\tdo_action('acf_options_page/load_text_domain'); \n\t\t}", "function plugin_initconfig_crowdtranslator( )\n{\n global $_CROWDTRANSLATOR_CONF, $_CROWDTRANSLATOR_DEFAULT;\n if ( is_array( $_CROWDTRANSLATOR_CONF ) && ( count( $_CROWDTRANSLATOR_CONF ) > 1 ) ) {\n $_CROWDTRANSLATOR_DEFAULT = array_merge( $_CROWDTRANSLATOR_DEFAULT, $_CROWDTRANSLATOR_CONF );\n }\n $me = 'crowdtranslator';\n $c = config::get_instance();\n if ( !$c->group_exists( $me ) ) {\n $c->add( 'sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, $me, 0 );\n $c->add( 'tab_main', NULL, 'tab', 0, 0, NULL, 0, true, $me, 0 );\n $c->add( 'fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, $me, 0 );\n // The below two lines add two settings to Geeklog's config UI\n $c->add( 'enabled', $_CROWDTRANSLATOR_DEFAULT[ 'enabled' ], 'select', 0, 0, 0, 10, true, $me, 0 ); // This adds a drop-down box\n }\n return true;\n}", "function maker_4ym_change_post_object_label() {\n global $wp_post_types;\n\n $labels = &$wp_post_types['post']->labels;\n $labels->name = 'Blog';\n $labels->singular_name = 'Artículos del Blog';\n $labels->add_new = 'Agregar un nuevo artículo';\n $labels->add_new_item = 'Escribir un nuevo artículo';\n $labels->edit_item = 'Editar un artículo';\n $labels->new_item = 'Nuevo artículo';\n $labels->view_item = 'Ver artículo';\n $labels->search_items = 'Buscar artículos';\n $labels->not_found = 'ningún artículo coincide con tu búsqueda';\n $labels->not_found_in_trash = 'ningún artículo en la papelera coincide con la búsqueda';\n}" ]
[ "0.65898657", "0.6542543", "0.61049074", "0.5950589", "0.59000653", "0.5863118", "0.5834209", "0.57861704", "0.57651937", "0.5666108", "0.5645403", "0.5635516", "0.5599845", "0.5589072", "0.5565746", "0.55436015", "0.5509131", "0.5508124", "0.5507005", "0.5498575", "0.54817265", "0.5454638", "0.5451511", "0.5432949", "0.54319847", "0.54316807", "0.54285693", "0.5380882", "0.5375682", "0.53752935" ]
0.70902514
0
Modify the caps list to add the unfiltered_html cap again if needed
function unfiltered_html_fix($caps, $cap, $user_id, $args) { // Check if the unfilter_html cap is requested if('unfiltered_html' == $cap) { // Check if there is a not allowed entry $key = array_search('do_not_allow', $caps); if (is_int($key)) { // Get the users' data $userdata = get_userdata($user_id); // I fthe user has the unfiltered_html cap, remove the do_not_allow entry from the caps array if(array_key_exists('unfiltered_html', $userdata->allcaps) && $userdata->allcaps['unfiltered_html']) { unset($caps[$key]); } } } // Return the updated caps return $caps; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nacin_filtered_html_for_editors( $caps, $cap, $user_id ) {\n\tif ( 'unfiltered_html' == $cap && ! is_super_admin( $user_id ) )\n\t\t$caps[] = 'do_not_allow';\n\treturn $caps;\n}", "public function remove_caps() {\n global $wp_roles;\n\n // TODO: see easy-digital-downloads plugin source codes for example implementation.\n }", "function palmate_edit_cap_filter( $allcaps, $cap, $args ) {\n if (in_array('edit_others_pages', $cap) && isset($args[2])) :\n $post_objects = get_field('palmate_edit_page_cap', 'user_' . $args[1]);\n if ($post_objects) :\n $has_post_id = count($post_objects) == 0 ? true : false;\n foreach ($post_objects as $post_object) :\n if ($post_object->ID == $args[2]) :\n $has_post_id = true;\n endif;\n endforeach;\n if ($has_post_id == false) :\n foreach ($cap as $c) :\n $allcaps[$c] = false;\n endforeach;\n endif;\n endif;\n endif;\n\n return $allcaps;\n}", "function __block_caps( $caps, $cap )\n\t{\n\t if ( $cap === 'install_themes' )\n\t $caps[] = 'do_not_allow';\n\t return $caps;\n\t}", "public function add_caps() {\n global $wp_roles;\n\n // TODO: see easy-digital-downloads plugin source codes for example implementation.\n }", "public function filter_has_cap( $all_caps = array() ) {\n\t\t\treturn array( 'read_private_talks' => true, 'edit_others_talks' => true );\n\t\t}", "public function remove_all_caps()\n {\n }", "protected function allow_html() {\n\t\tremove_filter( 'pre_term_description', 'wp_filter_kses' );\n\t\tremove_filter( 'term_description', 'wp_kses_data' );\n\n\t\tadd_filter( 'pre_term_description', 'wp_filter_post_kses' );\n\t}", "public function remove_caps_from_roles(): void {\n\t\t$all_capabilities_raw = $this->get_all_capabilities();\n\t\t$all_capabilities = array_values( $all_capabilities_raw );\n\t\t$all_capabilities = array_filter(\n\t\t\t$all_capabilities,\n\t\t\tstatic fn( $value ) => 'read' !== $value\n\t\t);\n\t\t$all_roles = wp_roles();\n\t\t$roles = array_values( (array) $all_roles->role_objects );\n\t\tforeach ( $roles as $role ) {\n\t\t\tif ( $role instanceof WP_Role ) {\n\t\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t\t$role->remove_cap( $cap );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires when removing the custom capabilities from existing roles.\n\t\t *\n\t\t * Can be used to remove the capabilities from other, custom roles.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $all_capabilities List of all post type capabilities, for reference.\n\t\t */\n\t\tdo_action( 'web_stories_remove_capabilities', $all_capabilities );\n\t}", "public function set_admin_caps(){\n\t\t\t\n\t\t\t$caps = $this->set_caps( $this->cpt_args );\n\t\t\t\n\t\t\t$admin = get_role( 'administrator' );\n\n\t\t\tforeach( $caps as $cap ){\n\t\t\t\tif( !$admin->has_cap( $cap ) )\n\t\t\t\t\t$admin->add_cap( $cap );\n\t\t\t}\n\t\t}", "protected function _init_caps($cap_key = '')\n {\n }", "static public function removeAdminCaps()\n {\n // récupérer le rôle administrateur\n $adminRole = get_role('administrator');\n // pour chaque cap prévue pour l'admin sur le CPT courant, on retire la cap\n foreach (static::ADMIN_CAPS as $cap => $grant) {\n $adminRole->remove_cap($cap);\n }\n }", "function erp_map_meta_caps( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {\n return apply_filters( 'erp_map_meta_caps', $caps, $cap, $user_id, $args );\n}", "function remove_jetpack( $caps, $cap, $user_id, $args ) {\n if ( 'jetpack_admin_page' === $cap ) {\n $caps[] = 'manage_options';\n }\n return $caps;\n}", "static public function addAdminCaps()\n {\n // récupérer le rôle administrateur\n $adminRole = get_role('administrator');\n // pour chaque cap prévue pour l'admin sur le CPT courant, on ajoute la cap\n foreach (static::ADMIN_CAPS as $cap => $grant) {\n $adminRole->add_cap($cap, $grant);\n }\n }", "public function update_user_level_from_caps()\n {\n }", "protected function get_restricted_cap()\n {\n }", "public function set_caps( $a ){\n\t\t\t\n\t\t\t$caps = array(\n\t\t\t\t\t'publish_posts' => 'publish_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_posts' => 'edit_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_others_posts' => 'edit_others_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_posts' => 'delete_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_others_posts' => 'delete_others_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'read_private_posts' => 'read_private_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_post' => 'edit_'.$a[ 'cap_post' ],\n\t\t\t\t\t'delete_post' => 'delete_'.$a[ 'cap_post' ],\n\t\t\t\t\t'read_post' => 'read_'.$a[ 'cap_post' ],\n\t\t\t\t\t'read' => 'read_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_private_posts' => 'edit_private_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'edit_published_posts' => 'edit_published_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_published_posts' => 'delete_published_'.$a[ 'cap_posts' ],\n\t\t\t\t\t'delete_private_posts' => 'delete_private_'.$a[ 'cap_posts' ]\n\t\t\t\t);\n\t\t\t\t\n\t\t\treturn $caps;\n\t\t}", "function acf_allow_unfiltered_html()\n{\n}", "public function remove_cap($cap)\n {\n }", "public function remove_cap($cap)\n {\n }", "public function filter_wp_kses_allowed_data_attributes($allowed_html)\n {\n }", "public function custom_category_descriptions_allow_html() {\n\t\t$filters = array(\n\t\t\t'pre_term_description',\n\t\t\t'pre_link_description',\n\t\t\t'pre_link_notes',\n\t\t\t'pre_user_description',\n\t\t);\n\n\t\tforeach ( $filters as $filter ) {\n\t\t\tremove_filter( $filter, 'wp_filter_kses' );\n\t\t}\n\t\tremove_filter( 'term_description', 'wp_kses_data' );\n\t}", "private function cnew_allowed_html() {\r\n $allowed_html = array(\r\n 'a' => array(\r\n 'class' => array(),\r\n 'href' => array(),\r\n 'title' => array(),\r\n ),\r\n 'b' => array(),\r\n 'strong' => array(),\r\n 'em' => array(),\r\n 'h1' => array(),\r\n 'h2' => array(),\r\n 'h3' => array(),\r\n 'h4' => array(),\r\n 'h5' => array(),\r\n 'h6' => array(),\r\n 'i' => array(),\r\n 'ul' => array(\r\n 'class' => array(),\r\n ),\r\n 'li' => array(\r\n 'class' => array(),\r\n ),\r\n 'ol' => array(\r\n 'class' => array(),\r\n ),\r\n 'p' => array(\r\n 'class' => array(),\r\n ),\r\n 'q' => array(\r\n 'cite' => array(),\r\n ),\r\n 'blockquote' => array(\r\n 'cite' => array(),\r\n ),\r\n 'cite' => array(\r\n 'title' => array(),\r\n ),\r\n 'abbr' => array(\r\n 'title' => array(),\r\n ),\r\n );\r\n\r\n return $allowed_html;\r\n }", "function removeBlacklistedAttributes($attribs) \n { \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*(\"[^\"]*\"|\\'[^\\']*\\')/i',\"\",$this->_html); \n $this->_html = preg_replace('/[\\s]+('.$attribs.')=[\\s]*[^ |^>]*/i',\"\",$this->_html); \n }", "function wp_maybe_grant_resume_extensions_caps($allcaps)\n {\n }", "public function user_has_cap($allcaps, $cap, $args) {\n $user = wp_get_current_user();\n // Allow administrators\n if ($user->ID === 0 || in_array('administrator', $user->roles)) {\n return $allcaps;\n }\n // Ignore if already disallowed\n if ($args[0] !== 'edit_post') {\n return $allcaps;\n }\n // Ignore non-post actions\n $post = get_post($args[2]);\n if ( ! $post instanceof WP_Post) {\n return $allcaps;\n }\n // Ignore unsupported post types\n if ( ! in_array($post->post_type, $this->post_types)) {\n return $allcaps;\n }\n // Finally, remove capability if post is locked\n $locked = get_post_meta($post->ID, 'vf_locked', true);\n if ($locked) {\n $allcaps[$cap[0]] = false;\n }\n return $allcaps;\n }", "protected function addCap($cap)\n {\n// $this->cap=$cap;\n echo $cap;\n }", "function map_meta_cap( $caps, $cap, $user_id, $args ){\n\n switch( $cap ){\n case 'edit_user':\n case 'remove_user':\n case 'promote_user':\n if( isset($args[0]) && $args[0] == $user_id )\n break;\n elseif( !isset($args[0]) )\n $caps[] = 'do_not_allow';\n $other = new WP_User( absint($args[0]) );\n if( $other->has_cap( 'administrator' ) ){\n if(!current_user_can('administrator')){\n $caps[] = 'do_not_allow';\n }\n }\n break;\n case 'delete_user':\n case 'delete_users':\n if( !isset($args[0]) )\n break;\n $other = new WP_User( absint($args[0]) );\n if( $other->has_cap( 'administrator' ) ){\n if(!current_user_can('administrator')){\n $caps[] = 'do_not_allow';\n }\n }\n break;\n default:\n break;\n }\n return $caps;\n }", "function custom_capabilities( $allcaps ) {\n\t// If you can manage options, you can use SST.\n\tif ( ! empty( $allcaps['manage_options'] ) ) {\n\t\t$allcaps['authenticate_sst'] = true;\n\t}\n\n\treturn $allcaps;\n}" ]
[ "0.678415", "0.6398957", "0.6286859", "0.6182761", "0.6059988", "0.59844756", "0.5831695", "0.5818075", "0.57009625", "0.5655802", "0.5650867", "0.56453943", "0.5632767", "0.546255", "0.54618245", "0.54593813", "0.5407884", "0.54071105", "0.5357758", "0.5268499", "0.5268499", "0.52648425", "0.5245249", "0.5229695", "0.52136254", "0.515154", "0.5109213", "0.50684476", "0.50639015", "0.5058234" ]
0.68786335
0
Converts a PHP error int to a string
private function _errorNumberString($intval) { $errorlevels = array( E_ALL => 'E_ALL', E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', E_STRICT => 'E_STRICT', E_USER_NOTICE => 'E_USER_NOTICE', E_USER_WARNING => 'E_USER_WARNING', E_USER_ERROR => 'E_USER_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_CORE_WARNING => 'E_CORE_WARNING', E_CORE_ERROR => 'E_CORE_ERROR', E_NOTICE => 'E_NOTICE', E_PARSE => 'E_PARSE', E_WARNING => 'E_WARNING', E_ERROR => 'E_ERROR' ); if (defined('E_DEPRECATED')) { $errorlevels[E_DEPRECATED] = 'E_DEPRECATED'; $errorlevels[E_USER_DEPRECATED] = 'E_USER_DEPRECATED'; } return $errorlevels[$intval]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error_level_tostring($intval, $separator)\r\n{\r\n $errorlevels = array(\r\n 2047 => 'E_ALL',\r\n 1024 => 'E_USER_NOTICE',\r\n 512 => 'E_USER_WARNING',\r\n 256 => 'E_USER_ERROR',\r\n 128 => 'E_COMPILE_WARNING',\r\n 64 => 'E_COMPILE_ERROR',\r\n 32 => 'E_CORE_WARNING',\r\n 16 => 'E_CORE_ERROR',\r\n 8 => 'E_NOTICE',\r\n 4 => 'E_PARSE',\r\n 2 => 'E_WARNING',\r\n 1 => 'E_ERROR');\r\n $result = '';\r\n foreach($errorlevels as $number => $name)\r\n {\r\n if (($intval & $number) == $number) {\r\n $result .= ($result != '' ? $separator : '').$name; }\r\n }\r\n return $result;\r\n}", "final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }", "public function errorString($code) {\n \n if(!is_numeric($code)) {\n return false;\n }\n\n $code = (int)$code;\n \n switch($code) {\n case 0: \n return \"Operation was successful\";\n case 247: \n return \"The userid provided is absent, or incorrect\";\n case 250: \n return \"The provided userid and/or Oauth credentials do not match\";\n case 286: \n return \"No such subscription was found\";\n case 293: \n return \"The callback URL is either absent or incorrect\";\n case 294: \n return \"No such subscription could be deleted\";\n case 304: \n return \"The comment is either absent or incorrect\";\n case 305: \n return \"Too many notifications are already set\";\n case 342: \n return \"The signature (using Oauth) is invalid\";\n case 343: \n return \"Wrong Notification Callback Url don't exist\";\n case 601: \n return \"Too Many Request\";\n case 2554: \n return \"Wrong action or wrong webservice\";\n case 2555: \n return \"An unknown error occurred\";\n case 2556: \n return \"Service is not defined\";\n }\n \n return false;\n }", "public static function getErrorMessage(int $code): string\n {\n return sprintf(\n '%s - Error Code = [%d]'\n , self::$errors[$code]\n , $code\n );\n }", "public function as_string() {\n return sprintf('%d %s', $this->code, self::$messages[$this->code]);\n }", "protected function _getErrorNumber()\n {\n return '';\n }", "private function int(int $value): string\n {\n return (string) $value;\n }", "protected function message(int $code): string\n {\n switch ($code) {\n case 0:\n return 'No error';\n case 1:\n return 'Multi-disk zip archives not supported';\n case 2:\n return 'Renaming temporary file failed';\n case 3:\n return 'Closing zip archive failed';\n case 4:\n return 'Seek error';\n case 5:\n return 'Read error';\n case 6:\n return 'Write error';\n case 7:\n return 'CRC error';\n case 8:\n return 'Containing zip archive was closed';\n case 9:\n return 'No such file';\n case 10:\n return 'File already exists';\n case 11:\n return 'Can\\'t open file';\n case 12:\n return 'Failure to create temporary file';\n case 13:\n return 'Zlib error';\n case 14:\n return 'Malloc failure';\n case 15:\n return 'Entry has been changed';\n case 16:\n return 'Compression method not supported';\n case 17:\n return 'Premature EOF';\n case 18:\n return 'Invalid argument';\n case 19:\n return 'Not a zip archive';\n case 20:\n return 'Internal error';\n case 21:\n return 'Zip archive inconsistent';\n case 22:\n return 'Can\\'t remove file';\n case 23:\n return 'Entry has been deleted';\n default:\n return 'An unknown error has occurred(' . intval($code) . ')';\n }\n }", "function error($code) {\n\tswitch ($code) {\n\t\tcase 'EntityExists':\n\t\t\t$str = 'Cannot complete that action because the entity already exists';\n\t\t\tbreak;\n\t\tcase 'EntityDoesNotExist':\n\t\t\t$str = 'Cannot complete that action because that entity does not exist';\n\t\t\tbreak;\n\t\tcase 'InvalidPassword':\n\t\t\t$str = 'The password supplied is not valid';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$str = $code;\n\t}\n\treturn $str;\n}", "protected function escapeInteger($value)\n {\n return (string) $value;\n }", "public function getMessage(): string\n {\n return \"The $this->name field must be an integer.\";\n }", "public function getErrorCode(): int;", "abstract protected function _getErrorNumber();", "abstract protected function _getErrorString();", "public function errorcode();", "public function getReasonPhrase(int $code): string\n {\n $code = $this->filterCode($code);\n\n if (!isset($this->values[$code])) {\n throw new OutOfBoundsException(sprintf(\"Unknown http status code: '%s'\", $code));\n }\n\n return $this->values[$code];\n }", "public function errorType($code)\n {\n switch($code)\n {\n case E_ERROR: // 1 //\n return 'E_ERROR';\n case E_WARNING: // 2 //\n return 'E_WARNING';\n case E_PARSE: // 4 //\n return 'E_PARSE';\n case E_NOTICE: // 8 //\n return 'E_NOTICE';\n case E_CORE_ERROR: // 16 //\n return 'E_CORE_ERROR';\n case E_CORE_WARNING: // 32 //\n return 'E_CORE_WARNING';\n case E_COMPILE_ERROR: // 64 //\n return 'E_COMPILE_ERROR';\n case E_COMPILE_WARNING: // 128 //\n return 'E_COMPILE_WARNING';\n case E_USER_ERROR: // 256 //\n return 'E_USER_ERROR';\n case E_USER_WARNING: // 512 //\n return 'E_USER_WARNING';\n case E_USER_NOTICE: // 1024 //\n return 'E_USER_NOTICE';\n case E_STRICT: // 2048 //\n return 'E_STRICT';\n case E_RECOVERABLE_ERROR: // 4096 //\n return 'E_RECOVERABLE_ERROR';\n case E_DEPRECATED: // 8192 //\n return 'E_DEPRECATED';\n case E_USER_DEPRECATED: // 16384 //\n return 'E_USER_DEPRECATED';\n }\n return \"\";\n }", "function jsonError($error) {\n\tswitch ( $error ) {\n\t\tcase JSON_ERROR_NONE:\n\t\t\treturn \"No error occurred\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_DEPTH:\n\t\t\treturn \"The maximum stack depth has been exceeded\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_STATE_MISMATCH:\n\t\t\treturn \"Invalid or malformed JSON\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_CTRL_CHAR:\n\t\t\treturn \"Control character error, possibly incorrectly encoded\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_SYNTAX:\n\t\t\treturn \"Syntax error\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_UTF8:\n\t\t\treturn \"Malformed UTF-8 characters, possibly incorrectly encoded\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_RECURSION:\n\t\t\treturn \"One or more recursive references in the value to be encoded\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_INF_OR_NAN:\n\t\t\treturn \"One or more NAN or INF values in the value to be encoded\";\n\t\t\tbreak;\n\t\tcase JSON_ERROR_UNSUPPORTED_TYPE:\n\t\t\treturn \"A value of a type that cannot be encoded was given\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn \"Unknown error\";\n\t\t\tbreak;\n\t}\n}", "function error_number($query)\n\t{\n\t\tif(!is_object($query) || !method_exists($query, \"errorCode\"))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$errorcode = $query->errorCode();\n\n\t\treturn $errorcode;\n\t}", "protected function getErrorMsgTemplate()\n {\n return 'The %s cast is ';\n }", "public function getErrorCode();", "public function getError(): int\n {\n return $this->error;\n }", "public function get_error_code()\n {\n }", "public function getCode(): int\n\t{\n\t\treturn $this->err->getCode();\n\t}", "public function getErrorCode()\n {\n return $this->getInput('error_code');\n }", "public function errorNumber()\n\t{\n\t\treturn $this->_source->errorNumber();\n\t}", "public function getError() : string {\n\t\t\treturn match ($this->error) {\n\t\t\t\tUPLOAD_ERR_OK => \"Upload completed successfully.\",\n\t\t\t\tUPLOAD_ERR_INI_SIZE => \"Upload exceeded maximum file size on server\",\n\t\t\t\tUPLOAD_ERR_FORM_SIZE => \"Upload exceeded maximum file size in browser\",\n\t\t\t\tUPLOAD_ERR_PARTIAL => \"Upload didn't complete\",\n\t\t\t\tUPLOAD_ERR_NO_FILE => \"No file was uploaded\",\n\t\t\t\tUPLOAD_ERR_NO_TMP_DIR => \"Missing temporary folder on server\",\n\t\t\t\tUPLOAD_ERR_CANT_WRITE => \"Failed to write upload to disk\",\n\t\t\t\tUPLOAD_ERR_EXTENSION => \"A server extension stopped the upload\",\n\t\t\t\tdefault => \"Unknown error code during file upload\",\n\t\t\t};\n\t\t}", "function errorCode($inc_errstr)\n{\n\techo \"<p><b>ERROR! \".$inc_errstr.\"</b></p>\";\n}", "public function getErrorMessageByCode($code): string\n {\n switch ($code) {\n case 400:\n {\n return 'Requisição Mal Formada';\n }\n case 401:\n {\n return 'Usuário não autorizado';\n }\n case 403:\n {\n return 'Acesso não autorizado';\n }\n case 404:\n {\n return 'Recurso não Encontrado';\n }\n case 405:\n {\n return 'Operação não suportada';\n }\n case 408:\n {\n return 'Tempo esgotado para a requisição';\n }\n case 409:\n {\n return 'Recurso em conflito';\n }\n case 413:\n {\n return 'Requisição excede o tamanho máximo permitido';\n }\n case 415:\n {\n return 'Content-type inválido';\n }\n case 422:\n {\n return 'Não foi possível processar as instruções contidas na requisição';\n }\n case 429:\n {\n return 'Requisição excede a quantidade máxima de chamadas permitidas à API.';\n }\n case 500:\n {\n return 'Erro na API';\n }\n }\n }", "public function getCodeConstant(): string\n\t{\n\t\treturn ExceptionUtil::getExceptionCode($this->err);\n\t}" ]
[ "0.65706104", "0.6526057", "0.6408439", "0.6399977", "0.63790435", "0.6315022", "0.6289075", "0.6205981", "0.60789806", "0.6077935", "0.5952338", "0.59312487", "0.5879333", "0.58779275", "0.5835858", "0.5826138", "0.5825865", "0.57955927", "0.5780753", "0.5779524", "0.576538", "0.5758351", "0.5757489", "0.5750919", "0.57485074", "0.5707905", "0.5692292", "0.5657612", "0.5649571", "0.5640602" ]
0.7100479
0
Return an instance for a give name, and create it if it doesn't exist. This allows both several distinct groups of notes in a same page and an usage with a single instance for all the page.
static public function getInstance($name = 'main', $start_index = 1) { if (!isset(self::$instances[$name])) { new skNotes($name, $start_index); } return self::$instances[$name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_instance_by_name($name) {\n\t\t$this->get_instance(\"\", \"$name\");\n\t\treturn $this;\n\t}", "public static function create($name = ''){\r\n $name = strtolower($name);\r\n if(empty(self::$instances[$name])){\r\n #$main = get_called_class()? get_called_class() : self;\r\n //$main = self;\r\n self::$instances[$name] = new self(); // self();\r\n }\r\n return self::$instances[$name];\r\n }", "public static function named_singleton($instance_name){\n\t\tif(!isset(static::$instances[$instance_name])){\n\t\t\treturn self::singleton_make_instance($instance_name, array_slice(func_get_args(),1));\n\t\t}\n\t\treturn static::$instances[$instance_name];\n\t}", "public static function getInstance(string $name = 'default'): self\n {\n if (! isset(self::$instances[$name])) {\n self::setInstance($name, new self());\n }\n\n return self::$instances[$name];\n }", "public static function getInstance($name = 'default')\n {\n return self::factory($name);\n }", "static function withName($name)\r\n {\r\n $interest = new Interest();\r\n $interest->name = $name;\r\n $interest->load_id();\r\n return $interest;\r\n }", "public static function getInstance($instance_name = 'default')\n {\n if (!isset(self::$instances))\n {\n self::$instances = array();\n }\n\n if (!isset(self::$instances[$instance_name]))\n {\n $class = __CLASS__;\n self::$instances[$instance_name] = new $class($instance_name);\n }\n\n return self::$instances[$instance_name];\n }", "public function get(string $name)\n {\n $name = $this->getName($name);\n\n if (array_key_exists($name, $this->instances)) {\n return $this->instances[$name];\n } else {\n $object = $this->create($name);\n\n if (in_array($name, $this->storeInstances, true)) {\n $this->set($name, $object);\n }\n\n return $object;\n }\n }", "static function getInstance($name){\n\t\tif(! isset( self::$_instances[$name]))\n\t\t\tself::$_instances[$name] = new cacheItem($name);\n\t\treturn self::$_instances[$name];\n\t}", "private function createByName($class, $name)\n {\n return $class::findOneCreateNew([\n 'name' => $name,\n ]);\n }", "public static function instance($name = null)\n\t{\n\t\tif (null === $name)\n\t\t{\n\t\t\t$name = md5(\\Request::active()->route->translation);\n\t\t}\n\n\t\tif ( ! isset(static::$instances[$name]))\n\t\t{\n\t\t\tthrow new FuelException(__METHOD__.\": Request to unknown instance {$name}\");\n\t\t}\n\n\t\treturn static::$instances[$name];\n\t}", "public function create($name);", "public function create(string $name): PageDecorator;", "function create() {\n\t\tglobal $default, $lang_err_doc_exist, $lang_err_database;\n\t\t//if the id >= 0, then the object has already been created\n\t\tif ($this->iId < 0) {\n\t\t\t//check to see if name exsits\n\t\t\t$sql = $default->db;\n\t\t\t$sQuery = \"SELECT id FROM \". $default->document_type_fields_table .\" WHERE document_type_id = ? and field_id = ?\";/*ok*/\n $aParams = array($this->iDocumentTypeID, $this->iFieldID);\n $sql->query(array($sQuery, $aParams));\n $rows = $sql->num_rows($sql);\n \n if ($rows > 0){\n $_SESSION[\"errorMessage\"] = \"DocTypes::The DocumentType name \" . $this->sName . \" is already in use!\";\n return false;\n }\n\t\t}\n\n return parent::create();\n\t}", "public function createDuplicate();", "static public function get($name)\n {\n\n if (!isset(self::$aInstances[$name]))\n {\n // echo \" returning new definition\\n\";\n self::$aInstances[$name] = new DataModel_Definition($name);\n }\n else\n // {\n // echo \" returning existing definition\\n\";\n // }\n // echo \" Count of definitions: \" . count(self::$aInstances) . \"\\n\";\n constraint_modelMustBeCalled(self::$aInstances[$name], $name);\n return self::$aInstances[$name];\n }", "public function create(bool $prepare = false)\n {\n // ensure that no other instance is created while we\n // determine ours\n $this->database->execute('BEGIN IMMEDIATE TRANSACTION');\n\n // check if there is a prepared instance we can use\n if ($prepare === false) {\n if ($instance = $this->get('ipHash IS NULL')) {\n $instance->grab();\n $this->database->execute('END TRANSACTION');\n\n return $instance;\n }\n }\n\n // generate a new unique name\n $table = $this->database->table('instances');\n do {\n $name = Str::random(8, 'alphaNum');\n } while ($table->where(['name' => $name])->count() > 0);\n\n // insert it into the DB and unlock again\n $props = [\n 'name' => $name,\n 'created' => $prepare === true ? null : time(),\n 'ipHash' => $prepare === true ? null : static::ipHash()\n ];\n $id = $table->insert($props);\n $this->database->execute('END TRANSACTION');\n\n // prevent that the template gets rebuilt while\n // the instance is created\n $this->demo()->lock()->acquireSharedLock();\n\n // create the actual instance\n $root = $this->demo()->config()->root() . '/public/' . $name;\n exec(\n 'cp -a ' .\n escapeshellarg($this->demo()->config()->templateRoot()) . ' ' .\n escapeshellarg($root),\n $output,\n $return\n );\n if ($return !== 0) {\n throw new Exception('Could not copy instance directory, got return value ' . $return);\n }\n\n $props['id'] = $id;\n $props['instances'] = $this;\n $instance = new Instance($props);\n\n $this->demo()->runHook($root, 'create:after', $instance);\n\n // the template can now be rebuilt again\n $this->demo()->lock()->releaseLock();\n\n return $instance;\n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function createNew();", "public static function findOrCreate(string $name)\n {\n $category = static::where('name', $name)->first();\n\n if (! $category) {\n return static::query()->create(['name' => $name]);\n }\n\n return $category;\n }", "public static function &CreateInstanceIfNotExists(){\n static $oInstance = null;\n\n if(!$oInstance instanceof self)\n $oInstance = new self();\n\n return $oInstance;\n }", "public static function newInstance($name = '')\n\t{\n\t\treturn new static($name);\n\t}", "function subpage_add_instance($subpage) {\n global $DB;\n\n return $DB->insert_record(\"subpage\", $subpage);\n}", "public static function createNew();", "public final function create(string $name, $attrs = null)\n {\n $this->insert(null, $child = static::el($name, $attrs));\n return $child;\n }", "abstract public function get_instance();", "public static function getInstance($name)\n\t{\n\t\t$rowData = (new App\\Db\\Query())\n\t\t\t->from(self::$menusTable)\n\t\t\t->where(['label' => $name])\n\t\t\t->limit(1)\n\t\t\t->one();\n\t\tif ($rowData) {\n\t\t\treturn self::getInstanceFromArray($rowData);\n\t\t}\n\t\treturn false;\n\t}", "final public static function getInstance()\n {\n // Get which class is the one we try to create\n $class_to_create = get_called_class();\n\n // If already exists in the array return the pointer\n if (!isset(self::$instances[$class_to_create])) {\n self::$instances[$class_to_create] = new $class_to_create();\n }\n\n return self::$instances[$class_to_create];\n }", "public static function instance( $name ) {\n\n if( !isset( self::$instance[ $name ] ) ) {\n self::$instance[ $name ] = new Log( $name );\n }\n\n return self::$instance[ $name ];\n }", "public function model($name){\n\t\treturn new $name();\n\t}" ]
[ "0.66478103", "0.6279453", "0.57138664", "0.5579757", "0.55593467", "0.55063534", "0.5467091", "0.5445959", "0.54185194", "0.54146576", "0.5393046", "0.53471726", "0.5316066", "0.5296416", "0.5273901", "0.5270045", "0.5264696", "0.52533877", "0.5243255", "0.52415645", "0.5193846", "0.51893586", "0.51857495", "0.5155534", "0.5132199", "0.5121621", "0.5112867", "0.5112247", "0.5098014", "0.50830865" ]
0.65738446
1
Whether or not at least one instance has been declared
static public function hasInstances() { return (bool) self::$instances; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function hasInstance()\n {\n return !self::$_instance ? false : true;\n }", "public static function hasInstance(){\n\t\tif(self::$instance !== null){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function hasInstance() {\n return (self::$instance != null);\n }", "public function isInstantiable() {\n\t\treturn !is_null($this->domain->class);\n\t}", "public static function initialized()\n\t{\n\t\treturn !is_null(self::$instance);\n\t}", "public function requiresInstance() : bool;", "public static function isLoading()\n {\n $qualifiedName = static::getSingletonClass();\n\n return isset(static::$instances[ $qualifiedName ])\n && static::$instances[ $qualifiedName ] === true;\n }", "public function onlyEmptyInstance()\n {\n return false;\n }", "public static function isLoaded()\n {\n $qualifiedName = static::getSingletonClass();\n\n return isset(static::$instances[ $qualifiedName ])\n && is_object(static::$instances[ $qualifiedName ]);\n }", "public function hasDefhpper(){\r\n return $this->_has(29);\r\n }", "public function valid()\n {\n\n if ($this->container['class_name'] === null) {\n return false;\n }\n return true;\n }", "public function hasElements()\n {\n return count($this->getElements()) > 0;\n }", "public function isDefined();", "public function isSigMember()\n {\n return $this->sigs()->where('main', 0)->count() > 0;\n }", "public function isInitialised();", "abstract public function is_have();", "public function hasStart(){\n return $this->_has(2);\n }", "public function hasStart(){\n return $this->_has(2);\n }", "public function is_class_reference() {\n\t\treturn ! empty( $this->get_class() );\n\t}", "static public function hasInstance($name = 'main')\n {\n return isset(self::$instances[$name]);\n }", "function have_interface() {\n\t\treturn count($this->watches) > 0;\n\t}", "public static function hasItems() {\n\t\treturn self::itemCount() > 0;\n\t}", "function hasInstanceGroups() {\n\t\treturn $this->_grouping->hasInstanceGroups();\n\t}", "public function isEmpty()\n\t{\n\t\treturn count( $this ) < 1;\n\t}", "protected function is_types_active() {\n\t\treturn class_exists( 'Types_Main' );\n\t}", "public function is_initialized()\n {\n }", "public function hasObject()\n {\n return (bool)!empty($this->object);\n }", "public function isOuterMostInstance() {}", "public function hasClass(): bool;", "public function has_person_types() {\n return !empty( $this->person_types );\n }" ]
[ "0.6926299", "0.68663096", "0.67592394", "0.67344093", "0.6689967", "0.66549003", "0.64389706", "0.64000255", "0.6397344", "0.62822354", "0.62742686", "0.6272355", "0.62215495", "0.6200866", "0.61925787", "0.6155768", "0.6132393", "0.6132393", "0.6116919", "0.61125475", "0.61033297", "0.61028385", "0.60795295", "0.6068077", "0.60465497", "0.60444355", "0.6028122", "0.601972", "0.60004556", "0.5961031" ]
0.7229147
0
Delete all existings notes in the instance
public function clearNotes() { $this->notes = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll()\n {\n return Laranote::where('model', get_class($this))\n ->where('model_id', $this->id)\n ->delete();\n }", "function cust_note_purge(){\r\n\t}", "public function delete() {\n // Deleting microarticles.\n $microarticles = $this->getMicroarticles();\n if (!empty($microarticles)) {\n foreach ($microarticles as $microarticle) {\n $microarticle->delete();\n }\n }\n\n // Deleting selfservices.\n $selfServices = $this->getSelfservices();\n if (!empty($selfServices)) {\n foreach ($selfServices as $selfService) {\n $selfService->delete();\n }\n }\n\n parent::delete();\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function delete(): void\n {\n $this->instances->demo()->runHook($this->root(), 'delete:before', $this);\n\n Dir::remove($this->root());\n $this->instances->delete($this->id);\n\n $this->instances->demo()->runHook($this->root(), 'delete:after', $this);\n }", "public function delete_all()\n {\n }", "public function delall()\n {\n }", "public function deleteAll(): void;", "abstract public function deleteAll();", "public function deleteAllPersistentData()\n {\n foreach ($this->persistantMap as $key) {\n $this->store->delete($key);\n }\n }", "public function destroy($id)\n {\n return Notes::find($id)->delete();\n }", "public static function unsnooze_notes() {\n\t\t$data_store = \\WC_Data_Store::load( 'admin-note' );\n\t\t$raw_notes = $data_store->get_notes(\n\t\t\tarray(\n\t\t\t\t'status' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_SNOOZED ),\n\t\t\t)\n\t\t);\n\t\t$now = new \\DateTime();\n\n\t\tforeach ( $raw_notes as $raw_note ) {\n\t\t\t$note = new WC_Admin_Note( $raw_note );\n\t\t\t$date_reminder = $note->get_date_reminder( 'edit' );\n\n\t\t\tif ( $date_reminder < $now ) {\n\t\t\t\t$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED );\n\t\t\t\t$note->set_date_reminder( null );\n\t\t\t\t$note->save();\n\t\t\t}\n\t\t}\n\t}", "public function fulldelete() {\n if ($this->id && !$this->elements) {\n $this->elements = self::get_instances(array('setid' => $this->id));\n }\n\n foreach ($this->elements as $elm) {\n $elm->delete();\n }\n\n parent::delete();\n }", "public function instance_deleted() {\n $this->purge_all_definitions();\n @rmdir($this->filestorepath);\n }", "public function unsetNote(): void\n {\n $this->note = [];\n }", "public function deleteAll()\n {\n //Find and destroy\n $entities = $this->findAll();\n return $this->deleteAll($entities);\n }", "public function delete()\n {\n $content = $this->get();\n\n foreach ($content as $key=>$value)\n {\n $this->set($key, null);\n }\n\n return $this->save();\n }", "public function delete()\n {\n $data = Comment::where(\"reply\", $this->id)->get();\n foreach ($data as $comment) {\n $comment->delete();\n }\n\n /**\n * Delete self\n */\n parent::delete();\n }", "public function delete_all() {\n\t\t$this->_cache = array();\n\t\t$this->_collections = array();\n\t}", "public function removeNotifications()\n {\n foreach ($this->notifications as $notification) {\n $notification->delete();\n }\n }", "protected function deleteAll()\n {\n Yii::$app->db->createCommand()\n ->delete($this->tableName, [$this->primaryKey => $this->owner->{$this->primaryKey}])\n ->execute();\n }", "function deleteNote(NoteInterface $note);", "public function destroy(Note $note)\n {\n \n }", "public function deleteAll() {\n if (isset($this::$has)) {\n foreach ($this::$has as $key => $value) {\n if(isset($this->$key)) {\n foreach ($this->$key as $item) {\n $item->deleteAll();\n }\n }\n }\n }\n $this->delete();\n }", "public function delete() {\n $events = $this->getEventsCreatedHere(); # we will need to write this method\n foreach ($events as $record) {\n $record->delete();\n }\n\n # delete the calendar_has_event records\n $has_events = $this->getCalendarHasEvents();\n foreach ($has_events as $record) {\n $record->delete();\n }\n\n # delete the user_has_permission records\n $permissions = $this->getAllPermissions();\n foreach ($permissions as $record) {\n $record->delete();\n }\n\n # delete the subscriptions on the calendar\n $subscriptions = $this->getSubscriptions();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n # delete the subscription_has_calendar records (remove calendar from subscriptions that subscribe to it)\n $subscriptions = $this->getSubscriptionHasCalendarRecords();\n foreach ($subscriptions as $record) {\n $record->delete();\n }\n\n return parent::delete();\n }", "function clearNotifs(){\n $aNotification = $this->model('Notification');\n\t\t$aNotification->clearNotifications();\n }", "protected function clearAllPersistentData()\r\n {\r\n }", "public function deleteAll(){\n try {\n $this->getTable()->delete();\n } catch (\\Exception $e) {\n $this->handleException($e);\n }\n return;\n }" ]
[ "0.65949166", "0.64415646", "0.6431757", "0.6355776", "0.6355776", "0.6355776", "0.6349734", "0.6345583", "0.63322914", "0.6330526", "0.6279643", "0.61425626", "0.61310434", "0.61271375", "0.611366", "0.6108818", "0.61079586", "0.60894454", "0.6082706", "0.6046894", "0.60440725", "0.6005003", "0.59788036", "0.5968172", "0.5965285", "0.5952648", "0.5949913", "0.5945129", "0.5938079", "0.59224945" ]
0.72404635
0
Whether or not the instance has notes.
public function hasNotes() { return (bool) $this->notes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHasnotes()\n {\n return $this->hasnotes;\n }", "public function HasNotesAvailable($numNotes)\n {\n return true;\n }", "public function issetNotes($index)\n {\n return isset($this->notes[$index]);\n }", "public function hasRemark(){\n return $this->_has(4);\n }", "public function notes()\r\n {\r\n $this->CI->db->where('rel_type', 'lead');\r\n $this->CI->db->where('rel_id', $this->leadId);\r\n\r\n return $this->CI->db->count_all_results('notes');\r\n }", "public function hasNotifications()\n {\n return count($this->notifications) > 0;\n }", "public function getNotes()\n {\n if (array_key_exists(\"notes\", $this->_propDict)) {\n return $this->_propDict[\"notes\"];\n } else {\n return null;\n }\n }", "public function getNotes()\n {\n if (array_key_exists(\"notes\", $this->_propDict)) {\n return $this->_propDict[\"notes\"];\n } else {\n return null;\n }\n }", "public function hasTips(){\n return $this->_has(19);\n }", "function getNotes() {\n\t\treturn $this->notes;\n\t}", "public function issetNote($index)\n {\n return isset($this->note[$index]);\n }", "public function issetNote($index)\n {\n return isset($this->note[$index]);\n }", "public function issetNote($index)\n {\n return isset($this->note[$index]);\n }", "public function getSharedNoteAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() != $this->user_id;\n }", "public function hasProperties(): bool\n {\n return !!$this->getProperties();\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function isPersistent()\n {\n return $this->persistent;\n }", "public function getNotes() {\n\t\treturn $this->_notes;\n\t}", "function getNotes() {\n\t\treturn $this->_Notes;\n\t}", "public function getIsNewRecord()\n {\n return $this->_item === null;\n }", "public function hasDescription() {\n return $this->_has(3);\n }", "public function hasDescription() {\n return $this->_has(3);\n }", "public function unread()\n {\n return $this->read_at === null;\n }", "public function hasComments()\n {\n return $this->getComments()->count() > 0;\n }", "private function isPaidCreditNote()\n {\n return ($this->getPaymentsTotal() >= $this->object->amount);\n }", "public function getNotes() {\n return $this->notes;\n }" ]
[ "0.7832878", "0.7188616", "0.66524655", "0.65862316", "0.64008695", "0.63334745", "0.63169765", "0.63169765", "0.6316238", "0.6172684", "0.6170044", "0.6170044", "0.6170044", "0.61361814", "0.6133082", "0.6111851", "0.6111851", "0.6111851", "0.6111851", "0.6111851", "0.60917145", "0.60915446", "0.6089409", "0.60880595", "0.60871154", "0.60871154", "0.6085348", "0.6079642", "0.6076428", "0.6064668" ]
0.8806864
0
Retrieve all notes of all instances in an array.
static public function getAllNotes() { $notes = array(); foreach (self::$instances as $i) { $notes = array_merge($notes, $i->getNotes()); } return $notes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findAll()\r\n {\r\n $sql = \"SELECT * FROM note\";\r\n try {\r\n $sth=$this->executer($sql);\r\n $rows = $sth->fetchAll(PDO::FETCH_ASSOC);\r\n } catch (PDOException $e) {\r\n die(\"Erreur lors de la requête SQL : \" . $e->getMessage());\r\n }\r\n $les_notes = array();\r\n foreach ($rows as $row) {\r\n $les_notes[] = new Note($row);\r\n }\r\n // Retourne un tableau d'objets \"note\"\r\n return $les_notes;\r\n }", "public function get_all_notes() {\n $sql = \"SELECT note_id FROM notes \n\t\tWHERE peducator_id='$this->peducator_id'\";\n $result = mysqli_query($this->connect_to_db, $sql);\n\n $arr = [];\n while ($row = mysqli_fetch_array($result)) {\n array_push($arr, get_note($row['note_id']));\n }\n\n return $arr;\n\n }", "public static function retrieveAllNotes() {\n return R::getAll('SELECT * FROM note');\n }", "public static function getAllNote() : array {\r\n global $config;\r\n $con = new Sql($config[\"host\"], $config[\"database\"], $config[\"username\"], $config[\"password\"]);\r\n $noteGateway = new NoteGateway($con);\r\n return $noteGateway->findAll();\r\n }", "public static function fetchAll() {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM ClientNotes';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute();\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $theNote = new Note($row);\n array_push($arr, $theNote);\n }\n return $arr;\n }", "private function get_notes()\n\t{\n\t\t$notes = $this->api->search( Options::get('simplenote__search') );\n\t\t\t\t\n\t\treturn $notes;\n\t}", "public function getNotes();", "public function notes()\n {\n return $this->morphedByMany('App\\Note', 'taggable');\n }", "function getNoteList()\n {\n $stmt = \"SELECT\n cno_id,\n cno_prj_id,\n cno_customer_id,\n cno_note\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_note\n ORDER BY\n cno_customer_id ASC\";\n $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return array();\n } else {\n for ($i = 0; $i < count($res); $i++) {\n $res[$i]['customer_title'] = self::getTitle($res[$i]['cno_prj_id'], $res[$i]['cno_customer_id']);\n }\n return $res;\n }\n }", "public function fetchAllNotes(){\n\t\t$fetchAll = $this->userClsObj->fetchAllNotes();\n\t\treturn $fetchAll;\n\t}", "function getNotes() {\n\t\treturn $this->notes;\n\t}", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function getNotes()\n {\n return $this->notes;\n }", "public function notes()\n {\n return $this->morphMany(Note::class, 'notable');\n }", "public function getNotes() {\n return $this->notes;\n }", "public function getNotes() {\n\t\treturn $this->_notes;\n\t}", "function return_notes()\n {\n $data = array();\n $query = $this->pdo->prepare('SELECT * FROM note');\n $query->execute();\n $posts = $query->fetchAll();\n $html = '';\n foreach ($posts as $value) \n {\n $html .= \"<div class='single-note'><div class='note-title'>\".$value['title'].\n \" <img class='delete' id='\".$value['id'].\"' src='img/delete.gif' alt='delete'></div><div class='note-text' id=\".$value['id'].\">\".$value['description'].\"</div></div>\";\n }\n $data['html'] = $html;\n return($data);\n }", "public function getNotes(array $options = null)\n\t{\n\t\treturn $this->getResourceChildCollection('notes', $options);\n\t}", "public function index()\n {\n return Notes::all();\n }", "function getNotes() {\n\t\treturn $this->_Notes;\n\t}", "public function setNotes(array $notes)\n {\n $this->notes = $notes;\n return $this;\n }", "public function getNotes($offset = 0, $length = null)\n {\n return array_slice($this->notes, $offset, $length);\n }", "public function index()\n {\n return Note::all();\n }", "public function testGetMultipleNotes()\n {\n $personas = Zend_Registry::get('personas');\n $personasContactIds = array();\n foreach ($personas as $persona) {\n $personasContactIds[] = $persona->contact_id;\n }\n $contacts = Addressbook_Controller_Contact::getInstance()->getMultiple($personasContactIds);\n \n // add note to contacts\n foreach ($contacts as $contact) {\n $this->_instance->addNote(new Tinebase_Model_Note(array(\n 'note' => 'very important note!',\n 'note_type_id' => Tinebase_Notes::getInstance()->getNoteTypes()->getFirstRecord()->getId(),\n 'record_id' => $contact->getId(),\n 'record_model' => 'Addressbook_Model_Contact',\n )));\n }\n \n $this->_instance->getMultipleNotesOfRecords($contacts);\n foreach ($contacts as $contact) {\n $this->assertGreaterThan(0, count($contact->notes), 'No notes found for contact ' . $contact->n_fn);\n }\n }", "public static function all()\n\t{\n\t\treturn self::new_instance_records()->all();\n\t}", "public function get_notes() {\n return YITH_WCBK()->notes->get_booking_notes( $this->id );\n }", "public function index()\n {\n $note = Note::all();\n }" ]
[ "0.7148266", "0.7115256", "0.7059663", "0.6985267", "0.68412703", "0.67093337", "0.6664714", "0.6662751", "0.64520955", "0.6357014", "0.6309638", "0.6259194", "0.6259194", "0.6259194", "0.6259194", "0.6259194", "0.62185127", "0.61943984", "0.6185033", "0.6170607", "0.61289346", "0.6117927", "0.6040127", "0.59580857", "0.5941279", "0.5933823", "0.5932342", "0.58516645", "0.5763313", "0.56947327" ]
0.7910401
0
Return the last index used in this instance
public function getLastIndex() { return $this->index - 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEndIndex()\n {\n return $this->end_index;\n }", "public function last()\n {\n if($this->length()>0)\n {\n return $this->getAt(($this->length()-1));\n }\n throw new \\OutOfBoundsException();\n }", "protected function setIndexAtMax()\n {\n return count($this->segments) - 1;\n }", "public function last()\n {\n return $this->fixedArray->offsetGet($this->currentSize - 1);\n }", "public function GetLastIndexInPage()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return ($this->GetFirstIndexInPage() + $this->GetNumberOfResultsInThisPage()) - 1;\n }", "public function get_last_tab_index() {\n\t\t\n\t\treturn $this->last_tab_index;\n\t\t\n\t}", "public function getIdx()\n {\n return $this->get(self::_IDX);\n }", "public function getLast(): int {\n return $this->last;\n }", "private function getLastMethodIndex() {\n\t\tend($this->methodArray);\n\t\treturn key($this->methodArray);\n\t}", "public function getIndexEnd();", "public function last()\n {\n $copy = $this->array;\n return end($copy);\n }", "public function getLast()\n\t{\n\t\treturn $this->last;\n\t}", "public function index(): int\n {\n return $this->index;\n }", "public function getLast()\n {\n $k = count($this);\n if ($k > 0) {\n return $this[$k - 1];\n }\n }", "public function lastItem() {\n\t\treturn $this->fastForward()->current();\n\t}", "public function getNewIndex()\n {\n return $this->new_index;\n }", "public static function getIndex(): int\n {\n return static::$index;\n }", "public function tell()\n {\n return $this->index;\n }", "public function last()\n {\n $this->cursor = $this->length - 1;\n\n return $this->current();\n }", "public function last()\n {\n return end($this->storage);\n }", "public function last()\n {\n return end($this->items);\n }", "public function getCurrent() {\n return $this->current-1;\n }", "public function last()\r\n\t{\r\n\t\treturn end($this->_items);\r\n\t}", "public function last() {\n return end($this->list);\n }", "public function getIndex() {\r\n\t\treturn $this->_index;\r\n\t}", "function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function lastObject()\n {\n return end($this->array);\n }", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function last() {\n return $this->seek($this->data['num_rows'] - 1);\n }" ]
[ "0.7855067", "0.74609345", "0.733592", "0.72967386", "0.7281308", "0.7230087", "0.72265196", "0.7222558", "0.7169545", "0.7104575", "0.70201665", "0.695318", "0.694076", "0.69365275", "0.6914049", "0.69137734", "0.69001776", "0.68961084", "0.6892495", "0.6887779", "0.6882234", "0.6873868", "0.68539256", "0.68467987", "0.68397576", "0.6826048", "0.6818998", "0.6815817", "0.6815817", "0.6806518" ]
0.8650569
0
Create a new stream from the given iterable (any primitive array or \Traversable). Stream
public static function of(iterable $iterable): self { $generator = function () use ($iterable) { foreach ($iterable as $item) { yield $item; } }; return new self($generator()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}", "public function streamAll(): Generator;", "private static function _toIterable(array $streams): iterable {\r\n\t\tforeach ($streams as $stream) {\r\n\t\t\tif (is_array($stream)) {\r\n\t\t\t\t$stream = new MemoryStream($stream);\r\n\t\t\t}\r\n\t\t\tif (!($stream instanceof Stream)) {\r\n\t\t\t\tthrow new InvalidArgumentException(\"Stream parameters must be Stream or array instance.\");\r\n\t\t\t}\r\n\t\t\tforeach ($stream->toIterable() as $key => $value) {\r\n\t\t\t\tyield $key => $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "abstract protected function _normalizeIterable($iterable);", "public function cartesianProduct(iterable $stream): Stream {\n\t\t$generator = function ($set_b) {\n\t\t\tforeach ($this as $element_a) {\n\t\t\t\tforeach ($set_b as $element_b) {\n\t\t\t\t\tyield [$element_a, $element_b];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(iterator_to_array($stream)));\n\t}", "private function wrapIterable(iterable $iterable): Generator\n {\n foreach ($iterable as $key => $value) {\n yield $key => $value;\n\n $this->iteratorAdvanced = true;\n }\n\n $this->iterator = null;\n }", "public abstract function toIterable(): iterable;", "function _arrayOrIterator(iterable $base, callable $generator) : iterable\n{\n $result = $generator($base);\n return is_array($base) ? iterator_to_array($result) : $result;\n}", "function pseudoTypeIterableAndArray(iterable|array|Traversable $var) {}", "protected function initList(Closure|iterable $iterable): Generator\n {\n if ($iterable instanceof CollectionInterface) {\n $iterable = $iterable->getIterator();\n }\n\n if (!$iterable instanceof Generator) {\n if (is_iterable($iterable)) {\n $iterable = fn(): Generator => yield from $iterable;\n }\n }\n\n if ($iterable instanceof Closure) {\n $iterable = $iterable();\n }\n\n if (!$iterable instanceof Generator) {\n throw new InvalidArgumentException('Argument must be iterable');\n }\n\n return $iterable;\n }", "function stream_for($resource = '', array $options = [])\n{\n // 若是标量则创建一个临时流, 将内容写入该临时流中并重置游标位置\n if (is_scalar($resource)) {\n $stream = fopen('php://temp', 'r+');\n if ($resource !== '') {\n fwrite($stream, $resource);\n fseek($stream, 0);\n }\n return new Stream($stream, $options);\n }\n\n switch (gettype($resource)) {\n case 'resource':\n return new Stream($resource, $options);\n break;\n\n case 'object':\n if ($resource instanceof StreamInterface) {\n return $resource;\n } elseif ($resource instanceof \\Iterator) {\n return new PumpStream(function () use ($resource) {\n if (!$resource->valid()) {\n return false;\n }\n $result = $resource->current();\n $resource->next();\n return $result;\n }, $options);\n } elseif (method_exists($resource, '__toString')) {\n return stream_for((string)$resource, $options);\n }\n break;\n\n case 'NULL':\n return new Stream(fopen('php://temp', 'r+'), $options);\n }\n\n if (is_callable($resource)) {\n return new PumpStream($resource, $options);\n }\n\n throw new \\InvalidArgumentException(\"Resource is invalid\");\n}", "public abstract function filter(callable|UnaryFunction|FilterOperator $filter): Stream;", "public function asTraversable();", "function foo(iterable $itetable){\n\tforeach ($iterable as $value){\n\t\t//...\n\t}\n}", "public static function stream(callable $callable, ...$args)\n {\n while(true) {\n if (is_callable($callable)) {\n yield $callable(...$args);\n } else {\n yield $callable;\n }\n }\n }", "public function transpose(): Stream {\n\t\t$streams = $this->map(function (iterable $iterable) {\n\t\t\treturn Stream::of($iterable);\n\t\t})\n\t\t\t->collect();\n\t\tif (count($streams) == 0) {\n\t\t\treturn new self(new \\ArrayIterator([]));\n\t\t}\n\n\t\t$generator = function (\\Iterator ...$streams): \\Generator {\n\t\t\tforeach ($streams as $stream) {\n\t\t\t\t$stream->rewind();\n\t\t\t}\n\t\t\t$all_are_valid = function (\\Iterator ...$streams) {\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\tif (!$stream->valid()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twhile ($all_are_valid(...$streams)) {\n\t\t\t\t$ziped_element = [];\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\t$ziped_element[] = $stream->current();\n\t\t\t\t\t$stream->next();\n\t\t\t\t}\n\t\t\t\tyield $ziped_element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(...$streams));\n\t}", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "function is_iterable($var)\n{\n return $var !== null \n && (is_array($var) \n || $var instanceof Traversable \n || $var instanceof Iterator \n || $var instanceof IteratorAggregate\n );\n}", "public static function is_iterable($input)\n {\n }", "public function stream();", "public function toArray(): iterable;", "public function __construct(iterable $items)\n {\n if (is_array($items)) {\n $items = new ArrayIterator($items);\n }\n\n parent::__construct($items);\n }", "public static function toIterable($value) : iterable\n\t{\n\t\treturn is_iterable($value) ? $value : self::toArray($value);\n\t}", "function compact($iterable)\n{\n if (is_array($iterable)) {\n return array_values(array_filter($iterable));\n }\n\n return compactIterable($iterable);\n}", "public abstract function map(callable|UnaryFunction|string|MapOperator $mapper): Stream;", "public static function of(array $array)\n {\n return self::from(Iterables::fromArray($array));\n }", "public function stream_from_scalar( $data ): StreamInterface {\n\t\treturn Stream::create( json_encode( $data ) ?: '' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.json_encode_json_encode\n\t}", "public function testIteratorWorksWithTraversableObject()\n {\n $iterator = $this->createIterator(new \\ArrayIterator(array(1)));\n\n $data = iterator_to_array($iterator);\n\n $expectedData = array(\n array(1)\n );\n $this->assertEquals($expectedData, $data);\n }", "function foo(iterable $iterable = null) {\n}", "public function testIsTraversable()\n {\n $this->assertInstanceOf('Traversable', $this->createIterator(array()));\n }" ]
[ "0.6559754", "0.62027353", "0.60805166", "0.5930609", "0.59261584", "0.57892394", "0.57766134", "0.56569535", "0.56410336", "0.5607612", "0.55913645", "0.55533034", "0.55237395", "0.55169445", "0.5494183", "0.5426795", "0.5402816", "0.5327347", "0.5319683", "0.53097826", "0.5301564", "0.52799934", "0.5247388", "0.52332556", "0.5211252", "0.5143727", "0.5116538", "0.51067066", "0.5069559", "0.5055017" ]
0.6511389
1
Create a new stream from the given iterable (any primitive array or \Traversable). as [key, value] format
public static function ofKeyValueMap(iterable $iterable): self { $generator = function () use ($iterable) { foreach ($iterable as $key => $item) { yield [$key, $item]; } }; return new self($generator()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function wrapIterable(iterable $iterable): Generator\n {\n foreach ($iterable as $key => $value) {\n yield $key => $value;\n\n $this->iteratorAdvanced = true;\n }\n\n $this->iterator = null;\n }", "function values(iterable $items) : iterable\n{\n return _arrayOrIterator($items, function($items) {\n foreach ($items as $_ => $value) {\n yield $value;\n }\n });\n}", "public function asTraversable();", "function fromPairs(iterable $items) : iterable\n{\n return _arrayOrIterator($items, function($items) {\n foreach ($items as list($key, $value)) {\n yield $key => $value;\n }\n });\n}", "function iterable_map_keys(iterable $iterable, callable $callback): \\Generator\n{\n foreach ($iterable as $key => $value) {\n yield call_user_func($callback, $value, $key) => $value;\n }\n}", "private static function _toIterable(array $streams): iterable {\r\n\t\tforeach ($streams as $stream) {\r\n\t\t\tif (is_array($stream)) {\r\n\t\t\t\t$stream = new MemoryStream($stream);\r\n\t\t\t}\r\n\t\t\tif (!($stream instanceof Stream)) {\r\n\t\t\t\tthrow new InvalidArgumentException(\"Stream parameters must be Stream or array instance.\");\r\n\t\t\t}\r\n\t\t\tforeach ($stream->toIterable() as $key => $value) {\r\n\t\t\t\tyield $key => $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function toPairs(iterable $items) : iterable\n{\n return _arrayOrIterator($items, function($items) {\n foreach ($items as $key => $value) {\n yield [$key, $value];\n }\n });\n}", "public static function of(iterable $iterable): self {\n\t\t$generator = function () use ($iterable) {\n\t\t\tforeach ($iterable as $item) {\n\t\t\t\tyield $item;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator());\n\t}", "public function toArray(): iterable;", "abstract protected function _normalizeIterable($iterable);", "public abstract function toIterable(): iterable;", "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}", "public static function toIterable($value) : iterable\n\t{\n\t\treturn is_iterable($value) ? $value : self::toArray($value);\n\t}", "function foo(iterable $itetable){\n\tforeach ($iterable as $value){\n\t\t//...\n\t}\n}", "public function keyBy(callable $callback): Stream {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tyield [$callback($value), $value];\n\t\t\t}\n\t\t};\n\t\treturn new Stream($generator($this));\n\t}", "private function buildValues(iterable $values): Generator\n {\n foreach ($values as $key => $value) {\n yield $key => new Value($value);\n }\n }", "function &iterable(iterable $value, string $namespace = 'default'): iterable\n{\n $var = new Variable\\IterableVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "function filter_with_key(iterable $iterable, ?callable $predicate = null): Iterator\n{\n return Iterator::from(static function () use ($iterable, $predicate): Generator {\n $predicate = $predicate ??\n /**\n * @param Tk $_k\n * @param Tv $v\n *\n * @return bool\n */\n static fn ($_k, $v) => Psl\\Internal\\boolean($v);\n\n foreach ($iterable as $k => $v) {\n if ($predicate($k, $v)) {\n yield $k => $v;\n }\n }\n });\n}", "function _arrayOrIterator(iterable $base, callable $generator) : iterable\n{\n $result = $generator($base);\n return is_array($base) ? iterator_to_array($result) : $result;\n}", "public function streamAll(): Generator;", "function compact($iterable)\n{\n if (is_array($iterable)) {\n return array_values(array_filter($iterable));\n }\n\n return compactIterable($iterable);\n}", "private function castToArray(iterable $value)\n {\n if ($value instanceof \\Traversable) {\n return iterator_to_array($value);\n }\n return (array)($value);\n }", "function iterator_to_array(#[LanguageLevelTypeAware(['8.2' => 'Traversable|array'], default: 'Traversable')] $iterator, bool $preserve_keys = true): array {}", "public static function specialsIterator(iterable $iter): iterable {\n\t\t$result = [];\n\t\tforeach ($iter as $k => $v) {\n\t\t\t$result[$k] = self::specials($v);\n\t\t}\n\t\treturn $result;\n\t}", "function flip(iterable $iterable): Iterator\n{\n return Iterator::from(static function () use ($iterable): Generator {\n foreach ($iterable as $k => $v) {\n yield $v => $k;\n }\n });\n}", "function mdl_unique_iterable($iterable, string $key = null)\n{\n $keys = [];\n foreach ($iterable as $k => $value) {\n # code...\n // Case the searched key does not exist, we simply add it to the output\n if (!isset($value[$key])) {\n yield $k => $value;\n continue;\n }\n if (array_key_exists($value[$key], $keys)) {\n continue;\n }\n $keys[$value[$key]] = true;\n yield $k => $value;\n }\n}", "function unique_by(iterable $iterable, callable $scalar_func): array\n{\n return Dict\\unique_by($iterable, $scalar_func);\n}", "public static function readables(): iterable;", "public function iterable(): iterable\n {\n return $this->array;\n }", "public function cartesianProduct(iterable $stream): Stream {\n\t\t$generator = function ($set_b) {\n\t\t\tforeach ($this as $element_a) {\n\t\t\t\tforeach ($set_b as $element_b) {\n\t\t\t\t\tyield [$element_a, $element_b];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(iterator_to_array($stream)));\n\t}" ]
[ "0.6266488", "0.5900001", "0.58386266", "0.5832316", "0.57738185", "0.57727206", "0.5742736", "0.5705308", "0.56659883", "0.56152385", "0.5591484", "0.5556349", "0.5494932", "0.5494178", "0.54241776", "0.53816116", "0.5348853", "0.5339272", "0.5333107", "0.5318429", "0.5296972", "0.5283564", "0.52791345", "0.5272705", "0.5256095", "0.5243646", "0.5217621", "0.5175986", "0.5171386", "0.5146358" ]
0.6234577
1
Creates a stream with int numbers from start to end by increments of a step. The range is inclusively.
public static function rangeInt(int $start, int $end, int $step = 1): self { return self::range($start, $end, $step); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function range($start, $end, $step = null): static;", "public function range(int $start, int $end = null, int $step = null, bool $equal = null) : \\Generator\n {\n $step = $step ?? 1;\n $equal = $equal ?? false;\n\n if (0 === $step) {\n return;\n }\n\n $isReverse = $step < 0;\n\n if ($isReverse) {\n $end = $end ?? 0;\n\n } else {\n if (! isset($end)) {\n [ $end, $start ] = [ $start, $end ];\n }\n\n $start = $start ?? 0;\n }\n\n // dd($start, $end, $isForward, $equal);\n\n for ( $i = $start;\n null\n ?? ( ( $equal && $isReverse ) ? $i >= $end : null )\n ?? ( $equal ? $i <= $end : null )\n ?? ( $isReverse ? $i > $end : null )\n ?? ( $i < $end );\n //\n $i += $step\n ) {\n yield $i;\n }\n }", "public static function createWithRange($low, $high, $step = 1)\n {\n return new static(range($low, $high, $step));\n }", "static public function range($start = 1, $stop = 1, $step = 1) {\n $argsNum = func_num_args();\n $args = func_get_args();\n\n if ($argsNum <= 1) {\n $stop = isset($args[0]) ? $args[0] : 0;\n $start = 0;\n }\n\n $step = isset($args[2]) ? $args[2] : 1;\n\n $start = intval($start);\n $stop = intval($stop);\n $step = intval($step);\n\n $range = array();\n while (1) {\n $range[] = $start;\n $start += $step;\n if ($start >= $stop) {\n break;\n }\n }\n\n return $range;\n }", "public static function range(int $step = 10, int $max = 100): array\n {\n if ($step < 1) {\n return [];\n }\n\n $array = [];\n for ($i = $step; $i <= $max; $i += $step) {\n $array[$i] = $i;\n }\n\n return $array;\n }", "function numberRange($start, $end)\n{\n $number_range = range($start, $end);\n\n return $number_range;\n}", "public static function everyInteger($min=0, $max=PHP_INT_MAX, $stride=1)\n {\n $min = (int)$min;\n $max = (int)$max;\n $stride = (int)$stride;\n\n if ($min > $max) {\n throw new \\Exception(\"Invalid integer range: \\$max should be at least $min, but it was set to $max\");\n }\n\n if ($stride < 1) {\n throw new \\Exception(\"Invalid integer range: \\$stride should be at least 1, but it was set to $stride\");\n }\n\n while (true) {\n for ($int = $min; $int < $max; $int++) {\n yield $int;\n }\n }\n }", "public function range($start = NULL, $length = NULL);", "function getSum($n){\n \n $range =500;\n for($i=0;$i<$n;$i++){\n echo $range--.\" \";\n }\n}", "public static function integers()\n {\n // First, make sure the most common numbers are covered.\n yield 0;\n yield -1;\n yield 1;\n\n // Then generate random numbers from an increasing range.\n $half_of_randmax = mt_getrandmax() / 2;\n $lim = 1;\n $iterations = 0;\n while (true) {\n $iterations++;\n\n yield mt_rand(-$lim, $lim);\n\n if ($lim <= $half_of_randmax) {\n $lim *= 2;\n } else {\n // Start over when maxed out.\n $lim = 1;\n }\n }\n }", "public function nth(int $step, int $offset = 0): self;", "function addNumbers($end, $start = 0) {\r\n $sum = 0;\r\n for($i = $start; $i <= $end; $i++){\r\n $sum += $i;\r\n }\r\n echo(\"The sum of $start to $end = $sum<br \\>\");\r\n\r\n }", "public function splitRange($start, $end) {\n \t$series = [];\n \t$ranges = [];\n\n \t// start is the same as min page; make standalone number\n \tif ( intval($start) === $this->_min_page ) {\n \t\t$series[] = $start;\n \t}\n \telse {\n\t\t\t$range = $start . $this->_range_delimiter . strval($this->_min_page);\n\t\t\t$series[] = $this->processRange($range);\n \t}\n\n \t// end only one more than min_page; make standalone number after stepping\n \tif ( intval($end) - $this->_min_page === 1 ) {\n \t\t$series[] = $this->step($end);\n \t}\n \telse {\n\t\t\t$range = strval($this->_min_page + 1). $this->_range_delimiter . $end;\n\t\t\t$series[] = $this->processRange($range);\n \t}\n\n \treturn implode($this->_series_delimiter, $series);\n }", "public function step($input) {\n\n \tif ( $this->isPrelim($input) ) {\n \t\treturn $input;\n \t}\n\n if ( !is_numeric($input) ) {\n throw new InvalidArgumentException(\"bad number: ${input}\");\n }\n\n $num = intval($input);\n\n if ( $num > $this->_min_page ) {\n $num = $num + $this->_increment;\n }\n\n return strval($num);\n }", "function rangeIter(int $min, int $max): int\n {\n $array = range($min, $max);\n $total = 0;\n\n while ($array)\n {\n $total += array_pop($array);\n }\n\n return $total;\n }", "function OutputRange($int){\n $intervals = array(4,14,32,45);\n $elements = count($intervals);\n for($i=0; $i<$elements-1; $i++){\n if($intervals[$i]<$int && $int<=$intervals[$i+1]){\n return $intervals[$i].'-'.$intervals[$i+1];\n }\n }\n return $intervals[$elements-1].'+';\n}", "public static function rangeFloat(float $start, float $end, float $step = 1): self {\n\t\treturn self::range($start, $end, $step);\n\t}", "public static function integerRange($min, $max)\n {\n $min = (int)$min;\n $max = (int)$max;\n\n if ($min > $max) {\n throw new \\Exception(\"Invalid integer range: \\$max should be at least $min, but it was set to $max\");\n }\n\n while (true) {\n yield mt_rand($min, $max);\n }\n }", "public function setStep(int $value): CustomField\n {\n $this->step = $value;\n\n return $this;\n }", "public static function floorStep($value, int $step = 1)\n\t{\n\t\treturn floor($value / $step) * $step;\n\t}", "function oddRange($min, $max)\n{\n $range = [];\n while ($min <= $max) {\n if ($min % 2 == 1) {\n $range[] = $min;\n }\n $min += 1;\n }\n return $range;\n}", "public static function between(int $min, int $max, bool $inclusive = true): self\n {\n return new self($min, $max, $inclusive);\n }", "function calc_step($min, $max, $from, $to) {\n\n\t// Thank you wordpress for this\n\t$spread = $max - $min;\n\tif ( $spread <= 0 )\n\t\t$spread = 1;\n\t$font_spread = $to - $from;\n\tif ( $font_spread < 0 )\n\t\t$font_spread = 1;\n\t$step = $font_spread / $spread;\n\n\treturn $step;\n}", "public static function period($range, $step, $format = \"Y-m-d\") {\n $tm = self::getTimeStamp($range[0]);\n $tm1 = self::getTimeStamp($range[1]);\n $period = array();\n while ($tm < $tm1) {\n $period[] = self::format($tm, $format);\n $tm += $step;\n }\n return $period;\n}", "private function create_range($n)\n {\n $this->range = array_fill(2, $n - 1, 1);\n }", "function take($n, $stream) {\n foreach ($stream as $x) {\n if ($n-- === 0) {\n break;\n }\n yield $x;\n }\n}", "function date_range($first, $last, $step = '+1 day', $output_format = 'd/m/Y' ) {\n\n $dates = array();\n $current = strtotime($first);\n $last = strtotime($last);\n\n while( $current <= $last ) {\n\n $dates[] = date($output_format, $current);\n $current = strtotime($step, $current);\n }\n\n return $dates;\n }", "public function getLovelyNumbers($start, $end){\n $repeated = 0; $remove_me = 0;\n if($end<$start){ return 'Action can not be completed : End number should be greater'; }\n for ($i = $start ; $i <= $end; $i++) \n { \n $repeated++;\n $crnt_number = $i; \n $history = array(); \n while($crnt_number) \n { \n if(isset($history[$crnt_number%10])){\n $ct = $crnt_number%10;\n if($ct/10==0) { \n $history[$crnt_number%10] = ($history[$crnt_number%10])+1;\n }\n if($history[$crnt_number%10]==3){ $remove_me++; break; }\n }\n else{\n $history[$crnt_number%10] = 1;\n }\n $crnt_number = (int)$crnt_number / 10; \n }\n }\n $selected_no = $repeated - $remove_me;\n return $selected_no; \n }", "public function getPageRange($range = 4)\n {\n $from = max(1, $this->getPage() - $range);\n $to = min($this->getPageCount(), $this->getPage() + $range);\n\n return range($from, $to);\n }", "function erp_get_dates_in_range($first, $last, $step = '+1 day', $output_format = 'Y-m-d' ) {\n\n $dates = array();\n $current = strtotime($first);\n $last = strtotime($last);\n\n while( $current <= $last ) {\n\n $dates[] = date($output_format, $current);\n $current = strtotime($step, $current);\n }\n\n return $dates;\n}" ]
[ "0.63381207", "0.621782", "0.5998347", "0.57822376", "0.57073665", "0.5627097", "0.5624641", "0.527763", "0.52707136", "0.50886863", "0.50744015", "0.4999341", "0.49987864", "0.49843305", "0.49477094", "0.49309063", "0.4901814", "0.48718464", "0.48344502", "0.47204393", "0.46720245", "0.46118575", "0.46089414", "0.4605191", "0.45978948", "0.4575566", "0.4556325", "0.4541591", "0.45339173", "0.45241764" ]
0.7073182
0
Creates a stream with float numbers from start to end by increments of a step. The range is inclusively.
public static function rangeFloat(float $start, float $end, float $step = 1): self { return self::range($start, $end, $step); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function floatRange($min, $max)\n {\n $min = (float)$min;\n $max = (float)$max;\n\n if ($min > $max) {\n throw new \\Exception(\"Invalid integer range: \\$max should be at least $min, but it was set to $max\");\n }\n\n while (true) {\n yield $min + mt_rand() / mt_getrandmax() * ($max - $min);\n }\n }", "public function range($start, $end, $step = null): static;", "public static function floats()\n {\n // First, make sure the most common numbers are covered.\n yield 0.0;\n yield -1.0;\n yield 1.0;\n\n // Then generate random numbers from an increasing range.\n $lim = 0.01;\n $iterations = 0;\n while (true) {\n $iterations++;\n\n yield $lim * (2 * mt_rand() / mt_getrandmax() - 1);\n\n if ($lim <= mt_getrandmax() / 2) {\n $lim *= 2;\n } else {\n // Start over when maxed out.\n $lim = 0.01;\n }\n }\n }", "public function range(int $start, int $end = null, int $step = null, bool $equal = null) : \\Generator\n {\n $step = $step ?? 1;\n $equal = $equal ?? false;\n\n if (0 === $step) {\n return;\n }\n\n $isReverse = $step < 0;\n\n if ($isReverse) {\n $end = $end ?? 0;\n\n } else {\n if (! isset($end)) {\n [ $end, $start ] = [ $start, $end ];\n }\n\n $start = $start ?? 0;\n }\n\n // dd($start, $end, $isForward, $equal);\n\n for ( $i = $start;\n null\n ?? ( ( $equal && $isReverse ) ? $i >= $end : null )\n ?? ( $equal ? $i <= $end : null )\n ?? ( $isReverse ? $i > $end : null )\n ?? ( $i < $end );\n //\n $i += $step\n ) {\n yield $i;\n }\n }", "public static function createWithRange($low, $high, $step = 1)\n {\n return new static(range($low, $high, $step));\n }", "public static function period($range, $step, $format = \"Y-m-d\") {\n $tm = self::getTimeStamp($range[0]);\n $tm1 = self::getTimeStamp($range[1]);\n $period = array();\n while ($tm < $tm1) {\n $period[] = self::format($tm, $format);\n $tm += $step;\n }\n return $period;\n}", "static public function range($start = 1, $stop = 1, $step = 1) {\n $argsNum = func_num_args();\n $args = func_get_args();\n\n if ($argsNum <= 1) {\n $stop = isset($args[0]) ? $args[0] : 0;\n $start = 0;\n }\n\n $step = isset($args[2]) ? $args[2] : 1;\n\n $start = intval($start);\n $stop = intval($stop);\n $step = intval($step);\n\n $range = array();\n while (1) {\n $range[] = $start;\n $start += $step;\n if ($start >= $stop) {\n break;\n }\n }\n\n return $range;\n }", "public static function floorStep($value, int $step = 1)\n\t{\n\t\treturn floor($value / $step) * $step;\n\t}", "public static function range(array $data): float\n\t{\n\t\treturn max($data) - min($data);\n\t}", "function calc_step($min, $max, $from, $to) {\n\n\t// Thank you wordpress for this\n\t$spread = $max - $min;\n\tif ( $spread <= 0 )\n\t\t$spread = 1;\n\t$font_spread = $to - $from;\n\tif ( $font_spread < 0 )\n\t\t$font_spread = 1;\n\t$step = $font_spread / $spread;\n\n\treturn $step;\n}", "function numberRange($start, $end)\n{\n $number_range = range($start, $end);\n\n return $number_range;\n}", "public static function rangeInt(int $start, int $end, int $step = 1): self {\n\t\treturn self::range($start, $end, $step);\n\t}", "function frand($min, $max, $decimals = 0) {\n $scale = pow(10, $decimals);\n return mt_rand($min * $scale, $max * $scale) / $scale;\n}", "function date_range($first, $last, $step = '+1 day', $output_format = 'd/m/Y' ) {\n\n $dates = array();\n $current = strtotime($first);\n $last = strtotime($last);\n\n while( $current <= $last ) {\n\n $dates[] = date($output_format, $current);\n $current = strtotime($step, $current);\n }\n\n return $dates;\n }", "public static function getRandomFloat($fMin = 0.0, $fMax = 1.0, $iDecimals = 2) {\n\t\t$fScale = pow(10, $iDecimals);\n\t\t\n\t\treturn mt_rand($fMin * $fScale, $fMax * $fScale) / $fScale;\n\t}", "protected static function rand_float($min, $max) {\n\t\t$f = mt_rand(0, 100000) * 0.00001;\n\t\treturn $min + (1 - $f) * $max;\n\t}", "public static function getRandomFloat($min, $max, $num = 1, $precision = 3) {\n if ($num < 1) {\n return NULL;\n }\n\n $numbers = array();\n foreach (range(0, $num - 1) as $index) {\n $number = $min + mt_rand() / mt_getrandmax() * ($max - $min);\n $numbers[] = substr(round($number, 3), 0, 10);\n }\n\n return $numbers;\n }", "function interpolate($pBegin, $pEnd, $pStep, $pMax) \n{\n\tif ($pBegin < $pEnd) \n\t{\n \t\treturn (($pEnd - $pBegin) * ($pStep / $pMax)) + $pBegin;\n\t} \n\telse \n\t{\n \t\treturn (($pBegin - $pEnd) * (1 - ($pStep / $pMax))) + $pEnd;\n\t}\n}", "public function splitAt(float $value): RangeCollection\n {\n if ($this->includesValue($value))\n {\n return new RangeCollection([\n new static($this->getLeft(), new Margin($value)),\n new static(new Margin($value), $this->getRight())\n ]);\n }\n throw new SplitValueIsOutOfRangeException(sprintf(\"Cannot split %s at %.2d\", $this, $value));\n }", "public function __construct(\n protected float $value,\n protected int $decimals = 2,\n protected ?string $decimal_separator = '.',\n protected ?string $thousands_separator = ',',\n protected ?string $before = '',\n protected ?string $after = '',\n ) {\n }", "public function splitRange($start, $end) {\n \t$series = [];\n \t$ranges = [];\n\n \t// start is the same as min page; make standalone number\n \tif ( intval($start) === $this->_min_page ) {\n \t\t$series[] = $start;\n \t}\n \telse {\n\t\t\t$range = $start . $this->_range_delimiter . strval($this->_min_page);\n\t\t\t$series[] = $this->processRange($range);\n \t}\n\n \t// end only one more than min_page; make standalone number after stepping\n \tif ( intval($end) - $this->_min_page === 1 ) {\n \t\t$series[] = $this->step($end);\n \t}\n \telse {\n\t\t\t$range = strval($this->_min_page + 1). $this->_range_delimiter . $end;\n\t\t\t$series[] = $this->processRange($range);\n \t}\n\n \treturn implode($this->_series_delimiter, $series);\n }", "public function getFloat($i);", "public function setFilterFloatRange($attribute, $min, $max, $exclude = false)\n\t{\n\t\t$this->floatrange[] = ($exclude ? '!' : '') . $attribute . \",{$min},{$max}\";\n\t}", "public function spread () {\n $low = min($this->values);\n $high = max($this->values);\n return round(((1 - ($low/$high)) * 100), 3);\n }", "public static function getFloat($min = 0, $max = 1) {\n return $min + mt_rand() / mt_getrandmax() * ($max - $min);\n }", "public function nth(int $step, int $offset = 0): self;", "public function range($start = NULL, $length = NULL);", "function erp_get_dates_in_range($first, $last, $step = '+1 day', $output_format = 'Y-m-d' ) {\n\n $dates = array();\n $current = strtotime($first);\n $last = strtotime($last);\n\n while( $current <= $last ) {\n\n $dates[] = date($output_format, $current);\n $current = strtotime($step, $current);\n }\n\n return $dates;\n}", "public static function range(int $step = 10, int $max = 100): array\n {\n if ($step < 1) {\n return [];\n }\n\n $array = [];\n for ($i = $step; $i <= $max; $i += $step) {\n $array[$i] = $i;\n }\n\n return $array;\n }", "function readFloat();" ]
[ "0.5762401", "0.5664802", "0.55207586", "0.5248579", "0.51220423", "0.49899173", "0.4924174", "0.47165972", "0.46979418", "0.46696383", "0.4607607", "0.45898265", "0.45523062", "0.45390302", "0.45363644", "0.44968668", "0.4488178", "0.44526297", "0.44419226", "0.4436335", "0.4420616", "0.4413178", "0.44036445", "0.43803933", "0.4380225", "0.43655148", "0.43652707", "0.43482658", "0.43334574", "0.4325726" ]
0.7213506
0
Collects all stream elements into an array.
public function collect(): array { return iterator_to_array($this, $use_keys=false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray()\n {\n return iterator_to_array($this->pipeline->get());\n }", "function toArray() {\n # This may use up all your RAM if you aren't careful.\n $arr = array();\n while (($i = $this->next()) !== NULL) {\n $arr[] = $i;\n }\n return $arr;\n }", "public function getArray()\n {\n return iterator_to_array($this->getIterator());\n }", "public function getProcessedElements(): array;", "public function toArray(): array\n {\n /* Enable extraction of data and priority */\n $this->setExtractFlags(self::EXTR_BOTH);\n\n /* Prepare output */\n $data = [];\n\n /* Iterate yourself */\n foreach ($this as $item) {\n $data[] = $item;\n }\n\n return $data;\n }", "public function streamAll(): Generator;", "public function asArray()\n {\n return iterator_to_array($this, false);\n }", "public function stream_stat(): array\n {\n return (array)$this->content;\n }", "public function toArray()\n {\n $res = [];\n Iterators::each($this->iterator(), function ($element) use (&$res) {\n $res[] = $element;\n });\n return $res;\n }", "public function toArray()\n {\n $data = [];\n\n for ($this->rewind(); $this->valid(); $this->next()) {\n $data[] = $this->current();\n }\n\n return $data;\n }", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getStreams();", "public function intoArrays()\n {\n return self::arraysOf($this);\n }", "public function getAsArray();", "public function toArray() : array {\n return iterator_to_array($this, TRUE);\n }", "public function toArray(): array\n {\n $array = [];\n\n for ($i = 1; $i <= $this->size; $i++) {\n $array[] = $this->elements[$i]['value'];\n }\n\n return $array;\n }", "public function toArray(): array {\n return iterator_to_array($this);\n }", "public function as_array() {\n return $this->elements;\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}" ]
[ "0.6419935", "0.63148016", "0.6036728", "0.5956803", "0.5955078", "0.5936763", "0.59309226", "0.5930208", "0.5916886", "0.5897171", "0.5866729", "0.5866729", "0.5866729", "0.5866729", "0.5866729", "0.5866729", "0.5844519", "0.58388007", "0.5830922", "0.5818323", "0.5814113", "0.5808344", "0.5783713", "0.5724687", "0.5724687", "0.5724687", "0.5724687", "0.57238054", "0.57238054", "0.57237685" ]
0.65708137
0
Collects all stream elements into an associative array. Each element needs to be an array tuple where the first element will be the key and the second one will be the value.
public function collectAsKeyValue(): array { $result = []; foreach ($this as [$key, $value]) { $result[$key] = $value; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray() {\n $array = array();\n\n $this->each(function($key, $value) use (&$array) {\n $array[$key] = $value;\n });\n\n return $array;\n }", "public function toArray()\n {\n $a = [];\n if (($e = $this->first) != null) {\n do {\n $key = $e->getKey();\n $value = $e->getValue();\n $a[$key] = $value;\n } while (($e = $e->next) != null);\n }\n return $a;\n }", "public function toArray()\n\t{\n\t\t$array = array();\n\n\t\tforeach ($this as $key => $value)\n\t\t{\n\t\t\t$array[$key] = $value;\n\t\t}\n\n\t\treturn $array;\n\t}", "function array_entries(array $array): array\n{\n $entries = [];\n foreach ($array as $key => $value) {\n $entries[] = [$key, $value];\n }\n\n return $entries;\n}", "abstract public function toAssoc(): array;", "public function toArray() {\n return\n [\n 'Key' => $this->getKey(),\n 'Value' => $this->getValue()\n ];\n }", "public function toArray() : array\n {\n return [\n 'Key' => $this->m_key,\n 'Value' => $this->m_value,\n ];\n }", "public function getKeysAndValues() {\n return array(\n array('key', 'key', 'value'),\n array('KEY', 'key', 'value'),\n array('Some_key', 'some-key', 'value'),\n array('SOME-KEY', 'some-key', 'value'),\n );\n }", "public function toArray() {\n\t\t$array = array();\n\n\t\tforeach($this as $k => $v) {\n\t\t\t$array[$k] = $v;\n\t\t}\n\n\t\treturn $array;\n\t}", "public function toArray() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = array();\n\t\t\t\n\t\t\t// Build Array\n\t\t\tforeach($this->_data as $entry) {\n\t\t\t\tforeach($entry as $key => $value) {\n\t\t\t\t\tif(get_class($value) == 'Bedrock\\\\Common\\\\DataFormat\\\\YAML') {\n\t\t\t\t\t\t$result[] = array($key => $value->toArray());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$result[] = array($key => $value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\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\tthrow new \\Bedrock\\Common\\DataFormat\\Exception('A problem was encountered while attempting to generate an array.');\n\t\t}\n\t}", "public function toArray() {\n\t\t$data\t= array(\n\t\t\t'hash'\t\t=> $this->getHash(),\n\t\t\t'dims'\t\t=> $this->dims,\n\t\t\t'measures'\t=> $this->measures\n\t\t);\n\n\t\tif (!is_null($this->time)){\n\t\t\t$data['time']\t= $this->time;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function toArray(): array\n {\n /* Enable extraction of data and priority */\n $this->setExtractFlags(self::EXTR_BOTH);\n\n /* Prepare output */\n $data = [];\n\n /* Iterate yourself */\n foreach ($this as $item) {\n $data[] = $item;\n }\n\n return $data;\n }", "public function all(): array\n {\n return collect($this->getKeys())\n ->mapWithKeys(fn (string $key) => [$key => $this->get($key)])\n ->toArray();\n }", "public function toArray() {\r\n return $this->associativeArray();\r\n }", "public function toArray(): array\n {\n $values = array_map(function ($value) {\n return $value instanceof static ? $value->toArray() : $value;\n }, $this->values(), $this->keys());\n\n return array_combine($this->keys(), $values);\n }", "public function collect(): array {\n\t\treturn iterator_to_array($this, $use_keys=false);\n\t}", "function to_array() {\r\n\t\t$out = array();\r\n\t\t\r\n\t\tforeach($this->input as $item) {\r\n\t\t\t$out[$item['name']] = $item['value'];\r\n\t\t}\r\n\t\t\r\n\t\treturn $out;\r\n\t}", "public function assoc()\n {\n $array = array(\n 'self' => $this->self\n );\n\n if (isset($this->first)) {\n $array['first'] = $this->first;\n }\n\n if (isset($this->prev)) {\n $array['prev'] = $this->prev;\n }\n\n if (isset($this->next)) {\n $array['next'] = $this->next;\n }\n\n if (isset($this->last)) {\n $array['last'] = $this->last;\n }\n\n return $array;\n }", "public function toArray(): array\n {\n $data = $this->data;\n $data[self::SRC_KEY] = $this->source;\n $data[self::DST_KEY] = $this->destination;\n $data[self::MODE_KEY] = $this->mode;\n return $data;\n }", "public function toAssociativeArray() {\n // TODO\n }", "public function toAssociativeArray() {\n // TODO\n }", "function asArray(iterable $collection, bool $preserveKeys = true): array\n{\n $aggregate = [];\n\n foreach ($collection as $index => $element) {\n if ($preserveKeys) {\n $aggregate[$index] = $element;\n } else {\n $aggregate[] = $element;\n }\n }\n\n return $aggregate;\n}", "public function asArray()\n\t{\n\t\t$fields = [\n\t\t\t'@type' => $this->type(),\n\t\t\t'@key' => $this->key()\n\t\t];\n\n\t\tforeach ($this->fields as $name => $field)\n\t\t{\n\t\t\t$fields[$name] = $field->value;\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function getKeyValuePair() : array \n { \n return [\n $this->key => $this->value\n ];\n }", "public function toArray() {\n\t\t\t$result = array();\n\t\t\tforeach (array_keys(static::$_fields) as $key) {\n\t\t\t\t$result[$key] = $this->getData($key);\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function toArray()\n {\n $array = parent::toArray();\n\n foreach ($array as $k => &$v) {\n $v['_count'] = $k;\n }\n\n return $array;\n }", "public function toArray(): array\n {\n $values = [\n static::CODEC => $this->getCodec(),\n static::PROFILE => $this->getProfile(),\n static::BITRATE => $this->getBitrate(),\n static::SAMPLE_RATE => $this->getSampleRate(),\n static::CHANNELS => $this->getChannels(),\n static::DURATION => $this->getDuration(),\n ];\n\n $values = array_filter($values, function ($value): bool {\n return !is_null($value);\n });\n\n return $values;\n }", "public function toArray(): array\n {\n $array = [];\n\n for ($i = 1; $i <= $this->size; $i++) {\n $array[] = $this->elements[$i]['value'];\n }\n\n return $array;\n }", "public function getDataAsAssociativeArray()\n\t\t{\n\t\t\t$csv = array();\n foreach($this->csvData as $row)\n {\n \t$csv[] = array_combine($this->csvHeaders, $row);\n }\n\n\t\t\treturn $csv;\n\t\t}", "function to_array() \n {\n $d = array();\n $d[\"vocab\"] = $this->vocab;\n $d[\"meta_name\"] = $this->meta_name;\n $d[\"text\"] = $this->text;\n $d[\"lang\"] = $this->lang;\n foreach($this->attrs as $key => $value) {\n $d[$key] = $value;\n }\n return $d;\n }" ]
[ "0.6317843", "0.6064852", "0.58164376", "0.5757449", "0.57298476", "0.5713465", "0.5700968", "0.5679242", "0.56701344", "0.55950105", "0.55759346", "0.55395365", "0.55016387", "0.5481405", "0.5465457", "0.54642135", "0.5431992", "0.5430393", "0.54246056", "0.54001576", "0.54001576", "0.53900534", "0.53337973", "0.5326362", "0.5308699", "0.52868724", "0.5282921", "0.5282742", "0.528182", "0.52765083" ]
0.67427254
0
If no callback is provided, return the first Stream's element. If a callback is provided, return the first element whose callback returns true. A default return can also be provided if nothing is found. Otherwise, an exception is thrown.
public function collectFirst(callable $callback = null, $default = null) { if($callback) { foreach ($this as $value) { if($callback($value)) { return $value; } } if (is_null($default)) { throw new \InvalidArgumentException('No element matching the criteria was found.'); } return $default; } $collected = $this->take(1)->collect(); if (empty($collected) && is_null($default)) { throw new \InvalidArgumentException('No elements available in this stream.'); } return array_shift($collected) ?? $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function firstOr(callable $callback){\n $result = $this->first();\n \n if($this->count==0){\n return call_user_func($callback);\n }\n\n return $result;\n }", "public function first(Closure $callback, $default = null)\n {\n foreach ($this->items as $key => $value) {\n if (call_user_func($callback, $key, $value)) {\n return $value;\n }\n }\n\n return $default;\n }", "public function first($callback = false, $default = null);", "public function first(? callable $callback = null, $default = null)\n {\n if ($this->isEmpty()) {\n return $default;\n }\n\n foreach ($this->items as $key => $value) {\n if (is_null($callback) || $callback($value, $key)) {\n return $value;\n }\n }\n\n return $default;\n }", "static function first(array $array, callable $callback, $default = null) {\n foreach ($array as $key => $value) {\n if ($callback($key, $value)) {\n return $value;\n }\n }\n\n return $default;\n }", "public function first(callable $callback = null)\n {\n if (null === $callback) {\n return reset($this->items);\n }\n\n return $this->filter($callback)->first();\n }", "public static function first($array, callable $callback, $default = null)\n {\n foreach ($array as $key => $value)\n {\n if (call_user_func($callback, $key, $value)) return $value;\n }\n\n return $default;\n }", "public function first(callable $callback = null, $default = null);", "public function first(callable $callback = null, $default = null);", "public static function first($array, callable $callback, $default = null)\n {\n foreach ($array as $key => $value) {\n if (call_user_func($callback, $key, $value)) {\n return $value;\n }\n }\n\n return value($default);\n }", "public static function first($array, $callback = NULL, $default = NULL)\n {\n \n if (is_null($callback)) {\n \n if (empty($array)) {\n return $default;\n }\n \n foreach ($array as $entry) {\n return $entry;\n }\n \n }\n \n foreach ($array as $key => $value) {\n if (call_user_func($callback, $value, $key)) {\n return $value;\n }\n }\n \n \n return $default;\n }", "public function first(callable $callback = null, $default = null)\n {\n return Arr::first($this->items, $callback, $default);\n }", "public function findFirst(Closure $func): mixed;", "function array_first($array, $callback, $default = null)\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (call_user_func($callback, $key, $value)) return $value;\n\t\t}\n\n\t\treturn value($default);\n\t}", "public function find(callable $callback, $default = null);", "public function collectLast(callable $callback = null, $default = null) {\n\t\tif(!$callback) {\n\t\t\t$callback = function($_) {\n\t\t\t\treturn true;\n\t\t\t};\n\t\t}\n\n\t\tforeach ($this as $value) {\n\t\t\tif($callback($value)) {\n\t\t\t\t$element_found = $value;\n\t\t\t}\n\t\t}\n\t\tif (isset($element_found)) {\n\t\t\treturn $element_found;\n\t\t}\n\t\tif (is_null($default)) {\n\t\t\tthrow new \\InvalidArgumentException('No element was found.');\n\t\t}\n\t\treturn $default;\n\t}", "public static function first($array, callable $callback, $default = null)\n {\n \n }", "public function getOne()\n\t{\n\t\tif ($this->count() > 0)\n\t\t{\n\t\t\t$this->seek(0);\n\t\t\treturn $this->current();\n\t\t} else\n\t\t\treturn null;\n\t}", "function first()\n{\n\t$this->rewind();\n\treturn $this->current();\n}", "function array_first($array, $callback, $default = null)\n {\n return Arr::first($array, $callback, $default);\n }", "public function getFirstStream()\r\n {\r\n \r\n $firstStream = false;\r\n \r\n $events = $this->api->getUserEvents($this->user->getHash());\r\n \r\n if(sizeof($events) > 0){\r\n \r\n //Use API to get the message's stream of the first event \r\n $firstEvent = $events[0];\r\n \r\n $firstStream = $this->api->getStream($firstEvent->getKeyword());\r\n \r\n //and set it as the event's stream\r\n $firstStream->setOwner($firstEvent);\r\n \r\n }\r\n //Return Stream\r\n return $firstStream;\r\n }", "public function find(callable $func)\n {\n foreach ($this->elements as $key => $value) {\n if($func($value, $key)) {\n return $value;\n }\n }\n\n return null;\n }", "function array_first($array, callable $callback = null, $default = null)\n {\n return Arr::first($array, $callback, $default);\n }", "public function first()\n {\n $this->rewind();\n return $this->current();\n }", "public function peekFirst();", "public abstract function findFirst(): Optional;", "public function takeWhile(callable $callback): Stream {\n\t\t$generator = static function(Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\treturn new self($generator($this));\n\t}", "public function findCallback(callable $callback, $key = false) {\n foreach ($this->list as $index => $model) {\n if ($callback($model)) {\n return $key ? $index : $model;\n }\n }\n\n return null;\n }", "public function array_first($array, callable $callback = null, $default = null)\n {\n return Arr::first($array, $callback, $default);\n }", "function find(callable $predicate): \\Closure\n{\n return function(array $arr) use ($predicate) {\n if (count($arr) == 0) {\n return null;\n }\n\n $element = head($arr);\n \n if ($predicate($element)) {\n return $element;\n }\n\n return find($predicate)(tail($arr));\n };\n}" ]
[ "0.73195654", "0.7304124", "0.7194703", "0.70436037", "0.7026656", "0.6956812", "0.6955377", "0.6913111", "0.6913111", "0.68229026", "0.6736036", "0.6681367", "0.65475136", "0.6502102", "0.6491796", "0.6313454", "0.6284653", "0.61106586", "0.60158604", "0.59619176", "0.595026", "0.5935974", "0.5929711", "0.59126145", "0.58839804", "0.5852511", "0.5838825", "0.58341956", "0.5787296", "0.57688963" ]
0.7359192
0
If no callback is provided, return the last Stream's element. If a callback is provided, return the last element whose callback returns true. A default return can also be provided if nothing is found. Otherwise, an exception is thrown.
public function collectLast(callable $callback = null, $default = null) { if(!$callback) { $callback = function($_) { return true; }; } foreach ($this as $value) { if($callback($value)) { $element_found = $value; } } if (isset($element_found)) { return $element_found; } if (is_null($default)) { throw new \InvalidArgumentException('No element was found.'); } return $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function last(callable $callback = null)\n {\n if (null === $callback) {\n return end($this->items);\n }\n\n return $this->filter($callback)->last();\n }", "public function firstOr(callable $callback){\n $result = $this->first();\n \n if($this->count==0){\n return call_user_func($callback);\n }\n\n return $result;\n }", "public function last($callback = false, $default = null);", "public function last(callable $callback = null, $default = null);", "public function last(callable $callback = null, $default = null)\n {\n return Arr::last($this->items, $callback, $default);\n }", "public function first(Closure $callback, $default = null)\n {\n foreach ($this->items as $key => $value) {\n if (call_user_func($callback, $key, $value)) {\n return $value;\n }\n }\n\n return $default;\n }", "public function collectFirst(callable $callback = null, $default = null) {\n\t\tif($callback) {\n\t\t\tforeach ($this as $value) {\n\t\t\t\tif($callback($value)) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_null($default)) {\n\t\t\t\tthrow new \\InvalidArgumentException('No element matching the criteria was found.');\n\t\t\t}\n\t\t\treturn $default;\n\t\t}\n\n\t\t$collected = $this->take(1)->collect();\n\t\tif (empty($collected) && is_null($default)) {\n\t\t\tthrow new \\InvalidArgumentException('No elements available in this stream.');\n\t\t}\n\t\treturn array_shift($collected) ?? $default;\n\t}", "public abstract function findLast(): Optional;", "public function first(? callable $callback = null, $default = null)\n {\n if ($this->isEmpty()) {\n return $default;\n }\n\n foreach ($this->items as $key => $value) {\n if (is_null($callback) || $callback($value, $key)) {\n return $value;\n }\n }\n\n return $default;\n }", "public static function last( $array, callable $callback = null, $default = null )\n {\n if ( is_null( $callback ) ) {\n return empty( $array ) ? value( $default ) : end( $array );\n }\n\n return static::first( array_reverse( $array, true ), $callback, $default );\n }", "public function first($callback = false, $default = null);", "public static function last($array, $callback = NULL, $default = NULL)\n {\n if (is_null($callback)) {\n \n if (empty($array)) {\n return $default;\n }\n \n return end($array);\n \n }\n \n return static::first(array_reverse($array, true), $callback, $default);\n \n }", "public static function last($array, callable $callback, $default = null)\n {\n return static::first(array_reverse($array), $callback, $default);\n }", "public static function last($array, callable $callback, $default = null)\n {\n return static::first(array_reverse($array), $callback, $default);\n }", "public function find(callable $callback, $default = null);", "static function first(array $array, callable $callback, $default = null) {\n foreach ($array as $key => $value) {\n if ($callback($key, $value)) {\n return $value;\n }\n }\n\n return $default;\n }", "function array_last($array, $callback, $default = null)\n {\n return Arr::last($array, $callback, $default);\n }", "function array_last($array, callable $callback = null, $default = null)\n {\n return Arr::last($array, $callback, $default);\n }", "public static function first($array, callable $callback, $default = null)\n {\n foreach ($array as $key => $value)\n {\n if (call_user_func($callback, $key, $value)) return $value;\n }\n\n return $default;\n }", "public function last() {\n\t\tif ($this->isNotEmpty()) {\n\t\t\t$length = $this->length();\n\t\t\t$counter = 1;\n\n\t\t\tforeach ($this->_value as $value) {\n\t\t\t\tif ($counter === $length) {\n\t\t\t\t\treturn $value;\n\t\t\t\t}\n\n\t\t\t\t++$counter;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getOne()\n\t{\n\t\tif ($this->count() > 0)\n\t\t{\n\t\t\t$this->seek(0);\n\t\t\treturn $this->current();\n\t\t} else\n\t\t\treturn null;\n\t}", "public function first(callable $callback = null)\n {\n if (null === $callback) {\n return reset($this->items);\n }\n\n return $this->filter($callback)->first();\n }", "public function array_last($array, callable $callback = null, $default = null)\n {\n return Arr::last($array, $callback, $default);\n }", "public function first(callable $callback = null, $default = null);", "public function first(callable $callback = null, $default = null);", "public function first(callable $callback = null, $default = null)\n {\n return Arr::first($this->items, $callback, $default);\n }", "public function last() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_pop( $result );\n\t}", "public static function first($array, callable $callback, $default = null)\n {\n foreach ($array as $key => $value) {\n if (call_user_func($callback, $key, $value)) {\n return $value;\n }\n }\n\n return value($default);\n }", "function array_last($array, $callback, $default = null)\n\t{\n\t\treturn array_first(array_reverse($array), $callback, $default);\n\t}", "function last(array $array): mixed\n{\n return $array ? end($array) : null; // No falses.\n}" ]
[ "0.69488955", "0.6819548", "0.6819459", "0.6515807", "0.6490716", "0.6485077", "0.6454872", "0.62238806", "0.62103343", "0.6166496", "0.6163891", "0.6144044", "0.6111412", "0.6111412", "0.6067586", "0.605912", "0.5973615", "0.5958467", "0.58836025", "0.587183", "0.5865332", "0.58523965", "0.5820472", "0.5793792", "0.5793792", "0.577788", "0.5759674", "0.5739766", "0.57388437", "0.57283753" ]
0.7370889
0
Transform the stream by applying the callback to each element of the stream.
public function map(callable $callback): self { $generator = function (Stream $stream) use ($callback) { foreach ($stream as $value) { yield $callback($value); } }; return new self($generator($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function map(callable $callback): Sequence;", "public function map(callable $callback);", "public function map(callable $callback);", "public function map(\\Closure $callback);", "public function map(callable ...$callbacks): self;", "public function process(\\Iterator $input, callable $callback)\n {\n $callback = \\Closure::fromCallable($callback);\n $input->rewind();\n iterator_apply(\n $input,\n function (\\Iterator $iterator) use ($callback) {\n $callback($iterator->current(), $iterator->key(), $iterator, $this);\n return true;\n },\n [$input]\n );\n return $this;\n }", "public function inspect(callable $callback): Stream {\n\t\treturn $this->map(function ($data) use ($callback) {\n\t\t\t$callback($data);\n\t\t\treturn $data;\n\t\t});\n\t}", "public function mapSpread(callable $callback)\n {\n return $this->map(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "public function transform(callable $callback)\n {\n\t\t$this->items = array_map($callback, $this->stack);\n\n\t\treturn $this;\n\t}", "protected static function mapStream($things, $callback)\n {\n $children = [];\n\n foreach ($things as $key => $value) {\n $info = self::fork();\n if ($info['parent']) {\n $children[$key] = $info;\n } else {\n $callback($key, $value, $info['stream']);\n fclose($info['stream']);\n exit;\n }\n }\n\n return self::getChildrenOutput($children);\n }", "public function pipe(callable $callback)\n {\n return $callback($this);\n }", "public function pipe(callable $callback)\n {\n return $callback($this);\n }", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function filter(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function each($callback)\n {\n array_walk($this->items, $callback);\n }", "public function forEach(callable $callback): void {\n\t\tforeach ($this as $value) {\n\t\t\t$callback($value);\n\t\t}\n\t}", "public function pipeAndReturnCallbackResult(callable $callback);", "public function map(callable $callback)\n {\n return $this->toBase()->map($callback);\n }", "public function apply(callable $callback);", "public function transform(callable $callback)\n {\n $this->items = $this->map($callback)->all();\n\n return $this;\n }", "public function keyBy(callable $callback): Stream {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tyield [$callback($value), $value];\n\t\t\t}\n\t\t};\n\t\treturn new Stream($generator($this));\n\t}", "public function each(callable $callback);", "public function each(callable $callback);", "public function each(callable $callback);", "public function each(callable $callback);", "public function eachSpread(callable $callback)\n {\n return $this->each(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "function apply(callable $cb) {\n\t\tarray_walk($this->rows, $cb, $this);\n\t\treturn $this;\n\t}", "public function groupBy(callable $callback): Stream {\n\t\t$values = [];\n\t\t$keys = [];\n\t\tforeach ($this as $value) {\n\t\t\t$key = $callback($value);\n\t\t\t$hashed_keys = is_object($key) ? spl_object_hash($key) : $key;\n\t\t\t$values[$hashed_keys][] = $value;\n\t\t\t$keys[$hashed_keys] = $key;\n\t\t}\n\n\t\t$generator = function (array $values, array $keys) {\n\t\t\tforeach ($keys as $hashed_keys => $key) {\n\t\t\t\tyield [$key, Stream::of($values[$hashed_keys])];\n\t\t\t}\n\t\t};\n\n\t\treturn new Stream($generator($values, $keys));\n\t}", "public function each(\\Closure $callback);", "public function each($callback)\n {\n foreach ($this->entries as $entry) {\n call_user_func_array($callback, [\n 'file' => $entry,\n ]);\n }\n }" ]
[ "0.6270724", "0.6170831", "0.6170831", "0.60312897", "0.5990805", "0.5944468", "0.592948", "0.5922422", "0.58295155", "0.58188117", "0.5803382", "0.5803382", "0.57873505", "0.57766956", "0.57671136", "0.5761434", "0.57578474", "0.5710141", "0.5706835", "0.57050765", "0.57006043", "0.57003933", "0.57003933", "0.57003933", "0.57003933", "0.5697264", "0.56523895", "0.55453444", "0.5541181", "0.5500657" ]
0.6703638
0
Take n elements of the stream.
public function take(int $n_elements): self { $generator = function (iterable $iterable, int $n_elements) { if ($n_elements == 0) { return; } $count = 0; foreach ($iterable as $element) { yield $element; if (++$count == $n_elements){ break; } } } ; return new self($generator($this, $n_elements)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function take($n, $stream) {\n foreach ($stream as $x) {\n if ($n-- === 0) {\n break;\n }\n yield $x;\n }\n}", "function take(iterable $iterable, int $n): Iterator\n{\n /** @psalm-suppress DeprecatedFunction */\n return slice($iterable, 0, $n);\n}", "function take($count);", "public function take($size = 1, $from = 0);", "public function take(int $n): VectorInterface;", "public function skip(int $n_elements): self {\n\t\treturn new self(new \\LimitIterator($this, $n_elements));\n\t}", "public function take($limit = 20);", "public function take($amount);", "public function skip($n);", "public function take($number_of_elements = 1)\r\n\t{\r\n\t\t$elements = [];\r\n\t\twhile(($number_of_elements > 0) and $this->hasNext())\r\n\t\t{\r\n\t\t\t$temp = $this->next();\r\n\t\t\t$objects->push($temp);\r\n\t\t\t$n--;\r\n\t\t}\r\n\r\n\t\treturn $objects->all();\r\n\t}", "function drop(iterable $iterable, int $n): Iterator\n{\n /** @psalm-suppress DeprecatedFunction */\n return slice($iterable, $n);\n}", "public abstract function skip(int $limit): Stream;", "public function limit($count, $offset);", "function expression_function_take($collection, $number)\n{\n if (is_array($collection)) {\n return array_slice($collection, 0, $number, true);\n } else if ($collection instanceof \\Iterator) {\n return new \\LimitIterator($collection, 0, $number);\n } else {\n throw new \\InvalidArgumentException('Collection must be an array or an Iterator');\n }\n}", "public function consumeSlice($n)\n {\n if ($this->length < $n) {\n throw new BufferUnderflowException();\n\n } elseif ($this->length === $n) {\n $buffer = $this->buffer;\n $this->buffer = \"\";\n $this->length = 0;\n return new Buffer($buffer);\n\n } else {\n $buffer = substr($this->buffer, 0, $n);\n $this->buffer = substr($this->buffer, $n);\n $this->length -= $n;\n return new Buffer($buffer);\n }\n }", "function drop($n, $collection = null) {\n if (!is_numeric($n)) {\n throw new \\InvalidArgumentException('drop expects the first argument to be numeric');\n }\n $dropper = function ($collection) use ($n) {\n if (is_array($collection)) {\n return array_slice($collection, $n);\n }\n if (is_string($collection)) {\n return substr($collection, $n);\n }\n if ($collection instanceof \\Traversable) {\n $out = array();\n $count = 0;\n foreach ($collection as $key => $value) {\n $count++;\n if ($count <= $n) {\n continue;\n }\n $out[] = $value;\n }\n return $out;\n }\n throw new \\InvalidArgumentException('drop expects argument 2 to be a collection');\n };\n return func_num_args() < 2 ? $dropper : $dropper($collection);\n}", "public function take($limit)\n {\n if ($limit < 0) {\n return $this->slice($limit, abs($limit));\n }\n\n return $this->slice(0, $limit);\n }", "public function takeLast($howMany);", "public function everyNth(int $n, int $position_of_first_nth_item = 0): CollectionInterface;", "function wprss_delete_oldest_feed_items( $n, $source ) {\n // If the source does not exist, do nothing\n if ( get_post( $source ) == NULL ) return;\n\n // Make sure $n is an integer\n $n = intval($n);\n\n // Do nothing if n is zero or negative\n if ( $n <= 0 ) return;\n\n // Get the feed items, as an array, not WP_Query.\n // We will need to perform some array operations\n $feed_items = wprss_get_feed_items_for_source( $source );\n $feed_items = $feed_items->get_posts();\n // Get number of feed items\n $count = count( $feed_items );\n\n // Index of first feed item to delete\n $start = $count - $n;\n // Cut the array of feed items to get the items to delete\n $to_delete = array_slice( $feed_items, $start );\n // log -- for now\n foreach( $to_delete as $fi ) {\n //wprss_log_obj( \"To delete\" , $fi->ID );\n }\n }", "public function slice($n)\n {\n if ($this->length < $n) {\n throw new BufferUnderflowException();\n\n } elseif ($this->length === $n) {\n return new Buffer($this->buffer);\n\n } else {\n return new Buffer(substr($this->buffer, 0, $n));\n }\n }", "public abstract function limit(int $limit): Stream;", "public function slice($array, $n, $position = null): static;", "public function skip($howMany);", "function skip($count);", "function skipBytes($n);", "public function limit($count = null)\n\t{\n\t\treturn $this->copy(array_slice($this->frames, 0, $count));\n\t}", "public static function take(array $array, int $limit): array\n {\n return array_slice($array, 0, $limit);\n }", "public function skip($length) {}", "public function filterFirstN(callable $filterer, ?int $max_number_of_filtered_items_to_return=null, bool $copy_keys=false, bool $bind_callback_to_this=true, bool $remove_filtered_items=false): CollectionInterface;" ]
[ "0.76029557", "0.7163059", "0.71334714", "0.687185", "0.6801092", "0.6401976", "0.6279521", "0.6146138", "0.61352503", "0.60863906", "0.606901", "0.58727854", "0.56067765", "0.5592765", "0.55332947", "0.5481268", "0.54710144", "0.5452936", "0.544439", "0.541599", "0.5401967", "0.5328101", "0.5326237", "0.5314047", "0.53000253", "0.52873003", "0.52616364", "0.5161228", "0.51598114", "0.51445514" ]
0.7187302
1
Skip n elements of the stream.
public function skip(int $n_elements): self { return new self(new \LimitIterator($this, $n_elements)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function skip($n);", "public function skip($howMany);", "function skip($count);", "public function skip($n)\n {\n $this->check($n);\n $this->pos += $n;\n }", "public function skip($amount);", "public function skip($length) {}", "public function skip($offset = 0);", "function skipBytes($n);", "public function skip($len) {\r\n\t\t// Do a read operation instead, because there is no way to find out how\r\n\t\t// many elements were really skipped\r\n\t\t$this->read($len);\r\n\t}", "function drop(iterable $iterable, int $n): Iterator\n{\n /** @psalm-suppress DeprecatedFunction */\n return slice($iterable, $n);\n}", "public abstract function skip(int $limit): Stream;", "public function skip(int $number): static\n {\n $this->iterator = Iterators::skip($this->iterator, $number);\n return $this;\n }", "function take($n, $stream) {\n foreach ($stream as $x) {\n if ($n-- === 0) {\n break;\n }\n yield $x;\n }\n}", "public function skip($_count=1) {\n\t\tif ($this->dry()) {\n\t\t\ttrigger_error(self::TEXT_AxonEmpty);\n\t\t\treturn;\n\t\t}\n\t\t$this->load($this->criteria,$this->order,$this->offset+$_count);\n\t}", "function expression_function_skip($collection, $number)\n{\n if (is_array($collection)) {\n return array_slice($collection, $number, null, true);\n } else if ($collection instanceof \\Iterator) {\n return new \\LimitIterator($collection, $number);\n } else {\n throw new \\InvalidArgumentException('Collection must be an array or an Iterator');\n }\n}", "function take(iterable $iterable, int $n): Iterator\n{\n /** @psalm-suppress DeprecatedFunction */\n return slice($iterable, 0, $n);\n}", "function skip($count=1) {\n\t\tif ($this->dry()) {\n\t\t\ttrigger_error(self::TEXT_M2Empty);\n\t\t\treturn;\n\t\t}\n\t\tself::load($this->criteria,$this->order,$this->offset+$count);\n\t}", "public function skip($numberToSkip)\n {\n return self::from(Iterables::skip($this, $numberToSkip));\n }", "public function skip($num)\n {\n return $this->set_option('skip', $num);\n }", "public function skip($offset)\n {\n $this->dataToArray();\n\n return new self(array_slice($this->data, $offset));\n }", "public function skip($count = null)\n\t{\n\t\tif ($count instanceof StackFilter) $count = $count->closure();\n\t\tif ($count instanceof \\Closure) $count = array_search($this->first($count), $this->frames);\n\n\t\treturn $this->copy(array_slice($this->frames, $count));\n\t}", "public function take(int $n_elements): self {\n\t\t$generator = function (iterable $iterable, int $n_elements) {\n\t\t\tif ($n_elements == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$count = 0;\n\t\t\tforeach ($iterable as $element) {\n\t\t\t\tyield $element;\n\t\t\t\tif (++$count == $n_elements){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} ;\n\t\treturn new self($generator($this, $n_elements));\n\t}", "function skip() {\n # This method is meant to sidestep any expensive processing\n # a subclass might perform as part of next().\n $this->next();\n }", "public function skip($skip){\r\n if(!is_integer($skip)){\r\n throw new \\Exception(\"Offset must be an integer.\");\r\n return;\r\n }\r\n $this->offset=$skip;\r\n return $this;\r\n }", "public function skip($size = null)\r\n\t{\r\n\t\tif(is_null($size)) {\r\n\t\t\t$this->addRule(new SkipRule());\r\n\t\t} else {\r\n\t\t\t$this->addRule(new SkipRule($size));\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "public static function skip(array $array, int $offset): array\n {\n return array_slice($array, $offset);\n }", "public function discard($n)\n {\n if ($this->length < $n) {\n throw new BufferUnderflowException();\n\n } elseif ($this->length === $n) {\n $this->buffer = \"\";\n $this->length = 0;\n return $this;\n\n } else {\n $this->buffer = substr($this->buffer, $n);\n $this->length -= $n;\n return $this;\n }\n }", "public function setLinesToSkip($number){\n $this->linesToSkip=intval($number);\n }", "function wprss_delete_oldest_feed_items( $n, $source ) {\n // If the source does not exist, do nothing\n if ( get_post( $source ) == NULL ) return;\n\n // Make sure $n is an integer\n $n = intval($n);\n\n // Do nothing if n is zero or negative\n if ( $n <= 0 ) return;\n\n // Get the feed items, as an array, not WP_Query.\n // We will need to perform some array operations\n $feed_items = wprss_get_feed_items_for_source( $source );\n $feed_items = $feed_items->get_posts();\n // Get number of feed items\n $count = count( $feed_items );\n\n // Index of first feed item to delete\n $start = $count - $n;\n // Cut the array of feed items to get the items to delete\n $to_delete = array_slice( $feed_items, $start );\n // log -- for now\n foreach( $to_delete as $fi ) {\n //wprss_log_obj( \"To delete\" , $fi->ID );\n }\n }", "public function skip($numberToSkip)\n {\n return $this->query->skip($numberToSkip);\n }" ]
[ "0.8461647", "0.7727323", "0.75114566", "0.738938", "0.7284405", "0.7264593", "0.69134307", "0.67743367", "0.6654874", "0.64932793", "0.6481634", "0.6470369", "0.6342277", "0.6315845", "0.6228642", "0.61722", "0.6162867", "0.6147567", "0.6146523", "0.60279554", "0.602723", "0.59024626", "0.5812755", "0.5801958", "0.57945913", "0.5596839", "0.5559894", "0.54745704", "0.5426558", "0.542586" ]
0.78368443
1
Separate the current stream into chunks limited by the custom function. The elements will be chunked while the test function returns the same value or until the stream ends. If a new value is returned from the test function this value will be added to the next chunk. Each chunk of elements is returned as an array.
public function chunkBy(callable $chunk_test): self { $generator = function (Stream $stream) use ($chunk_test) { $chunk = []; $last_test_value = null; $stream->rewind(); if ($stream->valid()) { $last_test_value = $chunk_test($stream->current()); $chunk[] = $stream->current(); } $stream->next(); while ($stream->valid()) { $current_test_value = $chunk_test($stream->current()); if ($last_test_value !== $current_test_value) { yield $chunk; $chunk = []; } $chunk[] = $stream->current(); $last_test_value = $current_test_value; $stream->next(); } if (count($chunk) > 0) { yield $chunk; } }; return new self($generator($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chunk(?array $array, int $number): array\n{\n if ($number < 1) {\n return [];\n }\n\n return \\array_chunk($array ?? [], $number, false);\n}", "private function chunk(array $filtered=[]) {\n foreach($this->unconsumed as $k => $elem) {\n $elems = $elem;\n if ( \n static::isFilter($elems) or \n ! is_array($elem)\n ) \n $elems = [$elem];\n\n if ( ! isset($filtered)) continue;\n $elf = &$filtered[$k];\n if ( ! isset($this->data[$k])) continue;\n $size = count($this->data[$k]);\n foreach($elems as $el) {\n // deal with a filter\n $filterInNeed = \n static::isFilter($el) && \n isset($el['flags']) && \n $this->needChunking($el['flags']);\n if ($filterInNeed) {\n // chunking\n $elf = $this->unjoin($elf, $size);\n }\n // deal with a def\n else if ($el instanceOf static) {\n $elf = $el->chunk($elf);\n }\n }\n }\n return $filtered;\n }", "public function testChunk()\n {\n $database = Database::create(['driver' => 'sqlite', 'dsn' => 'sqlite::memory:', 'prefix' => 'pre_']);\n $database->statement('CREATE TABLE pre_items(id INTEGER PRIMARY KEY ASC, name TEXT, value NUMERIC)');\n $database->insert(\n 'INSERT INTO pre_items (name, value) VALUES (?, ?), (?, ?), (?, ?), (?, ?)',\n ['Banana', 123, 'Apple', -10, 'Pen', null, 'Bottle', 0]\n );\n\n // Default processor\n $superQuery = new QueryProxy($database->table('items'));\n $superQuery->orderBy('id', 'desc')->chunk(10, function ($rows) {\n $this->assertEquals([\n ['id' => 4, 'name' => 'Bottle', 'value' => 0],\n ['id' => 3, 'name' => 'Pen', 'value' => null],\n ['id' => 2, 'name' => 'Apple', 'value' => -10],\n ['id' => 1, 'name' => 'Banana', 'value' => 123]\n ], $rows);\n });\n\n // Custom processor\n $superQuery = new class ($database->table('items')) extends QueryProxy {\n protected function processFetchedRow(array $row)\n {\n return implode('|', $row);\n }\n };\n $superQuery->orderBy('id', 'desc')->chunk(10, function ($rows) {\n $this->assertEquals(['4|Bottle|0', '3|Pen|', '2|Apple|-10', '1|Banana|123'], $rows);\n });\n\n // Error handling\n $this->assertException(InvalidArgumentException::class, function () use ($database) {\n (new QueryProxy($database->table('items')))->chunk(-10, function () {});\n });\n }", "function chunk(array $array, $size = 1, $preserveKeys = false)\n{\n return \\array_chunk($array, $size, $preserveKeys);\n}", "function chunk(int $size, iterable $items) : iterable\n{\n return compose(\n // Fpl\\values,\n Fpl\\groupBy(function($item, $key) use ($size) {\n return (int) $key / $size;\n }),\n Fpl\\values\n )($items);\n}", "public function chunk(int $size = 2) {\n\n return array_chunk($this->data, $size);\n }", "public function chunk($chunkSize);", "public function testFileReaderShouldSupportChunkedReads()\n {\n $fileReader = new ChunkedFileReader($this->__testFilePath, 3);\n $this->assertEquals('123', $fileReader->current());\n $fileReader->next();\n $this->assertEquals('456', $fileReader->current());\n $fileReader->seek(6);\n $this->assertEquals('90', $fileReader->current());\n }", "public function chunk($size, $preserve = true) {\n\t\treturn array_chunk($this->_value, (int) $size, $preserve);\n\t}", "public function chunks() { return $this->_m_chunks; }", "public function getProcessedElements(): array;", "public function eachSpread(callable $callback)\n {\n return $this->each(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "public function testBufferPartial(): void\n {\n $items = new ArrayObject([1, 2, 3]);\n $iterator = new BufferedIterator($items);\n foreach ($iterator as $key => $value) {\n if ($key == 1) {\n break;\n }\n }\n $result = [];\n foreach ($iterator as $value) {\n $result[] = $value;\n }\n $this->assertEquals([1, 2, 3], $result);\n }", "function take($n, $stream) {\n foreach ($stream as $x) {\n if ($n-- === 0) {\n break;\n }\n yield $x;\n }\n}", "public function getIterator(): \\Generator\n {\n while (!$this->stream->eof()) {\n $item = $this->stream->read($this->chunkSize);\n // @codeCoverageIgnoreStart\n // I don't know how to fabricate this manually, so I can't test it.\n if ($item === '') {\n continue;\n }\n // @codeCoverageIgnoreEnd\n yield $item;\n }\n }", "public function chunkMap(callable $callback, $count = 1000)\n {\n $collection = Collection::make();\n\n $this->chunk($count, function ($items) use ($collection, $callback) {\n $items->each(function ($item) use ($collection, $callback) {\n $collection->push($callback($item));\n });\n });\n\n return $collection;\n }", "public function chunkSizeDataProvider(): array\n {\n return [\n 'chunkHasSize' => [['size' => 5000], 5000],\n 'chunkHasNoSize' => [['size' => null], 0]\n ];\n }", "public function takeWhile(callable $callback): Stream {\n\t\t$generator = static function(Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\treturn new self($generator($this));\n\t}", "public function addChunks(\\google\\bigtable\\v1\\ReadRowsResponse\\Chunk $value){\n return $this->_add(2, $value);\n }", "function get_chunk($file,$start,$end){\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $file);\r\n curl_setopt($ch, CURLOPT_RANGE, $start.'-'.$end);\r\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_WRITEFUNCTION, 'chunk');\r\n $result = curl_exec($ch);\r\n curl_close($ch);\r\n }", "public function partition($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $valid = array();\n $invalid = array();\n\n foreach ($this->data as $key => $value) {\n if ($callback($value, $key, $this)) {\n $valid[$key] = $value;\n\n } else {\n $invalid[$key] = $value;\n }\n }\n\n return array(new static($valid), new static($invalid));\n }", "public function takeWhile(Closure $fn): VectorInterface;", "abstract protected function get( $chunks );", "function chunk(array|string $input, int $length, bool $keep_keys = false): array\n{\n return is_array($input) ? array_chunk($input, $length, $keep_keys)\n : str_chunk($input, $length, join: false);\n}", "function takeWhile(callable $function, iterable $items) : iterable\n{\n return _arrayOrIterator($items, function($items) use($function) {\n foreach ($items as $key => $value) {\n if (!$function($value, $key)) {\n return;\n }\n yield $key => $value;\n }\n });\n}", "function playlist_splitter($files)\n{\n $prevFileTime = null;\n $sliceArray = [];\n $array = [];\n logger(\"++ Total count of matching files in directory: \" . count($files));\n foreach ($files as $file) {\n $fileTime = (int) substr($file, 0, 10);\n if ($prevFileTime) {\n if ($fileTime - $prevFileTime > PLAYLISTCUTOFF) {\n logger(\"++ Found duration gap between files greater than \" . PLAYLISTCUTOFF . \"s\");\n logger(\n \"++ Found duration gap between files greater than \" . PLAYLISTCUTOFF . \"s - Duration between \" .\n $prevFileTime . \" and \" . $fileTime . \" is: \" . ($fileTime - $prevFileTime) . \"s\"\n );\n $sliceArray[] = $file;\n logger(\"++ Splitting into another playlist at file number \" . array_search($file, $files));\n }\n }\n $prevFileTime = $fileTime;\n }\n\n $result = [];\n foreach ($sliceArray as $delimiter) {\n foreach ($files as $key => $val) {\n if ($delimiter === $val) {\n $result[] = array_splice($files, 0, $key);\n continue 2;\n }\n }\n }\n if (!empty($files)) {\n $result[] = $files;\n }\n $counter = count($result);\n if ($counter > 1) {\n logger(\"++ Playlist split into \" . $counter . \" chunks\");\n }\n\n // logger($result);\n return $result;\n}", "public function generateChunked(int $queryChunkSize = 500, callable $callback = null) {\n\n\t\t\t$this->enforceOrderBy();\n\n\t\t\t$page = 1;\n\n\t\t\tdo {\n\t\t\t\t$results = $this->forPage($page, $queryChunkSize)->get();\n\n\t\t\t\t$count = $results->count();\n\n\t\t\t\t// invoke callback if one exists\n\t\t\t\tif ($callback && $count) {\n\t\t\t\t\t$results = call_user_func($callback, $results, $page);\n\n\t\t\t\t\tif (!is_iterable($results))\n\t\t\t\t\t\tthrow new RuntimeException('Callback passed to generateChunked() must return an iterable, got ' . (is_object($results) ? get_class($results) : strtolower(gettype($results))));\n\t\t\t\t}\n\n\t\t\t\t// yield results (do not use yield from, to generate new unique keys)\n\t\t\t\tforeach ($results as $curr) {\n\t\t\t\t\tyield $curr;\n\t\t\t\t}\n\n\t\t\t\tunset($results);\n\n\t\t\t\t++$page;\n\n\t\t\t} while ($count >= $queryChunkSize);\n\t\t}", "public function chunk($chunkSize = 200, $callback)\n {\n if (empty ($this->_table)) {\n throw new \\Exception('Table name is not specified');\n }\n\n if (!is_callable($callback)) {\n throw new \\Exception('Invalid $callback argument');\n }\n\n $offset = 0;\n $limit = $chunkSize;\n $entries = $this->table($this->_table)->get($limit, $offset);\n\n while (!empty ($entries)) {\n $callback($entries);\n\n $offset += $limit;\n $entries = $this->table($this->_table)->get($limit, $offset);\n }\n }", "protected function chunked()\n {\n }", "public function getChunksList(){\n return $this->_get(2);\n }" ]
[ "0.60656077", "0.5839131", "0.56522685", "0.5529906", "0.54212916", "0.53050655", "0.52817225", "0.51535314", "0.5109982", "0.5104696", "0.5037908", "0.502882", "0.5019372", "0.50047046", "0.50025856", "0.4971629", "0.49514958", "0.4923795", "0.4881878", "0.48604795", "0.484151", "0.48355925", "0.48287997", "0.48144245", "0.47756097", "0.474076", "0.47311762", "0.46967", "0.46718118", "0.46628386" ]
0.6675087
0
Writes all elements into the given resource. This method consumes the stream.
public function intoResource($resource): void { foreach ($this as $value) { fwrite($resource, $value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function writeStream($resource);", "public function updateStream($resource);", "public function putStream($resource);", "public function writeXmlResourceList() {\n // Neues XMLWriter-Objekt\n $this->xmlwriter = new \\XMLWriter();\n\n // Dokumenteneigenschaften\n $this->xmlwriter->openMemory();\n $this->xmlwriter->setIndent(TRUE);\n $this->xmlwriter->startDocument('1.0');\n // Document Type Definition (DTD)\n $this->xmlwriter->startDtd('resourcelist');\n $this->xmlwriter->writeDtdElement('resourcelist', '(file)');\n $this->xmlwriter->writeDtdElement('file', '(uid,pid,tstamp,crdate,type,storage,identifier,extension,mime_type,name,title,sha1,size,creation_date,modification_date,width,height,uuid)');\n $this->xmlwriter->writeDtdElement('uid', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('pid', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('tstamp', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('crdate', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('type', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('storage', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('identifier', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('extension', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('mime_type', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('name', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('title', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('sha1', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('size', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('creation_date', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('modification_date', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('width', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('height', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('uuid', '(#PCDATA)');\n $this->xmlwriter->endDtd();\n\n // Daten schreiben\n $this->xmlwriter->startElement('resourcelist');\n\n foreach ($this->fileList as $file) {\n $this->xmlwriter->startElement('file');\n $this->xmlwriter->writeElement('uid', $file->getUid());\n $this->xmlwriter->writeElement('pid', $file->getPid());\n $this->xmlwriter->writeElement('tstamp', $file->getTstamp());\n $this->xmlwriter->writeElement('crdate', $file->getCrdate());\n $this->xmlwriter->writeElement('type', $file->getType());\n $this->xmlwriter->writeElement('storage', $file->getStorage());\n $this->xmlwriter->writeElement('identifier', $file->getIdentifier());\n $this->xmlwriter->writeElement('extension', $file->getExtension());\n $this->xmlwriter->writeElement('mime_type', $file->getMimeType());\n $this->xmlwriter->writeElement('name', $file->getName());\n $this->xmlwriter->writeElement('title', $file->getTitle());\n $this->xmlwriter->writeElement('sha1', $file->getSha1());\n $this->xmlwriter->writeElement('size', $file->getSize());\n $this->xmlwriter->writeElement('creation_date', $file->getCreationDate());\n $this->xmlwriter->writeElement('modification_date', $file->getModificationDate());\n $this->xmlwriter->writeElement('width', $file->getWidth());\n $this->xmlwriter->writeElement('height', $file->getHeight());\n $this->xmlwriter->writeElement('uuid', $this->getUuid($file->getUid(), 'sys_file'));\n $this->xmlwriter->endElement();\n }\n\n $this->xmlwriter->endElement();\n $this->xmlwriter->endElement();\n $this->xmlwriter->endDocument();\n $writeString = $this->xmlwriter->outputMemory();\n\n $file = GeneralUtility::tempnam('resource_');\n GeneralUtility::writeFile($file, $writeString);\n\n $folder = GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT') . GeneralUtility::getIndpEnv('TYPO3_SITE_PATH') . 'fileadmin/deployment/media/' . date('Y_m_d', time());\n GeneralUtility::mkdir($folder);\n\n GeneralUtility::upload_copy_move($file, $folder . '/' . date('H-i-s', time()) . '_resource.xml');\n }", "public function writeStream($path, $resource, Config $config)\n {\n }", "function stream_for($resource = '', array $options = [])\n{\n // 若是标量则创建一个临时流, 将内容写入该临时流中并重置游标位置\n if (is_scalar($resource)) {\n $stream = fopen('php://temp', 'r+');\n if ($resource !== '') {\n fwrite($stream, $resource);\n fseek($stream, 0);\n }\n return new Stream($stream, $options);\n }\n\n switch (gettype($resource)) {\n case 'resource':\n return new Stream($resource, $options);\n break;\n\n case 'object':\n if ($resource instanceof StreamInterface) {\n return $resource;\n } elseif ($resource instanceof \\Iterator) {\n return new PumpStream(function () use ($resource) {\n if (!$resource->valid()) {\n return false;\n }\n $result = $resource->current();\n $resource->next();\n return $result;\n }, $options);\n } elseif (method_exists($resource, '__toString')) {\n return stream_for((string)$resource, $options);\n }\n break;\n\n case 'NULL':\n return new Stream(fopen('php://temp', 'r+'), $options);\n }\n\n if (is_callable($resource)) {\n return new PumpStream($resource, $options);\n }\n\n throw new \\InvalidArgumentException(\"Resource is invalid\");\n}", "protected function _write() {}", "protected function _transformStreamResponses(Endpoint $endpoint, \\Iterator $resources)\n {\n foreach ($resources as $resource) {\n yield $this->_transformResource($endpoint, $resource);\n }\n }", "public function writeStream(Customweb_Core_Stream_IInput $inputStream);", "public function setContent($resource, $charset = MailMimeParser::DEFAULT_CHARSET)\n {\n $stream = Psr7\\stream_for($resource);\n $this->attachContentStream($stream, $charset);\n // this->onChange called in attachContentStream\n }", "public function stream();", "public function renderOne($resource)\n {\n $transformer = new $this->transformerClass;\n $item = new Item($resource, $transformer);\n\n return $this->manager->createData($item)->toArray();\n }", "public function writeStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "private function packResources()\n {\n $resources = include_once __DIR__ . '/elements/resources.php';\n if (!is_array($resources)) {\n $this->modx->log(modX::LOG_LEVEL_ERROR, 'Cannot build resources');\n } else {\n foreach ($resources as $resource) {\n $this->builder->putVehicle($this->builder->createVehicle($resource, [\n xPDOTransport::UNIQUE_KEY => 'id',\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true\n ]));\n }\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Packaged in ' . count($resources) . ' resources.');\n }\n }", "public function writeStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function write($s) {}", "public function write($s) {}", "public function write($s) {}", "public function write($s) {}", "public function write($s) {}", "public function writeStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function write($data) {\n\n\t\t$document = $this->getHandle();\n\t\ttry {\n\t\t\t$document->loadXML($data);\n\t\t\t$document->save($this->fileInfo->getPathname());\n\t\t} catch (Exception $e) {\n\t\t\tthrow new WriteException(\"Cannot write to the resource: {$this->fileInfo->getPathname()}\", 0, $e);\n\t\t}\n\t}", "public function close()\n {\n $this->flush();\n $this->out->close();\n }", "public function writeTo($stream) {\n\t\t// have we written the request size yet?\n\t\t$written = $this->writeRequestSize($stream);\n\t\t\n\t\t// try to write the actual buffer itself\n\t\tif ($this->sizeWritten && !feof($this->buffer)) {\n\t\t\t//TODO: check that fread returns something\n\t\t\t$written += fwrite($stream, fread($this->buffer, 8192));\n\t\t}\n\t\t// if we are done, mark it off\n\t\tif (feof($this->buffer)) {\n\t\t\t$this->complete = true;\n\t\t\tfclose($this->buffer);\n\t\t}\n\t\treturn $written;\n\t}", "public function write($data) {\r\n\t\t$res=fwrite($this->_handle, $data);\r\n\t\tif(!$res) {\r\n\t\t\tthrow new Curly_Stream_Exception('An error occured while writing data into the output stream');\r\n\t\t}\r\n\t\telse if($res!==strlen($data)) {\r\n\t\t\tthrow new Curly_Stream_Exception('Not all data was written to the output stream. Just '.$res.' bytes were written');\r\n\t\t}\r\n\t}", "public function end_stream(){\r\n\t\t\t$this->stream->endElement(); // program\r\n\t\t\t$this->stream->endDocument();\r\n\t\t\techo $this->stream->outputMemory();\r\n\t\t}", "public function close()\n {\n fclose($this->resource);\n }", "protected function setupStreams()\n {\n ConsoleStub::$inputStream = fopen('php://memory', 'w+');\n ConsoleStub::$outputStream = fopen('php://memory', 'w+');\n ConsoleStub::$errorStream = fopen('php://memory', 'w+');\n }", "public function transform($resource)\n {\n return [];\n }", "protected function queueResourceAs($name, $resource)\n {\n array_push($this->multipartResources, [\n 'name' => $name,\n 'contents' => $resource,\n ]);\n }" ]
[ "0.70547235", "0.59955335", "0.5983213", "0.52996385", "0.52570987", "0.5147224", "0.50401485", "0.5022386", "0.5003748", "0.5000327", "0.49150887", "0.48501125", "0.4841634", "0.48354453", "0.48026127", "0.48020732", "0.48020732", "0.48020732", "0.48019445", "0.48019445", "0.47967312", "0.47927856", "0.477364", "0.47518504", "0.474065", "0.4734989", "0.47097182", "0.46937388", "0.46831116", "0.46813446" ]
0.7379074
0
Sum all elements of the stream. This method consumes the stream.
public function sum() { $sum = 0; foreach ($this as $value) { $sum += $value; } return $sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sum()\n {\n return array_sum($this->data);\n }", "public static function sum()\n {\n $args = func_get_args();\n $self = array_shift($args);\n\n //sum all of the elements\n return array_sum($args);\n }", "public function sum() {\n\t\treturn array_sum($this->_value);\n\t}", "public function sum();", "public function streamAll(): Generator;", "public function sum() {\r\n $summedData = 123;\r\n\r\n return $summedData;\r\n }", "function sum() {\n static $sum = false;\n $sum = $sum ?: curry('array_sum');\n return _apply($sum, func_get_args());\n}", "public function getSum()\n {\n return array_sum($this->values);\n }", "public function sum($sum=null)\n {\n $sum = LambdaUtils::toSelectCallable($sum);\n $temp = $this->select($sum)->toArray();\n return array_sum($temp);\n }", "public function sumItems(): float\n\t{\n\t\treturn $this->storage->sum();\n\t}", "public function testSum()\n {\n $this->assertEquals(6, $this->object->sum(function ($item) {\n return $item;\n }));\n }", "public function sum(string $key = null)\n {\n if (is_null($key)) {\n return array_sum($this->items);\n }\n\n $sum = 0;\n foreach ($this->items as $i => $item) {\n $sum += $this->value($item, $key);\n }\n\n return $sum;\n }", "public function sumQuantity($filter = null, $complyAll = true)\n {\n if ($this->isEmpty()) {\n return 0;\n }\n\n $allItems = $this->getItems($filter, $complyAll);\n\n return array_reduce($allItems, function ($carry, $item) {\n return $carry + $item->getQuantity();\n }, 0);\n }", "public abstract function collect(StreamCollector $collector): mixed;", "public function sum(): int\n {\n $out = 0;\n foreach ($this->arr as $v) {\n $out += $v;\n }\n return $out;\n }", "public static function sum( ...$numbers ) {\n \n // Remove the options object from the number array.\n $numbers = array_head($numbers);\n \n // Get the sum of all numbers.\n return array_sum($numbers);\n \n }", "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}", "function calculateAll(){\n try{\n $sum = 0;\n foreach($this->content as $inventary){\n foreach($inventary as $key=>$item){\n $sum1 = 0;\n foreach($item as $value)\n $sum1=$sum1+$value->weight*$value->price;\n echo \"value of \".$key.\" = \".$sum1.\"\\n\";\n }\n $sum = $sum + $sum1;\n }\n \n echo \"value of all inventary=\".$sum.\"\\n\";\n } catch (Exception $e) {\n echo $e;\n }\n }", "public static function sum(...$filter): array\n {\n self::collect();\n $return = [];\n\n $toAvg = [\n 'frequency'\n ];\n\n foreach (self::$content as $id => $entry) {\n foreach ($entry as $name => $value) {\n if ($filter && !in_array($name, $filter)) continue;\n\n if (isset($return[$name]) && !in_array($name, $toAvg)) continue;\n\n if (isset($return[$name]) && is_numeric($value))\n $return[$name] += $value;\n\n if (!isset($return[$name]))\n $return[$name] = $value;\n }\n }\n foreach ($return as $name => $value) {\n if (is_numeric($value) && in_array($name, $toAvg))\n $return[$name] = $value / count(self::$content);\n }\n return $return;\n }", "function sum($array)\n{\n return array_reduce($array, function($acc, $x) { return $acc + $x; });\n}", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "function theAddinator($numbers) {\n $sum = 0;\n\n //addinates numbers\n foreach ($numbers as $number) {\n $sum += $number;\n }\n\n //return the sum\n return $sum;\n}", "public function simpleSum($data)\n\t{\n\t\t$sum = 0;\n\t\tforeach ($data as $d)\n\t\t{\n\t\t\tif ($d != '')\n\t\t\t{\n\t\t\t\t$date = JFactory::getDate($d);\n\t\t\t\t$sum += $this->toSeconds($date);\n\t\t\t}\n\t\t}\n\t\treturn $sum;\n\t}", "public function getSum(): float;", "function arraySum($arr){\n $len = count($arr);\n $sum = 0;\n for ($i = 0; $i < $len; $i++){\n $sum += $arr[$i];\n }\n return $sum;\n}", "function sum($arrayOfNumbers)\n{\n $add = 0;\n foreach ($arrayOfNumbers as $number) {\n\n $add += $number;\n }\n return $add;\n}", "public function processInput()\n {\n foreach ($this->input as $line) {\n # Get the checksum\n $splitString = explode('[', $line);\n $encryptedName = $splitString[0];\n $checksumDirty = $splitString[1];\n\n # Get rid of the square bracket\n $checksumLine = substr(trim($checksumDirty), 0, -1);\n\n list($checksum, $number) = $this->getChecksum($encryptedName);\n if ($checksum == $checksumLine) {\n $this->sum += $number;\n }\n }\n\n return $this->sum;\n }", "function iterSumArray(array $array): int\n {\n $total = 0;\n while ($array)\n {\n $total += array_pop($array);\n }\n\n return $total;\n }", "private function array_sum($array)\n\t{\n\t\t//echo \"<pre>\";\n\t\t//print_r($array); exit;\n\n\t\t$sum = 0;\n\t\tforeach ($array as $value) {\n\t\t\t$sum += $value;\n\t\t}\n\t\treturn $sum;\n\t}", "public static function sum($parameters = null);" ]
[ "0.6136496", "0.584858", "0.58115804", "0.57927525", "0.56196636", "0.5525272", "0.54211575", "0.5302563", "0.5223474", "0.52013975", "0.51419604", "0.5080279", "0.5068577", "0.50340354", "0.5011676", "0.49945197", "0.49601725", "0.49409676", "0.49252394", "0.49213815", "0.48841345", "0.4863209", "0.48489365", "0.48478442", "0.48103207", "0.47758183", "0.47648966", "0.47548112", "0.47500914", "0.47438204" ]
0.60107446
1
Using the given accumulator, it calls the callback passing the accumulator and the value of the current element of the stream. The return of the callback is then saved into the accumulator and passed to the next element. Returns the accumulator when all elements have been consumed. This method consumes the stream.
public function reduce($accumulator, callable $callback) { foreach ($this as $value) { $accumulator = $callback($accumulator, $value); } return $accumulator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reduce(callable $callback, $initial = null);", "public function reduce(callable $callback, $initial = null);", "public function reduce(callable $callback, $initial = null);", "public function reduce(callable $callback, $initialValue = null)\n\t{\n\t\t$data = $initialValue;\n\t\t\n\t\tforeach ($this->data as $key => $value)\n\t\t{\n\t\t\t$data = $callback($value, $key, $data);\n\t\t}\n\t\t\n\t\treturn $data;\n\t}", "public function reduce(callable $reducer, $initial_value=NULL);", "public function reduce(Closure $callback, $initial = null) {\n\t\treturn array_reduce($this->_value, $callback, $initial);\n\t}", "public function accumulate(Closure $reducer): float\n {\n $accumulator = 0;\n foreach ($this->array as $key => $value) {\n $accumulator = call_user_func($reducer, $accumulator, $value, $key, $this);\n }\n return $accumulator;\n }", "function iterable_reduce(iterable $iterator, callable $function, $initial = null)\n{\n $acc = $initial;\n\n foreach ($iterator as $value) {\n $acc = $function($acc, $value);\n }\n\n return $acc;\n}", "public function reduce(callable $callback, $initial = null)\n {\n return array_reduce($this->items, $callback, $initial);\n }", "public function reduce(callable $callback, $initial = null)\n {\n return array_reduce($this->items, $callback, $initial);\n }", "public function reduce(\\Closure $c, $initialValue)\n {\n $val = $initialValue;\n foreach ($this->collection as $elmt) {\n $val = $c($val, $elmt);\n }\n $val = $this->format($val);\n\n return $val;\n }", "public function reduce($callback, $initial = null)\n {\n return array_reduce($this->toArray(), $callback, $initial);\n }", "public function reduce(callable $callback, float $initial = 0.0) : float\n {\n $carry = $initial;\n\n foreach ($this->a as $rowA) {\n foreach ($rowA as $valueA) {\n $carry = $callback($valueA, $carry);\n }\n }\n\n return $carry;\n }", "public function takeWhile(callable $callback): Stream {\n\t\t$generator = static function(Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\treturn new self($generator($this));\n\t}", "public function reduce(callable $function, $accumulator)\n {\n return $accumulator;\n }", "public function filter(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function reduce(Closure $func, mixed $initial = null): mixed;", "public function process(\\Iterator $input, callable $callback)\n {\n $callback = \\Closure::fromCallable($callback);\n $input->rewind();\n iterator_apply(\n $input,\n function (\\Iterator $iterator) use ($callback) {\n $callback($iterator->current(), $iterator->key(), $iterator, $this);\n return true;\n },\n [$input]\n );\n return $this;\n }", "public function reduction(callable $callback, mixed $initial = null): Collection;", "private function promiseReduce(array $values, callable $callback, $initialValue)\n {\n }", "public function reduce(Closure $closure);", "public abstract function reduce(callable|BinaryFunction $reducer, mixed $initialValue = null): mixed;", "public function reduce($input, $initialValue, $in): static;", "function array_reduce(iterable $array, callable $f, $acc)\n{\n foreach ($array as $key => $value) {\n $acc = call_user_func($f, $acc, $value, $key);\n }\n\n return $acc;\n}", "function reduce($callable, $initial = null);", "public function reduce(callable $f, $initialValue = null)\n {\n foreach ($this as $element) {\n $initialValue = $f($initialValue, $element);\n }\n\n return $initialValue;\n }", "public function inspect(callable $callback): Stream {\n\t\treturn $this->map(function ($data) use ($callback) {\n\t\t\t$callback($data);\n\t\t\treturn $data;\n\t\t});\n\t}", "function reduce(callable $function, $initial, iterable $items)\n{\n foreach ($items as $item) {\n $initial = $function($initial, $item);\n }\n return $initial;\n}", "public function map(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tyield $callback($value);\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function accept()\n {\n return $this->getClosure()->__invoke($this->getInnerIterator()->current());\n }" ]
[ "0.6066444", "0.6066444", "0.6066444", "0.6061434", "0.5901303", "0.579816", "0.5722104", "0.559246", "0.55001837", "0.55001837", "0.5486265", "0.5445154", "0.54277056", "0.54188454", "0.5370489", "0.52935076", "0.52909833", "0.5259008", "0.5254569", "0.52514917", "0.523973", "0.52204806", "0.52081615", "0.5196116", "0.51663727", "0.50812346", "0.50766826", "0.5013683", "0.5002918", "0.49876654" ]
0.6610466
0
Concats the current stream with the given iterable.
public function concat(iterable $stream): Stream { $generator = function (iterable $stream) { foreach ($this as $element) { yield $element; } foreach ($stream as $element) { yield $element; } }; return new self($generator($stream)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cartesianProduct(iterable $stream): Stream {\n\t\t$generator = function ($set_b) {\n\t\t\tforeach ($this as $element_a) {\n\t\t\t\tforeach ($set_b as $element_b) {\n\t\t\t\t\tyield [$element_a, $element_b];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(iterator_to_array($stream)));\n\t}", "public function streamAll(): Generator;", "private function wrapIterable(iterable $iterable): Generator\n {\n foreach ($iterable as $key => $value) {\n yield $key => $value;\n\n $this->iteratorAdvanced = true;\n }\n\n $this->iterator = null;\n }", "public function zip(iterable ...$iterables): Collection;", "abstract protected function _normalizeIterable($iterable);", "public abstract function toIterable(): iterable;", "public static function concat(Stream|array... $streams): Stream {\r\n\t\treturn new GeneratorStream(self::_toIterable($streams));\r\n\t}", "public function merge(iterable $items) {\n foreach ($items as $key => $value) {\n $this->items[$key] = $value;\n }\n return $this;\n }", "function compact($iterable)\n{\n if (is_array($iterable)) {\n return array_values(array_filter($iterable));\n }\n\n return compactIterable($iterable);\n}", "public static function of(iterable $iterable): self {\n\t\t$generator = function () use ($iterable) {\n\t\t\tforeach ($iterable as $item) {\n\t\t\t\tyield $item;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator());\n\t}", "public function appendedAll(iterable $that): Set;", "public function attach(Traversable $iterable)\n {\n $this->iterable = $iterable;\n }", "public function append(iterable $values): self\n {\n foreach ($values as $value) {\n $this->add($value);\n }\n\n return $this;\n }", "public abstract function collect(StreamCollector $collector): mixed;", "public function c(iterable $foo) : void\n {\n }", "function iterable_reduce(iterable $iterator, callable $function, $initial = null)\n{\n $acc = $initial;\n\n foreach ($iterator as $value) {\n $acc = $function($acc, $value);\n }\n\n return $acc;\n}", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function batchCursor(iterable $params = [], int $batchSize = 25, int $limit = null): \\Traversable;", "function printIterable(iterable $myIterable) {\n foreach($myIterable as $item) {\n echo $item;\n }\n }", "public function getFillIterable(): iterable;", "function _arrayOrIterator(iterable $base, callable $generator) : iterable\n{\n $result = $generator($base);\n return is_array($base) ? iterator_to_array($result) : $result;\n}", "private static function _toIterable(array $streams): iterable {\r\n\t\tforeach ($streams as $stream) {\r\n\t\t\tif (is_array($stream)) {\r\n\t\t\t\t$stream = new MemoryStream($stream);\r\n\t\t\t}\r\n\t\t\tif (!($stream instanceof Stream)) {\r\n\t\t\t\tthrow new InvalidArgumentException(\"Stream parameters must be Stream or array instance.\");\r\n\t\t\t}\r\n\t\t\tforeach ($stream->toIterable() as $key => $value) {\r\n\t\t\t\tyield $key => $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function foo(iterable $itetable){\n\tforeach ($iterable as $value){\n\t\t//...\n\t}\n}", "protected function flattenData(iterable $resources)\n {\n $flatted = collect();\n if (empty($resources)) {\n return $flatted;\n }\n foreach ($resources as $item) {\n $flatted->push($this->getResourceValues($item));\n }\n\n return $flatted;\n }", "protected function doConcatenate() {}", "public static function stream(callable $callable, ...$args)\n {\n while(true) {\n if (is_callable($callable)) {\n yield $callable(...$args);\n } else {\n yield $callable;\n }\n }\n }", "public function transformAndConcat(callable $transformer)\n {\n return self::from(Iterables::concatIterables($this->transform($transformer)));\n }", "public static function is_iterable($input)\n {\n }", "public function product(iterable ...$iterables) : \\Generator\n {\n $pools = [];\n foreach ( $iterables as $i => $iterable ) {\n foreach ( $iterable as $ii => $v ) {\n $pools[ $i ][ $ii ] = $v;\n }\n }\n\n $result = [ [] ];\n foreach ( $pools as $pool ) {\n $resultCurrent = [];\n foreach ( $result as $x ) {\n foreach ( $pool as $y ) {\n $resultCurrent[] = array_merge($x, [ $y ]);\n }\n }\n\n $result = $resultCurrent;\n }\n\n foreach ( $result as $item ) {\n yield $item;\n }\n }", "protected function initList(Closure|iterable $iterable): Generator\n {\n if ($iterable instanceof CollectionInterface) {\n $iterable = $iterable->getIterator();\n }\n\n if (!$iterable instanceof Generator) {\n if (is_iterable($iterable)) {\n $iterable = fn(): Generator => yield from $iterable;\n }\n }\n\n if ($iterable instanceof Closure) {\n $iterable = $iterable();\n }\n\n if (!$iterable instanceof Generator) {\n throw new InvalidArgumentException('Argument must be iterable');\n }\n\n return $iterable;\n }" ]
[ "0.5688292", "0.5492483", "0.5445235", "0.52554196", "0.5251211", "0.51417077", "0.5115941", "0.49334732", "0.48904446", "0.48433697", "0.4798258", "0.46832943", "0.4649254", "0.46127617", "0.45958123", "0.45696288", "0.45520613", "0.45348835", "0.45085305", "0.44870374", "0.44771126", "0.4454309", "0.44515237", "0.44264585", "0.4424309", "0.44142908", "0.4394412", "0.43851945", "0.43787873", "0.43770298" ]
0.69110096
0
Calculates the transpose matrix for the current stream. All elements of the stream must be an iterable. If the elements don't have the same size, the size of the smaller element will be used. It does consumes the stream, but not the elements. So, if used in a stream of streams, only the main stream will be consumed.
public function transpose(): Stream { $streams = $this->map(function (iterable $iterable) { return Stream::of($iterable); }) ->collect(); if (count($streams) == 0) { return new self(new \ArrayIterator([])); } $generator = function (\Iterator ...$streams): \Generator { foreach ($streams as $stream) { $stream->rewind(); } $all_are_valid = function (\Iterator ...$streams) { foreach ($streams as $stream) { if (!$stream->valid()) { return false; } } return true; }; while ($all_are_valid(...$streams)) { $ziped_element = []; foreach ($streams as $stream) { $ziped_element[] = $stream->current(); $stream->next(); } yield $ziped_element; } }; return new self($generator(...$streams)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transpose();", "function transpose(array $xs)\n{\n if (!$xs) {\n return array();\n }\n //special case: row matrix\n if (count($xs) == 1) {\n return array_chunk($xs[0], 1);\n }\n return call_user_func_array(\n 'array_map',\n array_merge(array(null), $xs)\n );\n}", "public function transpose() : self\n {\n switch ($this->m) {\n case 0:\n return $this;\n\n case 1:\n $b = [];\n\n foreach (current($this->a) ?: [] as $row) {\n $b[] = [$row];\n }\n\n return self::quick($b);\n\n default:\n return self::quick(array_map(null, ...$this->a));\n }\n }", "function transposeMatrix($arr){\n $length = count($arr);\n $sublength = count($arr[0]);\n $output = [];\n for($i=0; $i<$sublength; $i++){\n $tmp_arr = [];\n for($j=0; $j<$length;$j++){\n $tmp_arr[] = $arr[$j][$i];\n }\n $output[] = $tmp_arr;\n unset($tmp_arr);\n }\n return $output;\n}", "function transpose($matrix){\n\t$trans = Array();\n\tfor($i=0; $i<count($matrix[0]); $i++){\n\t\t$row = Array();\n\t\tfor($j=0; $j<count($matrix); $j++){\n\t\t\tarray_push($row, $matrix[$j][$i]);\n\t\t}\n\t\tarray_push($trans, $row);\n\t}\n\treturn $trans;\n}", "public function getTranspose(): Matrix\n {\n $matrix = new self(clone $this);\n $matrix->transpose();\n return $matrix;\n }", "public function transpose()\n {\n $literal = array();\n\n for ($i = 0; $i < $this->columns; $i++) {\n $literal[] = array();\n\n for ($j = 0; $j < $this->rows; $j++) {\n $literal[$i][] = $this->get($j, $i);\n }\n }\n\n return new static($literal);\n }", "function transpose(&$A, &$B)\r\n {\r\n $N = 4;\r\n for ($i = 0; $i < $N; $i++)\r\n for ($j = 0; $j < $N; $j++)\r\n $B[$i][$j] = $A[$j][$i];\r\n }", "public static function transpose($array) {\n // array_unshift($array, null);\n // return call_user_func_array('array_map', $array);\n return array_map(null, ...$array);\n }", "public function transpose(): Matrix\n {\n $matrix = static::create($this->y, $this->x);\n foreach ($this->table as $y => $row) {\n foreach ($row as $x => $cell) {\n $matrix->set($y, $x, $cell);\n }\n }\n\n $this->setData($matrix);\n\n return $this;\n }", "public function cartesianProduct(iterable $stream): Stream {\n\t\t$generator = function ($set_b) {\n\t\t\tforeach ($this as $element_a) {\n\t\t\t\tforeach ($set_b as $element_b) {\n\t\t\t\t\tyield [$element_a, $element_b];\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(iterator_to_array($stream)));\n\t}", "function transposeData($data) {\r\n $retData = array();\r\n foreach ($data as $row => $columns) {\r\n foreach ($columns as $row2 => $column2) {\r\n \t\t$retData[$row2][$row] = $column2;\r\n }\r\n }\r\n\treturn $retData;\r\n}", "public function testTranspose()\n {\n // check not array\n $this->assertFalse(Arrays::transpose('string'));\n\n // check bad arrays\n $this->assertFalse(\n Arrays::transpose(array('1', '2', '3')),\n 'Invalid two-dimensional array was accepted'\n );\n $this->assertFalse(\n Arrays::transpose(array('1' => 0, '2' => '0', '3' => array(0))),\n 'Invalid elements on a two-dimensional array were accepted'\n );\n\n // check array with numerical keys\n $array = array(\n 'key1' => array(\n 'value1'\n ),\n 'key2' => array(\n 'value1',\n 'value2'\n )\n );\n $transposed = array(\n array(\n 'key1' => 'value1',\n 'key2' => 'value1'\n ),\n array(\n 'key2' => 'value2'\n )\n );\n $this->assertEquals(\n $transposed,\n Arrays::transpose($array),\n 'Unexpected result of transpose()'\n );\n\n // check array with string keys\n $array = array(\n 'key1' => array(\n 'subkey1' => 'value1'\n ),\n 'key2' => array(\n 'subkey1' => 'value1',\n 'subkey2' => 'value2'\n )\n );\n $transposed = array(\n 'subkey1' => array(\n 'key1' => 'value1',\n 'key2' => 'value1'\n ),\n 'subkey2' => array(\n 'key2' => 'value2'\n )\n );\n $this->assertEquals(\n $transposed,\n Arrays::transpose($array),\n 'Unexpected result of transpose()'\n );\n\n // check array with no keys in common between sub arrays\n $array = array(\n 'key1' => array(\n 'subkey1' => 'value1'\n ),\n 'key2' => array(\n 'subkey2' => 'value1',\n 'subkey3' => 'value2'\n )\n );\n $transposed = array(\n 'subkey1' => array(\n 'key1' => 'value1',\n ),\n 'subkey2' => array(\n 'key2' => 'value1'\n ),\n 'subkey3' => array(\n 'key2' => 'value2'\n )\n );\n $this->assertEquals(\n $transposed,\n Arrays::transpose($array),\n 'Unexpected result of transpose()'\n );\n }", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public static function transpose($_name,$_flag=TRUE) {\n\t\t$_rows=F3::get($_name);\n\t\tif (!is_array($_rows)) {\n\t\t\tF3::$global['CONTEXT']=$_name;\n\t\t\ttrigger_error(self::TEXT_NotArray);\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ($_rows as $_keyx=>$_cols)\n\t\t\tforeach ($_cols as $_keyy=>$_valy)\n\t\t\t\t$_result[$_keyy][$_keyx]=$_valy;\n\t\tif (!$_flag)\n\t\t\treturn $_result;\n\t\tF3::set($_name,$_result);\n\t}", "private function _reorder_array(Matrix $transpose){\n $save_for_output[0] = $transpose->matrix[0];\n $save_for_output[1] = $transpose->matrix[4];\n $save_for_output[2] = $transpose->matrix[8];\n $save_for_output[3] = $transpose->matrix[12];\n $save_for_output[4] = $transpose->matrix[1];\n $save_for_output[5] = $transpose->matrix[5];\n $save_for_output[6] = $transpose->matrix[9];\n $save_for_output[7] = $transpose->matrix[13];\n $save_for_output[8] = $transpose->matrix[2];\n $save_for_output[9] = $transpose->matrix[6];\n $save_for_output[10] = $transpose->matrix[10];\n $save_for_output[11] = $transpose->matrix[14];\n $save_for_output[12] = $transpose->matrix[3];\n $save_for_output[13] = $transpose->matrix[7];\n $save_for_output[14] = $transpose->matrix[11];\n $save_for_output[15] = $transpose->matrix[15];\n $transpose->matrix = $save_for_output;\n return ($transpose);\n }", "public function getMatrix($asArray = false) {}", "static function transpose($data,$setdef=FALSE,$def=NULL){\n if(!is_array($data)) return(NULL);\n if(!array_reduce($data,create_function('$z,$x','return($z and is_array($x));'),TRUE))\n return(NULL);\n $ikeys = array_reduce($data,create_function('$z,$x','return(array_merge(array_keys($x)));'),array());\n $okeys = array_keys($data);\n $res = array();\n foreach($ikeys as $key){\n foreach($okeys as $ck){\n\tif(isset($data[$ck][$key])) \n\t $res[$key][$ck] = $data[$ck][$key];\n\telse if($setdef)\n\t $res[$key][$ck] = $def;\n }\n }\n return($res);\n }", "function flip(iterable $iterable): Iterator\n{\n return Iterator::from(static function () use ($iterable): Generator {\n foreach ($iterable as $k => $v) {\n yield $v => $k;\n }\n });\n}", "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}", "#[\\ReturnTypeWillChange]\n public function getIterator() : Traversable\n {\n foreach ($this->a as $row) {\n yield Vector::quick($row);\n }\n }", "public function collapse(): ?CollapseIterator;", "public function testIteratorWorksWithTraversable()\n {\n $originalDataSet = array(\n array(1, 2, 3),\n array(5, 4, 9)\n );\n $iterator = $this->createIterator(new \\IteratorIterator(new \\ArrayIterator($originalDataSet)));\n\n $data = iterator_to_array($iterator);\n $this->assertEquals($originalDataSet, $data);\n }", "public function streamAll(): Generator;", "function rotarMatriz($numeroFilas, $numeroColumnas, $matrizInicial) \n{ \n global $filasMatriz, $columnasMatriz; \n $fila = 0; \n $columna = 0; \n $siguienteFilaElementoPrimero = 0; \n $filaActual = 0; \n \n /* \n row - Staring row index \n m - ending row index \n col - starting column index \n n - ending column index \n i - iterator \n */\n while ($fila < $numeroFilas && $columna < $numeroColumnas) \n { \n \n if ($fila + 1 == $numeroFilas || \n $columna + 1 == $numeroColumnas) \n break; \n \n // Store the first element \n // of next row, this element \n // will replace first element \n // of current row \n $siguienteFilaElementoPrimero = $matrizInicial[$fila + 1][$columna]; \n \n /* Move elements of first row \n from the remaining rows */\n for ($i = $columna; $i < $numeroColumnas; $i++) \n { \n $filaActual = $matrizInicial[$fila][$i]; \n $matrizInicial[$fila][$i] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n $fila++; \n \n /* Move elements of last column \n from the remaining columns */\n for ($i = $fila; $i < $numeroFilas; $i++) \n { \n $filaActual = $matrizInicial[$i][$numeroColumnas - 1]; \n $matrizInicial[$i][$numeroColumnas - 1] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n $numeroColumnas--; \n \n /* Move elements of last row \n from the remaining rows */\n if ($fila < $numeroFilas) \n { \n for ($i = $numeroColumnas - 1; \n $i >= $columna; $i--) \n { \n $filaActual = $matrizInicial[$numeroFilas - 1][$i]; \n $matrizInicial[$numeroFilas - 1][$i] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n } \n $numeroFilas--; \n \n /* Move elements of first column \n from the remaining rows */\n if ($columna < $numeroColumnas) \n { \n for ($i = $numeroFilas - 1; \n $i >= $fila; $i--) \n { \n $filaActual = $matrizInicial[$i][$columna]; \n $matrizInicial[$i][$columna] = $siguienteFilaElementoPrimero; \n $siguienteFilaElementoPrimero = $filaActual; \n } \n } \n $columna++; \n } \n \n // Print rotated matrix\n echo \"<pre>\"; \n for ($i = 0; $i < $filasMatriz; $i++) \n { \n for ($j = 0; $j < $columnasMatriz; $j++) \n {\n if($matrizInicial[$i][$j] < 10)\n {\n echo \" \". $matrizInicial[$i][$j]. \" \"; \n } else {\n if($matrizInicial[$i][$j] < 100) {\n echo \" \". $matrizInicial[$i][$j] . \" \"; \n } else {\n echo $matrizInicial[$i][$j] . \" \"; \n }\n }\n }\n echo \"<br>\"; \n }\n echo \"</pre>\";\n}", "public function inverse(): matrix|null {\n if (!$this->isSquare()) {\n self::_err('Error::invalid Size of matrix!');\n }\n $imat = $this->copyMatrix();\n $ipiv = vector::factory($this->row, vector::INT);\n $lp = core\\lapack::sgetrf($imat, $ipiv);\n if ($lp != 0) {\n return null;\n }\n $lp = core\\lapack::sgetri($imat, $ipiv);\n if ($lp != 0) {\n return null;\n }\n unset($ipiv);\n unset($lp);\n return $imat;\n }", "public static function accumMatrix($src)\n {\n return matrix::accumulate($src);\n }", "function arrToMatrix(&$array, &$matrix){\r\n foreach ($array as $element) {\r\n $matrix[] = explode(\"|\", $element);\r\n }\r\n }", "private static function _toIterable(array $streams): iterable {\r\n\t\tforeach ($streams as $stream) {\r\n\t\t\tif (is_array($stream)) {\r\n\t\t\t\t$stream = new MemoryStream($stream);\r\n\t\t\t}\r\n\t\t\tif (!($stream instanceof Stream)) {\r\n\t\t\t\tthrow new InvalidArgumentException(\"Stream parameters must be Stream or array instance.\");\r\n\t\t\t}\r\n\t\t\tforeach ($stream->toIterable() as $key => $value) {\r\n\t\t\t\tyield $key => $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getAdjugate(): Matrix\n {\n return $this->getCofactors()->transpose();\n }" ]
[ "0.63671273", "0.6071555", "0.58615166", "0.5771654", "0.52695733", "0.51774955", "0.5106475", "0.4842924", "0.4817503", "0.47582892", "0.47341698", "0.47305107", "0.47294202", "0.4497927", "0.43362233", "0.43002367", "0.4119687", "0.40805608", "0.40076873", "0.39971435", "0.396144", "0.39462775", "0.39459655", "0.39419785", "0.3940422", "0.38658854", "0.38558513", "0.38488948", "0.3832486", "0.3787577" ]
0.722229
0
Executes a Cartesian product of the current stream (set A) with the given iterable (set B). The Cartesian product (AxB) returns subsets combining all elements of A with all elements of B. Each combination is contained in a array. It consumes the given stream.
public function cartesianProduct(iterable $stream): Stream { $generator = function ($set_b) { foreach ($this as $element_a) { foreach ($set_b as $element_b) { yield [$element_a, $element_b]; } } }; return new self($generator(iterator_to_array($stream))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function product(iterable ...$iterables) : \\Generator\n {\n $pools = [];\n foreach ( $iterables as $i => $iterable ) {\n foreach ( $iterable as $ii => $v ) {\n $pools[ $i ][ $ii ] = $v;\n }\n }\n\n $result = [ [] ];\n foreach ( $pools as $pool ) {\n $resultCurrent = [];\n foreach ( $result as $x ) {\n foreach ( $pool as $y ) {\n $resultCurrent[] = array_merge($x, [ $y ]);\n }\n }\n\n $result = $resultCurrent;\n }\n\n foreach ( $result as $item ) {\n yield $item;\n }\n }", "function array_cartesian_product(array $arrays): array\n{\n if (empty($arrays)) {\n return [[]];\n }\n\n $subset = array_shift($arrays);\n $cartesianSubset = array_cartesian_product($arrays);\n $product = [];\n\n foreach ($subset as $value) {\n foreach ($cartesianSubset as $p) {\n array_unshift($p, $value);\n $product[] = $p;\n }\n }\n\n return $product;\n}", "public function cartesianProduct(?callable $operation = null, ?callable $filter = null);", "function cartesian_product($input) {\r\n \t$result = array();\r\n\r\n\t\tforeach ($input as $key => $values) {\r\n\t\t\t// If a sub-array is empty, it doesn't affect the cartesian product\r\n\t\t\tif (empty($values)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\r\n\t\t\t// Seeding the product array with the values from the first sub-array\r\n\t\t\tif (empty($result)) {\r\n\t\t\t\tforeach($values as $value) {\r\n\t\t\t\t\t$result[] = array($key => $value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Second and subsequent input sub-arrays work like this:\r\n\t\t\t\t// 1. In each existing array inside $product, add an item with\r\n\t\t\t\t// key == $key and value == first item in input sub-array\r\n\t\t\t\t// 2. Then, for each remaining item in current input sub-array,\r\n\t\t\t\t// add a copy of each existing array inside $product with\r\n\t\t\t\t// key == $key and value == first item of input sub-array\r\n\t\r\n\t\t\t\t// Store all items to be added to $product here; adding them\r\n\t\t\t\t// inside the foreach will result in an infinite loop\r\n\t\t\t\t$append = array();\r\n\t\r\n\t\t\t\tforeach($result as &$product) {\r\n\t\t\t\t\t// Do step 1 above. array_shift is not the most efficient, but\r\n\t\t\t\t\t// it allows us to iterate over the rest of the items with a\r\n\t\t\t\t\t// simple foreach, making the code short and easy to read.\r\n\t\t\t\t\t$product[$key] = array_shift($values);\r\n\t\r\n\t\t\t\t\t// $product is by reference (that's why the key we added above\r\n\t\t\t\t\t// will appear in the end result), so make a copy of it here\r\n\t\t\t\t\t$copy = $product;\r\n\t\r\n\t\t\t\t\t// Do step 2 above.\r\n\t\t\t\t\tforeach($values as $pos_key=>$item) {\r\n\t\t\t\t\t\t$copy[$key] = $item;\r\n\t\t\t\t\t\t$append[] = $copy;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Undo the side effecst of array_shift\r\n\t\t\t\t\tarray_unshift($values, $product[$key]);\t\t\t\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\t// Out of the foreach, we can add to $results now\r\n\t\t\t\t$result = array_merge($result, $append);\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "private function createCartesianGeneratorRecursively(array $inputs): Generator\n {\n // Zero inputs is the recursion-end condition; the value to yield back would go through array_merge in the\n // general case, so using exactly an empty array here conveniently removes the need to include any kind of\n // special condition check in the multiplexer below.\n if (!$inputs) {\n yield [];\n return;\n }\n\n // Split the inputs in \"head\" (first one) and \"tail\" (all of the others); merge each item in head with each\n // item in the cartesian product of tail (recursively calculated) to get the cartesian product of all inputs.\n $head = array_shift($inputs); // and $inputs becomes the tail\n\n $multiplexer = function() use ($head, $inputs) {\n foreach ($head as $headValue) {\n $tailCartesianProduct = $this->createCartesianGeneratorRecursively($inputs);\n foreach ($tailCartesianProduct as $tailValues) {\n yield array_merge([$headValue], $tailValues);\n }\n }\n };\n\n yield from $multiplexer();\n }", "public function productRepeat(?int $repeat, iterable ...$iterables) : \\Generator\n {\n $repeat = $repeat ?? 1;\n $repeat = max(0, $repeat);\n\n $pools = [];\n foreach ( $iterables as $i => $iterable ) {\n foreach ( $iterable as $ii => $v ) {\n $pools[ $i ][ $ii ] = $v;\n }\n }\n\n $list = [];\n for ( $i = 0; $i < $repeat; $i++ ) {\n $list[] = $pools;\n }\n\n $pools = array_merge(...$list);\n\n yield from $this->product(...$pools);\n }", "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}", "private static function _toIterable(array $streams): iterable {\r\n\t\tforeach ($streams as $stream) {\r\n\t\t\tif (is_array($stream)) {\r\n\t\t\t\t$stream = new MemoryStream($stream);\r\n\t\t\t}\r\n\t\t\tif (!($stream instanceof Stream)) {\r\n\t\t\t\tthrow new InvalidArgumentException(\"Stream parameters must be Stream or array instance.\");\r\n\t\t\t}\r\n\t\t\tforeach ($stream->toIterable() as $key => $value) {\r\n\t\t\t\tyield $key => $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function streamAll(): Generator;", "protected static function cartesian($set): array\n {\n if (!$set) {\n return [[]];\n }\n\n $key = array_key_last($set);\n $subset = array_pop($set);\n $cartesianSubset = self::cartesian($set);\n\n $result = [];\n foreach ($subset as $value) {\n foreach ($cartesianSubset as $p) {\n $p[$key] = $value;\n $result[] = $p;\n }\n }\n\n return $result;\n }", "private function applyBaconArrr(array $streamOne, array $streamTwo) {\n return $this->applyArrrBacon($streamTwo, $streamOne); //this streams are reverse\n }", "public function __invoke(...$operands)\n\t{\n\t\t$operands = $this->generate($operands);\n\t\t$operand = $operands->current();\n\t\tif( $operand )\n\t\t{\n\t\t\tyield $operand;\n\t\t\tyield $operand;\n\t\t}\n\t}", "function permutations(array $elements)\n{\n if (count($elements) <= 1) {\n yield $elements;\n } else {\n foreach (permutations(array_slice($elements, 1)) as $permutation) {\n foreach (range(0, count($elements) - 1) as $i) {\n $first = array_slice($permutation, 0, $i);\n $second = [$elements[0]];\n $third = array_slice($permutation, $i);\n\n yield array_merge($first, $second, $third);\n }\n }\n }\n}", "public function combinationsAll(iterable $it, int $len) : ?\\Generator\n {\n $pool = [];\n foreach ( $it as $v ) {\n $pool[] = $v;\n }\n\n $size = count($pool);\n\n if (! $size && $len) {\n return;\n }\n\n $row = [];\n $indices = [];\n foreach ( $this->range($len) as $i ) {\n $indices[] = 0;\n $row[] = $pool[ 0 ];\n }\n yield $row;\n\n while ( true ) {\n $found = null;\n foreach ( $this->range($len - 1, 0, -1, true) as $i ) {\n if ($indices[ $i ] !== ( $size - 1 )) {\n $found = $i;\n break;\n }\n }\n\n if (null === $found) {\n return;\n }\n\n $i = $found;\n\n $replace = [];\n foreach ( $this->range($len - $i) as $ii ) {\n $replace[] = $indices[ $i ] + 1;\n }\n\n array_splice($indices, $i, count($indices), $replace);\n\n $row = [];\n foreach ( $indices as $i ) {\n $row[] = $pool[ $i ];\n }\n yield $row;\n }\n }", "public function zip(iterable ...$iterables): Collection;", "function product() {\n static $product = false;\n $product = $product ?: curry('array_product');\n return _apply($product, func_get_args());\n}", "public function transpose(): Stream {\n\t\t$streams = $this->map(function (iterable $iterable) {\n\t\t\treturn Stream::of($iterable);\n\t\t})\n\t\t\t->collect();\n\t\tif (count($streams) == 0) {\n\t\t\treturn new self(new \\ArrayIterator([]));\n\t\t}\n\n\t\t$generator = function (\\Iterator ...$streams): \\Generator {\n\t\t\tforeach ($streams as $stream) {\n\t\t\t\t$stream->rewind();\n\t\t\t}\n\t\t\t$all_are_valid = function (\\Iterator ...$streams) {\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\tif (!$stream->valid()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twhile ($all_are_valid(...$streams)) {\n\t\t\t\t$ziped_element = [];\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\t$ziped_element[] = $stream->current();\n\t\t\t\t\t$stream->next();\n\t\t\t\t}\n\t\t\t\tyield $ziped_element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(...$streams));\n\t}", "private function applyArrrBacon(array $streamOne, array $streamTwo) {\n $phrase1 = \"pook\";\n $phrase2 = \"beef\";\n\n $wordsInStream = count($streamOne);\n $streamOneCount = 0;\n $streamTwoCount = 0;\n for($i = 0; $i < $wordsInStream; $i++) {\n if(stripos($streamOne[$i], $phrase1) || substr($streamOne[$i], 0, strlen($phrase1)) === $phrase1) {\n $streamOneCount++;\n }\n if(stripos($streamTwo[$i], $phrase2) || substr($streamTwo[$i], 0, strlen($phrase2)) === $phrase2) {\n $streamTwoCount++;\n }\n }\n\n return array(\"total_first_stream\" => $streamOneCount, \"total_second_stream\" => $streamTwoCount);\n }", "public function combinations(iterable $it, int $len) : ?\\Generator\n {\n $pool = [];\n foreach ( $it as $v ) {\n $pool[] = $v;\n }\n\n $size = count($pool);\n\n if ($len > $size) {\n return;\n }\n\n $row = [];\n $indexes = [];\n foreach ( $this->range($len) as $i ) {\n $row[] = $pool[ $i ];\n $indexes[] = $i;\n }\n yield $row;\n\n while ( true ) {\n $found = null;\n foreach ( $this->range($len - 1, 0, -1, true) as $i ) {\n if ($indexes[ $i ] !== $i + $size - $len) {\n $found = $i;\n break;\n }\n }\n\n if (null === $found) {\n return;\n }\n\n $i = $found;\n\n $indexes[ $i ] += 1;\n\n foreach ( $this->range($i + 1, $len) as $j ) {\n $indexes[ $j ] = $indexes[ $j - 1 ] + 1;\n }\n\n $row = [];\n foreach ( $indexes as $i ) {\n $row[] = $pool[ $i ];\n }\n yield $row;\n }\n }", "public static function concat(Stream|array... $streams): Stream {\r\n\t\treturn new GeneratorStream(self::_toIterable($streams));\r\n\t}", "public function execute(iterable $values): iterable {\n\t\t$current = 0;\n\n\t\tforeach ($values as $key => $value) {\n\t\t\tif ($current >= $this->limit) {\n\t\t\t\tyield $key => $value;\n\t\t\t}\n\t\t\t$current++;\n\t\t}\n\t}", "function _arrayOrIterator(iterable $base, callable $generator) : iterable\n{\n $result = $generator($base);\n return is_array($base) ? iterator_to_array($result) : $result;\n}", "function zipargs($args, $fill=null) {\n $its = array();\n foreach($args as $xs)\n $its []= iter($xs);\n $opts = array();\n if(func_num_args() > 1)\n $opts['fill'] = $fill;\n return new \\std\\_ZipIterator($its, $opts);\n}", "abstract public function combineTo(array $array);", "public function getIterator()\n {\n $result = [];\n foreach ($this->busyPool as $connection){\n $result[] = $connection;\n }\n foreach ($this->availablePool as $connection){\n $result[] = $connection;\n }\n return new ArrayIterator($result);\n }", "public function combinations() : array\n {\n $combinations = [[]];\n\n foreach ($this->grid as $i => $params) {\n $append = [];\n\n foreach ($combinations as $product) {\n foreach ($params as $param) {\n $product[$i] = $param;\n $append[] = $product;\n }\n }\n\n $combinations = $append;\n }\n\n return $combinations;\n }", "public function testReadsMultibulkRepliesAsIterators() {\n\t\t$connection = $this->getConnection ( $profile, true );\n\t\t$connection->getProtocol ()->setOption ( 'iterable_multibulk', true );\n\t\t\n\t\t$connection->executeCommand ( $profile->createCommand ( 'rpush', array (\n\t\t\t\t'metavars',\n\t\t\t\t'foo',\n\t\t\t\t'hoge',\n\t\t\t\t'lol' \n\t\t) ) );\n\t\t$connection->writeCommand ( $profile->createCommand ( 'lrange', array (\n\t\t\t\t'metavars',\n\t\t\t\t0,\n\t\t\t\t- 1 \n\t\t) ) );\n\t\t\n\t\t$this->assertInstanceOf ( 'Predis\\Iterator\\MultiBulkResponse', $iterator = $connection->read () );\n\t\t$this->assertSame ( array (\n\t\t\t\t'foo',\n\t\t\t\t'hoge',\n\t\t\t\t'lol' \n\t\t), iterator_to_array ( $iterator ) );\n\t}", "public abstract function distinct(): Stream;", "public static function crossJoin( ...$arrays )\n {\n $results = [ [] ];\n\n foreach ( $arrays as $index => $array ) {\n $append = [];\n\n foreach ( $results as $product ) {\n foreach ( $array as $item ) {\n $product[ $index ] = $item;\n\n $append[] = $product;\n }\n }\n\n $results = $append;\n }\n\n return $results;\n }", "public function getFillIterable(): iterable;" ]
[ "0.62899864", "0.58701104", "0.5776011", "0.5727239", "0.5709965", "0.5388537", "0.5285905", "0.52151376", "0.51961654", "0.51206464", "0.48926914", "0.48033327", "0.47730547", "0.47282317", "0.4720078", "0.4680656", "0.46797884", "0.4677009", "0.46274552", "0.45820397", "0.45400563", "0.4489706", "0.44662958", "0.4447115", "0.4439692", "0.44322369", "0.44240463", "0.43834478", "0.436562", "0.43532395" ]
0.79956293
0
Applies the callback to each element of the stream and return a stream with array pairs where the first element is the return of the callback and the second one is a Stream with all values for which the callback returned that value. The return of the callback can be a scalar or an object. If an object is returned we use its identity to group. Caution, even though this method returns a Stream, it does consumes the original Stream.
public function groupBy(callable $callback): Stream { $values = []; $keys = []; foreach ($this as $value) { $key = $callback($value); $hashed_keys = is_object($key) ? spl_object_hash($key) : $key; $values[$hashed_keys][] = $value; $keys[$hashed_keys] = $key; } $generator = function (array $values, array $keys) { foreach ($keys as $hashed_keys => $key) { yield [$key, Stream::of($values[$hashed_keys])]; } }; return new Stream($generator($values, $keys)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function keyBy(callable $callback): Stream {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tyield [$callback($value), $value];\n\t\t\t}\n\t\t};\n\t\treturn new Stream($generator($this));\n\t}", "protected static function mapStream($things, $callback)\n {\n $children = [];\n\n foreach ($things as $key => $value) {\n $info = self::fork();\n if ($info['parent']) {\n $children[$key] = $info;\n } else {\n $callback($key, $value, $info['stream']);\n fclose($info['stream']);\n exit;\n }\n }\n\n return self::getChildrenOutput($children);\n }", "public function map(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tyield $callback($value);\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function inspect(callable $callback): Stream {\n\t\treturn $this->map(function ($data) use ($callback) {\n\t\t\t$callback($data);\n\t\t\treturn $data;\n\t\t});\n\t}", "public function eachSpread(callable $callback)\n {\n return $this->each(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "public function mapSpread(callable $callback)\n {\n return $this->map(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "public function streamAll(): Generator;", "public function filter(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function map(callable $callback): Sequence;", "public function pipeAndReturnCallbackResult(callable $callback);", "public function flatMap(callable $callback)\n {\n return $this->map($callback)->collapse();\n }", "public function flatMap(callable $callback): Set;", "public abstract function map(callable|UnaryFunction|string|MapOperator $mapper): Stream;", "public function takeWhile(callable $callback): Stream {\n\t\t$generator = static function(Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\treturn new self($generator($this));\n\t}", "public function map(callable $callback): self\n {\n $collection = Factory::create();\n\n $index = 0;\n foreach ($this->items as $key => $value) {\n $collection->set($key, $callback($value, $key, $index++));\n }\n\n return $collection;\n }", "public function pipeAndReturnSelf(callable $callback): CollectionInterface;", "public function map(callable $callback): Set;", "public function mapToGroups(callable $callback)\n {\n $groups = $this->map($callback)->reduce(function ($groups, $pair) {\n $groups[key($pair)][] = reset($pair);\n\n return $groups;\n }, []);\n\n return (new static($groups))->map([$this, 'make']);\n }", "public function pipe(callable $callback)\n {\n return $callback($this);\n }", "public function pipe(callable $callback)\n {\n return $callback($this);\n }", "public function flatMap(callable $callback): self {\n\t\treturn $this->map($callback)->flatten();\n\t}", "public function group($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $groups = array();\n\n foreach ($this->data as $key => $value) {\n $index = $callback($value, $key, $this);\n\n if (!isset($groups[$index])) {\n $groups[$index] = array();\n }\n\n $groups[$index][$key] = $value;\n }\n\n $this->data = $groups;\n\n return $this;\n }", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "function map(callable $function, iterable $items) : iterable\n{\n return _arrayOrIterator($items, function($items) use($function) {\n foreach ($items as $key => $value) {\n yield $key => $function($value, $key);\n }\n });\n}", "public function reduce($callback)\n {\n return Collection::new(array_reduce($this->items, $callback));\n }", "public function map(\\Closure $callback);", "public function reduction(callable $callback, mixed $initial = null): Collection;", "public function chunkMap(callable $callback, $count = 1000)\n {\n $collection = Collection::make();\n\n $this->chunk($count, function ($items) use ($collection, $callback) {\n $items->each(function ($item) use ($collection, $callback) {\n $collection->push($callback($item));\n });\n });\n\n return $collection;\n }", "public function reduce($callback, $initial = null)\n {\n return array_reduce($this->toArray(), $callback, $initial);\n }", "public function filter(callable $callback = null): Sequence;" ]
[ "0.67603105", "0.6529293", "0.65021646", "0.6350013", "0.6084933", "0.6047412", "0.5984444", "0.5984171", "0.5685418", "0.5643321", "0.56116086", "0.54669714", "0.5448248", "0.5446845", "0.54466915", "0.5380335", "0.5379854", "0.5375079", "0.5373469", "0.5373469", "0.53574806", "0.53267217", "0.5321932", "0.5230939", "0.52077717", "0.5186287", "0.51854515", "0.51653045", "0.51350737", "0.5089759" ]
0.7529892
0
Transform the stream by returning the values from a single column in it
public function pluck($column_key): Stream { $generator = static function (Stream $stream) use ($column_key) { foreach ($stream as $row) { $value = is_object($row) ? $row->{$column_key} : $row[$column_key]; if (isset($value)) { yield $value; } } }; return new Stream($generator($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function transform(Row $row);", "public function valuesFlat($column)\n {\n $data = $this->query->select(\n $this->filter,\n $this->order,\n [$column],\n $this->limitOffset,\n PDO::FETCH_NUM\n );\n\n foreach ($data as &$item) {\n $item = $item[0];\n }\n unset($item);\n\n return $data;\n }", "public function transform()\r\n {\r\n // Retrieve and set the column headings.\r\n $headings = $this->getDiscreteColumnValues(0);\r\n \r\n // One of the retrieved headings does not appear in the first set of data and so is added to the end of the\r\n // headings. When parsing the data though it appears as the penultimate heading, and so the order of headings\r\n // needs to be adjusted so that it can be known when a set of data has been parsed and a new set is begining.\r\n // FURTHER DEVELOPMENT: Parse headings and generate the headings list in the order that they appear in each set\r\n // of data. Generate a warning if the heading order varies between sets of data or one heading does not appear\r\n // at the start of each set of data as this is required to know when one row ends and a new row is to be\r\n // generated.\r\n $headings[6] = $headings[4];\r\n $headings[4] = $headings[5];\r\n $headings[5] = $headings[6];\r\n \r\n // Add additional headings we want.\r\n $headings[6] = 'Title';\r\n $headings[7] = 'First Name';\r\n $headings[8] = 'Surname';\r\n \r\n // Create the new output CSV.\r\n $outputFile = new CsvFile();\r\n $outputFile->addRow($headings);\r\n \r\n // Set up a new empty row to fill with data.\r\n $emptyRow = [];\r\n for ($i = 0; $i < count($headings); ++$i) {\r\n $emptyRow[$i] = '';\r\n }\r\n \r\n // Loop over the data and build the rows.\r\n $row = $emptyRow;\r\n $lastIndex = 0;\r\n foreach ($this->data as $iRow => $data) {\r\n $heading = $data[0];\r\n $value = $data[1];\r\n \r\n $index = array_search($heading, $headings);\r\n \r\n // If the row is complete, add it to the output and start a new row.\r\n if ($index < $lastIndex) {\r\n $outputFile->addRow($row);\r\n $row = $emptyRow;\r\n }\r\n \r\n // Add the data to the row.\r\n $row[$index] = $value;\r\n $lastIndex = $index;\r\n \r\n // Split any name into the 3 parts.\r\n // FURTHER DEVELOPMENT: Use a library util function for this.\r\n if ($index === 0) {\r\n \r\n $titles = [\r\n 'Mr',\r\n 'Mrs',\r\n 'Miss',\r\n 'Ms',\r\n 'Dr',\r\n 'Major',\r\n 'Lt Col'\r\n ];\r\n \r\n // Find any title of the name.\r\n if (in_array(substr($value, 0, 4), $titles)) {\r\n $row[6] = substr($value, 0, 4);\r\n $value = substr($value, 5);\r\n } elseif (in_array(substr($value, 0, 3), $titles)) {\r\n $row[6] = substr($value, 0, 3);\r\n $value = substr($value, 4);\r\n } elseif (in_array(substr($value, 0, 2), $titles)) {\r\n $row[6] = substr($value, 0, 2);\r\n $value = substr($value, 3);\r\n }\r\n \r\n // Extract first name.\r\n $row[7] = substr($value, 0, strpos($value, ' '));\r\n \r\n // Extract surname;\r\n $row[8] = substr($value, strpos($value, ' ') + 1);\r\n }\r\n }\r\n \r\n // Add the last completed row.\r\n $outputFile->addRow($row);\r\n \r\n $outputFile->toFile('/home/tom/Desktop/new-physio-data.csv');\r\n }", "protected function processRow($row)\n {\n return $row;\n }", "protected static function transformRow($row)\n {\n foreach ($row as $key => $value) {\n if ($value instanceof DateTime) {\n $row[$key] = $value->format('Y-m-d H:i:s');\n } else {\n if (is_object($value) && method_exists($value, '__toString')) {\n $row[$key] = $value->__toString();\n } else {\n $row[$key] = $value;\n }\n }\n }\n\n return $row;\n }", "public function transform($line) {\n\n return [\n 'amount' => $line->amount,\n 'description' => $line->description,\n 'quantity' => $line->quantity,\n 'product_id' => $line->product_id,\n 'is_chargeable' => $line->is_chargeable,\n ];\n }", "protected function value()\n {\n return $this->row($this->row);\n }", "protected function transformRow($row){\n\n // if nothing to do\n if($row===null || is_scalar($row)){\n return $row;\n }\n\n foreach($this->connections as $data){\n // get self value\n $self = $row->{$data->getSelfKey()};\n\n $class = $data->getClassName();\n\n // if data isset - inject into key\n if(isset($this->relatedData[$class][$self])){\n $row->{$class} = $this->relatedData[$class][$self];\n // or inject empty value\n }else{\n $row->{$class} = [];\n }\n }\n\n return $row;\n }", "abstract protected function mapRow(array $row);", "abstract protected function mapRow(array $row);", "abstract public function transform();", "public function toColumn() {\r\n\t\treturn $this->PDOStatement->fetchAll(PDO::FETCH_COLUMN,0);\r\n\t}", "public function nextRow() {\n $row = parent::nextRow();\n\n // If any decimal columns, ensure we map them back to the correct PHP type\n // GETS ROUND A HOPEFULLY TEMPORARY WEIRDNESS WITH PDO/MYSQL\n if ($this->decimalColumns && $row) {\n foreach ($this->decimalColumns as $decimalColumn) {\n $row[$decimalColumn] = doubleval($row[$decimalColumn]);\n }\n }\n\n return $row;\n }", "private function getPivot() {\n\n $column = 0;\n foreach ($this->array AS $row => $value) {\n $this->process[] = $this->getPivotArray($column, $row);\n }\n }", "public function processColumnListing($results) {\n return $results;\n }", "private function getColumnValues()\n {\n return array_slice($this->_args, 2);\n }", "public function values() {\n return Sequence(values($this->getIterator()));\n }", "public function transpose(): Stream {\n\t\t$streams = $this->map(function (iterable $iterable) {\n\t\t\treturn Stream::of($iterable);\n\t\t})\n\t\t\t->collect();\n\t\tif (count($streams) == 0) {\n\t\t\treturn new self(new \\ArrayIterator([]));\n\t\t}\n\n\t\t$generator = function (\\Iterator ...$streams): \\Generator {\n\t\t\tforeach ($streams as $stream) {\n\t\t\t\t$stream->rewind();\n\t\t\t}\n\t\t\t$all_are_valid = function (\\Iterator ...$streams) {\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\tif (!$stream->valid()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twhile ($all_are_valid(...$streams)) {\n\t\t\t\t$ziped_element = [];\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\t$ziped_element[] = $stream->current();\n\t\t\t\t\t$stream->next();\n\t\t\t\t}\n\t\t\t\tyield $ziped_element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(...$streams));\n\t}", "protected function convertRow(&$row) {\n\t\tforeach ($this->columns as $name => $type) {\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'int':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\t$row[$name] = (int) $row[$name];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'real':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\t$row[$name] = (float) $row[$name];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Currently unsure how to handle \"date\" formats\n\t\t\t\tcase 'datetime':\n\t\t\t\tcase 'timestamp':\n\t\t\t\t\tif (! is_null($row[$name])) {\n\t\t\t\t\t\tif ('0000-00-00 00:00:00' === $row[$name]) {\n\t\t\t\t\t\t\t$row[$name] = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$row[$name] = new DateTime($row[$name]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected function processDataRow($row)\n {\n $item = array();\n foreach($this->record as $name => $params)\n {\n if (isset($params['default'])) $default = $params['default'];\n else $default = null;\n $item[$name] = $default; // Even if not found, item will get an entry\n }\n foreach($row as $index => $value)\n {\n if (isset($this->map[$index]))\n {\n $name = $this->map[$index];\n $item[$name] = trim($value); // If found always get something not null\n }\n }\n return $item;\n }", "public function format($stream, $columns = [], $limit = PHP_INT_MAX, $offset = 0);", "public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}", "public function mapToRow()\n {\n $rowData = [];\n\n $refPropertyList = static::_getReflectionPropertyList();\n $reader = static::_getAnnotationReader();\n foreach ($refPropertyList as $property) {\n /* @var $annotation \\Pley\\DataMap\\Annotations\\Meta\\Property */\n $annotation = $reader->getPropertyAnnotation($property, \\Pley\\DataMap\\Annotations\\Meta\\Property::class);\n if ($annotation && $annotation->getColumnName()) {\n $rowData[$annotation->getColumnName()] = $this->{$property->getName()};\n }\n }\n\n return $rowData;\n }", "public function transform(Stream $stream) {\n\t\t$service = $stream->channel->service->getService();\n\n\t\treturn [\n\t\t\t'id' => $stream->id,\n\t\t\t'channel_id' => $stream->channel_id,\n\t\t\t'show_id' => $stream->show_id,\n\t\t\t'title' => $stream->title,\n\t\t\t'state' => $stream->state,\n\t\t\t'service' => $service->name(),\n\t\t\t'start_time' => $stream->start_time->toIso8601String(),\n\t\t\t'url' => $stream->getUrl(),\n\t\t\t'video_url' => $stream->getVideoUrl(),\n\t\t\t'chat_url' => $stream->getChatUrl(),\n\t\t];\n\t}", "protected function getTransformedData()\n {\n return $this->transformedData;\n }", "private function getSiteData($row) {\n return $row;\n }", "function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}", "public function map()\n {\n $mappedData = [];\n\n foreach ($this->rawData as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $index => $field) {\n if ($id = getVal($field, ['id'], null)) {\n $mappedData[$index]['id'] = $id;\n }\n\n $mappedData[$index]['transaction'] = $this->template;\n $mappedData[$index]['activity_id'] = getVal($this->rawData, ['activity_id'], null);\n $mappedData[$index]['transaction']['reference'] = getVal($field, ['reference'], null);\n $mappedData[$index]['transaction']['transaction_type'][0]['transaction_type_code'] = getVal($this->rawData, ['type'], null);\n $mappedData[$index]['transaction']['transaction_date'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['value'][0]['amount'] = getVal($field, ['amount'], null);\n $mappedData[$index]['transaction']['value'][0]['currency'] = getVal($field, ['currency'], null);\n $mappedData[$index]['transaction']['value'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['description'][0]['narrative'][0]['narrative'] = getVal($field, ['description'], null);\n $mappedData[$index]['transaction']['receiver_organization'][0]['narrative'][0]['narrative'] = getVal($field, ['organisation'], null);\n }\n }\n }\n\n return $mappedData;\n }", "public static function availableColumnData()\n {\n return static::columnData()->pipe(function ($columns) {\n return static::modifyAvailableColumns($columns);\n });\n }", "public function transform($value);" ]
[ "0.6434298", "0.5425334", "0.53994054", "0.5251193", "0.5157988", "0.5119396", "0.5053917", "0.50335985", "0.4931123", "0.4931123", "0.49058965", "0.4893327", "0.48917747", "0.48700684", "0.486823", "0.47969502", "0.47771242", "0.4694613", "0.46596757", "0.4635857", "0.4635546", "0.46137524", "0.46035692", "0.4590971", "0.4587592", "0.4567771", "0.45676127", "0.45673227", "0.45422804", "0.45295402" ]
0.5643434
1
Rejects the stream's elements that meet the callback's condition.
public function reject(callable $callback): self { $generator = function (Stream $stream) use ($callback): \Generator { foreach ($stream as $value) { if (!$callback($value)) { yield $value; } } }; return new self($generator($this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reject(Closure $callback): ReadableCollection;", "public function reject(callable $callback);", "public function testReject() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::reject($array, function($value) {\n\t\t\treturn ($value < 4);\n\t\t});\n\t\t$this->assertInternalType('array', $array);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test rejecting down to odd elements\n\t\t$result = _::reject($array, function($value) {\n\t\t\treturn (2 == $value);\n\t\t});\n\t\t$this->assertInternalType('array', $array);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[2]);\n\t}", "public function reject($callback)\n {\n if ($this->useAsCallable($callback)) {\n return $this->filter(function ($value, $key) use ($callback) {\n return ! $callback($value, $key);\n });\n }\n\n return $this->filter(function ($item) use ($callback) {\n return $item != $callback;\n });\n }", "public function reject($callback = true): static\n {\n $useAsCallable = $this->useAsCallable($callback);\n\n return $this->filter(\n fn($value, $key) => $useAsCallable\n ? ! $callback($value, $key)\n : $value != $callback\n );\n }", "public function reject(callable $c);", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "public function filter(\\Closure $callback);", "public function reject(array $messages);", "public function reject($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n foreach ($this->data as $key => $value) {\n if ($callback($value, $key, $this)) {\n unset($this->data[$key]);\n }\n }\n\n return $this;\n }", "static function reject($collection, $function)\n {\n $result = array();\n foreach($collection as $item) {\n if(!$function($item)) {\n $result[] = $item;\n }\n }\n return Ruby::wrap($result);\n }", "public function filter(callable $callback = null): Sequence;", "public function filter(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function filter(callable ...$callbacks): self;", "public function filter(callable $callback);", "public function reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\n }", "function reject($iterable, $lambda) {\n $out = array();\n foreach ($iterable as $v) if (!$lambda($v)) $out[] = $v;\n return $out;\n}", "public function reject() {\n }", "public function filter(callable $callback = null);", "public function filterNot(callable $hof);", "public function discard()\n {\n $this->channel->basic_reject(\n $this->tag(),\n false\n );\n }", "public function takeWhile(callable $callback): Stream {\n\t\t$generator = static function(Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\treturn new self($generator($this));\n\t}", "public function reject(...$arguments): self {\n return $this->end(self::STATE_REJECTED, $this->_failed, $arguments);\n }", "public function skipWhile(callable $callback): self {\n\t\t$generator = static function(Stream $stream) use ($callback) {\n\t\t\t$keep_value = false;\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tif ($keep_value || !$callback($value)) {\n\t\t\t\t\tyield $value;\n\t\t\t\t\t$keep_value = true;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn new self($generator($this));\n\t}", "public function skip(\\Closure $callback)\n {\n $this->_reject = $callback;\n\n return $this;\n }", "function kreject($iterable, $lambda) {\n $out = array();\n foreach ($iterable as $k => $v) if (!$lambda($v)) $out[$k] = $v;\n return $out;\n}", "public function filter(Closure $callback)\n {\n call_user_func($callback, $this->filter);\n }", "public function mustNot(callable $callback) \n {\n return $this->addMustNotParam(call_user_func($callback, with(new static($this->client))));\n }", "public function badFilter(): void\n {\n throw new RuntimeException('nope');\n }", "public function getRejected();" ]
[ "0.6965749", "0.68149865", "0.6606951", "0.6402454", "0.6234516", "0.61810344", "0.5622635", "0.56212217", "0.5619619", "0.5534541", "0.55338305", "0.552714", "0.5524085", "0.5492927", "0.5478482", "0.5421083", "0.5396678", "0.5263764", "0.5197999", "0.50575536", "0.5041981", "0.50082517", "0.49301144", "0.486903", "0.4860891", "0.48516804", "0.48474464", "0.4842241", "0.48254585", "0.47806677" ]
0.69185156
1
Returns true if none of the stream's elements meet the callback's condition. Returns false otherwise.
public function none(callable $callback): bool { foreach ($this as $value) { if ($callback($value)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function some(callable $callback): bool {\n\t\treturn count(array_filter($this->array, $callback)) > 0;\n\t}", "public function none($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $result = false;\n foreach ($this->data as $key => $value) {\n if ($callback($value, $key, $this)) {\n $result = false;\n break;\n\n } else {\n $result = true;\n }\n }\n\n return $result;\n }", "public function every(callable $callback): bool {\n\t\treturn $this->count() === count(array_filter($this->array, $callback));\n\t}", "function all(callable $callback, iterable $items) : bool\n{\n return !any(complement($callback), $items);\n}", "function any(callable $callback, iterable $items) : bool\n{\n foreach ($items as $item) {\n if ($callback($item)) {\n return true;\n }\n }\n return false;\n}", "public function every($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $result = false;\n foreach ($this->data as $key => $value) {\n if (!$callback($value, $key, $this)) {\n $result = false;\n break;\n\n } else {\n $result = true;\n }\n }\n\n return $result;\n }", "public function all(callable $callback): bool {\n\t\tforeach ($this as $value) {\n\t\t\tif (!$callback($value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function any(callable $callback): bool {\n\t\tforeach ($this as $value) {\n\t\t\tif ($callback($value)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function getIsEmptyCallback(): ?callable;", "public function forAll($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $result = true;\n foreach ($this->data as $key => $value) {\n if (!$callback($value, $key, $this)) {\n $result = false;\n break;\n }\n }\n\n return $result;\n }", "public function some(callable $callback): bool\n {\n return Tools::some($callback, $this->entries());\n }", "function none_of(mixed $subject, iterable $options, callable $callback = null): bool\n {\n return false === which_of($subject, $options, $callback);\n }", "public function some($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n $result = false;\n foreach ($this->data as $key => $value) {\n if ($callback($value, $key, $this)) {\n $result = true;\n break;\n }\n }\n\n return $result;\n }", "public function hasNext() {\n return call(array($this, 'next'), func_get_args()) != null;\n }", "public function every(callable $callback): bool\n {\n return Tools::every($callback, $this->entries());\n }", "public function untilTrue(callable $condition): bool\n {\n return $this->whileTrue($condition);\n }", "static function any($collection, $function)\n {\n foreach($collection as $item) {\n if($function($item)) {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function every(callable $callback): bool\n {\n return $this->blocks->every($callback);\n }", "public function any(callable $test): bool\n {\n foreach($this as $item) {\n if ($test($item)) {\n return true;\n }\n }\n\n return false;\n }", "public function valid()\n {\n return (false !== \\next($this->events)) ? current($this->events) : false;\n }", "public function hasNextInvisible() {\n return call(array($this, 'nextInvisible'), func_get_args()) != null;\n }", "static function all($collection, $function)\n {\n foreach($collection as $item) {\n if(!$function($item)) {\n return FALSE;\n }\n }\n return TRUE;\n }", "public function filter(callable $callback = null): Sequence;", "public function available() {\r\n\t\t// All streams were read\r\n\t\tif($this->_streamsCount===0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// The current stream has more data\r\n\t\tif(reset($this->_streams)->available()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t// Check the other streams, if they have data\r\n\t\tforeach($this->_streams as $stream) {\r\n\t\t\tif($stream->available()) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function isOk($arr) {\n return count(array_filter($arr)) == 0;\n }", "public function forNone(callable $predicate)\n {\n return !((boolean)call_user_func($predicate, $this->contents, 0, $this));\n }", "public function exists(callable $callback): bool\n {\n $index = 0;\n foreach ($this->items as $key => $item) {\n if (true === $callback($item, $key, $index++)) {\n return true;\n }\n }\n\n return false;\n }", "public function valid()\n {\n return count($this->result_queue) !== 0;\n }", "function hasNext() {\r\n if ($this->index == OFF_LIST) {\r\n return count($this->list) != 0;\r\n } else {\r\n return $this->index != count($this->list) - 1;\r\n }\r\n }", "public function allSatisfyConditions(callable $callback, bool $bind_callback_to_this=true): bool;" ]
[ "0.6890992", "0.6709504", "0.6467023", "0.6349564", "0.6331062", "0.63068867", "0.6188396", "0.6183574", "0.6174768", "0.6163484", "0.5909916", "0.5909458", "0.5892868", "0.57690465", "0.5716926", "0.5657389", "0.5624259", "0.5623829", "0.5568943", "0.55650514", "0.55610263", "0.55602527", "0.55520564", "0.5510706", "0.55036855", "0.5492079", "0.548095", "0.5471646", "0.54381883", "0.5422238" ]
0.69879305
0
Add an user in a working group
function addUserToWorkinggroup($idWG){ require_once 'model/dbConnector.php'; $connexion = openDBConnexion(); $request = $connexion->prepare(' INSERT INTO bdd_satisfevent.users_has_workinggroups SET Users_idUsers = ?, WorkingGroups_idWorkingGroups = ?'); $request->execute(array($_SESSION['logged']['idUsers'], $idWG)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add() {\n\t\t$data = array (\n\t\t\t'be_users_uid' => $this['beUserUid'],\n\t\t\t'group_uid' => $this['groupUid'],\n\t\t\t'rights' => $this['rights']\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group_be_users_mm',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addMembership', 'Added user '.$data['be_users_uid'].' to group '.$data['group_uid']);\n\t\t} else {\n\t\t\tthrow new Exception ('Error adding user. user / group: ' . $data['be_users_uid'] . ' ' . $data['group_uid']);\n\t\t}\n\t}", "public function testAddUserIntoGroup(){\n jAcl2DbUserGroup::createUser('robert');\n self::$grpId7 = $this->getLastId('id_aclgrp', 'jacl2_group');\n jAcl2DbUserGroup::addUserToGroup('robert', self::$grpId1);\n\n self::$groups[] = array('id_aclgrp'=>self::$grpId7,\n 'name'=>'robert',\n 'grouptype'=>2,\n 'ownerlogin'=>'robert');\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId7),\n array('login'=>'robert', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId1),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function add_user_to_group($user_to_add, $group, $status=NO_PERMISSIONS){\n\t\t// Create object for user invoking the script:\n\t\t$curr_user = new User();\n\t\t// Ensure all parties involved actually exists:\n\t\tif($curr_user->exists() && $user_to_add->exists() && $group->exists()){\n\t\t\t// Check the user trying to add a member is actually affiliated with and the owner of the group:\n\t\t\t// This check also ensures the group provided is active so don't need to check for that\n\t\t\tif($this->user_access_level($curr_user, $group) < OWNER || !$this->is_user_active_member($curr_user, $group))\n\t\t\t\treturn ['status'=>false, 'msg'=>'You do not have sufficient Access Rights for '.$group->name()];\n\t\t\t\t\n\t\t\t// Make sure current user isn't trying to add them-self to the group:\n\t\t\tif($curr_user->data()->id == $user_to_add->data()->id)\n\t\t\t\treturn ['status'=>false, 'msg'=>'You cannot add yourself to a group you already own'];\n\t\t\t\n\t\t\t// Ensure user being added isn't already a member of the group:\n\t\t\tif($this->is_user_active_member($user_to_add, $group))\n\t\t\t\treturn ['status'=>false, 'msg'=>$user_to_add->name().' is already a member of '.$group->name()];\n\n\t\t\t// Add the user to the group or reinstate them if they are a historical member:\n\t\t\tif($this->is_user_historical_member($user_to_add, $group)){\n\t\t\t\t// update USERS_TO_GROUPS_INTERMEDIARY table to reactivate user\n\t\t\t\tif($this->reactivate_user_with_group($user_to_add, $group))\n\t\t\t\t\treturn ['status'=>true, 'msg'=>$user_to_add->name().' has rejoined '.$group->name()];\n\t\t\t\telse\n\t\t\t\t\treturn ['status'=>false, 'msg'=>$user_to_add->name().' could not be reactivated with '.$group->name().'. Please try again or contact us for assistance'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// add user to USERS_TO_GROUPS_INTERMEDIARY table\n\t\t\t\tif($this->insert_into_intermediary_table($user_to_add->data()->id, $group->data()->id, $status))\n\t\t\t\t\treturn ['status'=>true, 'msg'=>$user_to_add->name().' has been added to '.$group->name()];\n\t\t\t\telse\n\t\t\t\t\treturn ['status'=>false, 'msg'=>$user_to_add->name().' could not be added to '.$group->name().'. Please try again or contact us for assistance'];\n\t\t\t}\n\t\t}\n\t\treturn ['status'=>false, 'msg'=>'Unable to add '.($user_to_add->exists() ? $user_to_add->name() : 'Invalid User').' to '.($group->exists() ? $group->name() : 'Invalid Group')];\n\t}", "function group_add_user($groupid, $userid, $role=null) {\n $groupid = group_param_groupid($groupid);\n $userid = group_param_userid($userid);\n\n $gm = new StdClass;\n $gm->member = $userid;\n $gm->group = $groupid;\n $gm->ctime = db_format_timestamp(time());\n if (!$role) {\n $role = get_field_sql('SELECT gt.defaultrole FROM {grouptype} gt, {group} g WHERE g.id = ? AND g.grouptype = gt.name', array($groupid));\n }\n $gm->role = $role;\n\n db_begin();\n insert_record('group_member', $gm);\n delete_records('group_member_request', 'group', $groupid, 'member', $userid);\n handle_event('userjoinsgroup', $gm);\n db_commit();\n}", "function group_add_user($group,$user){\n //adding a user is a bit fiddly, we need to get the full DN of the user\n //and add it using the full DN of the group\n \n //find the user's dn\n $user_info=$this->user_info($user,array(\"cn\"));\n if ($user_info[0][\"dn\"]==NULL){ return (false); }\n $user_dn=$user_info[0][\"dn\"];\n \n //find the group's dn\n $group_info=$this->group_info($group,array(\"cn\"));\n if ($group_info[0][\"dn\"]==NULL){ return (false); }\n $group_dn=$group_info[0][\"dn\"];\n \n $add=array();\n $add[\"member\"] = $user_dn;\n \n $result=@ldap_mod_add($this->_conn,$group_dn,$add);\n if ($result==false){ return (false); }\n return (true);\n }", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function addUserGroups()\n {\n Log::add('User groups added in installation script', JLog::DEBUG, 'com_cajobboard');\n\n $db = JFactory::getDbo();\n\n // Get the PK of the \"Registered\" user group\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName(array('id', 'title')))\n ->from ($db->quoteName('#__usergroups'))\n ->where ($db->quoteName('title') . ' = '. $db->quote('Registered'));\n\n $db->setQuery($query);\n\n $registeredGroupId = $db->loadResult();\n\n unset($query);\n\n // Get a list of all of the existing user groups so we don't duplicate adding ones we want\n $query = $db->getQuery(true);\n\n $query\n ->select ($db->quoteName('title'))\n ->from ($db->quoteName('#__usergroups'));\n\n $db->setQuery($query);\n\n $existingUserGroups = $db->loadColumn();\n\n // Add our new user groups\n foreach ($this->userGroups as $userGroup)\n {\n if (!in_array($userGroup, $existingUserGroups))\n {\n $groupModel = Table::getInstance('Usergroup');\n\n $groupModel->save(array(\n 'title' => $userGroup,\n 'parent_id' => $registeredGroupId\n ));\n }\n }\n\n Table::getInstance('Usergroup')->rebuild();\n }", "public function add() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\t$this['uid'] = $GLOBALS['TYPO3_DB']->sql_insert_id($res);\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addGroup', 'Added Group '.$data['name']);\n\t\t} else {\n\t\t\tthrow new Exception('Error adding group: ' . $data['name']);\n\t\t}\n\t\treturn($this['uid']);\n\t}", "public function addToGroup($name) {\r\n // Check if the user belongs to the group\r\n if (!in_array($name, $this->groups)) {\r\n // If not, then we add them to the group\r\n $this->groups[] = $name;\r\n // Update the object in the database\r\n $this->update();\r\n }\r\n }", "function addToGroup($userId, $db, $group, $leader) {\n if ($group == 0) {\n echo \"<meta http-equiv='REFRESH' content='0;url=createGroup.php'>\";\n return 0;\n }\n $query = ('UPDATE users SET currentGroup = :group, groupLeader = :leader WHERE id = :userId');\n $statement = $db -> prepare($query);\n $statement -> bindValue(':userId', $userId);\n $statement -> bindValue(':group', $group);\n $statement -> bindValue(':leader', $leader);\n\n // execute query and print error message if not\n if (!$statement -> execute()) { return print_r($stm->errorInfo(), true);} else {\n return true;\n }\n}", "public function addUser(){}", "function add_session_group_user() {\r\n // set connection var\r\n global $db;\r\n\r\n // protect from unauthorized access\r\n if (!isset($_SESSION['user']) or !isset($_SESSION['group'])) {\r\n logout();\r\n die();\r\n }\r\n\r\n if (!isset($_POST['formSurveyGroupUserUsername']) || \r\n (($_POST['formSurveyGroupUserUsername'] == '') && ($_POST['formSurveyGroupUserEmail'] == ''))) {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Моля, въведете Потребителско Име или Email за търсене на потребителя!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n die();\r\n }\r\n\r\n $username = $_POST['formSurveyGroupUserUsername'];\r\n\r\n $sql = \"SELECT id\r\n FROM users\r\n WHERE username = '$username'\r\n AND is_active = '1';\";\r\n\r\n $users = array();\r\n $new_group_user = null;\r\n foreach ($db->query($sql) as $key => $value) {\r\n $users[$key] = $value;\r\n foreach ($users[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $new_group_user = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n if ($new_group_user != null) {\r\n $group = new Group();\r\n $group = unserialize($_SESSION['group']);\r\n $session_group = new Group;\r\n $session_group = unserialize($_SESSION['group']);\r\n $users = $session_group->getMembersArray();\r\n if (!in_array($new_group_user, $users)) {\r\n array_push($users, $new_group_user);\r\n $session_group->setMembers(serialize($users));\r\n $_SESSION['group'] = serialize($session_group);\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно добавихте потребител към групата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n } else {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Този потребител е вече добавен към групата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n }\r\n } else {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Няма открит потребител с тези данни!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n }\r\n}", "public function enroll_user_to_group(){\n\t\t $users = array();\n\t\t\t$all_checked_request = $_REQUEST['request_id'];\n\t\t\t$group_id = $_REQUEST['group_id'];\n\t\t\t$group_user_limit = get_post_meta($group_id, 'wdm_group_users_limit_'.$group_id, true);\n\t\t\tif($group_user_limit > 0){\n\t\t\t\tforeach($all_checked_request as $request_id){\n\t\t\t\t\t$request_id = (int)$request_id;\n\t\t\t\t\t$request_info = $this->course_request_by_id($request_id);\n\t\t\t\t\t$user_id = (int)$request_info[0]->user_id;\n\t\t\t\t\tld_update_group_access($user_id, $group_id);\n\t\t\t\t\tupdate_user_meta( $user_id, 'learndash_group_users_'.$group_id.'', $group_id );\n\t\t\t\t\t$this->update_course_request($request_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function addUser(){\n\t}", "public function actionAddGroup()\n {\n echo \"Create an user group ...\\n\";\n $name = trim($this->prompt('Group name (max length 32 varchar):'));\n $desc = trim($this->prompt('Group description (max length 255 varchar):'));\n if ($name && $this->confirm(\"Are your sure to create an user group?\")) {\n if (DIRECTORY_SEPARATOR === '\\\\') {\n $name = iconv('GBK','UTF-8//IGNORE', $name);\n $desc = iconv('GBK','UTF-8//IGNORE', $desc);\n }\n $model = Yii::$app->menuManager->addGroup($name, $desc);\n if ($model->hasErrors()) {\n echo join(',', $model->getFirstErrors()) . \"\\n\";\n return self::EXIT_CODE_ERROR;\n }\n echo \"Success.\\n\";\n return self::EXIT_CODE_NORMAL;\n }\n echo \"Canceled!\\n\";\n return self::EXIT_CODE_NORMAL;\n }", "function addUsersToGroup($group_id, $user_ids){\n\n}", "public function joinGroup($user_id,$project_id);", "function add_newuser($user) {\n global $DB;\n $DB->insert_record('report_user_statistics', $user, false);\n}", "private function insertUserGroup() {\n\t $groupInfo = self::getQueryInfo('base_group', 'group_name', 'id');\n\t $userInfo = self::getQueryInfo('users', 'email', 'id');\n\t\t\n\t\tDB::table('base_user_group')->insert(['user_id'\t=> $userInfo['[email protected]'], 'group_id' => $groupInfo['sales.reporting']]);\n\t\tDB::table('base_user_group')->insert(['user_id'\t=> $userInfo['[email protected]'], 'group_id' => $groupInfo['customer.analytics']]);\n\t}", "function addMembership($args) {\n\t\t$groupId = isset($args[0])?(int)$args[0]:0;\n\t\t$userId = isset($args[1])?(int)$args[1]:null;\n\n\t\t$groupMembershipDao =& DAORegistry::getDAO('GroupMembershipDAO');\n\n\t\t// If a user has been selected, add them to the group.\n\t\t// Otherwise list users.\n\t\tif ($userId !== null) {\n\t\t\t$this->validate($groupId, $userId);\n\t\t\t$group =& $this->group;\n\t\t\t$user =& $this->user;\n\t\t\t// A valid user has been chosen. Add them to\n\t\t\t// the membership list and redirect.\n\n\t\t\t// Avoid duplicating memberships.\n\t\t\t$groupMembership =& $groupMembershipDao->getMembership($group->getId(), $user->getId());\n\n\t\t\tif (!$groupMembership) {\n\t\t\t\t$groupMembership = new GroupMembership();\n\t\t\t\t$groupMembership->setGroupId($group->getId());\n\t\t\t\t$groupMembership->setUserId($user->getId());\n\t\t\t\t// For now, all memberships are displayed in About\n\t\t\t\t$groupMembership->setAboutDisplayed(true);\n\t\t\t\t$groupMembershipDao->insertMembership($groupMembership);\n\t\t\t}\n\t\t\tRequest::redirect(null, null, 'groupMembership', $group->getId());\n\t\t} else {\n\t\t\t$this->validate($groupId);\n\t\t\t$group =& $this->group;\n\t\t\t$this->setupTemplate($group, true);\n\n\t\t\t$searchType = null;\n\t\t\t$searchMatch = null;\n\t\t\t$search = $searchQuery = Request::getUserVar('search');\n\t\t\t$searchInitial = Request::getUserVar('searchInitial');\n\t\t\tif (!empty($search)) {\n\t\t\t\t$searchType = Request::getUserVar('searchField');\n\t\t\t\t$searchMatch = Request::getUserVar('searchMatch');\n\n\t\t\t} elseif (!empty($searchInitial)) {\n\t\t\t\t$searchInitial = String::strtoupper($searchInitial);\n\t\t\t\t$searchType = USER_FIELD_INITIAL;\n\t\t\t\t$search = $searchInitial;\n\t\t\t}\n\n\t\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\t\t$journal =& Request::getJournal();\n\t\t\t$users = $roleDao->getUsersByRoleId(null, $journal->getId(), $searchType, $search, $searchMatch);\n\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t\t$templateMgr->assign('searchField', $searchType);\n\t\t\t$templateMgr->assign('searchMatch', $searchMatch);\n\t\t\t$templateMgr->assign('search', $searchQuery);\n\t\t\t$templateMgr->assign('searchInitial', Request::getUserVar('searchInitial'));\n\n\t\t\t$templateMgr->assign_by_ref('users', $users);\n\t\t\t$templateMgr->assign('fieldOptions', Array(\n\t\t\t\tUSER_FIELD_FIRSTNAME => 'user.firstName',\n\t\t\t\tUSER_FIELD_LASTNAME => 'user.lastName',\n\t\t\t\tUSER_FIELD_USERNAME => 'user.username',\n\t\t\t\tUSER_FIELD_EMAIL => 'user.email'\n\t\t\t));\n\t\t\t$templateMgr->assign('alphaList', explode(' ', __('common.alphaList')));\n\t\t\t$templateMgr->assign_by_ref('group', $group);\n\n\t\t\t$templateMgr->display('manager/groups/selectUser.tpl');\n\t\t}\n\t}", "function groups_add_member($groupid, $userid) {\n if (!groups_group_exists($groupid)) {\n return false;\n }\n\n if (groups_is_member($groupid, $userid)) {\n return true;\n }\n\n $member = new object();\n $member->groupid = $groupid;\n $member->userid = $userid;\n $member->timeadded = time();\n\n if (!insert_record('groups_members', $member)) {\n return false;\n }\n\n //update group info\n set_field('groups', 'timemodified', $member->timeadded, 'id', $groupid);\n\n //trigger groups events\n $eventdata = new object();\n $eventdata->groupid = $groupid;\n $eventdata->userid = $userid;\n events_trigger('groups_member_added', $eventdata);\n\n return true;\n}", "function cvs_add_user($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_owner;\r\n\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n\r\n $cvs_fields = $all_cvs_users[$cvs_user];\r\n\r\n if (is_null($cvs_fields)) {\r\n\t$cvs_fields[0] = $cvs_pass;\r\n\t$cvs_fields[1] = $cvs_owner;\r\n\t$all_cvs_users[$cvs_user] = $cvs_fields;\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Added user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user already exists\");\r\n }\r\n}", "private function addTestUser(): void\n {\n $this->terminus(sprintf('site:team:add %s %s', $this->getSiteName(), $this->getUserEmail()));\n }", "public function add_members() {\n // check if a user + group id exists in membership\n // update that if exists\n // else, add\n // redirect to group id\n\n if (!($this->input->post() || $this->session->has_userdata('curr_group_id'))) {\n $this->_redirect('dashboard/groups');\n exit();\n }\n\n $curr_group_id = $this->session->userdata('curr_group_id');\n \n if ($users = $this->input->post('users')) {\n $this->_add_users($users);\n }\n\n $this->_redirect('dashboard/groups/' . $curr_group_id);\n }", "public function addUser(MrAuthUser $user)\n {\n $writer = $this->getWriter();\n $user->save();\n \n if (!empty($user->id) && $user->isSynched() == TRUE)\n {\n $fields['group_id'] = $this->id;\n $fields['auth_id'] = $user->id;\n if (!$writer->doInsertIgnore(\"MrAuthGroupUser\", $fields))\n {\n return FALSE;\n }\n }\n else\n {\n // Not a valid user.\n return FALSE;\n }\n \n return TRUE;\n }", "function addGroupMember($mysqli, $groupID, $userID, $isAdmin, $isAccepted){\r\n $mysqli->query('INSERT INTO `group_members` VALUES ('.$groupID.','.$userID.','.$isAdmin.','.$isAccepted.')');\r\n }", "function eio_grp_add($grp, $req)\n{\n}", "private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }", "function add_user(MJKMH_User $user): void {\r\n\t\t$this->users[$user->id()] = $user;\r\n\t}" ]
[ "0.7490189", "0.71064216", "0.70748335", "0.69329166", "0.6901319", "0.6900726", "0.6647482", "0.6639866", "0.65988183", "0.65927345", "0.65243244", "0.65088683", "0.6503552", "0.64202017", "0.64126563", "0.6395145", "0.638195", "0.6359744", "0.6356307", "0.63518393", "0.6347881", "0.63407767", "0.63168657", "0.62978786", "0.62869084", "0.62569195", "0.6249718", "0.6209118", "0.62050027", "0.6204277" ]
0.7216636
1
Get the id of the most recent statistic entered
function getStatId(){ $connexion = openDBConnexion(); $request = $connexion->prepare(' SELECT idStatistics FROM bdd_satisfevent.statistics ORDER BY idStatistics DESC LIMIT 1 '); $request->execute(array()); $result = $request->fetchAll(); return $result[0]['idStatistics']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLastId() \n {\n if(!Patient::all() -> isEmpty()){\n $recentId = Patient::orderBy('patient_id', 'desc')->first()->patient_id;\n return $recentId;\n }\n }", "public function getMostRecentRunId() {\n return (float) $this->profile->mostRecentRun->attributes()->id;\n }", "public function log_fetch_highest_id () {\n\t\t# fetch\n\t try { $id = $this->Database->getObjectQuery(\"select id from logs order by id desc limit 1;\"); }\n\t\tcatch (Exception $e) { $this->Result->show(\"danger\", $e->getMessage(), false);\treturn false; }\n\t\t# return result\n\t\treturn $id->id;\n\t}", "public function requestLastInsertedId() {\n $sql = \"SELECT MAX(idTraffic) FROM traffic\";\n $result = $this->db->fetchOne($sql);\n return $result;\n }", "function get_last_id()\n {\n // TODO: Implement get_last_id() method.\n }", "public function scopeGetLastId()\n {\n return $this->latest()->first()->id;\n }", "protected function getLastId(){\n $student_current_id = \"SELECT students.id FROM `students` ORDER BY id DESC LIMIT 1\";\n $sql = $this->conn->prepare($student_current_id);\n $sql->execute();\n\n $result = $sql->setFetchMode(PDO::FETCH_ASSOC);\n $student_id = $sql->fetchAll();\n echo \"<br><br><br><br>\";\n foreach ($student_id as $id){\n $my_id = $id['id'];\n }\n return $my_id;\n }", "public function getLastId2()\r\n\t{\r\n\t\tif (Conexion::getEstatusConexion()) {\r\n\t\t\t$strSql = 'SELECT id_investigacion FROM investigaciones ORDER BY id_investigacion DESC LIMIT 1;';\r\n\t\t\t$respuestaArreglo = [];\r\n\t\t\t$id = 0;\r\n\t\t\ttry {\r\n\t\t\t\t$strExec = Conexion::prepare($strSql);\r\n\t\t\t\t$strExec->execute();\r\n\t\t\t\t$respuestaArreglo = $strExec->fetchAll();\r\n\t\t\t\tforeach ($respuestaArreglo as $valor) {\r\n\t\t\t\t\t$id = $valor['id_investigacion'];\r\n\t\t\t\t}\r\n\t\t\t} catch (PDOException $e) {\r\n\t\t\t\t\r\n\t\t\t\treturn $id;\r\n\t\t\t}\r\n\r\n\t\t\treturn $id;\r\n\t\t} else {\r\n\t\t\treturn $id;\r\n\t\t}\r\n\t}", "public function lastId()\r\n {\r\n return $this->getKey('last_id');\r\n }", "public static function get_last_id(){\r\n\t\treturn self::$last_id;\r\n\t}", "public function lastID(): int;", "function hpm_last_mutation_id () {\n\n global $wpdb;\n $table = $wpdb->prefix . 'hpm_mutations';\n $result = $wpdb->get_var( \"SELECT id FROM $table ORDER BY id DESC LIMIT 1\" );\n return (int) $result;\n\n}", "public function lastId(){\n return $this->lastId;\n }", "public function LastID()\r\r\n {\r\r\n $query=\"SELECT MAX(id) as Max FROM DevisVente WHERE 1\";\r\r\n $req = $this->connexion->getConnexion()->query($query);\r\r\n\r\r\n $dv = $req->fetchAll(PDO::FETCH_OBJ);\r\r\n\r\r\n return $dv;\r\r\n }", "public function lastId();", "public function get_last_id() {\n\t\treturn $this->last_id;\n\t}", "function getRecentSaleId(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT MAX(idSale) AS 'idSale' from sales\"); //<<sets column name from MAX(idSale) to idSale\n \n $results=[];\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n else{\n $results = false;\n }\n return $results;\n }", "function last_id(){\n\t\treturn(-1);\n\t}", "function lastId()\n {\n return isset($this->_query) ? $this->_query->lastId() : $this->_lastid;\n }", "public static function getLastNotificationID(){\n $row = getDatabase()->queryFirstRow(\"SELECT `id` FROM `notifications` ORDER BY `id` DESC\");\n return $row['id'];\n }", "function lastID(){\n return pg_last_oid($this->consulta);\n }", "public function getLastId();", "public function getLastId();", "private static function getMaxId () {\n return Dao::queryValue(\"select max(id) from medicines where id < 10000000\");\n }", "static function getLastID()\r\n {\r\n $tableUser = DatabaseManager::getNameTable('TABLE_USER');\r\n\r\n $query = \"SELECT MAX(id) AS Max FROM $tableUser\";\r\n\r\n return DatabaseManager::singleFetchAssoc($query)[\"Max\"];\r\n }", "public function getlast_record_insert()\r {\r $query = \"select MAX(`id`) from `ct_services`\";\r $result=mysqli_query($this->conn,$query);\r $value=mysqli_fetch_row($result);\r return $value[0];\r }", "function getRecentPurchaseId(){\n global $db;\n \n $stmt=$db->prepare(\"SELECT MAX(idPurchase)AS idPurchase from purchases\");\n \n $results=[];\n if($stmt->execute() && $stmt->rowCount()>0){\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\n }\n else{\n $results = false;\n }\n return $results;\n }", "function buscar_mayor_fecha () {\n global $DB;\n $sql = \"SELECT date FROM {report_user_statistics} WHERE id=(SELECT max(id) FROM {report_user_statistics});\";\n $fecha = $DB->get_record_sql($sql);\n return $fecha;\n}", "function Atv_getLastIdPresensi(): int\n{\n return PresensiGroup::orderByDesc('id')->first('id')->id;\n}", "protected function getLastPostId() {\n $this->lastPostId = Post::select('habr_id')->orderBy('unix_time','desc')->first()->habr_id;\n }" ]
[ "0.6897157", "0.6890844", "0.6872332", "0.67314315", "0.67112243", "0.6698977", "0.65915495", "0.6590501", "0.65786535", "0.650163", "0.64815086", "0.6474372", "0.64730155", "0.644067", "0.6439496", "0.6422828", "0.6399042", "0.63962114", "0.63622415", "0.63537735", "0.6345979", "0.6322396", "0.6322396", "0.6321653", "0.6317825", "0.63146275", "0.6259072", "0.625878", "0.6238633", "0.62294906" ]
0.717757
0