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 |
---|---|---|---|---|---|---|
Function to remove cursor for a member | protected function OP_removeCursor ($es_id, $member_id)
{
$op = array(
'optype' => 'RemoveCursor',
'memberid' => (string) $member_id,
'reason' => 'server-idle',
'timestamp' => self::getTimeStamp()
);
$this->OP_add2Db($op, $es_id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function unsetCursor(): void\n {\n $this->cursor = [];\n }",
"public function unsetCursor(): void\n {\n $this->cursor = [];\n }",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public static function remove_self() {\n\t\tglobal $I2_SQL;\n\t\t$tjstarid = $I2_SQL->query('SELECT boxid FROM intrabox WHERE name=\"tjstar\";')->fetch_single_value();\n\t\t$users = $I2_SQL->query('SELECT uid FROM intrabox_map WHERE boxid=%d;', $tjstarid)->fetch_all_arrays(Result::ASSOC);\n\t\tforeach ($users as $user) {\n\t\t\t$order = $I2_SQL->query('SELECT box_order FROM intrabox_map WHERE boxid=%d AND uid=%d;', $tjstarid, $user['uid'])->fetch_single_value();\n\t\t\t$I2_SQL->query('DELETE FROM intrabox_map WHERE uid=%d AND boxid=%d;', $user['uid'], $tjstarid);\n\t\t\t$I2_SQL->query('UPDATE intrabox_map SET box_order=box_order-1 WHERE uid=%d AND box_order>%d;', $user['uid'], $order);\n\t\t}\n\t\t$I2_SQL->query('DELETE FROM intrabox WHERE name=\"tjstar\";');\n\t\t\n\t}",
"public function remove() {}",
"public function remove() {}",
"public function closeCursor()\n {\n }",
"function drop_member($member_id) {\n $this->db->where('member_id',$member_id);\n $this->db->delete('members_tbl');\n }",
"public function remove() {\n\t\t$this->setRemoved(TRUE);\n\t}",
"function guildMemberRemove(GuildMember $member);",
"public function removeFriend($friend_guid);",
"public function remove($offset = null);",
"public function onRemove();",
"public function detachMarker($name);",
"public function closeCursor();",
"public function destroy(member $member)\n {\n //\n }",
"public function removeMember(Editor $editor): self\n {\n if($this->members->contains($editor)){\n // Remove a member\n $this->members->removeElement($editor);\n\n // Remove a reference\n if($editor->getGroupsMember()->contains($this)){\n $editor->getGroupsMember()->removeElement($this);\n }\n }\n }",
"abstract public function remove();",
"abstract public function remove();",
"abstract public function remove();",
"function removeActiveUser($memberName){\r\n if(!TRACK_VISITORS) return;\r\n $q = \"DELETE FROM \".TBL_ACTIVE_USERS.\" WHERE memberName = '$memberName'\";\r\n mysql_query($q, $this->connection);\r\n $this->calcNumActiveUsers();\r\n }",
"public function removePoint(int $point): M_member\n\t{\n\n\t\t$this->db->set($this->pointField(), $this->point - $point);\n\t\t$this->db->where($this->idField(), $this->id);\n\t\t$this->db->update($this->tableName());\n\n\t\treturn $this->getData();\n\t}",
"public function remove() {\n }",
"public function remove_competitor($memberid){\n $sql = \"DELETE FROM tournamentCompetitors WHERE tournamentID=$this->id AND competitorID=$memberid\";\n $result = self::$database->query($sql);\n }",
"public function remove()\n {\n }",
"public function removeUsageRights() {}",
"public function clearAutotoc()\n {\n unset(self::$tocifiers[$this->owner]);\n }"
]
| [
"0.61880624",
"0.61880624",
"0.55962497",
"0.55962497",
"0.55962497",
"0.55962497",
"0.55338293",
"0.5466746",
"0.546618",
"0.5457626",
"0.54472154",
"0.54234403",
"0.54133487",
"0.5399922",
"0.53695506",
"0.5363168",
"0.533858",
"0.5336895",
"0.5275598",
"0.5251874",
"0.5243914",
"0.5243914",
"0.5243914",
"0.52283967",
"0.52255464",
"0.52039176",
"0.52021223",
"0.5181118",
"0.51750493",
"0.51709276"
]
| 0.70319855 | 0 |
Function to get opsepcs of session base on seq head | protected function OP_getOPSECS($es_id, $seq_head)
{
if ($seq_head == "")
{
$seq_head = -1;
}
$ops = array();
$query = $this->db->select(
self::OP_TABLE,
'collab_opspec',
'collab_es_id ="'. $es_id.'" AND collab_seq >'.$seq_head,
__LINE__,
__FILE__,
false, 'ORDER BY collab_seq ASC', self::APP_NAME);
foreach ($query as $spec)
{
$op = json_decode($spec['collab_opspec'], true);
$op['memberid'] = strval($op['memberid']);
$ops [] = $op;
}
return $ops;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSessionsOrdonnees() {\n return $this->sessions()->orderBy('num_ordre', 'asc')->get();\n }",
"public function GetStricModeBySession ();",
"public function get_sessions($request){\r\n\t\treturn $request['session'];\r\n\t}",
"public function actionGetListaSessions()\r\n\t\t{\r\n\t\t\treturn $varSession = [\r\n\t\t\t\t\t\t\t'postData',\r\n\t\t\t\t\t\t\t'conf',\r\n\t\t\t\t\t\t\t'begin',\r\n\t\t\t\t\t];\r\n\r\n\t\t}",
"function sessionStats()\n{\n return generateQuery('-st | sed \\'s/ */ /g\\' '); \n}",
"protected abstract function get_sessions();",
"public function sessions() {\n return $this->rich_model->get_sessions();\n // return $this->rich_model->get_mikrotik_sessions();\n }",
"protected function get_sessions()\n {\n }",
"public function session_list()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}",
"public function getSession() {\n\t\t$msg[]=\"<details><summary>SESSION AND COOKIES</summary>\";\n\t\t$msg[]=$this->show();\n\t\t$msg[]=\"</details>\";\n\t\treturn implode(\"\\n\",$msg);\n\t}",
"protected function getOpcoes() \r\n\t{\r\n\t\treturn $this->aOpcoes;\r\n\t}",
"public function getSessionTds()\n {\n return $this->sessionTds;\n }",
"public function obterTipoSession(){\n $controller = new SessionController();\n\n echo $controller->getTipoSession();\n\n }",
"public function getOpis()\n {\n return $this->opis;\n }",
"function getIOPsLeft() {\n return $this->iops_left;\n }",
"public function getShntseq()\n {\n return $this->shntseq;\n }",
"function cek_session(){\n echo '<pre>';\n print_r($this->session->all_userdata());\n echo '</pre>';\n }",
"public function getAllActiveMentorshipSessionsNum() {\n return $this->mentorshipSessionStorage->getAllActiveMentorshipSessionsNum();\n }",
"function getInterceptionPoints() ;",
"public function getIops()\n {\n return $this->iops;\n }",
"public function getSession()\r\n {\r\n return $this->sessionID;\r\n }",
"public function getSessionInstances()\n {\n $sessionObjects = [];\n foreach ($this->objects as $information) {\n if (isset($information['i']) && $information['s'] === ObjectConfiguration::SCOPE_SESSION) {\n $sessionObjects[] = $information['i'];\n }\n }\n return $sessionObjects;\n }",
"function get_number_of_sessions()\n {\n\t\treturn count($this->sessions);\n\t}",
"public function getSequence() {\n for ($i = 0; $i < $this->N; $i++) {\n $key = (int) $this->a[$i];\n $valor = (int) $this->w[$i];\n if (in_array($key, $this->secuencelist)) {\n array_push($this->secuencelist, $valor);\n } else {\n $this->secuencelist[$key][] = $valor;\n }\n }\n $this->fillIndex();\n return $this->secuencelist;\n }",
"function getPagetop () {\n\t\t$this->_goTop();\n\t\t$this->_goFin();\n\t\treturn $this->_roof[\"dtd\"].implode(\"\\n\",$this->_roof[\"meta\"]).\"\\n\".implode(\"\\n\",$this->_roof[\"cuerpo\"]).$this->_roof[\"fin\"];\n\t}",
"public function retrieveConcurrentSessions()\n {\n $endpoint = self::$endpoint . '/statistics' . SessionEndpoint::$endpoint;\n return self::sendRequest(Method::GET, $endpoint);\n }",
"public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }",
"public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }",
"public function getOpposCount()\n {\n return $this->count(self::_OPPOS);\n }",
"function stunnel_printcsr() {\n}"
]
| [
"0.5624508",
"0.5365307",
"0.51935595",
"0.5177928",
"0.5064789",
"0.50476223",
"0.49416816",
"0.4900877",
"0.48181275",
"0.47832248",
"0.4782369",
"0.47655076",
"0.47472677",
"0.4743909",
"0.47213674",
"0.46889418",
"0.4683073",
"0.4671476",
"0.4665172",
"0.45895436",
"0.45858595",
"0.45575228",
"0.45434636",
"0.4521511",
"0.4520276",
"0.4514745",
"0.4502775",
"0.4502775",
"0.4502775",
"0.44975898"
]
| 0.5884436 | 0 |
Return last member id from member table in db | protected function MEMBER_getLastMember()
{
$query = $this->db->select(
self::MEMBER_TABLE,
'collab_member_id',
'',
__LINE__,
__FILE__,
false,
"ORDER BY `collab_member_id` DESC LIMIT 1;"
);
$last_row = $query->fetchRow();
return is_array($last_row)? $last_row['collab_member_id']: 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdMax() {\n $maxId = myPDO()->query('SELECT MAX(member_id) FROM members');\n return $maxId->fetch()[0];\n }",
"public function get_next_member($member)\n {\n $tempid = $this->connection->query_value_if_there('SELECT uid FROM ' . $this->connection->get_table_prefix() . 'users WHERE uid>' . strval($member) . ' ORDER BY uid');\n return $tempid;\n }",
"function _gen_uniquememberid()\r\n\t{\r\n\t\t$lastmem_id = $this->_get_config_param('LAST_MEMBERID_ALLOTED');\r\n\t\t$member_id = $lastmem_id+1;\r\n\t\t$this->_set_config_param('LAST_MEMBERID_ALLOTED',$member_id);\r\n\t\t// check if member id is already alloted \r\n\t\tif($this->db->query(\"select count(*) as t from pnh_member_info where pnh_member_id = ? \",$member_id)->row()->t)\r\n\t\t\treturn $this->_gen_uniquememberid();\r\n\t\telse\r\n\t\t\treturn $member_id;\r\n\t}",
"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 lastId();",
"function getMembershipId() {\r\n\t\t$db = JFactory::getDbo() ;\r\n\t\t$sql = 'SELECT MAX(membership_id) FROM #__osmembership_subscribers';\r\n\t\t$db->setQuery($sql);\r\n\t\t$membershipId = (int) $db->loadResult() ;\r\n\t\tif (!$membershipId) {\r\n\t\t\t$membershipId = (int) OSMembershipHelper::getConfigValue('membership_id_start_number');\r\n\t\t\tif (!$membershipId)\r\n\t\t\t\t$membershipId = 1000 ;\r\n\t\t} else {\r\n\t\t\t$membershipId++ ;\r\n\t\t}\t\r\n\t\t\r\n\t\treturn $membershipId ;\r\n\t}",
"public function getMemberid()\r\n {\r\n return $this->_memberid;\r\n }",
"public function getLastId();",
"public function getLastId();",
"function get_last_id()\n {\n // TODO: Implement get_last_id() method.\n }",
"function getMaxID() {\n $con = getConnection();\n $sql = \"SELECT MAX(ID) FROM members_tab;\";\n \n if ($stmt = mysqli_prepare($con, $sql)) {\n mysqli_stmt_execute($stmt);\n mysqli_stmt_bind_result($stmt, $data); \n while (mysqli_stmt_fetch($stmt)) {\n return $data;\n } \n mysqli_stmt_close($stmt);\n }\n closeConnection($con);\n }",
"public function get_previous_member($member)\n {\n $tempid = $this->connection->query_value_if_there('SELECT uid FROM ' . $this->connection->get_table_prefix() . 'users WHERE uid<' . strval($member) . ' AND uid>0 ORDER BY uid DESC');\n return $tempid;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function getMemberId()\n {\n return $this->member_id;\n }",
"public function get_last_id() {\n\t\treturn $this->last_id;\n\t}",
"public function getLastForMember($memberId, $withPhantoms = false){\r\n\t\t$maxId = $this->_backend->getMaxIdForMember($memberId, $withPhantoms);\r\n\t\tif($maxId){\r\n\t\t\treturn $this->get($maxId);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public function lastID(): int;",
"function lastid(){\n\t\t$query = 'SELECT idVideo FROM video Order By idVideo Desc Limit 1';\n\t\t$link = createConection();\n\t\tif($row = pg_fetch_array(pg_exec($link,$query))){\n\t\t\tcloseConection($link);\n\t\t\treturn $row['idvideo'];\n\t\t}else{\n\t\t\tcloseConection($link);\n\t\t\treturn 0;\n\t\t}\n\t}",
"public static function get_last_id(){\r\n\t\treturn self::$last_id;\r\n\t}",
"public static function getLastUserId()\n {\n $lastId = DB::table('users')\n ->select('id')\n ->orderBy('id','desc')\n ->limit(1)\n ->get();\n return $lastId;\n }",
"public function lastId(){\n return $this->lastId;\n }",
"public function getMemberId()\n {\n return $this->memberId;\n }",
"public function getMemberId()\n {\n return $this->memberId;\n }",
"protected function _getLoggedInMemberId() {\n\t\tController::loadModel('Member');\n\t\treturn $this->Member->getIdForMember($this->Auth->user());\n\t}",
"public function getMemberId()\n {\n return $this->iMemberDatabaseId;\n }"
]
| [
"0.7670292",
"0.7262416",
"0.7063046",
"0.7017604",
"0.6915603",
"0.6869594",
"0.68215907",
"0.67845875",
"0.67845875",
"0.6772071",
"0.67696506",
"0.6763802",
"0.6717809",
"0.6717809",
"0.6717809",
"0.6717809",
"0.6717809",
"0.6717809",
"0.6717809",
"0.6685689",
"0.6667588",
"0.66625816",
"0.6612555",
"0.65912586",
"0.6580358",
"0.65789783",
"0.6574392",
"0.6574392",
"0.6543156",
"0.65424705"
]
| 0.7924007 | 0 |
Construct the bnf object An optionnel string can be add to be parsed as rules | public function __construct($id="bnf", $rules="")
{
$this->id = $id;
//$this->parser = new bnfParser($this);
if($rules!=="")
$this->parseRules($rules);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseRule(&$part, &$strPart, $bnfId){\n\t\t$strPart = trim($strPart);\n\t\t$notParsedStrPart = $strPart;\n\t\t$type = $part->type;\n\t\t\n\t\t$end = self::findEnd(\n\t\t\t$notParsedStrPart, \n\t\t\tself::getTypeClosure($part->type),\n\t\t\tself::getTypeClosure($part->type, false)\n\t\t);\n\t\t\n\t\tif($type == bnf::PART_OPTION or $type == bnf::PART_SET or $type == bnf::PART_REPETITION)\n\t\t{\n\t\t\t$part->parts = array();\n\t\t\t$toParseStr = substr($notParsedStrPart, 0, $end);\n\t\t\twhile($toParseStr != \"\")\n\t\t\t{\n\t\t\t\t$part->parts[] = self::parseSubRule($toParseStr, $bnfId);\n\t\t\t}\n\t\t}else{\n\t\t\t$part->id = substr($notParsedStrPart, 0, $end);\n\t\t}\t\t\n\t\t$notParsedStrPart = trim(substr($notParsedStrPart, $end+1));\n\t\t\n\t\tif(isset($notParsedStrPart[0]) && $notParsedStrPart[0]===\"|\")\n\t\t{\n\t\t\t$part->coordinator = \"or\";\n\t\t\t$notParsedStrPart = trim(substr($notParsedStrPart, 1));\t\t\t\n\t\t}\t\t\n\t\t$strPart = trim($notParsedStrPart);\n\t\t\t\t\n\t}",
"public function makeRules()\n {\n $this->rules = [];\n preg_match_all(\"/([.#a-z0-9-]*)\\s?({[^}]*})/i\", $this->contents(), $comands);\n foreach ($comands[1] as $k => $selector) {\n preg_match_all(\"/([a-z0-9-]*):([^;]*);/i\", $comands[2][$k], $declarations);\n $this->rules[$selector] = [];\n foreach ($declarations[1] as $i => $property) {\n $this->rules[$selector][$property] = $declarations[2][$i];\n }\n }\n }",
"abstract public function parseRules();",
"public function __construct()\n {\n /* [b] bold tag */\n $builder = new CodeDefinitionBuilder('b', '<strong>{param}</strong>');\n array_push($this->definitions, $builder->build());\n\n /* [center] tag */\n $builder = new CodeDefinitionBuilder('center', '<center>{param}</center>');\n array_push($this->definitions, $builder->build());\n\n /* [left] tag */\n $builder = new CodeDefinitionBuilder('left', '<left>{param}</left>');\n array_push($this->definitions, $builder->build());\n\n /* [right] tag */\n $builder = new CodeDefinitionBuilder('right', '<right>{param}</right>');\n array_push($this->definitions, $builder->build());\n\n\n /* [ol] tag */\n $builder = new CodeDefinitionBuilder('ol', '<ol>{param}</ol>');\n array_push($this->definitions, $builder->build());\n\n /* [ol] tag */\n $builder = new CodeDefinitionBuilder('ul', '<ul>{param}</ul>');\n array_push($this->definitions, $builder->build());\n\n /* [li] tag */\n $builder = new CodeDefinitionBuilder('li', '<li>{param}</li>');\n array_push($this->definitions, $builder->build());\n\n /* [sup] tag */\n $builder = new CodeDefinitionBuilder('sup', '<sup>{param}</sup>');\n array_push($this->definitions, $builder->build());\n\n /* [i] italics tag */\n $builder = new CodeDefinitionBuilder('i', '<em>{param}</em>');\n array_push($this->definitions, $builder->build());\n\n /* [u] italics tag */\n $builder = new CodeDefinitionBuilder('u', '<u>{param}</u>');\n array_push($this->definitions, $builder->build());\n\n $urlValidator = new \\JBBCode\\validators\\UrlValidator();\n\n /* [url] link tag */\n $builder = new CodeDefinitionBuilder('url', '<a href=\"{param}\">{param}</a>');\n $builder->setParseContent(false)->setBodyValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [url=http://example.com] link tag */\n $builder = new CodeDefinitionBuilder('url', '<a href=\"{option}\">{param}</a>');\n $builder->setUseOption(true)->setParseContent(true)->setOptionValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [pilot=1][/pilot] pilot tag */\n $builder = new CodeDefinitionBuilder('pilot', '<a pilot=\"{option}\">{param}</a>');\n $builder->setUseOption(true);\n array_push($this->definitions, $builder->build());\n\n /* [youtube] tag */\n $builder = new CodeDefinitionBuilder('youtube', '<iframe width=\"812\" height=\"600\" src=\"http://www.youtube.com/embed/{param}?wmode=opaque\" data-youtube-id=\"{param}\" frameborder=\"0\" allowfullscreen=\"\"></iframe>');\n $builder->setUseOption(false)->setParseContent(false);\n array_push($this->definitions, $builder->build());\n\n\n /* [img] image tag */\n $builder = new CodeDefinitionBuilder('img', '<img style=\"max-width:812px\" src=\"{param}\"/>');\n $builder->setUseOption(false)->setParseContent(false)->setBodyValidator($urlValidator);\n array_push($this->definitions, $builder->build());\n\n /* [img=alt text] image tag */\n /*$builder = new CodeDefinitionBuilder('img', '<img src=\"{param} alt=\"{option}\" />');\n $builder->setUseOption(true);\n array_push($this->definitions, $builder->build());*/\n\n /* [color] color tag */\n $builder = new CodeDefinitionBuilder('color', '<font color=\"{option}\">{param}</font>');\n $builder->setUseOption(true)->setOptionValidator(new \\JBBCode\\validators\\CssColorValidator());\n array_push($this->definitions, $builder->build());\n\n /* [font] fontface tag */\n $builder = new CodeDefinitionBuilder('font', '<font face=\"{option}\">{param}</font>');\n $builder->setUseOption(true);\n array_push($this->definitions, $builder->build());\n\n\n /* [size] color tag */\n $builder = new CodeDefinitionBuilder('size', '<font size=\"{option}\">{param}</font>');\n $builder->setUseOption(true);//->setOptionValidator(new \\JBBCode\\validators\\CssColorValidator());\n array_push($this->definitions, $builder->build());\n\n }",
"function create_parser() {}",
"public function __construct($mode)\n {\n $mode = substr($mode, 0, 3);\n $rest = substr($mode, 1);\n\n $this->base = substr($mode, 0, 1);\n $this->plus = (strpos($rest, '+') !== false);\n $this->flag = trim($rest, '+');\n\n if ($this->flag == '') {\n $this->flag = 'b';\n }\n }",
"static public function getDefaultRuleSet()\n {\n return array(\n array(\n \"lookup_char\"=> \"a\",\n \"ending_string\"=> \"ai\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"a\",\n \"ending_string\"=> \"a\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"b\",\n \"ending_string\"=> \"bb\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"c\",\n \"ending_string\"=> \"city\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"s\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"c\",\n \"ending_string\"=> \"ci\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"c\",\n \"ending_string\"=> \"cn\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"t\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"d\",\n \"ending_string\"=> \"dd\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"d\",\n \"ending_string\"=> \"dei\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"d\",\n \"ending_string\"=> \"deec\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"ss\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"d\",\n \"ending_string\"=> \"dee\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"d\",\n \"ending_string\"=> \"de\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"d\",\n \"ending_string\"=> \"dooh\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"e\",\n \"ending_string\"=> \"e\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"f\",\n \"ending_string\"=> \"feil\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"v\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"f\",\n \"ending_string\"=> \"fi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"g\",\n \"ending_string\"=> \"gni\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"g\",\n \"ending_string\"=> \"gai\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"g\",\n \"ending_string\"=> \"ga\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"g\",\n \"ending_string\"=> \"gg\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"h\",\n \"ending_string\"=> \"ht\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"h\",\n \"ending_string\"=> \"hsiug\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"5\",\n \"append_string\"=> \"ct\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"h\",\n \"ending_string\"=> \"hsi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"i\",\n \"ending_string\"=> \"i\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"i\",\n \"ending_string\"=> \"i\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"ji\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"d\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"juf\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"s\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"ju\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"d\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"jo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"d\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"jeh\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"r\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"jrev\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"t\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"jsim\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"t\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"jn\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"d\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"j\",\n \"ending_string\"=> \"j\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"s\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lbaifi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"6\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lbai\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lba\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lbi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lib\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"l\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lc\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lufi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"luf\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lu\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lai\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"lau\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"la\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"l\",\n \"ending_string\"=> \"ll\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"m\",\n \"ending_string\"=> \"mui\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"m\",\n \"ending_string\"=> \"mu\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"m\",\n \"ending_string\"=> \"msi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"m\",\n \"ending_string\"=> \"mm\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"nois\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"j\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"noix\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"ct\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"noi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"nai\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"na\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"nee\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"ne\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"n\",\n \"ending_string\"=> \"nn\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"p\",\n \"ending_string\"=> \"pihs\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"p\",\n \"ending_string\"=> \"pp\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"re\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"rae\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"ra\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"ro\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"ru\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"rr\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"rt\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"r\",\n \"ending_string\"=> \"rei\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"sei\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"sis\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"si\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"ssen\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"ss\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"suo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"su\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"s\",\n \"intact_flag\"=> \"*\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"s\",\n \"ending_string\"=> \"s\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tacilp\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"ta\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tnem\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"4\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tne\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tna\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tpir\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"b\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tpro\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"b\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tcud\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tpmus\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tpec\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"iv\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tulo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"v\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tsis\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tsi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"t\",\n \"ending_string\"=> \"tt\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"u\",\n \"ending_string\"=> \"uqi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"u\",\n \"ending_string\"=> \"ugo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"v\",\n \"ending_string\"=> \"vis\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"j\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"v\",\n \"ending_string\"=> \"vie\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"v\",\n \"ending_string\"=> \"vi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ylb\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yli\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"y\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ylp\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"0\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yl\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ygo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yhp\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ymo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ypo\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yti\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yte\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ytl\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yrtsi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"5\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yra\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yro\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yfi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \".\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"ycn\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"t\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"y\",\n \"ending_string\"=> \"yca\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"3\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"z\",\n \"ending_string\"=> \"zi\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"2\",\n \"append_string\"=> \"\",\n \"continue_flag\"=> \">\"),\n array(\n \"lookup_char\"=> \"z\",\n \"ending_string\"=> \"zy\",\n \"intact_flag\"=> \"\",\n \"remove_total\"=> \"1\",\n \"append_string\"=> \"s\",\n \"continue_flag\"=> \".\") \n );\n }",
"public function __construct(array $cfg = null)\n\t{\n\t\tif ( isset($cfg['name'], $cfg['tag']) )\n\t\t{\n\t\t\t$mandatory_opt = array();\n\t\t\t$possible_opt = array(\"required\", \"width\", \"placeholder\", \"cssclass\", \"title\");\n\t\t\t$this->cfg = $cfg;\n\t\t\t$this->tag = strtolower($cfg['tag']);\n\t\t\t$this->name = $cfg['name'];\n\t\t\t$this->id = isset($cfg['id']) ? $cfg['id'] : \\bbn\\str\\text::genpwd(20,15);\n\t\t\t$this->label = isset($cfg['label']) ? $cfg['label'] : str_replace(']', ')',str_replace('[',' (',str_replace('_', ' ', $cfg['name'])));\n\t\t\t$this->required = isset($cfg['required']) ? $cfg['required'] : false;\n\t\t\t$this->options = isset($cfg['options']) ? $cfg['options'] : array();\n\t\t\t$this->script = isset($cfg['script']) ? $cfg['script'] : '';\n\t\t\t$this->value = isset($cfg['value']) ? $cfg['value'] : '';\n\t\t\tswitch ( $this->tag )\n\t\t\t{\n\t\t\t\tcase \"input\":\n\t\t\t\t\tarray_push($mandatory_opt, \"type\");\n\t\t\t\t\tarray_push($possible_opt, \"minlength\", \"maxlength\", \"size\", \"rangelength\", \"min\", \"max\", \"range\", \"email\", \"url\", \"date\", \"number\", \"digits\", \"creditcard\", \"equalTo\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"textarea\":\n\t\t\t\t\tarray_push($mandatory_opt, \"cols\", \"rows\");\n\t\t\t\t\tarray_push($possible_opt, \"minlength\", \"maxlength\", \"rangelength\", \"height\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"select\":\n\t\t\t\t\tarray_push($mandatory_opt, \"options\");\n\t\t\t\t\tarray_push($possible_opt, \"multiple\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"file\":\n\t\t\t\t\tarray_push($possible_opt, \"multiple\", \"accept\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tforeach ( $mandatory_opt as $m ){\n\t\t\t\tif ( isset($cfg['options'][$m]) ){\n\t\t\t\t\t$this->options[$m] = $cfg['options'][$m];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tdie(\"Argument $m is missing in your config... Sorry!\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ( $cfg['options'] as $k => $v ){\n\t\t\t\tif ( in_array($k, $possible_opt) ){\n\t\t\t\t\t$this->options[$k] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function createParser();",
"public function addRule(bnfRule $rule){\n\t\t$this->rules[] = $rule;\t\t\n\t}",
"function __construct($args)\n {\n if (is_string($args)) {\n $this->ruleID = $args;\n $this->getRules();\n $this->offerID = $this->rules[0][\"offer_idoffer\"];\n } else // if we're creating a new device rule\n {\n\n $this->postData = $args;\n\n $this->offerID = $args[0];\n\n $this->ruleName = $args[1];\n\n $this->redirectOffer = $args[2];\n\n $this->deny = $args[3];\n\n for ($i = 4; $i < count($args); $i++) {\n $this->deviceList[] = $args[$i];\n }\n\n if ($this->deny == true) {\n $this->deny = 1;\n } else {\n $this->deny = 0;\n }\n }\n\n\n }",
"public function __construct($stringFilter)\n {\n foreach (explode(static::LOGIC_OPERATOR, $stringFilter) as $filter) {\n $this->conditions[] = explode(' ', trim($filter));\n }\n }",
"public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }",
"function cfgString2CfgArray($cfgStr) {\r\n\r\n // Traverse the number of form elements:\r\n $tLines = explode(chr(10), $cfgStr);\r\n foreach($tLines as $k => $v) {\r\n\r\n // Initialize:\r\n $confData = array();\r\n $val = trim($v);\r\n\r\n // Accept a line as configuration if a) it is blank(! - because blank lines indicates new, unconfigured fields) or b) it is NOT a comment.\r\n if (!$val || strcspn($val, '#/')) {\r\n\r\n // Split:\r\n $parts = t3lib_div::trimExplode('|', $val);\r\n\r\n // Label:\r\n $confData['label'] = trim($parts[0]);\r\n\r\n // Field:\r\n $fParts = t3lib_div::trimExplode(',', $parts[1]);\r\n $fParts[0] = trim($fParts[0]);\r\n if (substr($fParts[0], 0, 1) == '*') {\r\n $confData['required'] = 1;\r\n $fParts[0] = substr($fParts[0], 1);\r\n }\r\n\r\n $typeParts = t3lib_div::trimExplode('=', $fParts[0]);\r\n $confData['type'] = trim(strtolower(end($typeParts)));\r\n\r\n if ($confData['type']) {\r\n if (count($typeParts) == 1) {\r\n $confData['fieldname'] = substr(ereg_replace('[^a-zA-Z0-9_]', '', str_replace(' ', '_', trim($parts[0]))), 0, 30);\r\n\r\n // Attachment names...\r\n if ($confData['type'] == 'file') {\r\n $confData['fieldname'] = 'attachment'.$attachmentCounter;\r\n $attachmentCounter = intval($attachmentCounter)+1;\r\n }\r\n } else {\r\n $confData['fieldname'] = str_replace(' ', '_', trim($typeParts[0]));\r\n }\r\n\r\n switch((string)$confData['type']) {\r\n case 'select':\r\n case 'radio':\r\n $confData['default'] = implode(chr(10), t3lib_div::trimExplode(',', $parts[2]));\r\n break;\r\n default:\r\n $confData['default'] = trim($parts[2]);\r\n break;\r\n }\r\n\r\n // Field configuration depending on the fields type:\r\n switch((string)$confData['type']) {\r\n case 'textarea':\r\n $confData['cols'] = $fParts[1];\r\n $confData['rows'] = $fParts[2];\r\n $confData['extra'] = strtoupper($fParts[3]) == 'OFF' ? 'OFF' :\r\n '';\r\n $confData['specialEval'] = trim($parts[3]);\r\n break;\r\n case 'input':\r\n case 'password':\r\n $confData['size'] = $fParts[1];\r\n $confData['max'] = $fParts[2];\r\n $confData['specialEval'] = trim($parts[3]);\r\n break;\r\n case 'file':\r\n $confData['size'] = $fParts[1];\r\n break;\r\n case 'select':\r\n $confData['size'] = intval($fParts[1])?$fParts[1]:\r\n '';\r\n $confData['autosize'] = strtolower(trim($fParts[1])) == 'auto' ? 1 :\r\n 0;\r\n $confData['multiple'] = strtolower(trim($fParts[2])) == 'm' ? 1 :\r\n 0;\r\n break;\r\n }\r\n }\r\n } else {\r\n // No configuration, only a comment:\r\n $confData = array(\r\n 'comment' => $val );\r\n }\r\n\r\n // Adding config array:\r\n $cfgArr[] = $confData;\r\n }\r\n\r\n // Return cfgArr\r\n return $cfgArr;\r\n }",
"function create_rules_from_ini($ini_array)\n\t{\n\t\t\n\t\t$rulesOptions = array(\n\t\t\"Case_insensitive\",\n\t\t\"higher_than\",\n\t\t\"exclude\",\n\t\t\"longer_than\",\n\t\t\"max\"\n\t\t);\n\t\t\n\t\t$rulesArray = array();\n\t\tforeach ($ini_array as $key => $value) {\n\t\t\tif (in_array($key, $rulesOptions)) {\n\t\t\t\t$rulesArray[] = $key . \" = \" . $value;\n\t\t\t}\n\t\t}\n\t\treturn $rulesArray;\n\t}",
"public function getOptionParser()\n {\n $parser = parent::getOptionParser();\n $parser->setDescription('This is RBAC utility, which wraps acl cli');\n // $parser->addArgument('add_rule',[\n // 'help' => 'Add hierachical rules to acos table',\n // ]);\n\n return $parser;\n }",
"function __construct($string_to_add = \"\"){\n\t\tsettype($string_to_add,\"string\");\n\t\tif(strlen($string_to_add)>0){\n\t\t\t$this->addString($string_to_add);\n\t\t}\n\t}",
"function __construct(array $rules = null)\n {\n parent::__construct($rules);\n $this->addPath('parse', $this->fixPath(dirname(__FILE__)).'Parse/Creole');\n $this->renderingType = 'char';\n $this->setRenderConf('xhtml', 'center', 'css', 'center');\n $this->setRenderConf('xhtml', 'url', 'target', null);\n }",
"private function configureUsingFluentDefinition(): void\n {\n $data = ExpressionParser::parse($this->signature);\n\n parent::__construct($data['name']);\n\n foreach ($data['arguments'] as $argument) {\n $this->getDefinition()->addArgument($argument);\n }\n\n foreach ($data['options'] as $option) {\n $this->getDefinition()->addOption($option);\n }\n }",
"public function __construct($name, $ttl, $order, $pref, $flags, $service, $regex, $replacement) {\n parent::__construct($name, $ttl);\n $this->order= $order;\n $this->pref= $pref;\n $this->flags= $flags;\n $this->service= $service;\n $this->regex= $regex;\n $this->replacement= $replacement;\n }",
"function addRuleInstances(&$digester) {\r\n\r\n\t\t$applicationPattern\t\t= 'phpmvc-config';\r\n\r\n\t\t// DataSourceConfig\r\n\t\t$dataSourcesPattern\t\t= 'phpmvc-config/data-sources';\r\n\t\t$dataSourcePattern\t\t= 'phpmvc-config/data-sources/data-source';\r\n\r\n\t\t// ActionConfig\r\n\t\t$actionMappingsPattern\t= 'phpmvc-config/action-mappings';\r\n\t\t$actionMappingPattern\t= 'phpmvc-config/action-mappings/action';\r\n\t\t$actionForwardPattern\t= 'phpmvc-config/action-mappings/action/forward';\r\n\r\n\t\t// FormBean\r\n\t\t$formBeansPattern\t\t\t= 'phpmvc-config/form-beans';\r\n\t\t$formBeanPattern\t\t\t= 'phpmvc-config/form-beans/form-bean';\r\n\r\n\r\n\t\t$globForwardsPattern\t\t= '*/global-forwards';\r\n\t\t$setPropertyPattern\t\t= 'phpmvc-config/my-object/property';\r\n\r\n\r\n\t\t// DataSourceConfig <data-source ...>\r\n\t\t// Create a new configuration object ('DataSourceConfig')\r\n\t\t$digester->addObjectCreate(\r\n\t\t\t\t\t\t\t$dataSourcePattern,\t// <data-source ...>\r\n\t\t\t\t\t\t\t'DataSourceConfig',\t// config class to build\r\n\t\t\t\t\t\t\t'className');\t\t\t// [optional] specify an alternate to \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the default 'DataSourceConfig' config \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// file, if this attribute is present in\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the phpmvc-config xml descriptor file\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Eg: \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// <data-source ... className=\"MyDataSourceConfig\">\r\n\t\t// Set the configuration objects properties\r\n\t\t// phpmvc-config xml descriptor file attributes must match the target object methods\r\n\t \t// Eg: \"driverClassName\" maps to \"BasicDataSource->setDriverClassName\"\r\n\t\t$digester->addSetProperties($dataSourcePattern);\r\n\t\t// Add a callback reference to bind the configuration object to its parent\r\n\t\t// (ApplicationConfig) object.\r\n\t\t// Eg: Rule(pattern-to-match, ApplicationConfig->addDataSourceConfig(dataSourceConfig))\r\n\t\t$digester->addSetNext($dataSourcePattern, 'addDataSourceConfig');\t\t\r\n\r\n\r\n\t\t// ActionConfig\r\n\t\t$digester->addObjectCreate($actionMappingPattern, 'ActionConfig');\r\n\t\t$digester->addSetProperties($actionMappingPattern);\r\n\t\t$digester->addSetNext($actionMappingPattern, 'addActionConfig');\t\r\n\r\n\t\t$digester->addObjectCreate($actionForwardPattern, 'ForwardConfig');\r\n\t\t$digester->addSetProperties($actionForwardPattern);\r\n\t\t$digester->addSetNext($actionForwardPattern, 'addForwardConfig');\t\r\n\r\n\r\n\t\t// FormBeanConfig\r\n\t\t$digester->addObjectCreate($formBeanPattern, 'FormBeanConfig');\r\n\t\t$digester->addSetProperties($formBeanPattern);\r\n\t\t$digester->addSetNext($formBeanPattern, 'addFormBeanConfig');\t\r\n\r\n }",
"public function buildRules(): void\n {\n }",
"public function __construct($rule)\n {\n $this->rule = $rule;\n }",
"function opting($opt) {\n\t$opt['table']=ascheck(@$opt['table'],'');\n\t$opt['subject']=ascheck(@$opt['subject'],array());\n\t$opt['subject_str']=ar2str(@$opt['subject'],\"_\");\n\t$opt['topic_in']=ascheck(@$opt['topic_in'],array());\n\t$opt['topic_out']=ascheck(@$opt['topic_out'],array());\n\t$opt['name']=ascheck(@$opt['name'],$opt['subject_str'].ac::$nth);\n\t$opt['title']=ascheck(@$opt['title'],$opt['name']);\n\t$opt['id']=ascheck(@$opt['id'],'');\n\t$opt['bucket']=ascheck(@$opt['bucket'],false);\n\t$opt['list']=ascheck(@$opt['list'],false);\n\t$opt['debug']=ascheck(@$opt['debug'],false);\n\t$opt['class']=ascheck(@$opt['class'],'p');\n\t$opt['modal']=ascheck(@$opt['modal'],true);\n\t$opt['scope']=ascheck(@$opt['scope'],'');\n\t$opt['prepend']=ascheck(@$opt['prepend'],'');\n\t$opt['append']=ascheck(@$opt['append'],'');\n\t$opt['order']=ascheck(@$opt['order'],'');\n\treturn $opt;\n}",
"private function setRules()\n {\n $form = array(\n array(\n 'field' => 'nama_agen',\n 'label' => 'Nama Agen',\n 'rules' => 'required|max_length[25]'\n ),\n array(\n 'field' => 'alamat_agen',\n 'label' => 'Alamat Agen',\n 'rules' => 'max_length[50]'\n ),\n );\n return $form;\n }",
"public function __construct()\n {\n $this->pluralRules = Pluralize::all();\n $this->singularRules = Singularize::all();\n $this->aplicator = new Rules();\n \n foreach (Irregularize::all() as $rule) {\n $this->irregularSingles[$rule[0]] = $rule[1];\n $this->irregularPlurals[$rule[1]] = $rule[0];\n }\n \n foreach (Uncountable::all() as $rule) {\n $this->addUncountableRule($rule);\n }\n }",
"public function __construct()\n {\n $this->rulesets = [\n // Exact values\n function ($value) {\n return is_string($value) && isset($this->exactReplacements[$value])\n ? [$this, 'replaceExactValue']\n : null;\n },\n\n // Router (MVC applications)\n // We do not want to rewrite these.\n function ($value, array $keys) {\n $key = array_pop($keys);\n // Only worried about a top-level \"router\" key.\n return $key === 'router' && $keys === [] && is_array($value)\n ? [$this, 'noopReplacement']\n : null;\n },\n\n // service- and pluginmanager handling\n function ($value) {\n return is_array($value) && array_intersect_key(self::SERVICE_MANAGER_KEYS_OF_INTEREST, $value) !== []\n ? [$this, 'replaceDependencyConfiguration']\n : null;\n },\n\n // Array values\n function ($value, array $keys) {\n return $keys !== [] && is_array($value)\n ? [$this, 'processConfig']\n : null;\n },\n ];\n }",
"protected function setDefaultSettings()\r\n {\r\n $this->addFilter(STRINGPARSER_FILTER_PRE, array(&$this, 'convertlinebreaks')); //unify all linebreak variants from different systems\r\n $this->addFilter(STRINGPARSER_FILTER_PRE, array(&$this, 'convertlinks'));\r\n // $this->addFilter(STRINGPARSER_FILTER_POST, array(&$this, 'stripBBtags'));\r\n $this->addFilter(STRINGPARSER_FILTER_POST, array(&$this, 'removeDoubleEscapes'));\r\n $this->addParser(array('block', 'inline', 'link', 'listitem'), 'htmlspecialchars');\r\n $this->addParser(array('block', 'inline', 'link', 'listitem'), 'nl2br');\r\n $this->addParser('list', array(&$this, 'bbcode_stripcontents'));\r\n $this->addCode('b', 'simple_replace', null, array('start_tag' => '<b>', 'end_tag' => '</b>'), 'inline', array('block', 'inline'), array());\r\n $this->addCode('i', 'simple_replace', null, array('start_tag' => '<i>', 'end_tag' => '</i>'), 'inline', array('block', 'inline'), array());\r\n $this->addCode('u', 'simple_replace', null, array('start_tag' => '<u>', 'end_tag' => '</u>'), 'inline', array('block', 'inline'), array());\r\n $this->addCode('s', 'simple_replace', null, array('start_tag' => '<strike>', 'end_tag' => '</strike>'), 'inline', array('block', 'inline'), array());\r\n $this->addCode('url', 'usecontent?', array(&$this, 'do_bbcode_url'), array('usecontent_param' => 'default'), 'inline', array('listitem', 'block', 'inline'), array('link'));\r\n $this->addCode('img', 'usecontent', array(&$this, 'do_bbcode_img'), array('usecontent_param' => array('w', 'h')), 'image', array('listitem', 'block', 'inline', 'link'), array());\r\n $this->addCode('quote', 'callback_replace', array(&$this, 'do_bbcode_quote'), array('usecontent_param' => 'default'), 'block', array('block', 'inline'), array());\r\n// $this->addCode('quote', 'usecontent?', array(&$this, 'do_bbcode_quote'), array('usecontent_param' => 'default'), 'link', array ('block', 'inline'), array ('link'));\r\n $this->addCode('code', 'usecontent', array(&$this, 'do_bbcode_code'), array('usecontent_param' => 'default'), 'block', array('block', 'inline'), array('list', 'listitem'));\r\n $this->addCode('list', 'simple_replace', null, array('start_tag' => '<ul>', 'end_tag' => '</ul>'), 'list', array('block', 'listitem'), array());\r\n $this->addCode('*', 'simple_replace', null, array('start_tag' => '<li>', 'end_tag' => '</li>'), 'listitem', array('list'), array());\r\n $this->setCodeFlag('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL);\r\n $this->setCodeFlag('*', 'paragraphs', true);\r\n $this->setCodeFlag('list', 'paragraph_type', BBCODE_PARAGRAPH_BLOCK_ELEMENT);\r\n $this->setCodeFlag('list', 'opentag.before.newline', BBCODE_NEWLINE_DROP);\r\n $this->setCodeFlag('list', 'closetag.before.newline', BBCODE_NEWLINE_DROP);\r\n\r\n $this->setOccurrenceType('img', 'image');\r\n $this->setMaxOccurrences('image', 5);\r\n\r\n // do not convert new lines to paragraphs, see stringparser_bbcode::setParagraphHandlingParameters();\r\n $this->setRootParagraphHandling(false);\r\n }",
"abstract protected function newParser();",
"public function setTypes(){\n $this->var = false;\n $this->symb = false;\n $this->label = false;\n $type = '';\n \n //Ulozi postupne do jednotlivych promennych jestli dany argument odpovida nejakemu danemu vzoru a pote v podminkach rozhodneme typ argumentu (ktery na konci funkce ulozime do typu) a take jestli je argument var, symb, label nebo type\n $var = preg_match(\"/^(TF|LF|GF)@((\\p{L}|-|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n $int = preg_match(\"/^int@([\\+\\-])?([0-9])*$/u\", $this->arg);\n $bool = preg_match(\"/^bool@(true|false)$/u\", $this->arg);\n $string = preg_match(\"/^string@(\\p{L}|[^(\\w\\\\\\)]|\\d|[_]|\\\\\\\\([0-9][0-9][0-9]))*$/u\", $this->arg);\n $nil = preg_match(\"/^nil@nil$/u\", $this->arg);\n $label = preg_match(\"/^((\\p{L}|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n if($var){\n $type = \"var\";\n $this->var = true;\n $this->symb = true;\n }\n if($int){\n $type = \"int\";\n $this->symb = true;\n }\n if($bool){\n $type = \"bool\";\n $this->symb = true;\n }\n if($string){\n $type = \"string\";\n $this->symb = true;\n }\n if($nil){\n $type = \"nil\";\n $this->symb = true;\n }\n if($label){\n if(preg_match(\"/^(int|bool|string)$/u\", $this->arg)){\n $this->type_type = true;\n }\n $type = \"label\";\n $this->label = true; \n }\n if(!($var||$int||$bool||$string||$nil||$label)){\n fwrite(STDERR, \"CHYBA \".ERROR_23.\" - spatny argument\\n\");\n exit(ERROR_23);\n }\n $this->setType($type);\n }"
]
| [
"0.4974273",
"0.49555087",
"0.4835287",
"0.4774892",
"0.47628763",
"0.47506887",
"0.4719365",
"0.46665704",
"0.46207792",
"0.4598571",
"0.45288464",
"0.45109713",
"0.4503138",
"0.4496302",
"0.44310665",
"0.44139034",
"0.44032797",
"0.44018376",
"0.43766534",
"0.4374726",
"0.43724924",
"0.43463543",
"0.43429863",
"0.43390882",
"0.43211412",
"0.43146777",
"0.4297493",
"0.42836836",
"0.42673528",
"0.42645943"
]
| 0.56915414 | 0 |
Add a rule in this bnf system | public function addRule(bnfRule $rule){
$this->rules[] = $rule;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function addRule( phpucInputRule $rule )\n {\n $this->rules[] = $rule;\n }",
"abstract public function addRule(ValidationRule$rule);",
"public function addRule(RuleIface $rule);",
"public function add_rule( WP_Autoload_Rule $rule );",
"public function add($name, $rule = null) {\n\t\t$this->_rules = Set::merge($this->_rules, is_array($name) ? $name : array($name => $rule));\n\t}",
"public function addRule($name, $rule) {\n\t\t$this->checkRule($name, $rule);\n\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\tif ($input['name'] == $name) {\n\t\t\t\t$this->_inputs[$key]['rule'][] = $rule;\n\t\t\t}\n\t\t}\n\t}",
"public function add_rule($selector)\n {\n }",
"function addRule($key, $type, $arg = null)\n {\n $this->rules[] = array(\n 'key' => $key,\n 'type' => $type,\n 'arg' => $arg\n );\n }",
"public function addRule(RuleIface $rule)\n {\n $this->rules[] = $rule;\n }",
"public function append(callable $rule)\n {\n $this->rules[] = $rule;\n }",
"public function addRule(Rule $rule): Manager\n {\n $this->rules[] = $rule;\n return $this;\n }",
"public function addRule(string $field, IValidationRule $rule): void;",
"function hm_add_rewrite_rule( $rule, $query, $template = null, $args = array() ) {\n\n\tglobal $hm_rewrite_rules;\n\n\t$hm_rewrite_rules[ $rule ] = array( $rule, $query, $template, wp_parse_args( $args ) );\n\n}",
"public function addRule($rule, $db){\r\n $sql = \"INSERT INTO rules(rule) values (:rule)\";\r\n $pdostm = $db->prepare($sql);\r\n $pdostm->bindParam(':rule', $rule);\r\n\r\n $count = $pdostm->execute();\r\n return $count;\r\n }",
"public function addRules($rules)\r\n {\r\n $this->_rules = $rules;\r\n }",
"public static function addRule(\\GraphQL\\Validator\\Rules\\ValidationRule $rule)\n {\n }",
"public function appendRule( $filter )\n {\n $this->rules[] = $filter;\n $this->clearCache();\n }",
"public function addRule(array $rule, $overwrite = false)\n {\n if($overwrite)\n {\n array_merge($this->rules, $rule);\n }\n else\n {\n $val = '';\n if(array_key_exists(key($rule), $this->rules))\n {\n $val = $this->rules[key($rule)].'|';\n }\n $this->rules[key($rule)] = $val.$rule[key($rule)];\n }\n \n return $this;\n }",
"public function add_rule($regex, $query, $after = 'bottom')\n {\n }",
"static function addRule(\\CharlotteDunois\\Validation\\RuleInterface $rule) {\n if(static::$rulesets === null) {\n static::initRules();\n }\n \n $class = \\get_class($rule);\n $arrname = \\explode('\\\\', $class);\n $name = \\array_pop($arrname);\n \n $rname = \\str_replace('rule', '', \\mb_strtolower($name));\n static::$rulesets[$rname] = $rule;\n \n if(\\mb_stripos($name, 'rule') !== false) {\n static::$typeRules[] = $rname;\n }\n }",
"private function addRule($type, Rule $newRule = null)\n {\n if (!$newRule) {\n return;\n }\n\n $this->rules->add($newRule, $type);\n }",
"public function addRule(FormRule $formRule){\n\t\tif(is_a($formRule,'FormRule')===false){\n\t\t\tFormItBuilder::throwError('Form rule \"'.$formRule.'\" is not a valid FormRule type. Recommend using FormRuleType constants to define rule type.');\n\t\t}else{\n\t\t\t$this->_rules[]=$formRule;\n\t\t}\n\t}",
"private function addRule($column, $rule)\n {\n if (!array_key_exists($column, $this->rules)) {\n $this->rules[$column] = '';\n }\n\n $this->rules[$column] .= '|' . $rule;\n $this->rules[$column] = trim($this->rules[$column], '|');\n }",
"public function addRule(Rule $rule)\n {\n $this->rules[] = $rule;\n return $this;\n }",
"public function add_rule($key, $rule, $error = NULL, $name = NULL) {\n\t\t$this->rules[] = (object) array('key' => $key, 'rule' => $rule, 'error_msg' => $error, 'name' => $name);\n\t}",
"function iis7_add_rewrite_rule($filename, $rewrite_rule)\n {\n }",
"public function addRules($rules){\n\t\tforeach($rules as $rule){\n\t\t\t$this->addRule($rule);\n\t\t}\n\t}",
"public function addRule(RuleInterface $rule)\r\n\t{\r\n\t\t$this->rules[] = $rule;\r\n\t\t$this->dirty = true;\r\n\t\treturn $this;\r\n\t}",
"public static function add_rewrite_rule()\n {\n }",
"private function addRule( $rule_name, $field, $value )\n {\n if ( !isset ( $this->rules[$field] ))\n $this->rules[$field] = array( );\n if ( is_array( $value ))\n array_shift( $value );\n // remove the first element becaust it's contains the rule name.\n $this->rules[$field][$rule_name] = $value;\n }"
]
| [
"0.6911536",
"0.68590087",
"0.6796775",
"0.65818495",
"0.6440216",
"0.6336621",
"0.62616",
"0.61791986",
"0.6155176",
"0.6053139",
"0.6032105",
"0.60271925",
"0.60178626",
"0.5961058",
"0.5932126",
"0.59144264",
"0.58985424",
"0.5861756",
"0.57716537",
"0.5768053",
"0.5766702",
"0.5764509",
"0.5754658",
"0.57438713",
"0.57426155",
"0.5717929",
"0.57011306",
"0.56632614",
"0.56087124",
"0.55632126"
]
| 0.7884931 | 0 |
Create an html table representing the rule given by the first parameter, and limit the representation by the levels of the | public function table($rule, $level)
{
bnf::$maxLevel = $level;
return bnfRule::$rules[$this->id][$rule]->table(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function table($level){\n\t\treturn \"<div class=\\\"word quoted final\\\"><span>\".htmlspecialchars($this->id).\"</span></div>\";\t\n\t}",
"function html_generate_table($heights, $weights, $rows) {\n $html = '<table>';\n $html .= html_generate_row($heights, ' ', true);\n foreach ($rows as $key => $row) {\n $html .= html_generate_row($row, $weights[$key]);\n }\n $html .= '</table>';\n return $html;\n}",
"function makeTable($netid, $pass) {\r\n $dataJSON = getOwlspaceData($netid,$pass, 1);\r\n\r\n $returnString = \"\";\r\n\r\n $data = json_decode($dataJSON, true);\r\n\r\n $keys = array_keys($data);\r\n\r\n echo '<table class=\"table\">';\r\n // go through and make table\r\n foreach (array_keys($data) as $index => $classKey) {\r\n foreach (array_keys($data[$classKey]) as $index => $assignmentKey) {\r\n echo '<tr>';\r\n echo '<td>', $classKey, '</td>';\r\n echo '<td>', $assignmentKey, '</td>';\r\n echo '<td>', $data[$classKey][$assignmentKey], '</td>';\r\n echo '</tr>';\r\n }\r\n }\r\n echo '</table>';\r\n\r\n \r\n }",
"protected function generateTable(&$params)\n {\n $groupingField = array_search($params[\"grouping_fields\"][$params[\"grouping_level\"]],$params[\"fields\"]);\n $groupingLevel = $params[\"grouping_level\"];\n $accumulatedTotals = array();\n \n if(count($this->reportData) == 0) return;\n \n do\n {\n if($_POST[\"grouping_\".($params[\"grouping_level\"]+1).\"_newpage\"] == \"1\")\n {\n $params[\"report\"]->addPage($_POST[\"grouping_\".($params[\"grouping_level\"]+1).\"_newpage\"]);\n }\n\n $headingValue = $this->reportData[$this->reportDataIndex][$groupingField];\n $this->drawHeading($headingValue, $params);\n\n $totalsBox = new TableContent($params[\"headers\"],null);\n $totalsBox->style[\"totalsBox\"] = true;\n array_unshift($params[\"previous_headings\"], array($headingValue, $groupingField));\n $params[\"ignored_fields\"][] = $groupingField;\n\n if($params[\"grouping_fields\"][$groupingLevel + 1] == \"\")\n {\n $data = array();\n do\n {\n //if($t == 1000) die(); $t++;\n $continue = true;\n $row = $this->reportData[$this->reportDataIndex];\n //var_dump($row);\n\n @$data[] = array_values($row);\n\n $this->reportDataIndex++;\n\n foreach($params[\"previous_headings\"] as $heading)\n {\n if($heading[0] != $this->reportData[$this->reportDataIndex][$heading[1]])\n {\n array_shift($params[\"previous_headings\"]);\n $continue = false;\n break;\n }\n }\n }while($continue);\n \n $totals = $this->drawTable($data, $params, $params[\"data_params\"], null, $headingValue);\n array_pop($params[\"ignored_fields\"]);\n }\n else\n {\n $params[\"grouping_level\"]++;\n $totals = $this->generateTable($params);\n array_shift($params[\"previous_headings\"]);\n $params[\"grouping_level\"]--;\n array_pop($params[\"ignored_fields\"]);\n }\n\n if($this->drawTotals && $totals != null)\n {\n $totalsBox->data_params = $this->dataParams;\n $totalsBox->data_params[\"widths\"] = $this->widths;\n $totals[0] = \"$headingValue\";\n $totalsBox->setData($totals);\n $params[\"report\"]->add($totalsBox);\n foreach($totals as $i => $total)\n {\n if($total === null) continue;\n $accumulatedTotals[$i] += $total;\n }\n }\n\n if($params[\"previous_headings\"][0][0] != $this->reportData[$this->reportDataIndex][$params[\"previous_headings\"][0][1]])\n {\n break;\n }\n\n }while($this->reportDataIndex < count($this->reportData));\n \n return $accumulatedTotals; \n }",
"function generateHorizontalTableFromQuery($tableid, $title, $description, $sql){\n\t\t global $database;\n\n $rec = $database->query($sql);\n \n if (!$rec || !$rec->num_rows){\n\t\t\t return $database->error;\n\t\t }\n\t\t \n\t\t $field_names = array();\n\t\t $fields = \"\";\n\t\t $body = \"\";\n\t\t\t\n\t\t\t// first field\n\t\t\t$field_names[] = \"<th>Category</th>\";\n\t\t\twhile ($row = $rec->fetch_array()){\n\t\t\t\t$col = $row[0];\n\t\t\t\t$field_names[] = \"<th>$col</th>\";\n\t\t\t}\n\n\t\t\t$fields = implode(\"\", $field_names);\n\t\t\t\n\t\t\tmysqli_data_seek($rec, 0);\n\n\t\t\t$keys = array();\t\t\t\n\t\t\t$row = $rec->fetch_array();\n\t\t\t$keys_ = array_keys($row);\n\t\t\t$idx = 0;\n\n\t\t\tforeach($keys_ as $key){\n\t\t\t\tif (! is_numeric($key) && $idx > 1){\n\t\t\t\t\t$keys[] = $key;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$idx++;\n\t\t\t}\n\n\t\t\tmysqli_data_seek($rec, 0);\n\t\t\t$data = \"\";\n\t\t\t$body = \"\";\n\t\t\t\n\t\t\t$total_fields = sizeof($field_names); // account for category\n\t\t\t$datasets = [];\n\t\t\t$idx = 1;\n\t\t\t\n\t\t\twhile ($row = $rec->fetch_array()){\t\t\n\t\t\t\tforeach($keys as $category) {\n\t\t\t\t\t\t $data = $row[$category];\n\t\t\t\t\t\t if (!$data) $data = 0;\n\t\t\t\t\t\t $datasets[$category][] = \"<td>$data</td>\"; \n\t\t\t\t}\n\t\t\t}\t\t\t\n\n\t\t\tforeach ($datasets as $key=>$arr){\n\t\t\t\t$data = implode(\"\", $arr);\n\t\t\t\t$body .= \"<tr><td>$key</td>$data</tr>\";\n\t\t\t\t$idx++;\n\t\t\t}\n\t\t\t\n\t\t\treturn \"<h5 style='font-weight:bold'>$title <small class='pull-right'>$description</small></h5>\n\t\t\t\t\t <div class='table-responsive' style='overflow-x:scroll;'>\n\t\t\t\t\t\t <table class='table table-hover table-bordered' id='$tableid'>\n\t\t\t\t\t <thead>\n\t\t\t\t\t\t <tr>$fields</tr>\n\t\t\t\t\t\t </thead>\n\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t\t$body\n\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t </table>\n\t\t\t\t\t\t</div>\";\n }",
"function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }",
"public function createGridData()\n {\n $aPeriods = $this->getGridDataPeriods();\n $aLevels = $this->getGridDataLevels();\n if (empty($aPeriods) || empty($aLevels)) {\n $this->aErrors[] = 'No period or level data provided';\n\n return false;\n }\n $aAllPeriodLevels = $this->getAllGridDataPeriodLevels($aPeriods, $aLevels);\n ?>\n <table id=\"dimension_table\" border=\"1\" class=\"dim_table\">\n <tbody><tr>\n <th></th>\n <?php\n foreach ($aLevels as $nLevelId => $aLevel) {\n ?>\n <th>\n <?php\n if (!empty($aLevel['link_exists'])) {\n ?>\n <a class=\"more\" title=\"<?=$aLevel['label']?>\" \n href=\"?year=<?=$aLevel['nYear']?>&level=<?=$aLevel['level']\n ?>&parent_level_id=<?=$aLevel['level_id']?>\"><?=$aLevel['code']?></a>\n <?php\n } else {\n echo $aLevel['code'];\n }\n ?>\n </th>\n <?php\n }\n ?>\n </tr></tbody>\n <?php\n foreach ($aPeriods as $nPeriodId => $aPeriod) {\n echo \"<tr><td>{$aPeriod['period_name_x_axis']}</td>\\n\";\n foreach ($aLevels as $aLevel) {\n $nLevelId = $aLevel['id'];\n ?>\n <td>\n <?php\n if (!empty($aAllPeriodLevels[$nPeriodId][$nLevelId]['link_exists'])) {\n ?>\n <a class=\"more\" title=\"<?=$aLevel['label']?>\" \n href=\"?year=<?=$aLevel['nYear']?>&period_id=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['period_id']?>&level=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['level']?>&parent_level_id=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['parent_level_id']?>&level_id=<?=\n $aAllPeriodLevels[$nPeriodId][$nLevelId]['level_id']?>\"><?=\n $this->getFormattedAmt($aAllPeriodLevels[$nPeriodId][$nLevelId]['amt'])?></a>\n <?php\n } else {\n echo '0';\n }\n ?>\n </td>\n <?php\n }\n echo \"</tr>\\n\";\n }\n\n echo '</table>';\n }",
"public function write() {\n\t\t$table = '<table '.$this->addHTML.'>';\n\t\tif(!is_null($this->tableInfo['head'])) {\n\t\t\t$table .= '<thead><tr>';\n\t\t\tforeach($this->tableInfo['head'] as $value) {\n\t\t\t\t$table .= '<th>'.$value.'</th>';\n\t\t\t}\n\t\t\tif($this->crud) {\n\t\t\t\t\t$table .= '<th>Options</th>';\t\n\t\t\t}\n\t\t\t$table .= '</tr></thead>';\n\t\t}\n\t\t$table .= '<tbody>';\n\t\tif(isset($this->tableInfo['rows'])) {\n\t\t\tforeach($this->tableInfo['rows'] as $row) {\n\t\t\t\t$table .= '<tr>';\n\t\t\t\tforeach($row as $key => $column) {\n\t\t\t\t\tif(($key != $this->crud_id) OR $this->show_crud_id) {\n\t\t\t\t\t\t$table .= '<td>'.$column.'</td>';\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($this->crud && isset($row[$this->crud_id])) {\n\t\t\t\t\t$table .= '<td>';\n\t\t\t\t\t$table .= '<a href=\"'.$this->crudPath.'Details/'.$row[$this->crud_id].'\" title=\"Details\"><i class=\"fa fa-search\"></i></a> | ';\n\t\t\t\t\t$table .= '<a href=\"'.$this->crudPath.'Edit/'.$row[$this->crud_id].'\" title=\"Edit\"><i class=\"fa fa-wrench\"></i></a> | ';\n\t\t\t\t\t$table .= '<a href=\"'.$this->crudPath.'Delete/'.$row[$this->crud_id].'\" title=\"Delete\"><i class=\"fa fa-trash\"></i></a>';\n\t\t\t\t\t$table .= '</td>';\n\t\t\t\t}\n\t\t\t\t$table .= '</tr>';\n\t\t\t}\n\t\t} else {\n\t\t\t$table .= '<tr>';\n\t\t\t$table .= '<td>';\n\t\t\t$table .= 'No Data to show here.';\n\t\t\t$table .= '</td>';\n\t\t\t$table .= '</tr>';\t\n\t\t}\n\t\t\n\t\t$table .= '</tbody></table>';\n\t\treturn $table;\n\t}",
"function tableauToHTML(array $tab)\n{\n echo \"<table>\";\n foreach ($tab as $i => $ligne) {\n echo \"<tr>\";\n foreach ($ligne as $j => $valeur) {\n echo \"<td>$valeur</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}",
"function makeHTMLTable($array){\n\t\t // start table\n\t\t $html = '<table>';\n\t\t // header row\n\t\t $html .= '<tr>';\n\t\t // foreach($array[0] as $key=>$value){\n\t\t // $html .= '<th>' . htmlspecialchars($key) . '</th>';\n\t\t // }\n\t\t // $html .= '</tr>';\n\t\t // data rows\n\t\t foreach( $array as $key=>$value){\n\t\t $html .= '<tr>';\n\t\t foreach($value as $key2=>$value2){\n\t\t $html .= '<td>' . htmlspecialchars($value2) . '</td>';\n\t\t }\n\t\t $html .= '</tr>';\n\t\t }\n\t\t // finish table and return it\n\t\t $html .= '</table>';\n\t\t return $html;\n\t\t\t}",
"function buildHTMLTable($dataSet){\n\n $tblHTML = \"<table class='cleanTbl'>\";\n\n foreach ($dataSet as $row) {\n\n $tblHTML = $tblHTML.\"<tr class='cleanTbl'>\";\n\n foreach($row as $col){\n\n $tblHTML = $tblHTML.\"<td class='cleanTbl'>$col</td>\";\n\n }\n $tblHTML = $tblHTML.\"</tr>\";\n\n }\n $tblHTML = $tblHTML.\"</table>\";\n\n return $tblHTML;\n}",
"public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }",
"function make_table($table) {\n return print_table($table, true);\n}",
"private function createTree() {\n\t\t$html = $this->getSpec();\n\t\t$html .= '<div class=\"tal_clear\"></div>';\n\t\t$html .= $this->getSkills();\n\n\t\treturn $html;\n\t}",
"function groupsHTML($arrAllGroups) {\n global $LANG;\n $intLastGroup=0;\n if (is_array($arrAllGroups)) {\n $intGroups = count($arrAllGroups);\n // Build Groups\n foreach($arrAllGroups as $intGroupKey => $arrSingleGroup) {\n $strOutput .= '<tr class=\"bgColor5\">\n <td colspan=\"3\"><b><em>'.$LANG->getLL(\"conditions_group\").' ' . ($intLastGroup+1) .'</em></b></td>\n <td colspan=\"2\"><b>'.$LANG->getLL(\"conditions_condition\").'</b></td>\n </tr>'.chr(10);\n $strGroupButtons = !$this->blnLocalization?implode(chr(10),$this->getGroupButtons($intGroupKey,$intGroups)):' ';\n // Build Rules\n foreach($arrSingleGroup['rule'] as $intRuleKey => $arrRule) {\n $arrRule['field'] = stripslashes($arrRule['field']);\n $strOutput .= '<tr class=\"bgColor4\">'.chr(10);\n if ($intRuleKey!=0) {\n $strOutput .= '<td align=\"right\">'.$LANG->getLL(\"conditions_and\").'</td>'.chr(10);\n } else {\n \t$intExtraRow = !$this->blnLocalization?1:0;\n $strOutput .= '<td rowspan=\"'.(count($arrSingleGroup['rule'])+$intExtraRow).'\" class=\"bgColor5\">\n \t\t\t'.$strGroupButtons.'\n \t\t\t</td>\n <td><b>'.$LANG->getLL(\"conditions_rules\").'</b></td>'.chr(10);\n }\n $strOutput .= '<td style=\"white-space:nowrap;\">';\n if (!$this->blnLocalization) {\n\t\t\t\t\t\t$strOutput .= '<select name=\"'.$this->strExtKey.'[grps]['.$intGroupKey.'][rule]['.$intRuleKey.'][field]\" onChange=\"submit();\">\n\t \t\t\t'.implode(chr(10),$this->getFields($arrRule['field'])).'\n\t \t\t\t</select>';\n } else {\n \t$arrFields = $this->getFields($arrRule['field']);\n \t$strOutput .= '<input name=\"'.$this->strExtKey.'[grps]['.$intGroupKey.'][rule]['.$intRuleKey.'][field]\" type=\"hidden\" value=\"'.$arrFields['uid'].'\" />'.$arrFields['title'];\n }\n\t\t\t\t\t$strOutput .= '</td>\n <td style=\"white-space:nowrap;\">';\n $strOutput .= implode(chr(10),$this->getOperators($this->strExtKey.'[grps]['.$intGroupKey.'][rule]['.$intRuleKey.']',$arrRule));\n $strOutput .= '</td>\n <td width=\"11\">';\n // No trashbin when single rule in a group\n if (!$this->blnLocalization && count($arrSingleGroup['rule'])>1) {\n $strOutput .= '<input type=\"image\" name=\"'.$this->strExtKey.'[rule_remove]['.$intGroupKey.']['.$intRuleKey.']\"'.IconUtility::skinImg($this->objDoc->backPath,'gfx/garbage.gif').BackendUtility::titleAltAttrib($LANG->getLL(\"conditions_ruleRemove\")).' />'.chr(10);\n } else {\n \t$strOutput .=' ';\n }\n $strOutput .= '</td></tr>'.chr(10);\n }\n if (!$this->blnLocalization) {\n\t $strOutput .= '<tr class=\"bgColor4\">\n\t <td align=\"right\">'.$LANG->getLL(\"conditions_and\").'</td>\n\t <td><select name=\"'.$this->strExtKey.'[grps]['.$intGroupKey.'][rule]['.($intRuleKey+1).'][field]\" onChange=\"submit();\">\n\t <option value=\"'.$this->extKey.'_new\">'.$LANG->getLL('conditions_newField').'</option>\n\t '. implode(chr(10),$this->getFields()).'\n\t </select></td>\n\t <td colspan=\"2\"></td>\n\t </tr>'.chr(10);\n }\n $intLastGroup = $intGroupKey;\n }\n }\n // Build New Group\n if (!$this->blnLocalization) {\n\t $strOutput .= '<tr class=\"bgColor6\">\n\t <td colspan=\"5\"><b>'.$LANG->getLL(\"conditions_new\").'</b></td>\n\t </tr>\n\t <tr class=\"bgColor6\">\n\t <td> </td>\n\t <td><b>'.$LANG->getLL(\"conditions_rules\").'</b></td>\n\t <td colspan=\"3\"><select name=\"'.$this->strExtKey.'[grps]['.($intLastGroup+1).'][rule][0][field]\" onChange=\"submit();\">\n\t <option value=\"'.$this->extKey.'_new\">'.$LANG->getLL('conditions_newField').'</option>'\n\t . implode(chr(10),$this->getFields()).'\n\t </select></td>\n\t </tr>'.chr(10);\n }\n return $strOutput;\n\t}",
"function table($text) {\n\t\t$output = \"\";\n\t\tif (!empty($text)) {\n\t\t\t$output .= '<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\"100%\">';\n\t\t\t$array = explode(\"\\n\", $text);\n\t\t\tfor ($i=0; $i<count($array); $i++) {\n\t\t\t\tif (!empty($array[$i])) {\n\t\t\t\t\t$row = explode(\":\", $array[$i], 2);\n\t\t\t\t\t$title = isset($row[0]) ? $row[0] : '';\n\t\t\t\t\t$data = isset($row[1]) ? $row[1] : '';\n\t\t\t\t\tif ($i%2 == 0) {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_a\"><td class=\"form_title\" width=\"30%\">'.$title.'</td><td bgcolor=\"#EBF1F6\" width=\"70%\">'.$data.'</td></tr>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$output .= '<tr class=\"row_ab_b\"><td class=\"form_title\">'.$title.'</td><td bgcolor=\"#FFFFFF\">'.$data.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$output .= '</table>';\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function drawTable()\n {\n echo \"<table border='1'>\";\n for ($i = 0; $i < $this->m; $i++) {\n echo \"<tr>\";\n for ($j = 0; $j < $this->n; $j++) {\n if ($this->isInSolution($i, $j, $this->matrix)) {\n echo \"<td bgcolor='#9acd32'>\";\n } else {\n echo \"<td>\";\n }\n echo $this->matrix[$i][$j];\n echo \"</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }",
"private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }",
"private static function convertRulesToHtml($info)\n\t{\n\t\t$args = \"\";\n\t\t\n\t\tif(is_int($info['colspan']))\t$args .= \" colspan='{$info['colspan']}'\";\n\t\tif(is_int($info['rowspan']))\t$args .= \" rowspan='{$info['rowspan']}'\";\n\t\tif($info['id'])\t\t\t\t\t$args .= \" id='{$info['id']}'\";\n\t\tif($info['class'])\t\t\t\t$args .= \" class='{$info['class']}'\";\n\t\tif($info['style'])\t\t\t\t$args .= \" style='{$info['style']}'\";\n\t\tif($info['args'])\t\t\t\t$args .= \" {$info['args']}\";\n\t\t\n\t\treturn $args;\n\t}",
"function generate_html_tail(){\n $all_tests = $GLOBALS['total_counter'];\n $ok_tests = $GLOBALS['passed_counter'];\n $fail = $GLOBALS['failed_counter'];\n\n if($all_tests > 0){\n $success_rate = ($ok_tests / $all_tests)* 100;\n }\n else{\n $success_rate = 0;\n }\n\n echo \" </table><br>\\n\";\n echo \" <h3>Summary:</h3>\\n\";\n echo \" <table style=\\\"width: 300px\\\">\\n\";\n echo \" <tr>\\n\";\n echo \" <td>Number of tests</td>\\n\";\n echo \" <td>$all_tests</td>\\n\";\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <td>Successful tests</td>\\n\";\n echo \" <td>$ok_tests</td>\\n\";\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <td>Failed tests</td>\\n\";\n echo \" <td>$fail</td>\\n\";\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <td>Success rate</td>\\n\";\n echo \" <td>$success_rate%</td>\\n\";\n echo \" </tr>\\n\";\n echo \" </table>\\n\";\n echo \" </body>\\n\";\n echo \"</html>\\n\";\n}",
"function constructTableHead() {\n\n $header = '<tr><th>Country</th>';\n if (isset($_GET['pop'])) {\n $header .= '<th>Total Population</th>';\n }\n if (isset($_GET['birth'])) {\n $header .= '<th>Birth Rate</th>';\n }\n if (isset($_GET['death'])) {\n $header .= '<th>Death Rate</th>';\n }\n\n $header .= '</tr>';\n return $header;\n }",
"function toTable($data)\n{\n//print_r($data);\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = \"<table>\\n\\t<tr>\";\n\tforeach($keys as $key)\n\t{\n\t\t$result .= '<th>' . $key . '</th>';\n\t}\n\t$result .= \"</tr>\\n\";\n\t$counter = 0;\n\tforeach($data as $item)\n\t{\n\t\t$counter++;\n\t\tif ($counter % 2 == 1)\n\t\t{\n\t\t\t$result .= \"\\t<tr>\";\n\t\t} else\n\t\t{\n\t\t\t$result .= \"\\t<tr class=\\\"odd\\\">\";\n\t\t}\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= '<td>' . $value . '</td>';\n\t\t}\n\t\t$result .= \"</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\treturn $result;\n}",
"public function build_unit_details_table()\n\t{\n global $CFG;\n\t\t$retval = \"<div id='unitName$this->id' class='tooltipContentT'>\".\n \"<div><h3>$this->name</h3>\";\n \n if ($this->comments != ''){\n $retval .= \"<br><div style='background-color:#FF9;'>\".bcgt_html($this->comments, true).\"</div><br>\";\n }\n \n $retval .= \"<table><tr><th>\".get_string('criteriaName','block_bcgt').\"</th>\".\n \"<th>\".get_string('criteriaDetails','block_bcgt').\"</th></tr>\";\n\t\tif($criteriaList = $this->criterias)\n\t\t{\n require_once($CFG->dirroot.'/blocks/bcgt/plugins/bcgtbtec/classes/sorters/BTECCriteriaSorter.class.php');\n $criteriaSorter = new BTECCriteriaSorter();\n usort($criteriaList, array($criteriaSorter, \"ComparisonDelegateByNameObject\"));\n\t\t\t//Sort the criteria on P, M and then D\n\t\t\tforeach($criteriaList AS $criteria)\n\t\t\t{\n\t\t\t\t$retval .= \"<tr><td>\".$criteria->get_name().\"</td><td>\".$criteria->get_details().\"</td></tr>\";\n\t\t\t}\n\t\t}\n\t\t$retval .= \"</table></div></div>\";\n\t\treturn $retval;\n\t}",
"function buildRow($network){\n $offset = 0;\n $i = 0;\n while($i < 7){\n $currentTitle = getTitle($network, getTime($offset));\n if (count($currentTitle) == 0){\n echo '<td colspan=\"1\">Local Programming</td>';\n $collumns = 1;\n $offset += 30;\n }\n else{\n $collumns = (int)($currentTitle[0]['RUNTIME'] / 30);\n if($i + $collumns > 7 ){\n $collumns = 2;\n }\n else if ($i + $collumns == 7){\n $collumns += 1;\n }\n echo '<td colspan=\"'. $collumns.'\"><a href = \"/phase5/pages/info.php?id= ' . $currentTitle[0]['ID']. '\">' . $currentTitle[0]['TITLE'] . '</td> ';\n $offset += $currentTitle[0]['RUNTIME'] ;\n }\n $i += $collumns; \n }\n}",
"function rec_layout_tables($input) {\r\n\t$c = $ct = $cnt = 0;\r\n\t//preg_match_all('/<table[^>]*width=\"600\"[^>]*>.*?<\\/table>/is', $this->code, $tables);\r\n\tpreg_match_all('/<table[^>]*>.*?<\\/table>/is', $input, $tables);\r\n\tif(preg_match_all('/<table[^>]*>.*?<\\/table>/is', $tables, $tables_for_rec)) {\r\n\t\tforeach($tables_for_rec[0] as $index => $subtable) {\r\n\t\t\t$subtable = rec_layout_tables ($subtable);\r\n\t\t}\r\n\t}\t\t\r\n\tforeach($tables[0] as $index => $table) {\r\n\t\tif (preg_match('/<table[^>]*summary=\"[^\"]*\"[^>]*>/is', $table) || \r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?Table(au|) [0-9]{1,3}( |):.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table) ||\r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?<a name=\"tab.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table) ||\r\n\t\tpreg_match('/<p[^>]*>(<strong>|).*?<a id=\"tab.+?(<\\/strong>|)<\\/p>\\s*<table[^>]*>/is', $table)) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$initial_table = $table;\r\n\t\t/*\r\n\t\t$biggest_width_for_table = \"0\";\r\n\t\t$width_type1 = \"\";\r\n\t\tpreg_match_all('/<tr[^>]>.*?<\\/tr>/is', $table, $trs);\r\n\t\tforeach($trs[0] as $index => $tr) {\r\n\t\t\tpreg_match_all('/<(td|th)[^>]*( width=\"([^\"]*)\")[^>]*>/is', $tr, $cell_widths1);\r\n\t\t\tpreg_match_all('/<(td|th)[^>]*( style=\"width:([^;]*);\")[^>]*>/is', $tr, $cell_widths2);\r\n\t\t\t$biggest_width1 = \"0\";\r\n\t\t\t$width_type1 = \"\";\r\n\t\t\t$biggest_width2 = \"0\";\r\n\t\t\t$width_type2 = \"\";\t\t\t\t\r\n\t\t\tforeach($cell_widths1[3] as $index => $cell_width) {\r\n\t\t\t\tpreg_match('/([0-9]*)([^0-9]*)/is', $cell_width, $width_match);\r\n\t\t\t\t$width_type1 = $width_match[2];\r\n\t\t\t\tif ($width_match[1] > $biggest_width1) {\r\n\t\t\t\t\t$biggest_width1 = $width_match[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tforeach($cell_widths2[3] as $index => $cell_width) {\r\n\t\t\t\tpreg_match('/([0-9]*)([^0-9]*)/is', $cell_width, $width_match);\r\n\t\t\t\t$width_type2 = $width_match[2];\r\n\t\t\t\tif ($width_match[1] > $biggest_width2) {\r\n\t\t\t\t\t$biggest_width2 = $width_match[1];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($biggest_width1 != 0) {\r\n\t\t\t\tif ($width_type1 == \"\") {\r\n\t\t\t\t\t$width_type1 = \"px\";\r\n\t\t\t\t}\r\n\t\t\t\t$biggest_width_for_tr = $biggest_width1;\r\n\t\t\t} else {\r\n\t\t\t\tif ($width_type2 == \"\") {\r\n\t\t\t\t\t$width_type2 = \"px\";\r\n\t\t\t\t}\r\n\t\t\t\t$biggest_width_for_tr = $biggest_width2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$biggest_width_for_tr\t\t\t\r\n\t\t}\r\n\t\t*/\r\n\t\tforeach($this->config['layout_tables'] as $search => $replace) {\r\n\t\t\t$table = preg_replace(\"/\" . $search . \"/is\", $replace, $table, -1, $c);\r\n\t\t\t//$this->logMsgIf(\"layout_tables[\" . htmlentities($search) . \"]\", $c);\r\n\t\t\t//$ct += $c;\r\n\t\t}\r\n\t\t\r\n\t\tpreg_match('/<div style=\"width:100%;\">\\s*<div[^>]* style=\"clear:both;\">\\s*<div([^>]*) style=\"float:left;[^\"]*\">/is', $table, $first_cell_attributes);\r\n\r\n\t\tif (preg_match('/width:([^;]*);/is', $first_cell_attributes[1], $first_cell_width)){\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4width:' . $first_cell_width[1] . ';\">', \r\n\t\t\t$table);\r\n\t\t}\r\n\t\t\r\n\t\tif(preg_match('/class=\"[^\"]*(width[0-9]{1,3})[^\"]*\"/is', $first_cell_attributes[1], $first_cell_width)) {\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\" class=\"' . $first_cell_width[1] . '\">', \r\n\t\t\t$table);\r\n\t\t}\r\n\t\t\r\n\t\tpreg_match('/<div style=\"width:100%;\">\\s*<div[^>]* style=\"clear:both;\">\\s*<div[^>]* style=\"float:left;[^\"]*\"[^>]*>.*?<\\/div>\\s*<div([^>]*) style=\"float:left;[^\"]*\">/is', $table, $second_cell_attributes);\t\t\t\t\t\t\r\n\t\t/*\r\n\t\tif (preg_match('/width:([^;]*);/is', $second_cell_attributes[1], $second_cell_width)){\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">(.*?)<\\/div>(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\">$5<\\/div>$6<div$7 style=\"float:left;$8' . $second_cell_width[1] . ';\">', \r\n\t\t\t$table);\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\tif(preg_match('/class=\"[^\"]*(width[0-9]{1,3})[^\"]*\"/is', $second_cell_attributes[1], $second_cell_width)) {\r\n\t\t\t$table = preg_replace(\r\n\t\t\t'/<div([^>]*) style=\"clear:both;\">(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\"([^>]*)>(.*?)<\\/div>(\\s*)<div([^>]*) style=\"float:left;([^\"]*)\">/is', \r\n\t\t\t'<div$1 style=\"clear:both;\">$2<div$3 style=\"float:left;$4\"$5>$6<\\/div>$7<div$8 style=\"float:left;$9\" class=\"' . $second_cell_width[1] . '\">', \r\n\t\t\t$table);\r\n\t\t}\t\t\t\r\n\t\t*/\r\n\t\t$this->code = str_replace($initial_table, $table, $this->code, $ct);\r\n\t\t$cnt += $ct;\r\n\t}\r\n\t$this->logMsgIf(\"layout_tables\", $cnt);\r\n\treturn $output;\r\n}",
"function exibeLab($lab, $qtdLinha, $qtdColuna){\n echo '<table border=\"0\" cellspacing=\"1\" cellpadding=\"20\" align=\"center\" style=\"margin-top:20px;\" >';\n for ($l=0; $l<$qtdLinha; $l++){\n echo '<tr>';\n for ($c=0; $c<$qtdColuna; $c++){\n if ($lab[$l][$c] == 0){\n echo '<td style=\"background-color:white\"></td>';\n }elseif ($lab[$l][$c] == 1){\n echo '<td style=\"background-color:black\"></td>';\n }elseif ($lab[$l][$c] == 3){\n echo '<td style=\"background-color:red\"></td>';\n }elseif ($lab[$l][$c] == 4){\n echo '<td style=\"background-color:black\"></td>';\n }elseif ($lab[$l][$c] == 5){\n echo '<td style=\"background-color:#5F9EA0;\"></td>';\n }\n }\n echo '</tr>';\n }\n echo \"</table>\";\n }",
"public function graph($rule, $level)\n\t{\n\t\treturn $this->table($rule, $level);\n\t}",
"function build_table($new,$array_cat){\n\t\t//de categorias de serviceo.\n\t\t//Hacemos las iniciaciones pertinentes para intentar\n\t\t//aclarar un poco el codigo\n\t\t$ini_fila=\"<tr>\";\n\t\t$fin_fila=\"</tr>\";\n\t\t$ini_col='<td valign=\"top\" nowrap>';\n\t\t$fin_col=\"</td>\";\n\t\t$NUM_MAX_COLS=1;\n\t\t//Por cada columna un padre y sus hijos.\n\t\t$cadena='<table border=\"0\">';\n\t\t$num_current_col=$NUM_MAX_COLS+1;\t\t\n\t\tfor ($i=0;$i<count($array_cat);$i++){\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$num_current_col=1;\n\t\t\t\t$cadena=$cadena.$ini_fila;\n\t\t\t}\n\t\t\t$cadena=$cadena.$ini_col;\n\t\t\t//Damos el padre para que empiece la recursividad\t\t\t\n\t\t\t\n\t\t\t$cadena=$cadena.$this->build_col($new,$array_cat[$i],0,\"services\");\t\t\n\t\t\t//0 es el numero de tabulaciones inicial.\n\t\t\t//\"services\" es el nombre que tendran los checkbox.\n\t\t\t$cadena=$cadena.$fin_col;\n\t\t\t$num_current_col++;\n\t\t\tif ($num_current_col==$NUM_MAX_COLS+1){\n\t\t\t\t$cadena=$cadena.$fin_fila;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Si el numero de la columna actual es menor\n\t\t//que el numero maximo de columnas +1 \n\t\t//restamos al maximo la actual para saber cuantas faltan. \n\t\tif ($num_current_col<$NUM_MAX_COLS+1){\t\t\t\n\t\t\t$cadena=$cadena.'<td colspan=\"'.($NUM_MAX_COLS+1-$num_current_col).'\"> '.$fin_col.$fin_fila;\n\t\t}\n\t\t$cadena=$cadena.'</table>';\n\t\treturn $cadena;\n\t}",
"function writeHTML()\n\t{\n\t\tglobal $_activeTree;\n\t\t\n\t\t$_activeTree= $this;\n\t\t\n\t\t$this->writeScript();\n\t\t$width = is_numeric($this->width) ? \"{$this->width}px\" : $this->width;\n\t\t$height = is_numeric($this->height) ? \"{$this->height}px\" : $this->height;\n\t\t\n\t\tif ($this->selectMode == \"single\")\n\t\t{\n?>\n<input type='hidden' name='<?echo $this->id ?>' id='<?echo $this->id?>' value='<?echo $this->value ?>'/>\n<? \n\t\t}\n?><table id=\"<?echo $this->id?>_table\" class=\"<? echo $this->style?>\" cellpadding=\"0\" cellspacing=\"0\" <? if ($this->width) echo \"style='width:{$width}'\"; ?>>\n\t\t <? \n\t\t if ($this->title)\n\t\t {\n\t\t ?>\t\t \n\t\t <tr>\n\t\t <th><? echo $this->title?></th>\n\t\t </tr>\n\t\t <?\n\t\t }\n\t\t ?>\n\t\t <tr>\n\t\t <td>\n\t\t <div style=\"padding: 0; margin: 0; width: 100%;<? if ($this->height > 0) { ?> height: <?echo $this->height?>px;<? } ?><?if ($this->scroll) echo \"overflow: auto\"?>\">\n<?\n\t\t$this->writeNodes();\n?>\n\t\t </div>\n\t\t </td>\n\t\t </tr>\n\t\t</table>\n<?\n\t\t$_activeTree = null;\n\t}",
"public function buildTable($data) {\n $table = '<table class=\"table\">'\n . '<thead>'\n . '<tr>'\n . '<th>Currency</th>'\n . '<th>Rate (%)</th>'\n . '</tr>'\n . '</thead>'\n . '<tbody>';\n\n foreach ($data as $key => $val) {\n if (floatval($val) >= 1) {\n $table .= '<tr class=\"alert alert-success\">';\n \n } elseif (floatval($val) < -1) {\n $table .= '<tr class=\"alert alert-danger\">';\n \n } elseif (floatval($val) < 0) {\n $table .= '<tr class=\"alert alert-warning\">';\n \n } else {\n $table .= '<tr>';\n }\n\n $table .= '<td>' . $key . '</td>'\n . '<td>' . $val . '</td>'\n . '</tr>';\n }\n\n $table .= '</tbody>'\n . '</table>';\n\n return $table;\n }"
]
| [
"0.617564",
"0.5786443",
"0.5776051",
"0.5737149",
"0.5712434",
"0.5687329",
"0.56362486",
"0.56211597",
"0.5611117",
"0.55278116",
"0.5509415",
"0.5502169",
"0.5494241",
"0.5466884",
"0.54432017",
"0.5440201",
"0.5399959",
"0.53668106",
"0.5362514",
"0.5359752",
"0.5344287",
"0.5336666",
"0.5335159",
"0.53254324",
"0.5318695",
"0.531619",
"0.53144586",
"0.53126484",
"0.5307208",
"0.5303827"
]
| 0.62503046 | 0 |
Return css link tag positioning by the given relative path to the lib directory | public function getCssLink($htmlRelativeDir="."){
return "<link type=\"text/css\" media=\"all\" rel=\"stylesheet\" href=\"".$this->getCss($htmlRelativeDir)."\">";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCssPath();",
"function wp_make_link_relative($link)\n {\n }",
"public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}",
"public function css_path(){\n return $this->css_path;\n }",
"public function getStylesheetUrl (): string;",
"protected function applyUrl()\n\t{\n\t\t// CSS\n\t\t$nodes = $this->dom->getElementsByTagName('link');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('href');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('href', $url);\n\t\t\t}\n\t\t}\n\t\t// JS\n\t\t$nodes = $this->dom->getElementsByTagName('script');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('src');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('src', $url);\n\t\t\t}\n\t\t}\n\t\t// Image\n\t\t$nodes = $this->dom->getElementsByTagName('img');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('src');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->layout_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('src', $url);\n\t\t\t}\n\t\t}\n\t\t// Anchor\n\t\t$nodes = $this->dom->getElementsByTagName('a');\n\t\tforeach ($nodes as $node) {\n\t\t\t$url = $node->getAttribute('href');\n\t\t\tif (strlen($url) > 0 && $url[0] == ':') {\n\t\t\t\t$url = $this->base_url . '/' . trim($url, ':');\n\t\t\t\t$node->setAttribute('href', $url);\n\t\t\t}\n\t\t}\n\t}",
"function css_url($file = NULL, $folder = NULL)\n {\n return get_instance()->theme->css_url($file, $folder);\n }",
"private static function _getPageCSSPath()\n {\n Channels::includeSystem('GUI');\n $cssPath = '/__web/'.GUI::getSystemWebPath('Help').'/Templates/Help/Help.css';\n return $cssPath;\n\n }",
"public function getStylesheetDir (): string;",
"function _wp_normalize_relative_css_links($css, $stylesheet_url)\n {\n }",
"function src_inc_css(string $file) : string {\n return \"<link rel='stylesheet' href='\".$file.\"'>\";\n}",
"function addheadercode_func() {\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"'.ILIBRARY_DIR_URL.'styles/generic.css\" />' . \"\\n\";\n}",
"public function getRelativePath(){\n\t\treturn 'Less';\n\t}",
"private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }",
"public function link($file, $pkgHandle = null) {\n\n\t\t$fh=loader::helper('file');\n\n\t\tLoader::library('3rdparty/lessc.inc', 'less');\n\n\t\t$less = new LessOutputObject();\n\n\t\t// if the first character is a / then that means we just go right through, it's a direct path\n\t\tif (substr($file, 0, 1) == '/' || substr($file, 0, 4) == 'http' || strpos($file, DISPATCHER_FILENAME) > -1) {\n\t\t\t$less->compress = false;\n\t\t\t$filename = $file;\n\t\t}\n\n\t\t$v = View::getInstance();\n\t\t// checking the theme directory for it. It's just in the root.\n\t\tif ($v->getThemeDirectory() != '' && file_exists($v->getThemeDirectory() . '/' . $file)) {\n\t\t\t$filename = $v->getThemePath() . '/' . $file;\n\t\t} else if ($pkgHandle != null) {\n\t\t\tif (file_exists(DIR_BASE . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $file)) {\n\t\t\t\t$filename = DIR_REL . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $file;\n\t\t\t} else if (file_exists(DIR_BASE_CORE . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $file)) {\n\t\t\t\t$filename = ASSETS_URL . '/' . DIRNAME_PACKAGES . '/' . $pkgHandle . '/' . DIRNAME_CSS . '/' . $file;\n\t\t\t}\n\t\t}\n\n\t\tif ($filename == '') {\n\t\t\tif (file_exists(DIR_BASE . '/' . DIRNAME_CSS . '/' . $file)) {\n\t\t\t\t$filename = DIR_REL . '/' . DIRNAME_CSS . '/' . $file;\n\t\t\t} else {\n\t\t\t\t$filename = ASSETS_URL_CSS . '/' . $file;\n\t\t\t}\n\t\t}\n\n\t\t$dest_filename = md5($filename).\".css\";\n\n\n\t\t// Now we have the file to play with\n\t\t$less->file = $v->getThemeDirectory() . '/' . $file;\n\n\t\t// if there is no CSS, or the Less has changed more recently than the corresponding\n\t\t// CSS, we need to parse it.\n\t\tif ( ( !file_exists(DIR_BASE . '/' . DIRNAME_CSS . '/' .$dest_filename) )\n\t\t\t\t\t|| ( filemtime(DIR_BASE . '/' . $filename) > filemtime(DIR_BASE . '/' . DIRNAME_CSS . '/' .$dest_filename) ) ) {\n\n\t\t\t$lessc = new lessc();\n\t\t\t$lessc->setImportDir(array($v->getThemeDirectory() . '/'));\n\t\t\t$data = file_get_contents(DIR_BASE . '/' . $filename);\n\t\t\t$output_file = DIRNAME_CSS.\"/\".$dest_filename;\n\n\t\t\ttry {\n \t$output_data = $lessc->parse($data);\n\t\t\t file_put_contents($output_file, $output_data);\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\t$message = t('LESS ERROR: '). $e->getMessage() .', '. $less->file;\n\t\t\t}\n\t\t}\n\n\t\t$less->file = ASSETS_URL_WEB.'/'.DIRNAME_CSS.'/'.$dest_filename;\n\n\t\t$less->file .= (strpos($less->file, '?') > -1) ? '&' : '?';\n\t\t$less->file .= 'v=' . md5(APP_VERSION . PASSWORD_SALT);\n\t\t// for the javascript addHeaderItem we need to have a full href available\n\t\t$less->href = $less->file;\n\t\tif (substr($less->file, 0, 4) != 'http') {\n\t\t\t$less->href = ASSETS_URL_WEB_FULL . $less->file;\n\t\t}\n\t\treturn $less;\n\t}",
"public function CSS($file,$hook=''){\n \n $file=$this->getFileName($file);\n $incl=pinCSSLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }",
"private function links()\n {\n foreach ($this->controller->links as $value)\n echo \"\\t<link rel='stylesheet' href='\" . DOMAIN . $value . \"' />\\n\";\n }",
"function link_tag( $href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE )\n\t{\n\t\t$CI =& get_instance();\n\t\t$link = '<link ';\n\n\t\tif ( is_array( $href ) )\n\t\t{\n\t\t\tforeach ( $href as $k => $v )\n\t\t\t{\n\t\t\t\tif ( $k === 'href' && ! preg_match( '#^([a-z]+:)?//#i', $v ) )\n\t\t\t\t{\n\t\t\t\t\tif ( $index_page === TRUE )\n\t\t\t\t\t{\n\t\t\t\t\t\t$link .= 'href=\"' . $CI->config->site_url( $v ) . '\" ';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$link .= 'href=\"' . $CI->config->slash_item( 'base_url' ) . $v . '\" ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$link .= $k . '=\"' . $v . '\" ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( preg_match( '#^([a-z]+:)?//#i', $href ) )\n\t\t\t{\n\t\t\t\t$link .= 'href=\"' . $href . '\" ';\n\t\t\t}\n\t\t\telseif ( $index_page === TRUE )\n\t\t\t{\n\t\t\t\t$link .= 'href=\"' . $CI->config->site_url( $href ) . '\" ';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$link .= 'href=\"' . $CI->config->slash_item( 'base_url' ) . $href . '\" ';\n\t\t\t}\n\n\t\t\t$link .= 'rel=\"' . $rel . '\" type=\"' . $type . '\" ';\n\n\t\t\tif ( $media !== '' )\n\t\t\t{\n\t\t\t\t$link .= 'media=\"' . $media . '\" ';\n\t\t\t}\n\n\t\t\tif ( $title !== '' )\n\t\t\t{\n\t\t\t\t$link .= 'title=\"' . $title . '\" ';\n\t\t\t}\n\t\t}\n\n\t\treturn $link . \"/>\\n\";\n\t}",
"protected function renderCssLibraries() {}",
"public function showCss()\n {\n $addon_css = $this->css->url('pagelinks.css');\n $output = '<link rel=\"stylesheet\" href=\"' . $addon_css . '\">';\n $output .= '<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css\">';\n\n return $output;\n\n }",
"function css_src($file, $dir = 'css', $version = OMEKA_VERSION)\n{\n return src($file, $dir, 'css', $version);\n}",
"function getCssUrl() {\r\n\t\treturn parent::getPluginPath() . '/css/';\r\n\t}",
"function ReadCSS($html)\n{\n//! @desc CSS parser\n//! @return string\n\n/*\n* This version ONLY supports: .class {...} / #id { .... }\n* It does NOT support: body{...} / a#hover { ... } / p.right { ... } / other mixed names\n* This function must read the CSS code (internal or external) and order its value inside $this->CSS. \n*/\n\n\t$match = 0; // no match for instance\n\t$regexp = ''; // This helps debugging: showing what is the REAL string being processed\n\t\n\t//CSS inside external files\n\t$regexp = '/<link rel=\"stylesheet\".*?href=\"(.+?)\"\\\\s*?\\/?>/si'; \n\t$match = preg_match_all($regexp,$html,$CSSext);\n $ind = 0;\n\n\twhile($match){\n //Fix path value\n $path = $CSSext[1][$ind];\n $path = str_replace(\"\\\\\",\"/\",$path); //If on Windows\n //Get link info and obtain its absolute path\n $regexp = '|^./|';\n $path = preg_replace($regexp,'',$path);\n if (strpos($path,\"../\") !== false ) //It is a Relative Link\n {\n $backtrackamount = substr_count($path,\"../\");\n $maxbacktrack = substr_count($this->basepath,\"/\") - 1;\n $filepath = str_replace(\"../\",'',$path);\n $path = $this->basepath;\n //If it is an invalid relative link, then make it go to directory root\n if ($backtrackamount > $maxbacktrack) $backtrackamount = $maxbacktrack;\n //Backtrack some directories\n for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $path = substr( $path, 0 , strrpos($path,\"/\") );\n $path = $path . \"/\" . $filepath; //Make it an absolute path\n }\n elseif( strpos($path,\":/\") === false) //It is a Local Link\n {\n $path = $this->basepath . $path; \n }\n //Do nothing if it is an Absolute Link\n //END of fix path value\n $CSSextblock = file_get_contents($path);\t\n\n //Get class/id name and its characteristics from $CSSblock[1]\n\t $regexp = '/[.# ]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\n\t preg_match_all( $regexp, $CSSextblock, $extstyle);\n\n\t //Make CSS[Name-of-the-class] = array(key => value)\n\t $regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\n\n\t for($i=0; $i < count($extstyle[1]) ; $i++)\n\t {\n \t\tpreg_match_all( $regexp, $extstyle[2][$i], $extstyleinfo);\n \t\t$extproperties = $extstyleinfo[1];\n \t\t$extvalues = $extstyleinfo[2];\n \t\tfor($j = 0; $j < count($extproperties) ; $j++) \n \t\t{\n \t\t\t//Array-properties and Array-values must have the SAME SIZE!\n \t\t\t$extclassproperties[strtoupper($extproperties[$j])] = trim($extvalues[$j]);\n \t\t}\n \t\t$this->CSS[$extstyle[1][$i]] = $extclassproperties;\n\t \t$extproperties = array();\n \t\t$extvalues = array();\n \t\t$extclassproperties = array();\n \t}\n\t $match--;\n\t $ind++;\n\t} //end of match\n\n\t$match = 0; // reset value, if needed\n\n\t//CSS internal\n\t//Get content between tags and order it, using regexp\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\"> \n\t$match = preg_match($regexp,$html,$CSSblock);\n\n\tif ($match) {\n \t//Get class/id name and its characteristics from $CSSblock[1]\n \t$regexp = '/[.#]([^.]+?)\\\\s*?\\{(.+?)\\}/s'; // '/s' PCRE_DOTALL including \\n\n \tpreg_match_all( $regexp, $CSSblock[1], $style);\n\n\t //Make CSS[Name-of-the-class] = array(key => value)\n\t $regexp = '/\\\\s*?(\\\\S+?):(.+?);/si';\n\n\t for($i=0; $i < count($style[1]) ; $i++)\n\t {\n \t\tpreg_match_all( $regexp, $style[2][$i], $styleinfo);\n \t\t$properties = $styleinfo[1];\n \t\t$values = $styleinfo[2];\n \t\tfor($j = 0; $j < count($properties) ; $j++) \n \t\t{\n \t\t\t//Array-properties and Array-values must have the SAME SIZE!\n \t\t\t$classproperties[strtoupper($properties[$j])] = trim($values[$j]);\n \t\t}\n \t\t$this->CSS[$style[1][$i]] = $classproperties;\n \t\t$properties = array();\n \t\t$values = array();\n \t\t$classproperties = array();\n \t}\n\t} // end of match\n\n\t//Remove CSS (tags and content), if any\n\t$regexp = '/<style.*?>(.*?)<\\/style>/si'; // it can be <style> or <style type=\"txt/css\"> \n\t$html = preg_replace($regexp,'',$html);\n\n \treturn $html;\n}",
"function media_theplatform_mpx_get_external_css($href) {\n\n $result = drupal_http_request($href);\n // Grab its CSS.\n $css = $result->data;\n\n // If this is PDK stylesheet, change relative image paths to absolute.\n $parts = explode('/', $href);\n if ($parts[2] == 'pdk.theplatform.com') {\n // Remove filename.\n array_pop($parts);\n // Store filepath.\n $css_path = implode('/', $parts) . '/';\n // Replace all relative images with absolute path to skin_url.\n $css = str_replace(\"url('\", \"url('\" . $css_path, $css);\n }\n return $css;\n}",
"public static function locate_in_library($filename = null, $dir = 'css') {\r\n\r\n $file = false;\r\n if (isset($filename)):\r\n $filepath = 'library/' . $dir . '/' . $filename;\r\n if (file_exists(get_stylesheet_directory() . '/' . $filepath)):\r\n $file = get_stylesheet_directory_uri() . '/' . $filepath;\r\n\r\n elseif (file_exists(get_template_directory() . '/' . $filepath)):\r\n $file = get_template_directory_uri() . '/' . $filepath;\r\n\r\n elseif (CWP_PATH . '/' . $filepath):\r\n $file = CWP_URL . '/' . $filepath;\r\n\r\n endif;\r\n return $file;\r\n endif;\r\n\r\n }",
"function page_path_to_page_link($page)\n{\n require_code('urls2');\n return _page_path_to_page_link($page);\n}",
"function style_cdn($path)\r\n{\r\n\t$path = (env('APP_ENV') === 'local') ? $path : env('CDN_URL') . $path;\r\n\r\n\treturn '<link media=\"all\" type=\"text/css\" rel=\"stylesheet\" href=\"' . $path . '\">';\r\n}",
"protected function _link($type)\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'create urls to js/css files',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $links = '';\n $end = '';\n $front = '';\n\n switch ($type) {\n case'css':\n $front = '<link href=\"';\n $end = '\" rel=\"stylesheet\" type=\"text/css\"/>';\n $arr = $this->_css;\n break;\n\n case'js':\n $front = '<script src=\"';\n $end = '\" type=\"text/javascript\"></script>';\n $arr = $this->_js;\n break;\n }\n\n if (!empty($arr['external'])) {\n foreach ($arr['external'] as $mod) {\n foreach ($mod as $val) {\n if (is_array($val)) {\n\n foreach ($val as $key => $media) {\n foreach ($media as $file) {\n $links .= \"\\t\\t\" . $front . $file\n . '\" media=\"' . $key . $end . \"\\n\";\n }\n }\n\n } else {\n $links .= \"\\t\\t\" . $front . $val . $end . \"\\n\";\n }\n }\n }\n }\n\n if (!empty($arr['internal'])) {\n $path = '{;core;domain;}{;core;lang;}{;path;core_' . $type . '/';\n $endPath = ';}';\n $media = '';\n $internal = '';\n $intMedia = '';\n $key = '';\n\n foreach ($arr['internal'] as $mod => $values) {\n if (isset($values['media'])) {\n\n foreach ($values['media'] as $key => $elements) {\n foreach ($elements as $file) {\n $intMedia .= $mod . ',' . $file . '/';\n }\n }\n\n $media .= \"\\t\\t\" . $front . $path . $intMedia\n . $endPath . '\" media=\"' . $key . $end . \"\\n\";\n unset($values['media']);\n }\n\n foreach ($values as $file) {\n $internal .= $mod . ',' . $file . '/';\n }\n }\n\n if ($internal) {\n $links .= \"\\t\\t\" . $front . $path . $internal . $endPath . $end . \"\\n\";\n }\n\n if ($media) {\n $links .= $media;\n }\n }\n\n $this->generate('core;' . $type, $links);\n }",
"static function css($href) {\n\t\tif (is_array($href)) {\n\t\t\t$return = '';\n\t\t\tforeach ($href as $h) $return .= self::css($h);\n\t\t\treturn $return;\n\t\t} else {\n\t\t\t//see if shortcut exists\n\t\t\t$shortcuts = config::get('css.shortcuts');\n\t\t\tif (array_key_exists($href, $shortcuts)) $href = $shortcuts[$href];\n\t\t\treturn self::tag('link', array('rel'=>'stylesheet', 'href'=>$href));\n\t\t}\n\t}",
"private function relativePathFix($path){\n\t\t// check if page is a generated javadoc\n\t\t$page_str = $this->doc->saveHTML();\n\t\tif(preg_match('%.*Generated by javadoc.*%', $page_str)){\n\t\t\t// if it is, fix the frame-based links so that the path isn't appended to itself infinitely\n\t\t\t$path = preg_replace('%(.*\\/).*\\.html\\?(.*\\/.*)%', \"$1$2\", $path);\n\t\t}\n\t\t$dirs = explode('/', $path);\n\t\t// check if link goes up a directory\n\t\tif($dirs[0] == '..'){\n\t\t\t$new_path = explode('/', $this->current_path);\n\t\t\tif(count($dirs) == 2){\n\t\t\t\tarray_pop($new_path);\n\t\t\t\tarray_pop($new_path);\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t} else {\n\t\t\t\t// remove slash from end of current path to ensure single slashes\n\t\t\t\tif(empty($new_path[count($new_path)-1]) || is_null($new_path[count($new_path)-1])){\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// go up directories\n\t\t\t\twhile($dirs[0] == '..'){\n\t\t\t\t\tarray_shift($dirs);\n\t\t\t\t\tarray_pop($new_path);\n\t\t\t\t}\n\t\t\t\t// stick the two paths together to get new path\n\t\t\t\t$new_path = implode('/', $new_path).'/';\n\t\t\t\t$new_path .= implode('/', $dirs);\n\t\t\t}\n\t\t// if link it to same dir, remove the ./\n\t\t} elseif($dirs[0] == '.'){\n\t\t\t$new_path = $this->current_path.substr($path, 2);\n\t\t// if the link starts at root, use it without modification\n\t\t} elseif(empty($dirs[0]) || is_null($dirs[0])){\n\t\t\t$new_path = $path;\n\t\t} elseif(strlen($dirs[0]) == 2){\n\t\t\t$new_path = '/'.$path;\n\t\t// default to adding the link's value to the end of the current directory\n\t\t} else {\n\t\t\t$new_path = $this->current_path.$path;\n\t\t}\n\t\t\n\t\t// if the link doesn't point to a file or query string, but has no end slash, add one\n\t\tif(count(explode('.', $new_path)) < 2 && count(explode('?', $new_path)) < 2 && substr($new_path, -1) != '/'){\n\t\t\t$new_path .= '/';\n\t\t}\n\t\treturn $new_path;\n\t}"
]
| [
"0.5976405",
"0.55870706",
"0.5526606",
"0.5479225",
"0.54688793",
"0.53883064",
"0.5388249",
"0.5387983",
"0.5352028",
"0.53480923",
"0.529685",
"0.52921855",
"0.52615255",
"0.5259174",
"0.521065",
"0.5196607",
"0.51958925",
"0.5191051",
"0.5169822",
"0.51544666",
"0.51271045",
"0.5110779",
"0.5100775",
"0.50988907",
"0.5094864",
"0.5079065",
"0.50673634",
"0.5041677",
"0.50321925",
"0.5025646"
]
| 0.5903169 | 1 |
Make it so that people pages exist. Under WordPress, almost everything publishable is a post. register_post_type() is invoked to create a particular flavor of posts that describe people. | static function register_post_type ()
{
register_post_type(
'person',
array(
'labels' => array(
'name' => __x( 'People', 'post type general name' ),
'singular_name' => __x( 'Person', 'post type singular name' ),
'menu_name' => __x( 'People', 'admin menu' ),
'name_admin_bar' => __x( 'Person', 'add new on admin bar' ),
'add_new' => __x( 'Add New', 'book' ),
'add_new_item' => ___( 'Add New Person' ),
'new_item' => ___( 'New Person' ),
'edit_item' => ___( 'Edit Person' ),
'view_item' => ___( 'View Person' ),
'all_items' => ___( 'All People' ),
'search_items' => ___( 'Search People' ),
'parent_item_colon' => ___( 'Parent People:' ),
'not_found' => ___( 'No persons found.' ),
'not_found_in_trash' => ___( 'No persons found in Trash.' )
),
'description' => ___( 'Noteworthy people' ),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'people' ),
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'menu_icon' => 'dashicons-welcome-learn-more',
'supports' => array( 'title', 'editor', 'thumbnail' )
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function people() {\n\t\tregister_post_type(\n\t\t\t'people',\n\t\t\tarray(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name' => __( 'People' ),\n\t\t\t\t\t'singular_name' => __( 'Person' ),\n\t\t\t\t),\n\t\t\t\t'public' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'custom-fields' ),\n\t\t\t\t'taxonomies' => array( 'category' ),\n\t\t\t\t'menu_icon' => 'dashicons-media-text',\n\t\t\t)\n\t\t);\n\t}",
"public function register_post_type() {\n\t\tadd_action( 'init', array( $this, 'post_registration_callback' ), 0, 0 );\n\t}",
"function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }",
"public static function register_post_types() {}",
"public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }",
"function people_post_type() {\n\n\t/***************************************************************\n\t *\n\t OUR PEOPLE\n\t *\n\t***************************************************************/\n\n\t$peopleLabels = array(\n\t\t'name' => _x( 'Our People', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Our People', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Our People', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Our People', 'text_domain' ),\n\t\t'archives' => __( 'Our People Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Our People Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Our People:', 'text_domain' ),\n\t\t'all_items' => __( 'All Our People', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Person', 'text_domain' ),\n\t\t'add_new' => __( 'Add New Person', 'text_domain' ),\n\t\t'new_item' => __( 'New Person', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Person', 'text_domain' ),\n\t\t'update_item' => __( 'Update Person', 'text_domain' ),\n\t\t'view_item' => __( 'View Person', 'text_domain' ),\n\t\t'view_items' => __( 'View Our People', 'text_domain' ),\n\t\t'search_items' => __( 'Search Our People', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into Person', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Person', 'text_domain' ),\n\t\t'items_list' => __( 'Our People list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Our People list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter Our People list', 'text_domain' ),\n\t);\n\t$peopleArgs = array(\n\t\t'label' => __( 'Our People', 'text_domain' ),\n\t\t'description' => __( 'Post Type Description', 'text_domain' ),\n\t\t'labels' => $peopleLabels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t// 'taxonomies' => array( 'team_categories' ),\n\t\t//'rewrite' => array( 'slug' => 'team-archive' ),\n\t\t'rewrite' => true,\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 20,\n\t\t'menu_icon' => 'dashicons-groups',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_rest' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => false,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\n\tregister_post_type( 'people', $peopleArgs );\n\t/* this adds your post categories to your custom post type */\n\t// register_taxonomy_for_object_type( 'team_categories', 'team' );\n\n}",
"function register_post_types(){\n }",
"function register_post_types(){\n }",
"function registerPostTypes()\n{\n register_post_type('destination', [\n 'public' => true,\n 'label' => 'Destinations',\n 'supports' => ['title', 'editor', 'thumbnail']\n ]);\n register_post_type('review', [\n 'public' => true,\n 'label' => 'Reviews',\n 'supports' => ['title', 'editor']\n ]);\n}",
"function register_post_types()\n {\n }",
"public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}",
"public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post_type, $args);\n }",
"function register_post_types() {\n\t}",
"function register_post_types() {\n\t}",
"public function register_post_types() {\n\n\t}",
"private function register_post_type() {\n\t\t\t// register the post type\n\t\t\t$args = array('label' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t\t\t\t\t'public' => false,\n\t\t\t\t\t\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t\t\t\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t\t\t\t\t'rewrite' => array('slug' => $this->post_type, 'with_front' => false),\n\t\t\t\t\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t\t\t\t\t'menu_position' => 100,\n\t\t\t\t\t\t\t\t\t\t'menu_icon' => 'dashicons-admin-generic',\n\t\t\t\t\t\t\t\t\t\t'supports' => array('title','custom-fields','revisions'),\n\t\t\t\t\t\t\t\t\t\t'labels' => array('name' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'singular_name' => __('Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'menu_name' =>\t__('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new' => __('Add Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new_item' => __('Add New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => __('Edit', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit_item' => __('Edit Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'new_item' => __('New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view_item' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'search_items' => __('Search Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found' => __('No Options Pages Found', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found_in_trash' => __('No Options Pages Found in Trash', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => __('Parent Options Page', $this->text_domain)));\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}",
"function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }",
"public function create_post_types() {\n }",
"public function register_post_types() {\n\n\t\t// FAQ\n\t\tif (!MKB_Options::option('disable_faq')) {\n\t\t\t$this->register_faq_cpt();\n\t\t\t$this->register_faq_taxonomy();\n\t\t}\n\t}",
"public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }",
"public function init_post_type() {\n\t\t\t\n\t\t\t$labels = array(\n\t\t\t\t'name'\t\t\t\t=> 'Meetups',\n\t\t\t\t'new_item'\t\t\t=> 'Neues Meetup',\n\t\t\t\t'singular_name'\t\t=> 'Meetup',\n\t\t\t\t'view_item'\t\t\t=> 'Zeige Meetups',\n\t\t\t\t'edit_item'\t\t\t=> 'Editiere Meetup',\n\t\t\t\t'add_new_item'\t\t=> 'Meetup hinzufügen',\n\t\t\t\t'not_found'\t\t\t=> 'Kein Meetup gefunden',\n\t\t\t\t'search_items'\t\t=> 'Durchsuche Meetups',\n\t\t\t\t'parent_item_colon' => ''\n\t\t\t);\n\t\t\t\n\t\t\t$supports = array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'comments',\n\t\t\t);\n\t\t\t\n\t\t\t$args = array(\n\t\t\t\t'public'\t\t\t\t=> TRUE,\n\t\t\t\t'publicly_queryable'\t=> TRUE,\n\t\t\t\t'show_ui'\t\t\t\t=> TRUE, \n\t\t\t\t'query_var'\t\t\t\t=> TRUE,\n\t\t\t\t'capability_type'\t\t=> 'post',\n\t\t\t\t'hierarchical'\t\t\t=> FALSE,\n\t\t\t\t'menu_position'\t\t\t=> NULL,\n\t\t\t\t'supports'\t\t\t\t=> $supports,\n\t\t\t\t'has_archive'\t\t\t=> TRUE,\n\t\t\t\t'rewrite'\t\t\t\t=> TRUE,\n\t\t\t\t'labels'\t\t\t\t=> $labels\n\t\t\t);\n\t\t\t\n\t\t\tregister_post_type( 'wpmeetups', $args );\n\t\t}",
"public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }",
"function create_post_type() {\n\tregister_post_type( 'Architects', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Architects' ),\n\t\t\t'singular_name' => __( 'Architect' ),\n\t\t\t'add_new_item' => __( 'Add architect' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this architect' ),\n\t\t\t'new_item' => __( 'New architect' ),\n\t\t\t'view' => __( 'View architect' ),\n\t\t\t'view_item' => __( 'View this architect' ),\n\t\t\t'search_items' => __( 'Search architects' ),\n\t\t\t'not_found' => __( 'No architect was found' ),\n\t\t\t'not_found_in_trash' => __( 'No architects in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => true, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','page-attributes','trackbacks'),\n\t\t'rewrite' => array('slug'=>'architect','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\t// Remotes custom post type\n\tregister_post_type( 'Remotes', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Projects' ),\n\t\t\t'singular_name' => __( 'Project' ),\n\t\t\t'add_new_item' => __( 'Add projects' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this project' ),\n\t\t\t'new_item' => __( 'New project' ),\n\t\t\t'view' => __( 'View project' ),\n\t\t\t'view_item' => __( 'View this project' ),\n\t\t\t'search_items' => __( 'Search project' ),\n\t\t\t'not_found' => __( 'No project was found' ),\n\t\t\t'not_found_in_trash' => __( 'No project in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => false, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','comments','trackbacks'),\n\t\t'rewrite' => array('slug'=>'project','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\t// Scienticic custom post type\n\tregister_post_type( 'scientifics', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Scientifics' ),\n\t\t\t'singular_name' => __( 'Scientific' ),\n\t\t\t'add_new_item' => __( 'Add scientific' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this scientific' ),\n\t\t\t'new_item' => __( 'New scientific' ),\n\t\t\t'view' => __( 'View scientific' ),\n\t\t\t'view_item' => __( 'View this scientific' ),\n\t\t\t'search_items' => __( 'Search scientific' ),\n\t\t\t'not_found' => __( 'No scientific was found' ),\n\t\t\t'not_found_in_trash' => __( 'No scientifics in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => true, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','page-attributes','trackbacks'),\n\t\t'rewrite' => array('slug'=>'scientific','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\n}",
"function my_first_coffee() {\n $args = array (\n\n 'labels' => array(\n 'name' => 'Coffees',\n 'singular_name' => 'Coffee'\n ),\n 'hierarchical' => true, //we want to behave like a page if false it behaves like a post\n 'public' => true,\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-store',\n 'supports' => array ('title', 'editor', 'thumbnail', 'custom-fields', 'comments', 'excerpt'),\n 'rewrite' => array('slug' => 'our-coffees'),\n );\n\n register_post_type( 'coffees', $args );\n}",
"function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}",
"function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}",
"function register_post_type(){\n \n $capability = acf_get_setting('capability');\n \n if(!acf_get_setting('show_admin'))\n $capability = false;\n \n register_post_type($this->post_type, array(\n 'label' => 'Options Page',\n 'description' => 'Options Page',\n 'labels' => array(\n 'name' => 'Options Pages',\n 'singular_name' => 'Options Page',\n 'menu_name' => 'Options Pages',\n 'edit_item' => 'Edit Options Page',\n 'add_new_item' => 'New Options Page',\n ),\n 'supports' => array('title'),\n 'hierarchical' => true,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => 'edit.php?post_type=acf-field-group',\n 'menu_icon' => 'dashicons-layout',\n 'show_in_admin_bar' => false,\n 'show_in_nav_menus' => false,\n 'can_export' => false,\n 'has_archive' => false,\n 'rewrite' => false,\n 'exclude_from_search' => true,\n 'publicly_queryable' => false,\n 'capabilities' => array(\n 'publish_posts' => $capability,\n 'edit_posts' => $capability,\n 'edit_others_posts' => $capability,\n 'delete_posts' => $capability,\n 'delete_others_posts' => $capability,\n 'read_private_posts' => $capability,\n 'edit_post' => $capability,\n 'delete_post' => $capability,\n 'read_post' => $capability,\n ),\n 'acfe_admin_orderby' => 'title',\n 'acfe_admin_order' => 'ASC',\n 'acfe_admin_ppp' => 999,\n ));\n \n }",
"function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}",
"function BH_register_posttypes() {\r\n\r\n\tBH_register_posttype_event();\r\n\tBH_register_posttype_gallery();\r\n\r\n}",
"public static function registerWPPostType()\n {\n register_post_type\n (\n 'fs_feed_entry',\n array\n (\n 'label' => 'Feed Entries',\n 'labels' => array\n (\n 'name' => 'Feed Entries',\n 'singular_name' => 'Feed Entry',\n 'add_new' => 'Add New',\n 'add_new_item' => 'Add New Feed Entry',\n 'edit_item' => 'Edit Feed Entry',\n 'new_item' => 'New Feed Entry',\n 'view_item' => 'View Feed Entry',\n 'search_items' => 'Search Feed Entries',\n 'not_found' => 'No Feed Entries Found',\n 'not_found_in_trash' => 'No Feed Entries Found In Trash',\n 'parent_item_colon' => 'Parent Feed Entries:',\n 'edit' => 'Edit',\n 'view' => 'View Feed Entry'\n ),\n 'public' => false,\n 'show_ui' => true\n )\n );\n }"
]
| [
"0.7855856",
"0.7418234",
"0.7285491",
"0.71690285",
"0.71198624",
"0.7066123",
"0.7049788",
"0.70419556",
"0.70292634",
"0.70178294",
"0.69984156",
"0.6976406",
"0.6975736",
"0.6975736",
"0.6933671",
"0.68923926",
"0.6869477",
"0.6799266",
"0.6783482",
"0.6782155",
"0.67467076",
"0.67455614",
"0.67442244",
"0.67437977",
"0.6735586",
"0.67330456",
"0.67318493",
"0.67246014",
"0.67143834",
"0.67087734"
]
| 0.78243846 | 1 |
Set the value of id_entity | public function setId_entity($id_entity)
{
$this->id_entity = $id_entity;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEntity( $entity )\n {\n\n $this->entity = $entity;\n $this->rowid = $entity->getId();\n \n }",
"function SetId($value) { $this->id=$value; }",
"public function setEntityId($entityId) {\n $this->entityId = $entityId;\n }",
"public function setEntityId(?int $entityId);",
"public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"function jo($entity) {\n $entity->setEntityId(($entity->getEntityId() +1));\n }",
"private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}",
"function setid_exp($val)\n { $this->id_exp=$val;}",
"public function getId_entity($id_entity=null)\n {\n if ($id_entity != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE id_entity = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$id_entity]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->id_entity;\n }\n \n }",
"public function set_id($setid){\n $this->id = $setid;\n }",
"function setid_exp($val)\n { $this->id_exp=$val;}",
"function setid_exp($val)\n { $this->id_exp=$val;}",
"public function setId($value)\n {\n $this->setDataField('id', $value);\n }",
"protected function _setIdentity($id, $entity) {\r\n\t\tif (!$this->_hasIdentity($id)) {\r\n\t\t\t$this->_identityMap[$id] = $entity;\r\n\t\t}\r\n\t}",
"public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}",
"public function setId($x) { $this->id = $x; }",
"public function setID($id) {\n $this->id = $id; \n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"public function setIdAttribute($value)\n {\n $this->attributes['id'] = $value;\n }",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"function setEntity($entity_type, $entity_id) {\n $this->checkChange();\n\n // Ignore empty values.\n if (empty($entity_type) || empty($entity_id)) {\n return $this;\n }\n\n $this->entity_type = $entity_type;\n $this->entity_id = $entity_id;\n return $this;\n }",
"public function set($id, $value);",
"public function set($id, $value);",
"public function setID($id){\n $this->id = $id;\n }",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }",
"function setId($id){\r\n\t\t$this->id = $id;\r\n\t}",
"public function set_id($id){\n $this->id = $id;\n }"
]
| [
"0.7381502",
"0.72896516",
"0.7132784",
"0.7095683",
"0.7038721",
"0.69752806",
"0.6887758",
"0.68150157",
"0.66694915",
"0.6633416",
"0.66080946",
"0.65963644",
"0.65950745",
"0.65950745",
"0.6573833",
"0.6572237",
"0.65217113",
"0.650569",
"0.649681",
"0.6467035",
"0.6460262",
"0.6448935",
"0.64455676",
"0.64363587",
"0.64363587",
"0.6422789",
"0.64217746",
"0.6417024",
"0.6415659",
"0.64132345"
]
| 0.7674024 | 0 |
Set the value of domaine | public function setDomaine($domaine)
{
$this->domaine = $domaine;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setNom($value)\n\t{\n\t\t$this -> _nom = $value;\n\t}",
"public function setContenu(string $contenu): void\n {\n $this->contenu= $contenu;\n }",
"function setDetalle($sdetalle = '')\n {\n $this->sdetalle = $sdetalle;\n }",
"public function __set($nome, $valor) {\n $this->nome = $valor;\n }",
"public function setidExamen($Valor){\r\n $this->idExamen = trim($Valor);\r\n }",
"function setNom($nom) { if (is_string($nom)) {\r\n $this->_nom = $nom;\r\n }\r\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNome(string $nome)\n {\n $this->nome = $nome;\n }",
"public function setNom($nom){\n if(empty($nom)){\n //on redirige\n header(\"Location:../vu/formulaire_inscription.php\");\n return;\n\n }\n //on declare de la variable nom puis on appelle la varibale prive nom\n $this->_nom = $nom;\n }",
"public function setVida($valor){\n $this->vida=$valor;\n }",
"public function __set($nombre,$valor){\n $class = get_class($this);\n $nombre = strtolower($nombre); // se ponen los nombres en mayusculas ya que en la base de datos estan asi y estan en minusculas no funcionan las consultas\n if(property_exists($class,$nombre)){\n $this->$nombre = $valor; // le asignas al campo de igual nombre en la BD el valor pasado por parametro.\n }\n }",
"public function _setNombre($Nombre)\n {\n $this->Nombre = $Nombre;\n\n }",
"function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }",
"public function setPersonne($valeur)\n {\n $this->id_personne = $valeur;\n }",
"public function getDomaine($domaine=null)\n {\n if ($domaine != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE domaine = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$domaine]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->domaine;\n }\n \n }",
"public function setNome($nome){$this->nome = $nome;}",
"public function setValorDiaria($valorDiaria)\n {\n $this->valorDiaria = $valorDiaria;\n\n \n\n }",
"public function __set($nome, $valor) {\n $this->dados[$nome] = $valor;\n }",
"public function setNombre($n){\n\t\t$this->nombre = $n;\n\t}",
"public function testSetDomBanque() {\n\n $obj = new Employes();\n\n $obj->setDomBanque(\"domBanque\");\n $this->assertEquals(\"domBanque\", $obj->getDomBanque());\n }",
"public function setEdad($valor){\n\t\t\t$this->edad = $valor;\n\t\t}",
"function setNombre($nombre){\n\t\tif (is_string($nombre)){\n\t\t\t$this->nombre=$nombre;\n\t\t}else{\n\t\t\tthrow new Exception(\"Debe establecer una cadena para el nombre\");\n\t\t}\t\t\n\t}",
"public function setNome($valor){\n\t\t\t$this->nome = $valor;\n\t\t}",
"protected function setVida() {\n $this->vida = 200;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $this->db->real_escape_string($nombre);\n\n \n }",
"public function setIdempresa($idempresa){\n $this->idempresa = $idempresa;\n }",
"public function set($atributo, $valor) {\r\n\t\t\t $this->$atributo = $valor;\r\n\t\t}",
"function setNombre_dl($snombre_dl = '')\n {\n $this->snombre_dl = $snombre_dl;\n }",
"public function setDomainAttribute($value)\n {\n $this->attributes['domain'] = strtolower($value);\n }"
]
| [
"0.670152",
"0.64344215",
"0.6172033",
"0.614307",
"0.6112591",
"0.60995513",
"0.60806483",
"0.60806483",
"0.60339695",
"0.60312116",
"0.59851235",
"0.59814155",
"0.59125835",
"0.5906952",
"0.5904508",
"0.5878773",
"0.58719325",
"0.5850933",
"0.5847991",
"0.5809604",
"0.57987016",
"0.5764826",
"0.57560956",
"0.57520044",
"0.5745614",
"0.5742184",
"0.57389367",
"0.57298845",
"0.5728346",
"0.5708571"
]
| 0.7207015 | 0 |
Set the value of bp | public function setBp($bp)
{
$this->bp = $bp;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setValue ($value) {\n\t\t$this->_value = $value;\n\t}",
"function setPlace( &$value )\n {\n $this->Place = $value;\n }",
"function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}",
"function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}",
"public function setValue($value){\n $this->_value = $value;\n }",
"function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);"
]
| [
"0.61799836",
"0.6149069",
"0.6136377",
"0.6131183",
"0.6059759",
"0.5970114",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.59155583",
"0.5915305",
"0.5915305",
"0.5834921",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029",
"0.5826029"
]
| 0.7108403 | 0 |
Set the value of ville | public function setVille($ville)
{
$this->ville = $ville;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVille($valeur)\n {\n $this->ville = $valeur;\n }",
"public function setVida($valor){\n $this->vida=$valor;\n }",
"protected function setVida() {\n $this->vida = 200;\n }",
"public function setValue($v){\n $this->value = $v;\n }",
"public function setValor($valor)\n {\n $this->valor = $valor;\n }",
"public function setVille(?string $ville): self\n {\n $this->ville = $ville;\n\n return $this;\n }",
"public function setVille($ville)\n {\n $this->ville = $ville;\n\n return $this;\n }",
"public function setVille(?string $ville):self\n {\n $this->ville = $ville;\n\n return $this;\n }",
"public function getVille()\n {\n return $this->ville;\n }",
"public function setValeur($valeur)\n {\n $this->valeur = $this->recupValeur($valeur);\n }",
"public function setVoti(float $voto){\n if($voto>2 && $voto <= 10 ){\n \n $this->voti[] = $voto;\n \n } else {\n\n $messaggio = new Exception(\"Il valore $voto è errato\");\n throw $messaggio;\n\n }\n }",
"public function setVatIdNo($vatin);",
"public function setNerve($value)\n {\n $this->nerve = $value;\n }",
"public function setValorAttribute($value)\n {\n $this->attributes['valor'] = str_replace(\",\", \".\", str_replace(\".\", \"\", $value));\n }",
"function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }",
"public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}",
"function __set($name,$value){\r\n switch ($name){\r\n case 'gas': // daca aveam in loc de case, return numai trebuia sa pun break\r\n if(is_numeric($value)) $this->gas = $value;\r\n break; // la return nu se pune break!!\r\n case new Exception(\"Gas tre sa fie numeric\"); //arunca o eroare\r\n break;\r\n }\r\n }",
"public function getVille_idville()\r\n {\r\n return $this->ville_idville;\r\n }",
"function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}",
"public function set($n,$v)\n\t{\n\t\tif (isset($this->prefs[$n])) {\n\t\t\t$this->prefs[$n]['value'] = $v;\n\t\t}\n\t}",
"public function setVigour($value)\n {\n return $this->set(self::VIGOUR, $value);\n }",
"function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}",
"public function testSetNomVille() {\n\n $obj = new Collaborateurs();\n\n $obj->setNomVille(\"nomVille\");\n $this->assertEquals(\"nomVille\", $obj->getNomVille());\n }",
"function setValue($value) {\n $this->value = $value;\n }",
"public function setValorLancar($nValorLancar){\n $this->nValorLancar = $nValorLancar;\n }",
"public function testSetPrixVente() {\n\n $obj = new Collaborateurs();\n\n $obj->setPrixVente(10.092018);\n $this->assertEquals(10.092018, $obj->getPrixVente());\n }",
"function setNiveau($niveau) { $niveau = (int) $niveau;\r\n if ($niveau >= 1 && $niveau <= 100) {\r\n $this->_niveau = $niveau;\r\n }\r\n }",
"function __set($modelo, $valor)\n\t{\n\t\t$this->modelo = $modelo;\n\t}",
"function setNota_num($inota_num = '')\n {\n $this->inota_num = $inota_num;\n }",
"public function set($atributo, $valor) {\r\n\t\t\t $this->$atributo = $valor;\r\n\t\t}"
]
| [
"0.7607434",
"0.6543471",
"0.64467597",
"0.626502",
"0.61783457",
"0.6159194",
"0.6065006",
"0.602216",
"0.5956322",
"0.5891147",
"0.57661486",
"0.57028466",
"0.55879563",
"0.55873495",
"0.5540058",
"0.54986167",
"0.5491278",
"0.5480593",
"0.54791987",
"0.5475379",
"0.54606664",
"0.5414766",
"0.54010034",
"0.5377454",
"0.5369017",
"0.5368171",
"0.53157586",
"0.5307016",
"0.52938247",
"0.5285387"
]
| 0.6607578 | 1 |
Set the value of update_by | public function setUpdate_by($update_by)
{
$this->update_by = $update_by;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _setUpdatedBy($updatedBy) {\n\t\t$this->_updatedBy = $updatedBy;\n\t}",
"public function setBy($x) { $this->by = $x; }",
"public function updateBy( array $data, $value = NULL, $field = 'id' );",
"public function setUpdatedBy()\n {\n $userService = app()->make(AuthUserService::class);\n if ($userService->check()) {\n $this->{static::UPDATED_BY} = $userService->user()->id;\n }\n\n return $this;\n }",
"public function getUpdate_by($update_by=null)\n {\n if ($update_by != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE update_by = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$update_by]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->update_by;\n }\n \n }",
"public function setIdUpdate($idUpdate){\n $this->idUpdate=$idUpdate;\n }",
"public function _setUpdatedByAdmin($updatedByAdmin) {\n\t\t$this->_updatedByAdmin = $updatedByAdmin;\n\t}",
"public function setBy($by) {\n\t\t$this->attributes['by'] = $by;\n\t\t$this->by = $by;\n\t\treturn $this;\n\t}",
"public function forUpdate($set = TRUE);",
"public function setUpdatedBy(int $updatedBy)\n\t{\n\t\t$this->updatedBy = $updatedBy;\n\n\t\treturn $this;\n\t}",
"protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }",
"public function _getUpdatedBy() {\n\t\treturn $this->_updatedBy;\n\t}",
"public function getUpdateBy()\n {\n return $this->hasOne(User::className(), ['id' => 'updated_by']);\n }",
"public function getUpdatedBy()\n\t{\n\t\treturn $this->updatedBy;\n\t}",
"public function updating(Siswa $siswa)\n {\n $siswa->updated_by = \\Auth::user()->id;\n }",
"public function setUpdatedBy($updatedBy) {\n\t\t$this->_setUpdatedBy($updatedBy);\n\t\treturn $this;\n\t}",
"public function testUpdatedBy()\n {\n $updatedBy = new User();\n $event = (new Event())->setUpdatedBy($updatedBy);\n $this->assertEquals($updatedBy, $event->getUpdatedBy());\n }",
"protected static function updated_by(): mixed\n\t{\n\t\treturn self::$query->updated_by;\n\t}",
"public function setStateUpdate($update){\n $this->update=$update;\n }",
"private function SetModifiedBy(User $value = null)\n\t\t{\n\t\t\t$this->modifiedby = $value;\n\t\t}",
"public function setUpdate_at($update_at)\n {\n $this->update_at = $update_at;\n \n return $this;\n }",
"public function update() {\n\t\t$date = date(\"Y-m-d H:i:s\");\n\n\t\t$query=mysql_query(\"update \".$this->table.\" set \".$this->column.\" = '\".mysql_escape_string($this->value).\"', modified_by = \".$this->userID.\", modified='\".$date.\"' where id=\".$this->id);\n\n\t}",
"public function beforeUpdate()\n {\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"public function _update()\n {\n $this->updatedAt = new \\DateTime();\n }",
"public function setToUpdate()\n\t{\n\t\t$this->todo = 2 ;\n\t}",
"public function addUpdated()\n {\n try {\n $date = new DateTime();\n $this->updated_at = $date->format('Y-m-d H:i:s');\n $this->updated_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }",
"public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}",
"public function setLastUpdatedBy($userID);",
"public function updator()\n {\n return $this->belongsTo(User::class, 'updated_by');\n }",
"public function updator()\n {\n return $this->belongsTo(User::class, 'updated_by');\n }"
]
| [
"0.71269834",
"0.67451936",
"0.6626519",
"0.65955627",
"0.6535593",
"0.6336943",
"0.618899",
"0.61513186",
"0.60835236",
"0.6080476",
"0.60582566",
"0.60320497",
"0.6027964",
"0.60158443",
"0.6012018",
"0.5960064",
"0.58396405",
"0.5832077",
"0.5820128",
"0.5818278",
"0.578887",
"0.578287",
"0.57775515",
"0.57674795",
"0.5732216",
"0.57061297",
"0.56848013",
"0.5677074",
"0.5667012",
"0.5667012"
]
| 0.7710697 | 0 |
Lists all Genre entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$genres = $em->getRepository('SerieBundle:Genre')->findAll();
return $this->render('genre/index.html.twig', array(
'genres' => $genres,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n return GenreResource::collection(Genre::all());\n }",
"public function actionIndex()\n {\n $searchModel = new GenreSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function findAll() {\r\n $sql = \"select * from t_genre order by gen_id\";\r\n $result = $this->getDb()->fetchAll($sql);\r\n \r\n // Converts query result to an array of domain objects\r\n $genres = array();\r\n foreach ($result as $row) {\r\n $genreId = $row['gen_id'];\r\n $genres[$genreId] = $this->buildDomainObject($row);\r\n }\r\n return $genres;\r\n }",
"function getGenres(){\n $genres = $this->all('schema:genre');\n return $genres;\n }",
"public function findAllGenres()\n {\n $query = 'SELECT DISTINCT t.genre FROM ApiTracklistBundle:Track t ORDER BY t.genre';\n\n return $this->getEntityManager()\n ->createQuery($query)\n ->getResult();\n }",
"public function index()\n {\n return new GenreCollection(Genre::all()->sortBy('name'));\n }",
"public function indexAction() : array\n {\n $genres = $this->getDoctrine()->getRepository(Genre::class)->findAll();\n\n return ['genres' => $genres];\n }",
"public function findAll(){\r\n //requête à exécuter et comment il doit renvoyer les infos\r\n $sql = \"SELECT *\r\n FROM genre\";\r\n\r\n return self::getResults(\r\n self::select($sql, null, true),\r\n self::$className\r\n );\r\n }",
"public function index() {\n $genres = \\App\\Genre::get();\n return view('admin.genres.list', ['genres' => $genres]);\n }",
"public function getGenres()\n {\n $genres = Genre::orderBy('name','ASC')->get();\n\n return view('genres')->with('genres',$genres);\n }",
"public function getAll()\n {\n return \\App\\Movie::all()->load('genre');\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('GaleriasBundle:Galeria')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function index()\n {\n $genres = Genre::all();\n return view('genres', ['genres' => $genres]);\n }",
"public static function getAll() {\n $lesObjets = array();\n $requete = \"SELECT * FROM genre\";\n $stmt = Bdd::getPdo()->prepare($requete);\n $ok = $stmt->execute();\n if ($ok) {\n // Tant qu'il y a des enregistrements dans la table\n while ($enreg = $stmt->fetch(PDO::FETCH_ASSOC)) {\n //ajoute un nouveau genre au tableau\n $lesObjets[] = self::enregVersMetier($enreg);\n }\n }\n return $lesObjets;\n }",
"public function getListeGenre() {\n try {\n $lesGenres = DB::table('GENRE')\n ->Select('IDGENRE','LIBELLEGENRE')\n\n ->get();\n return $lesGenres;\n } catch (QueryException $e) {\n throw new MonException($e->getMessage());\n }\n }",
"public function getGenres()\n {\n $sql = \"select G.GEN_ID as id, GEN_NOM as nom, count(ALB_ID) AS nbAlbums \" .\n \"from T_GENRE G left join T_ALBUM A on G.GEN_ID=A.GEN_ID group by G.GEN_ID order by GEN_NOM\";\n return $this->executerRequete($sql);\n }",
"public function index()\n {\n $genres = Genre::with('books')\n ->paginate(20);\n\n return view('admin.genre.index', compact('genres'));\n }",
"public function getAllEntities();",
"public function getGenreList() {\n $data = $this->read();\n if(empty($data)){\n $error = $this->db->error();\n return false;\n }\n return $data;\n }",
"function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }",
"public function index() {\n return Jsend::success(Genre::all()->toArray());\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Glossary')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function get_genres()\n {\n return $this->db->get('tbl_genre')->result_array();\n }",
"public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }",
"public function index()\n {\n return view('genre.genre_index', [\n 'genres' => Genre::all()\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $gagnants = $em->getRepository('AppBundle:Gagnant')->findAll();\n\n return $this->render('gagnant/index.html.twig', array(\n 'gagnants' => $gagnants,\n ));\n }",
"public function index(){\n\n $genres = Genre::all();\n \n return view('home', compact('genre'));\n }",
"public static function liste(){\n\t\t\t$sql=\"SELECT * from Genre\";\n\t\t\t$res=DB::get_instance()->prepare($sql);\n\t\t\t$res->execute();\n\t\t\t// gérer les erreurs éventuelles\n\t\t\tif($res->rowCount()==0){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$p= $res->fetchAll();\n\t\t\treturn $p;\n\t\t\t\n\t\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $gardes = $em->getRepository('KidzyBundle:Garde')->findAll();\n\n return $this->render('@Kidzy/garde/index.html.twig', array(\n 'gardes' => $gardes,\n ));\n }",
"public function indexAction()\n {\n if (!$this->get('security.context')->isGranted('ROLE_ADMIN') ) {\n return $this->redirect($this->generateUrl('error'), 302); \n }\n $em = $this->getDoctrine()->getManager(); \n $entities = $em->getRepository('SytemSGBundle:Grupos')->findAll();\n\n return $this->render('SytemSGBundle:Grupos:index.html.twig', array(\n 'entities' => $entities,\n ));\n }"
]
| [
"0.70429295",
"0.70120436",
"0.6894314",
"0.6893458",
"0.68385917",
"0.67797714",
"0.67756814",
"0.66557527",
"0.65557504",
"0.6534678",
"0.6530369",
"0.64410657",
"0.6388792",
"0.6383442",
"0.6366813",
"0.6326284",
"0.6247234",
"0.6222564",
"0.6216516",
"0.6213483",
"0.6194185",
"0.61897683",
"0.61507666",
"0.61468893",
"0.61045",
"0.6079146",
"0.60236317",
"0.60080326",
"0.60068583",
"0.6003545"
]
| 0.70362043 | 1 |
Creates a form to delete a Genre entity. | private function createDeleteForm(Genre $genre)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('genre_delete', array('id' => $genre->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm(Reglement $reglement)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('reglement_delete', array('codeRegl' => $reglement->getCoderegl())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Recette $recette)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('recette_delete', array('id' => $recette->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('rubrique_delete', array('id' => $id)))\r\n// ->setMethod('DELETE')\r\n ->add('submit', SubmitType::class, array('label' => 'Supprimer la rubrique courante'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(voyageur $voyageur)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('voyageur_delete', array('id' => $voyageur->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Restricciones $restriccione)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('restricciones_delete', array('id' => $restriccione->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(GestionRetour $gestionRetour)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('retours_delete', array('id' => $gestionRetour->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Hogar $hogar)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('hogar_delete', array('id' => $hogar->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(livre $livre)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('livre_delete', array('id' => $livre->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Scenaristes $scenariste)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('scenaristes_delete', array('id' => $scenariste->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Releve $releve)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('releve_delete', array('id' => $releve->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Registro $registro)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('registro_delete', array('id' => $registro->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}",
"private function createDeleteForm(Gagnant $gagnant)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('gagnant_delete', array('id' => $gagnant->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Musicien $musicien)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('musicien_delete', array('codeMusicien' => $musicien->getCodemusicien())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(RendezVous $rendezVous)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('r_delete', array('id' => $rendezVous->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Garde $garde)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('garde_delete', array('idGarde' => $garde->getIdGarde())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Clasificaciontg $clasificaciontg)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('clasificaciontg_delete', array('id' => $clasificaciontg->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Plateformes $plateforme)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administration_plateformes_delete', array('id' => $plateforme->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(PsychEvalFreq $psychEvalFreq)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eval_freq_delete', array('id' => $psychEvalFreq->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Groupe $groupe)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('groupe_delete', array('id' => $groupe->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Covoiturage $covoiturage)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('personnel_covoiturage_delete', array('id' => $covoiturage->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('galerias_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(Nomenclature $nomenclature)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('nomenclature_delete', array('id' => $nomenclature->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('caracteristicasequipo_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Proprietaire $proprietaire) {\n return $this->createFormBuilder\n ->setAction($this->generateUrl('post_admin_delete', array('id' => $proprietaire->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function delete() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::delete(): Attempt to delete an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Delete the Article\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$st = $conn->prepare ( \"DELETE FROM :table WHERE id = :id LIMIT 1\" );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->execute();\r\n\t\t$conn = null;\r\n\t}",
"private function createDeleteForm($id,$idcupo)\n {\n\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('liquidaciones_delete', array('id' => $id,'idcupo'=>$idcupo)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete','attr' => array('class' => 'form-control')))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Groupe $groupe)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('groupe_delete', array('idGroup' => $groupe->getIdgroup())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(NatureOp $priorite)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('back_natureop_delete', array('id' => $priorite->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }"
]
| [
"0.69484854",
"0.686731",
"0.6823078",
"0.67485756",
"0.6739969",
"0.6655109",
"0.6602307",
"0.6596271",
"0.6556525",
"0.655565",
"0.6552498",
"0.65520245",
"0.6529108",
"0.65102917",
"0.650087",
"0.64991164",
"0.6472959",
"0.6464222",
"0.64621615",
"0.64598924",
"0.64330435",
"0.6418187",
"0.64090204",
"0.63664395",
"0.6359348",
"0.6350632",
"0.63371485",
"0.63363284",
"0.6331776",
"0.63262224"
]
| 0.7664629 | 0 |
Verifies the integrity of the items and files and cleans up expired items | public function cleanUp(): string
{
$warnings = '';
$files = [];
// verify validity of the items
foreach ($this->collection() as $itemName => $item) {
if ($item->isExpired()) {
// delete expired item and its file
$item->delete();
} else {
// item is not expired, verify if its file is still there
$file = $this->app->filePath($item->filename());
if (is_file($file)) {
// note the file path down for later
$files[] = $file;
} else {
$warnings .= sprintf(
'File "%s" for item "%s" does not exist' . "\n",
$file,
$itemName
);
}
}
}
// find orphaned files
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->app->filePath()));
foreach ($iterator as $file) {
// skip dotfiles like .gitignore
if (substr($file->getFilename(), 0, 1) === '.') {
continue;
}
// check if we encountered the file in any item before
if (!in_array($file->getPathname(), $files)) {
$warnings .= sprintf('File "%s" is orphaned' . "\n", $file->getPathname());
}
}
return $warnings;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteExpiredFiles(){\r\n $dir = $this->emailVerify->getDataFolder().self::FOLDER_PATH;\r\n foreach (glob($dir.\"*.token\") as $file) {\r\n $uF = unserialize(gzdecode(file_get_contents($file)));\r\n $tee = new TokenExpireEvent($this->emailVerify, $uF[\"token\"]);\r\n $this->emailVerify->getServer()->getPluginManager()->callEvent($tee);\r\n if (!$uF[\"valid\"] and filemtime($file) < time() - 60*60*24*7) {\r\n unlink($file);\r\n }\r\n }\r\n }",
"public function purgeAll() {\n\t\tset_time_limit(300);\n\t\t$this->load->model(\"filehandlerbase\");\n\t\t$fileList = $this->filehandlerbase->findDeletedItems();\n\t\t$mfa = $this->input->post(\"mfa\");\n\t\t$serial = $this->input->post(\"arn\");\n\n\t\t/**\n\t\t * we need to cache this because MFA is only good once\n\t\t */\n\t\t$lastUsedToken = null;\n\t\tforeach($fileList as $fileEntry) {\n\t\t\t$fileHandler = $this->filehandler_router->getHandlerForObject($fileEntry->getFileObjectId());\n\t\t\tif(!$fileHandler) { \n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$fileHandler->loadFromObject($fileEntry)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($lastUsedToken)) {\n\t\t\t\t$fileHandler->s3model->sessionToken = $lastUsedToken;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif(!$fileHandler->deleteSource($serial,$mfa)) {\n\t\t\t\t\t$this->logging->logError(\"purgeAll\",\"Could not delete asset with key\" . $fileEntry->getFileObjectId());\n\t\t\t\t}\n\t\t\t\t$lastUsedToken = $fileHandler->s3model->sessionToken;\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\techo $e;\n\t\t\t\techo \"Deletion fail\";\n\t\t\t}\n\n\t\t}\n\n\t\tinstance_redirect(\"/admin\");\n\t}",
"public function test_purge() {\n\t\t$purgedFilesInt = Cdnmd5::purge('-1 day');\n\t\t// ensure THIS file exists as a valid hash\n\t\t$this->assertEqual($this->testfile_js_hash, Cdnmd5::makeHash($this->testfile_js));\n\t\t$purgedFilesInt = Cdnmd5::purge('-1 day');\n\t\t$this->assertEqual(0, $purgedFilesInt);\n\t\t// remove THIS file as a valid hash\n\t\t@unlink(Cdnmd5::getConfigFile($this->testfile_js));\n\t\t$purgedFilesInt = Cdnmd5::purge('+1 day');\n\t\t// NOTE: this may not work, if this file was modified and uploaded in\n\t\t// less than 1 sec... (hash/modified timstampes will differ)\n\t\t// also there are a few hours timezone discrepancies...\n\t\t#$this->assertEqual(1, $purgedFilesInt);\n\t\t$this->assertTrue($purgedFilesInt > 0 && $purgedFilesInt < 10);\n\t\t// TODO: idea for better test, upload some \"trash\" files and ensure those are purged\n\t}",
"private function clean() {\n foreach (glob($this->dir . '/*') as $file) {\n $name = basename($file);\n if (!preg_match('/^\\d{10}/', $name))\n throw new \\Exception('Unexpected filename. Make sure \"' . $this->dir . '\" contains only build artefacts (and is thus safe to clean) and try again.');\n $deleted = unlink($file);\n if (!$deleted)\n throw new \\Exception('Failed to delete \"' . $file . '\". Make sure target directory is writable to allow delete of other users files.');\n }\n }",
"public function purgeInvalidatedArchives()\n { $store = new InvalidatedReports();\n $idSitesByYearMonth = $store->getSitesByYearMonthArchiveToPurge();\n foreach ($idSitesByYearMonth as $yearMonth => $idSites) {\n if(empty($idSites)) {\n continue;\n }\n\n $date = Date::factory(str_replace('_', '-', $yearMonth) . '-01');\n $numericTable = ArchiveTableCreator::getNumericTable($date);\n\n $archiveIds = $this->model->getInvalidatedArchiveIdsSafeToDelete($numericTable, $idSites);\n\n if (count($archiveIds) == 0) {\n continue;\n }\n $this->deleteArchiveIds($date, $archiveIds);\n\n $store->markSiteIdsHaveBeenPurged($idSites, $yearMonth);\n }\n }",
"public function deleteExpiredCache() {\n $this->logger->debug('Deleting of expired cache files');\n $list = glob($this->cacheFilePath . '*.cache');\n if (!$list) {\n $this->logger->info('No cache files were found skipping');\n return;\n }\n $this->logger->info('Found [' . count($list) . '] cache files to remove if expired');\n foreach ($list as $file) {\n $this->logger->debug('Processing the cache file [' . $file . ']');\n $data = $this->getCacheFileContent($file);\n if ($data === false) {\n $this->logger->warning('Can not get cache data for file [' . $file . ']');\n } else if (time() > $data['expire']) {\n $this->logger->info('The cache data for file [' . $file . '] already expired remove it');\n unlink($file);\n } else {\n $this->logger->info('The cache data for file [' . $file . '] not yet expired skip it');\n }\n }\n }",
"function flush(){\n $path = $this->cachePath .'/'. $this->prefix .'*';\n $files = glob($path);\n $rm_total = 0;\n if (is_array($files) && !empty($files)){\n foreach($files as $file){\n $fp = fopen($file, \"r\");\n $meta = $this->_readMeta($fp);\n if ($meta['expired']!=0 && $meta['expired']<time()){\n fclose($fp);\n unlink($file);\n ++$rm_total;\n }\n }\n }\n return $rm_total;\n }",
"public function cleanFiles()\n { \n $this->zip();\n // $this->unzip();\n\n if (!empty($this->files)) {\n foreach ($files as $file) {\n $this->clean($file);\n }\n }\n }",
"public function deleteExpiredLogs()\n {\n $client = $this->createLocalStorageDriver();\n\n $allFiles = $client->files();\n\n foreach ($allFiles as $file) {\n $fileDate = new DateTime(str_replace('.json', '', $file));\n\n $currentDate = new DateTime(date('d-m-Y'));\n\n $interval = $fileDate->diff($currentDate);\n\n if ($interval->days > $this->expireDays) {\n $client->delete($file);\n }\n }\n }",
"public function testExpireTrashByRetentionAndSpace() {\n\t\t// create some files\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file1.txt', 'file1');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file2.txt', 'file2');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file3.txt', 'file3');\n\n\t\t// delete them so that they end up in the trash bin\n\t\t\\OC\\Files\\Filesystem::unlink('file1.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file2.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file3.txt');\n\n\t\t//make sure that files are in the trash bin\n\t\t$filesInTrash = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(3, $filesInTrash);\n\n\t\t// simulate as 1 out of 3 files expired\n\t\t$this->expiration->expects($this->exactly(3))\n\t\t\t->method('isExpired')\n\t\t\t->willReturnOnConsecutiveCalls(\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t\t// in this case we are over quota, so true will be returned\n\t\t\t\t// even though file expiration date is ok\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t// simulate as only 2 files need to be cleaned to satisfy quota\n\t\t$this->quota->expects($this->exactly(1))\n\t\t\t->method('calculateFreeSpace')\n\t\t\t->willReturn(-8);\n\n\t\t// call expire by retention\n\t\t$this->trashExpiryManager->expireTrash(self::TEST_TRASHBIN_USER1);\n\n\t\t$remainingFiles = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(1, $remainingFiles);\n\n\t\t$this->assertEquals(\n\t\t\t\\array_slice($filesInTrash, 2),\n\t\t\t$remainingFiles\n\t\t);\n\t}",
"private function checkFileUpdates() {\n\n if ($this->request->params['controller'] != 'acos' || ($this->request->params['action'] != 'admin_synchronize' && $this->request->params['action'] != 'admin_prune_acos' && $this->request->params['action'] != 'admin_build_acl')) {\n if ($this->AclManager->isControllerHashFileOutOfSync()) {\n $missingAcoNodes = $this->AclManager->getMissingAcos();\n $nodesToPrune = $this->AclManager->getAcosToPrune();\n\n $hasUpdates = false;\n\n if (count($missingAcoNodes) > 0) {\n $hasUpdates = true;\n }\n\n if (count($nodesToPrune) > 0) {\n $hasUpdates = true;\n }\n\n $this->set('nodesToPrune', $nodesToPrune);\n $this->set('missingAcoNodes', $missingAcoNodes);\n\n if ($hasUpdates) {\n $this->render('Acl.Acos/admin_has_updates');\n $this->response->send();\n $this->AclManager->updateControllerHashFile();\n exit();\n } else {\n $this->AclManager->updateControllerHashFile();\n }\n \t\t\n \t\t$this->AclManager->update_controllers_hash_file();\n }\n }\n }",
"public function clean_expired_keys()\n {\n }",
"public function cleanContrexxCaching()\n {\n $this->_deleteAllFiles();\n }",
"public function actionClean() {\n $deletedArr=[];\n $errorArr=[];\n foreach(Finder::find('*')->in(CACHE_DIRECTORY) as $file=>$info){\n try{\n FileSystem::delete($file);\n $deletedArr[]=$file;\n }catch (\\Exception $e){\n $errorArr[]=$file;\n }\n }\n $response=[\n 'state'=>(empty($errorArr)?'OK':'error'),\n 'deleted'=>$deletedArr,\n 'errors'=>$errorArr\n ];\n $this->sendJson($response);\n }",
"protected function tidyUpFiles() {\n\t\t/* load valid ids */\n\t\t$validIds = array();\n\t\t$result = $this->db->query('SELECT id FROM image');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$validIds[] = $entry[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* remove entries with missing file */\n\t\tforeach ($validIds as $id) {\n\t\t\tif (!is_file(self::getPath($id))) {\n\t\t\t\t$this->delete($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* delete from list what is not in the database */\n\t\tif ($dh = opendir(self::FILES_DIR)) {\n\t\t\twhile (($id = readdir($dh)) !== false) {\n\t\t\t\tif (preg_match('#^[0-9a-zA-Z]+$#', $id) && !in_array($id, $validIds) && $id != self::DATABASE_FILE) {\n\t\t\t\t\t$this->delete($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}",
"public static function invalidate() {\n if (is_dir(self::$fileBased))\n {\n $dir = opendir(self::$fileBased);\n while ($file = readdir($dir)) {\n @unlink(YPFramework::getFileName(self::$fileBased, $file));\n }\n }\n }",
"public function cleanup() {\n $dirIt = new DirectoryIterator($this->path);\n // Convert days to seconds\n $lifetimeSeconds = self::$lifetime * 3600 * 24;\n /** @var DirectoryIterator $fileInfo */\n foreach ($dirIt as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n $fileAge = time() - $fileInfo->getMTime();\n if ($fileAge > $lifetimeSeconds) {\n $this->deleteFile();\n }\n }\n }",
"public function testExpireTrashByRetention() {\n\t\t// create some files\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file1.txt', 'file1');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file2.txt', 'file2');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file3.txt', 'file3');\n\n\t\t// delete them so that they end up in the trash bin\n\t\t\\OC\\Files\\Filesystem::unlink('file1.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file2.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file3.txt');\n\n\t\t//make sure that files are in the trash bin\n\t\t$filesInTrash = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(3, $filesInTrash);\n\n\t\t// simulate as 1 out of 3 files expired,\n\t\t// and next 2 do not need expiration\n\t\t$this->expiration->expects($this->exactly(2))\n\t\t\t->method('isExpired')\n\t\t\t->willReturnOnConsecutiveCalls(\n\t\t\t\ttrue,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t// call expire by retention\n\t\t$this->trashExpiryManager->expireTrashByRetention(self::TEST_TRASHBIN_USER1);\n\n\t\t$remainingFiles = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(2, $remainingFiles);\n\n\t\t$this->assertEquals(\n\t\t\t\\array_slice($filesInTrash, 1),\n\t\t\t$remainingFiles\n\t\t);\n\t}",
"function CleanupTickets(){\n\t\t\n\t\tglobal $mainframe;\n\t\t\n\t\t$db = JFactory::getDBO();\n\n\t\t## Create a new date NOW()-1h. (database session is not longer than 2 hours in global config.\n\t\t$cleanup = date('Y-m-d H:i:s', mktime(date('H')-1, date('i'), date('s'), date('m'), date('d'), date('Y')));\n\n\t\t## Pickup the items that will be deleted. We need to update the ticketcounter.\n\t\t## First getting the selected item in an object.\n\t\t$update = 'SELECT ticketid \n\t\t\t\t FROM #__ticketmaster_orders \n\t\t\t\t WHERE orderdate < \"'.$cleanup.'\" AND userid = 0';\n\t\n\t\t\n\t\t$db->setQuery($update);\n\t\t$this->data = $db->loadObjectList();\t\n\t\t\n\t\t$count = count($this->data);\n\t\t\n\t\tif ($count < 1){\n\t\t\texit();\n\t\t}\t\t\n\t\t\n\t\t## Now go on with the delete functions. All expired orders have been saved.\n\t\t$query = 'DELETE FROM #__ticketmaster_orders WHERE orderdate < \"'.$cleanup.'\" AND userid = 0';\n\t\t\n\t\t## Do the query now\tand delete all selected invoices.\n\t\t$db->setQuery( $query );\n\t\t\n\t\t## When query goes wrong.. Show message with error.\n\t\tif (!$db->query()) {\n\t\t\t$this->setError($db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\t\n\n\t\t## Tickets have been removed successfull\n\t\t## Now we need to update the totals from the Object earlier this script.\n\t\t$k = 0;\n\t\tfor ($i = 0, $n = count($this->data); $i < $n; $i++ ){\n\t\t\n\t\t\t$row = &$this->data[$i];\n\t\t\t\n\t\t\t## Update the tickets-totals that where removed.\n\t\t\t$query = 'UPDATE #__ticketmaster_tickets'\n\t\t\t\t. ' SET totaltickets = totaltickets+1'\n\t\t\t\t. ' WHERE ticketid = '.$row->ticketid.' ';\n\t\t\t\n\t\t\t## Do the query now\t\n\t\t\t$db->setQuery( $query );\n\t\t\t\n\t\t\t## When query goes wrong.. Show message with error.\n\t\t\tif (!$db->query()) {\n\t\t\t\t$this->setError($db->getErrorMsg());\n\t\t\t\treturn false;\n\t\t\t}\t\t\n\t\t\t\n\t\t$k=1 - $k;\n\t\t}\t\t\t\n\t\n\t}",
"private function purgefiles()\n\t{\n\t\t$params=JComponentHelper::getParams('com_jbolo');\n\t\t$uploaddir=JPATH_COMPONENT.DS.'uploads';\n\t\t$exp_file_time=3600*24*$params->get('purge_days');\n\t\t$currts=time();\n\t\techo \"<div class='alert alert-success'>\".\n\t\tJText::_('COM_JBOLO_PURGE_OLD_FILES');\n\t\t/*\n\t\t * JFolder::files($path,$filter,$recurse=false,$full=false,$exclude=array('.svn'),$excludefilter=array('^\\..*'))\n\t\t*/\n\t\t$current_files=JFolder::files($uploaddir,'',1,true,array('index.html'));\n\t\t//print_r($current_files);die;\n\t\tforeach($current_files as $file)\n\t\t{\n\t\t\tif( $file != \"..\" && $file != \".\" )\n\t\t\t{\n\t\t\t\t$diffts=$currts-filemtime($file);\n\t\t\t\tif($diffts > $exp_file_time )\n\t\t\t\t{\n\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_DELETING_FILE').$file;\n\t\t\t\t\tif(!JFile::delete($file)){\n\t\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_ERROR_DELETING_FILE').'-'.$file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</div>\";\n\t}",
"public function apply() {\r\n chdir(APP_PATH . '/tmp/');\r\n\r\n //Get the files whose name begins from 'vdumes_', these files are VDUMES should be updated. If they begins from 'wwoffice_', they mean used by WWOffice.\r\n $array = glob(\"vdumes_*.txt\");\r\n $count = count($array);\r\n\r\n if ($count == 0) {\r\n exit();\r\n }\r\n\r\n //cycle each file for update\r\n foreach ($array as $val) {\r\n //The files's content seperated by semicolon, from left to right is domain,address,quota.\r\n $str = file_get_contents(APP_PATH . '/tmp/' . $val);\r\n $arr = explode(';', $str);\r\n\r\n //The update data\r\n $arr[] = array(\r\n 'quota' => $arr[2]\r\n );\r\n\r\n //The condition for update\r\n $conditions = array(\r\n 'username' => $arr[1],\r\n );\r\n $mx = spClass('lib_mailbox');\r\n $bl = $mx->update($conditions, $arr);\r\n\r\n //Get the affected rows.\r\n $rows = $mx->affectedRows();\r\n\r\n //If the affected rows equal -1, it means update failure, otherwise it means success.\r\n if ($rows == -1) {\r\n $this->spArgs('msg') = 'Update quota failure.';\r\n $this->writelog();\r\n } else {\r\n //If update success, then delete the txt file. If it failed, jump the error message then jump to the index page of mailbox controller.\r\n if (!unlink($val)) {\r\n $this->spArgs('msg') = 'The file is failed by deleting.';\r\n $this->writelog();\r\n }\r\n return TRUE;\r\n }\r\n }\r\n }",
"function deleteOldInvs() {\n\tif ($handle = opendir('./')) {\n\t\twhile (false !== ($file = readdir($handle))) { \n\t\t\t$ext = substr($file, -3);\n\t\t\tif ($ext != 'inv')\n\t\t\t\tcontinue;\n\t\t\tif((time() - filemtime($file)) > 86400)\n\t\t\t\tunlink($file);\n\n\t\t}\n\t\tclosedir($handle); \n\t}\n}",
"public function purgeAction()\n\t{\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\t$dirFiles = $this->bucket->ListFiles($this->generateUploadDir(), true);\n\n\t\t\t$now = new \\DateTime('now');\n\t\t\tforeach ($dirFiles['file'] as $fileName)\n\t\t\t{\n\t\t\t\tif (preg_match('/^([^_]+)_([0-9]{8})_([^_]+)_.+$/i', $fileName, $parts))\n\t\t\t\t{\n\t\t\t\t\t//$type = $parts[1];\n\t\t\t\t\t//$hash = $parts[3];\n\t\t\t\t\t$date = \\DateTime::createFromFormat('Ymd', $parts[2]);\n\t\t\t\t\t$interval = $now->diff($date);\n\t\t\t\t\tif ($interval->d > self::EXPIRE_DAYS)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->bucket->DeleteFile($this->generateUploadDir(). $fileName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->finishAction();\n\t}",
"private function gc()\n\t{\n\t\tif ($handle = opendir(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/'))\n\t\t{ \n\t\t\t$dir_array = array(); \n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{ \n\t\t\t\tif ($file != '.' AND $file != '..')\n\t\t\t\t{\n\t\t\t\t\tif (file_exists(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lastmod = @filemtime(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file);\n\t\t\t\t\t\tif (($lastmod + ($this->ttl)) < time())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t@unlink(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file);\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\tclosedir($handle);\n\t\t}\n\t}",
"public function actionPurgeExpiredTokens()\n {\n $now = Carbon::now();\n\n $this->cleanUpExpiredTokens($now);\n\n $this->cleanUpExpiredAuthorizationCodes($now);\n }",
"function clean(){\n global $wpdb;\n global $DOPBSP;\n \n $wpdb->query('DELETE FROM '.$DOPBSP->tables->reservations. ' WHERE token <> \"\" AND ((check_out < \"'.date('Y-m-d').'\" AND check_out <> \"\") OR (check_in < \"'.date('Y-m-d').'\" AND check_out = \"\"))');\n $wpdb->query('UPDATE '.$DOPBSP->tables->reservations.' SET status=\"expired\" WHERE status <> \"expired\" AND ((check_out < \"'.date('Y-m-d').'\" AND check_out <> \"\") OR (check_in < \"'.date('Y-m-d').'\" AND check_out = \"\"))');\n }",
"public static function maintain() {\n// self::maintainItem($item, $fields);\n\n $db = JFactory::getDBO();\n\n $query = '\n SELECT DISTINCT v.fieldid, v.itemid\n FROM #__k2_extra_fields_values AS v,\n (\n SELECT DISTINCT vv.itemid, vv.fieldid\n FROM #__k2_extra_fields_values AS vv, #__k2_extra_fields_definition vf\n WHERE\n vv.itemid NOT IN (SELECT id FROM #__k2_items) AND\n vv.fieldid = vf.id AND\n vf.definition LIKE \"%valid=media%\" AND\n vv.partindex = 0 AND\n vv.value = \"upload\"\n ) AS f\n WHERE v.itemid = f.itemid AND v.fieldid = f.fieldid AND v.partindex = ' . (K2FieldsMedia::SRCPOS - 1);\n\n $db->setQuery($query);\n $entries = $db->loadObjectList();\n\n if (!empty($entries)) {\n $_entries = array();\n\n foreach ($entries as $entry) {\n if (!isset($_entries[$entry->fieldid])) $_entries[$entry->fieldid] = array();\n\n $_entries[$entry->fieldid][] = $entry->itemid;\n }\n\n $model = K2Model::getInstance('fields', 'K2FieldsModel');\n $fields = $model->getFieldsById(array_keys($_entries));\n\n foreach ($fields as $fieldid => $field) {\n $items = $_entries[$fieldid];\n\n foreach ($items as $item) {\n $dir = self::getStorageDirectory($field, $item);\n $thumbdir = K2FieldsModelFields::setting('thumbfolder', $field);\n\n if (JFolder::exists($dir.'/'.$thumbdir)) JFolder::delete($dir.'/'.$thumbdir);\n\n if (JFolder::exists($dir)) JFolder::delete($dir);\n }\n }\n }\n }",
"public static function cleanCache()\n {\n $tempDir = sys_get_temp_dir() . \"/\";\n $filePointer = fopen(\n $tempDir . \"giftpromo_cleancache.lock\",\n \"w+\"\n );\n try {\n if (flock(\n $filePointer,\n LOCK_EX | LOCK_NB\n )) {\n // clear out any stale cache entries\n $useCache = Mage::app()->useCache('giftpromo_product_valid');\n if ($useCache) {\n $cacheModel = Mage::app()->getCache();\n // clear out any old cache for this.\n /** @noinspection PhpUndefinedMethodInspection */\n self::getHelper()->debug(\"Giftpromo - clean cache cron\");\n $cacheModel->clean(\n Zend_Cache::CLEANING_MODE_OLD,\n array('GIFTPROMO_PRODUCT_VALID')\n );\n }\n flock(\n $filePointer,\n LOCK_UN\n );\n unlink($tempDir . \"giftpromo_cleancache.lock\");\n } else {\n self::getHelper()->debug(\n \"Could not execute cron for clean cache - file lock '{$filePointer}' is in place, job may be running.\"\n );\n }\n } catch (Exception $e) {\n flock(\n $filePointer,\n LOCK_UN\n );\n unlink($tempDir . \"giftpromo_cleancache.lock\");\n mage::logException($e);\n self::getHelper()->debug($e->getMessage());\n mage::throwException($e->getMessage());\n }\n }",
"public function clean() {\n $this->logger->debug('Deleting of all cache files');\n $list = glob($this->cacheFilePath . '*.cache');\n if (!$list) {\n $this->logger->info('No cache files were found skipping');\n return;\n }\n $this->logger->info('Found [' . count($list) . '] cache files to remove');\n foreach ($list as $file) {\n $this->logger->debug('Processing the cache file [' . $file . ']');\n unlink($file);\n }\n }",
"public function cleanRepair() {}"
]
| [
"0.6432089",
"0.6081106",
"0.587504",
"0.58073884",
"0.58016634",
"0.5795249",
"0.579096",
"0.577308",
"0.57053995",
"0.56975317",
"0.56790584",
"0.5670454",
"0.56674725",
"0.56099015",
"0.5606711",
"0.5599495",
"0.5563707",
"0.5554562",
"0.55514324",
"0.5541887",
"0.5532494",
"0.5506106",
"0.5471444",
"0.5463424",
"0.54521936",
"0.5449211",
"0.5445398",
"0.5434512",
"0.54219747",
"0.540097"
]
| 0.62844634 | 1 |
empty function in order to avoid Fatal error: Cannot redeclare class SPF\deployment\Lock | function lock()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function lock(): void;",
"public function lock() {}",
"public function lock(): void {}",
"public function lock(): void {}",
"public function lock(): void {}",
"public function lock(): void {}",
"public function lock(): void {}",
"protected function hashLockClause() {}",
"public function lockToNormal() {}",
"public function lock(): void;",
"protected static function defaultLockVersion()\n {\n return 1;\n }",
"public function trylock() {}",
"public function getMaintenanceLock()\r\n {\r\n return $this->_loadClass('lockFile', true, array(GEMS_ROOT_DIR . '/var/settings/lock.txt'));\r\n }",
"private function createLock($key) {\n // but we'll ignore that out of convenience\n @apc_add($key . '.lock', '', 5);\n }",
"protected function ipLockClause() {}",
"private function createLock($key) {\n // but we'll ignore that out of convenience\n @apc_add ( $key . '.lock', '', 5 );\n }",
"public function writeunlock() {}",
"public function __construct() {\n\t\t$lockPath = $this->getLockPath();\n\t\t$this->lockPathAndFilename = $lockPath . md5(FLOW_PATH_ROOT) . '_Flow.lock';\n\t\t$this->lockFlagPathAndFilename = $lockPath . md5(FLOW_PATH_ROOT) . '_FlowIsLocked';\n\t\t$this->removeExpiredLock();\n\t}",
"protected function get__locked()\n\t{\n\t\treturn NULL;\n\t}",
"public function readunlock() {}",
"function free_lock(string $key): void\n{\n $logger = \\Logger::getLogger(\"files.lock\");\n $lockfn = get_lock_filename($key);\n $logger->debug(\"Free lock '$key'\");\n if (!unlink($lockfn)) {\n $logger->error(\"Error unlocking $key\");\n }\n}",
"function cera_grimlock_single() {\n\t\tdo_action( 'grimlock_single' );\n\t}",
"function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }",
"function lock(string $key): void;",
"public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}",
"public function lock()\n {\n $this->locked = true;\n }",
"public function lock(string $name): void;",
"function claim_lock(string $key): void\n{\n $logger = \\Logger::getLogger(\"files.lock\");\n $lockfn = get_lock_filename($key);\n $logger->debug(\"Claim lock: '$lockfn'\");\n if (!file_exists($lockfn)) {\n $logger->error(\"Lock file missing: $lockfn\");\n die();\n }\n $pid = file_get_contents($lockfn);\n if ($pid) {\n $logger->error(\"Lock file already claimed: $lockfn $pid\");\n die();\n }\n file_put_contents($lockfn, getmypid());\n}",
"public function lock()\n {\n $this->isLocked = true;\n }",
"public function handle_override_changeset_lock_request()\n {\n }"
]
| [
"0.69460756",
"0.6747951",
"0.673069",
"0.673069",
"0.673069",
"0.673069",
"0.673069",
"0.66911846",
"0.6621509",
"0.65507424",
"0.65036345",
"0.63380384",
"0.6212664",
"0.61554587",
"0.6136137",
"0.60556024",
"0.60331434",
"0.5976369",
"0.59563076",
"0.5946219",
"0.5936445",
"0.59345603",
"0.59219635",
"0.5917403",
"0.5906063",
"0.58830476",
"0.5879897",
"0.587625",
"0.58597606",
"0.5842568"
]
| 0.6970383 | 0 |
Write a function which takes any string as input, and returns it's reverse. For example, | public function reverseString( $string ) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function solution($str) {\n return strrev($str);\n}",
"function reverseString(&$str) {\n\t$str = strrev($str);\n}",
"function reverse($string)\n{\n $r = strlen($string);\n if($r == 1)\n {\n return $string;\n }\n else\n {\n $n--;\n return reverse(substr($string,1, $r)) . substr($string, 0, 1);\n }\n}",
"public function reverse();",
"public function reverse();",
"public function reverse();",
"public function reverse();",
"public function reversed();",
"function reverseStr(&$str) \n{ \n $n = strlen($str); \n \n // Swap character starting \n // from two corners \n for ($i = 0; $i < $n / 2; $i++) \n //swap the string \n list($str[$i], $str[$n - $i - 1]) = array($str[$n - $i - 1], $str[$i]); \n}",
"public function reverse() {}",
"public function reverse()\n {\n $reversed = UTF8::strrev($this->str);\n\n return static::create($reversed, $this->encoding);\n }",
"function reverseThisRek(string $string)\n {\n if(strlen($string) > 1)\n {\n return substr($string, -1) . reverseThisRek(substr($string, 0, -1));\n }\n return $string;\n }",
"function reverseThisIter(string $string)\n {\n $stringArray = str_split($string);\n $length = count($stringArray);\n \n for($i = 0; $i < $length; $i++)\n {\n $newString[] = array_pop($stringArray);\n }\n \n $string = implode(\"\", $newString);\n \n return $string;\n }",
"function utf8_strrev($str){\n preg_match_all('/./us', $str, $ar);\n return join('',array_reverse($ar[0]));\n}",
"public function reverse() {\n $str = Input::get ( 'value' );\n $task = new My_task;\n $result = $task->reverse($str);\n return $result;\n }",
"function reverseWords(String $str) : String {\n\n $rev = strrev(preg_replace('/[^a-zA-Z *]/','', strtolower($str)));\n $strx = array_reverse(explode(' ',$rev));\n return implode(' ',$strx);\n\n}",
"function reverse()\n {\n }",
"function reverse($object);",
"public function reverseString($str) {\r\n if (!$str) {\r\n return '';\r\n }\r\n $length = strlen($str);\r\n $reversedString = '';\r\n // Loop to reverse the given string/number\r\n for ($i = $length - 1; $i >= 0; $i--) {\r\n $reversedString .= $str{$i};\r\n }\r\n return $reversedString;\r\n }",
"function palindrome($input){\n $trimed = strtolower(preg_replace('/\\W/', '', $input.\"\"));\n //if the string is a palindrome it must evaluate true when compared to itself reversed\n return strcmp($trimed,strrev($trimed))==0?\"True\":\"False\";\n \n}",
"function isPalindrome($string) {\n return (strlen($string) > 1 && $string === strrev($string));\n}",
"public function reverse() : Str\n {\n $this->string = strrev($this->string);\n return $this;\n }",
"public function reverseTransform($str)\n {\n return parent::reverseTransform(substr($str, 4));\n }",
"function palindromChecker($string)\n{\n\t$stringArray = str_split($string, 1);\n\t$newArray = [];\n\tfor ($i = count($stringArray) - 1; $i > -1; $i--) {\n\t\tarray_push($newArray, $stringArray[$i]);\n\t}\n\t$reverseWord = implode('', $newArray);\n\tif ($string == $reverseWord) {\n\t\techo 'The word is palindrome';\n\t} else {\n\t\techo 'The word is not palindrome';\n\t}\n}",
"protected function reverseWord(string $word): string\n {\n return strrev($word);\n }",
"function MyMod_Sort_Reverse_Get($reverse=\"\")\n {\n $reverse=$this->Reverse;\n if ($reverse==\"\")\n {\n $value=$this->CGI_GETint($this->ModuleName.\"_Reversed\");\n \n if (!empty($value))\n {\n $reverse=$value;\n }\n else\n {\n $reverse=0;\n }\n }\n\n return $reverse;\n }",
"function palindrome($letter) \n{\n if ($letter == strrev($letter))\n return 1;\n else\n\t return 0;\n}",
"public function reverse($value) {\n return $this->setProperty('reverse', $value);\n }",
"public function reverse($value) {\n return $this->setProperty('reverse', $value);\n }",
"public function GetReverseParams ();"
]
| [
"0.7737465",
"0.7521762",
"0.75001484",
"0.7224193",
"0.7224193",
"0.7224193",
"0.7224193",
"0.707716",
"0.7007522",
"0.6929951",
"0.69180924",
"0.68492144",
"0.67312324",
"0.6600258",
"0.65217924",
"0.6451435",
"0.63529676",
"0.6351132",
"0.6301745",
"0.6197365",
"0.61238897",
"0.6093211",
"0.60381913",
"0.59428906",
"0.5829192",
"0.58196354",
"0.5808442",
"0.5696209",
"0.5696209",
"0.56893396"
]
| 0.80795825 | 0 |
Write a function which returns the longest word in the first paragraph of the Ghettysburg Address (provided in Questions::GHETTYSBURG_ADDRESS below. | public function findLongestWord() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLongestWord($sentence) {\n\t\t$words = explode(' ', $sentence);\n\n\t\t$longestWord = '';\n\n\t\t$nbWords = count($words);\n\n\t\tif($nbWords > 0) {\n\t\t\t$longestWord = $words[0];\n\t\t}\n\n\t\tfor($i = 0; $i < $nbWords; $i++) {\n\t\t\tif(strlen($words[$i]) > strlen($longestWord)) {\n\t\t\t\t$longestWord = $words[$i];\n\t\t\t}\n\t\t}\n\t\treturn $longestWord;\n\t}",
"public function wordLength(){\n\n\t\t\t\t\n\t\t\t\t$array = explode(' ',$this->sentence);\n\t\t\t\t$Length = strlen($array[0]);\n\t\t\t\t$shortestWord=NULL;\n\n\t\t\t\tforeach ($array as $word) {\n \t\t\t\t\tif (strlen($word) < $Length) {\n \t\t\t\t\t $Length = strlen($word);\n \t\t\t \t\t $shortestWord = $word;\n \t\t\t\t }\n\t\t\t\t}\n\t\t\t\techo $shortestWord;\n\n\t\t\t}",
"function wpe_excerptlength_homelatest($length) {\n return 13;\n}",
"function acoc_max_charlength($charlength, $text = NULL) {\n\tif ($text) {\n\t\t$excerpt = $text;\n\t} else {\n\t\t$excerpt = get_the_excerpt();\n\t}\n\n\t$charlength++;\n\tif (strlen($excerpt)>$charlength) {\n\t\t$subex = substr($excerpt,0,$charlength-5);\n $exwords = explode(\" \",$subex);\n\t\t$excut = -(strlen($exwords[count($exwords)-1]));\n\t\tif ($excut<0) {\n\t\t\treturn substr($subex,0,$excut);\n\t\t} else {\n\t\t\treturn $subex;\n\t\t}\n\t\treturn '..';\n\t} else {\n\t\treturn $excerpt;\n\t}\n}",
"function the_excerpt_max_charlength($charlength) {\n $excerpt = get_the_excerpt();\n $charlength++;\n if(strlen($excerpt)>$charlength) {\n $subex = substr($excerpt,0,$charlength-5);\n $exwords = explode(\" \",$subex);\n $excut = -(strlen($exwords[count($exwords)-1]));\n if($excut<0) {\n echo substr($subex,0,$excut);\n } else {\n \t echo $subex;\n }\n echo ' <a href=\"'.get_permalink().'\"> Read more ...</a>';\n } else {\n\t echo $excerpt;\n }\n}",
"static function last_word($sentence){\n if(!isset($sentence)){\n $result = '0';\n }else{\n $all_word=explode(\" \", $sentence);\n $last_word=$all_word[count(explode(\" \", $sentence))-1];\n $result = strlen($last_word);\n\n }\n return $result;\n }",
"function anteprima($txt, $lung_max) {\n\n return (count($words = explode(' ', $txt)) > $lung_max) ? implode(' ', array_slice($words, 0, $lung_max)) . \"...\" : $txt;\n\n}",
"public static function longestString($array) {\r\n\t$i = 0;\r\n\t\r\n\tforeach ($array as $value) {\t\r\n\t\tif (strlen($value) > $i) {\t\r\n\t\t\t$i = strlen($value);\r\n\t\t}\t\t\t\r\n\t}\r\n\t\r\n\treturn $i;\r\n}",
"function lengthOfLastWord($str)\n{\n if (strlen($str)==0) {\n return;\n }\n $arr = explode(\" \", $str);\n $result = array_diff($arr, array(''));\n $result = strlen($result[count($result)-1]);\n return $result;\n}",
"function tronquer_texte($texte, $longeur_max)\n{\n if (strlen($texte) > $longeur_max)\n {\n $texte = substr($texte, 0, $longeur_max);\n $dernier_espace = strrpos($texte, \"\");\n $texte = substr($texte, 0, $dernier_espace).\"...\";\n }\n return $texte;\n}",
"function limit_content($title,$len) {\n if (str_word_count($title) > $len) {\n $keys = array_keys(str_word_count($title, 2));\n $title = substr($title, 0, $keys[$len]);\n }\n return $title;\n}",
"function rls_text_excerpt($length) {\n return 25;\n}",
"function tz_excerpt_length($length) {\nreturn 55; }",
"public function getMaxLength();",
"function getLittleDescription($texte, $nbchar = 20)\n{\nreturn (strlen($texte) > $nbchar ? substr(substr($texte,0,$nbchar),0,strrpos(substr($texte,0,$nbchar),\" \")).\"...\" : $texte);\n}",
"function shapeSpace_truncate_string($phrase, $max_words) {\n\t\n\t$phrase_array = explode(' ', $phrase);\n\t\n\tif (count($phrase_array) > $max_words && $max_words > 0) \n\t\t$phrase = implode(' ', array_slice($phrase_array, 0, $max_words)) . __('...', 'shapespace');\n\t\n\treturn $phrase;\n\t\n}",
"public function getLastWord()\n {\n return $this->lastword;\n }",
"function trimWordLen($str, $max) {\n $str = cleanSpaces($str);\n $lines = explode(\"\\n\", $str);\n $ss = \"\";\n foreach ($lines as $i => $line) {\n $words = explode(\" \", $line);\n foreach ($words as $j => $w)\n $ss.=trimWord($w, $max) . \" \";\n $ss.=\"\\n\";\n }\n return cleanSpaces($ss);\n}",
"function longExplanation($text) {\n $students = \"Information for students and parents that are currently a part of the team or are interested in joining.\";\n if ($text == \"STUDENTS\") {\n return $students;\n }\n}",
"function adr_link_length($link, $max)\n{\n\tif (strlen($link) > $max)\n\t\t$newlink = substr($link, 0, ($max - 3)) .'...';\n\telse\n\t\t$newlink = $link;\nreturn $newlink;\n}",
"function atSubstrwords($text, $maxchar, $end = '...')\n{\n if (strlen($text) > $maxchar || $text == '') {\n $words = preg_split('/\\s/', $text);\n $output = '';\n $i = 0;\n while (1) {\n $length = strlen($output) + strlen($words[$i]);\n if ($length > $maxchar) {\n break;\n } else {\n $output .= \" \" . $words[$i];\n ++$i;\n }\n }\n $output .= $end;\n } else {\n $output = $text;\n }\n return $output;\n}",
"function substrwords($text,$maxchar){\n\tif (strlen($text) > $maxchar) { \n\t\t$words = explode(\" \", $text); \n\t\t$output = ''; \n\t\t$i = 0; \n\t\twhile (true) { \n\t\t\t$length = (strlen($output) + strlen($words[$i]));\n\t\t\tif ($length > $maxchar) { \n\t\t\t\tbreak; \n\t\t\t} else { \n\t\t\t\t$output = $output . \" \" . $words[$i]; \n\t\t\t\t++$i; \n\t\t\t} \n\t\t}\n\t} else { \n\t\t$output = $text;\n\t}\n\t return $output;\n}",
"function too_long_words($text,$word_maxlength)\n {\n $text = preg_replace(\"/\\015\\012|\\015|\\012/\", \"\\n\", $text);\n $text = str_replace(\"\\n\", ' ', $text);\n $words = explode(' ',$text);\n foreach($words as $word)\n {\n $length = mb_strlen(trim($word), CHARSET);\n if($length > $word_maxlength)\n {\n $too_long_words[] = $word;\n }\n }\n if(isset($too_long_words))\n {\n return $too_long_words;\n }\n return false;\n }",
"function maxlength($text, $max, $shorten=true)\n{\nif(strlen($text) >= $max) {\nif($shorten) {\n$text = substr($text, 0, ($max-3)).\"...\";\n} else {\n$text = substr($text, 0, ($max));\n} }\nreturn $text;\n}",
"function ellipsis($long_string, $max_character = 30) {\n $short_string = strlen($long_string) > $max_character ? substr($long_string, 0, $max_character).\"...\" : $long_string;\n\t\treturn $short_string;\n }",
"function _char_limit($str, $length, $minword = 3)\n {\n $sub = '';\n $len = 0;\n \n foreach (explode(' ', $str) as $word)\n {\n $part = (($sub != '') ? ' ' : '') . $word;\n $sub .= $part;\n $len += strlen($part);\n \n if (strlen($word) > $minword && strlen($sub) >= $length)\n {\n break;\n }\n }\n \n return $sub . (($len < strlen($str)) ? '...' : '');\n\n }",
"function tfuse_substr($str, $length, $more = '...', $minword = 3) {\r\n $sub = '';\r\n $len = 0;\r\n \r\n foreach (explode(' ', $str) as $word) {\r\n $part = (($sub != '') ? ' ' : '') . $word;\r\n $sub .= $part;\r\n $len += strlen($part);\r\n \r\n if (strlen($word) > $minword && strlen($sub) >= $length)\r\n break;\r\n }\r\n \r\n return (($len < strlen($str)) ? $sub . ' ' . $more : $sub);\r\n }",
"function gallo_excerpt( $length ) {\n\treturn 30;\n}",
"public function getLongestLineLength(): int\n {\n return 0;\n }",
"function ts_get_shortened_string($text,$word_limit)\r\n{\r\n\t$words = explode(' ', $text, ($word_limit + 1));\r\n\tif(count($words) > $word_limit)\r\n\t{\r\n\t\tarray_pop($words);\r\n\t\treturn implode(' ', $words).\"...\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn implode(' ', $words);\r\n\t}\r\n}"
]
| [
"0.631341",
"0.6028681",
"0.59418696",
"0.57612014",
"0.5729432",
"0.5695807",
"0.56765896",
"0.5636818",
"0.55954856",
"0.5512497",
"0.5505409",
"0.55048025",
"0.546145",
"0.54491013",
"0.54468757",
"0.5408977",
"0.53503466",
"0.53432417",
"0.53345686",
"0.5306806",
"0.5296603",
"0.52894443",
"0.52806586",
"0.52700496",
"0.5269487",
"0.5259427",
"0.5257776",
"0.52396256",
"0.52312285",
"0.5225535"
]
| 0.69784844 | 0 |
BONUS QUESTION Write a function that accepts a query string as input, performs a repo search on the github api using the query string, and prints the name, url, and language of the repository. TIPS: GitHub API info is located at Use the search endpoint: EXAMPLE OUTPUT: testrocket Ruby sublimetext2rubytests Python rubyplsql Ruby | public function listGithubSearchResults( $query ) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_project_github($user, $project) {\n $ch = @curl_init(); //inicia uma nova sessao\n curl_setopt($ch, CURLOPT_URL, \"http://github.com/api/v2/json/repos/show/$user/$project\"); //faz a pesquisa contida no url\n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Googlebot/2.1'); //utiliza Googlebot 2.1\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\t//define o retorno como string\n $page = curl_exec($ch);\t//executa as opcoes definidas\n curl_close($ch);\t//encerra sessao\n\t$github_json = json_decode($page); //descodifica string JSON\n\tif(isset($github_json->repository->name)){\n\t\t$string_name = $github_json->repository->name;\n\t} else {\n\t\t$string_name = null;\n\t}\n\tif(isset($github_json->repository->description)){\n\t\t$string_title = $github_json->repository->description;\n\t} else {\n\t\t$string_title = \"n/a\";\n\t}\n\tif(isset($github_json->repository->url)){\n\t\t$string_source = $github_json->repository->url;\n\t} else {\n\t\t$string_source = \"n/a\";\n\t}\n\tif(isset($github_json->repository->owner)){\n\t\t$string_owner = array();\n\t\tarray_push($string_owner, $github_json->repository->owner);\n\t} else {\n\t\t$string_owner = array(\"n/a\");\n\t}\n\tif(isset($github_json->repository->language)){\n\t\t$string_lang = array();\n\t\t$string_lang = preg_split('/,/', $github_json->repository->language, -1);\n\t} else {\n\t\t$string_lang = array(\"n/a\");\n\t}\n\t//faz replace da Visual Basic por VB/VBS\n\t$string_lang=str_replace('Visual Basic', 'VB/VBS', $string_lang, $count);\n\tif(isset($github_json->repository->created_at)){\n\t\t$string_date = array();\n\t\tpreg_match(\"/[0-9]*\\\\/[0-9]*\\\\/[0-9]*/\", $github_json->repository->created_at, $match);\n\t\tarray_push($string_date, preg_replace('/\\\\//', '', $match[0], -1));\n\t\tpreg_match(\"/[0-9]*\\\\/[0-9]*\\\\/[0-9]*/\", $github_json->repository->pushed_at, $match2);\n\t\tarray_push($string_date, preg_replace('/\\\\//', '', $match2[0], -1));\n\t} else {\n\t\t$string_date = array(\"n/a\");\n\t}\t\n\treturn array($string_name, $string_title, $string_source, $string_owner, $string_lang, $string_date, \"n/a\");\t\n}",
"function searchForUser($searchString) {\n $GitHubResponse = basicCurl(\"https://api.github.com/search/users?q=\".$searchString);\n $jsonResult = json_decode($GitHubResponse, true);\n $returnString = \"You searched for \".$searchString.\", I found: <br />\";\n $itemsArray = $jsonResult['items'];\n foreach ($itemsArray as $currentItem) {\n $returnString = $returnString.$currentItem['login'].\"<br />\";\n }\n return $returnString;\n}",
"function query_api($term, $location, $price, $radius, $categories, $sort) { \n $response = search($term, $location, $price, $radius, $categories, $sort);\n echo $response;\n}",
"function github_request($url)\r\n{\r\n $ch = curl_init();\r\n\r\n $access = 'username:db1ff77b2eb06b3aa967e28f1943193ac831f064';\r\n\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));\r\n curl_setopt($ch, CURLOPT_USERAGENT, 'Agent smith');\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_USERPWD, $access);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n $output = curl_exec($ch);\r\n curl_close($ch);\r\n $result = json_decode(trim($output), true);\r\n return $result;\r\n}",
"public function actionSearch()\n {\n $currentPage = Yii::$app->request->get('page') ? Yii::$app->request->get('page') : 1;\n $query = Yii::$app->request->get('search');\n\n $repos = GitHubApi::findRepo($query, $currentPage);\n $pages = new Pagination(['totalCount' => $repos['total_count'], 'pageSize' => 20]);\n $pages->pageSizeParam = false;\n\n return $this->render('search', [\n 'repos' => $repos,\n 'pages' => $pages,\n ]);\n }",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"public function projectsSearchGet(string $query, string $max_version = null, int $limit = 20, int $offset = 0, string $flavor = null, &$responseCode, array &$responseHeaders);",
"function synonym_lookup($query) {\n\n $apikey = \"GdbOBg1JYIou4guyIKfq\"; // NOTE: replace test_only with your own key \n $word = $query; // any word \n $language = \"en_US\"; // you can use: en_US, es_ES, de_DE, fr_FR, it_IT \n $endpoint = \"http://thesaurus.altervista.org/thesaurus/v1\";\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$endpoint?word=\" . urlencode($word) . \"&language=$language&key=$apikey&output=json\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n $info = curl_getinfo($ch);\n curl_close($ch);\n\n //either return $result populated with the JSON decoded data\n if ($info['http_code'] == 200) {\n $result = json_decode($data, true);\n }\n\n\n //or return result as 0\n else {\n $result = 0;\n }\n\n return $result;\n}",
"public function search($params) {\n\t\t$callUrl = \"https://en.wikipedia.org/w/api.php?action=query&list=search&utf8=&format=json&srlimit=5&srsearch=\".urlencode($params[\"q\"]);\n\n\t\t/**\n\t\t* Create curl request and send it\n\t\t*/\n\t\t$process = curl_init($callUrl);\n\t\tcurl_setopt($process, CURLOPT_HTTPHEADER, array('Accept: application/json'));\n\t\tcurl_setopt($process, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($process, CURLOPT_TIMEOUT, 5);\n\t\tcurl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$text = curl_exec($process);\n\t\tcurl_close($process);\n\t\t$raw = json_decode($text);\n\n\t\t/**\n\t\t * return message, if we could not get any results\n\t\t */\n\t\tif( count($raw->query->search) <= 0 ) {\n\t\t\t$answer = new Answer();\n\t\t\t$answer->addText(\"Unfortunately I was not able to find anything for *\" . $params[\"q\"] . \"*.\");\n\t\t\treturn $answer;\n\t\t}\n\n\t\t/**\n\t\t * get results into list\n\t\t */\n\t\t$answer = new Answer();\n\t\t$answer->addText(\"Here are the top wikipedia articles for *\" . $params[\"q\"] . \"*: \");\n\n\t\tforeach($raw->query->search as $res) {\n\t\t\t$answer->addAttachment(\n\t\t\t\tnew Attachment(\n\t\t\t\t\t$res->title,\n\t\t\t\t\tstrip_tags($res->snippet),\n\t\t\t\t\t\"https://en.wikipedia.org/wiki/\" . rawurlencode($res->title)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $answer;\n\t}",
"function core_github_com($url, $prefix='api'){\n\t$fp = fsockopen(\"ssl://\".$prefix.\".github.com\", 443, $errno, $errstr, 30);\n\tif (!$fp){ echo 'Could not connect to Github'; return false; }\n\t$out = \"GET /\".$url.\" HTTP/1.1\\r\\n\";\n\t$out .= \"Host: \".$prefix.\".github.com\\r\\n\";\n\t$out .= \"Connection: Close\\r\\n\\r\\n\";\n\tfwrite($fp, $out);\n\t$buffer = '';\n\twhile (!feof($fp)) {\n\t\t$buffer .= fgets($fp, 128);\n\t}\n\tfclose($fp);\n\tpreg_match(\"/^content-length:\\s*(\\d+)\\s*$/mi\", $buffer, $matches);\n\t$length = $matches[1];\t\n\t$content = substr($buffer, $length*-1, $length);\n\tswitch($prefix){\n\t\tcase \"api\":\n\t\t\treturn json_decode($content);\n\t\t\tbreak;\n\t\tcase \"raw\":\n\t\t\treturn $content;\n\t\t\tbreak;\n\t}\t\t\n}",
"public static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }",
"public function action_search_doc()\n\t{\n\t\tglobal $context;\n\n\t\t$context['doc_apiurl'] = 'https://github.com/elkarte/Elkarte/wiki/api.php';\n\t\t$context['doc_scripturl'] = 'https://github.com/elkarte/Elkarte/wiki/';\n\n\t\t// Set all the parameters search might expect.\n\t\t$postVars = explode(' ', $context['search_term']);\n\n\t\t// Encode the search data.\n\t\tforeach ($postVars as $k => $v)\n\t\t{\n\t\t\t$postVars[$k] = urlencode($v);\n\t\t}\n\n\t\t// This is what we will send.\n\t\t$postVars = implode('+', $postVars);\n\n\t\t// Get the results from the doc site.\n\t\trequire_once(SUBSDIR . '/Package.subs.php');\n\t\t// Demo URL:\n\t\t// https://github.com/elkarte/Elkarte/wiki/api.php?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=template+eval\n\t\t$search_results = fetch_web_data($context['doc_apiurl'] . '?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=' . $postVars);\n\n\t\t// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?\n\t\tif (!$search_results || preg_match('~<' . '\\?xml\\sversion=\"\\d+\\.\\d+\"\\?' . '>\\s*(<api>.+?</api>)~is', $search_results, $matches) !== 1)\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t$search_results = !empty($matches[1]) ? $matches[1] : '';\n\n\t\t// Otherwise we simply walk through the XML and stick it in context for display.\n\t\t$context['search_results'] = array();\n\n\t\t// Get the results loaded into an array for processing!\n\t\t$results = new XmlArray($search_results, false);\n\n\t\t// Move through the api layer.\n\t\tif (!$results->exists('api'))\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t// Are there actually some results?\n\t\tif ($results->exists('api/query/search/p'))\n\t\t{\n\t\t\t$relevance = 0;\n\t\t\tforeach ($results->set('api/query/search/p') as $result)\n\t\t\t{\n\t\t\t\t$title = $result->fetch('@title');\n\t\t\t\t$context['search_results'][$title] = array(\n\t\t\t\t\t'title' => $title,\n\t\t\t\t\t'relevance' => $relevance++,\n\t\t\t\t\t'snippet' => str_replace('class=\\'searchmatch\\'', 'class=\"highlight\"', un_htmlspecialchars($result->fetch('@snippet'))),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"function make_curl($search_param, $url){\n \n // default header shit\n $headers = array(\"Accept: application/json\", \"Content-Type: application/json\");\n \n //step1\n $cSession = curl_init($url);\n \n //echo $search_param[\"league_name\"];\n //echo json_encode($search_param);\n\n //step2\n //curl_setopt($cSession,CURLOPT_URL, $url.\"?league_name=\".$search_param[\"league_name\"].\"&year=\".$search_param[\"year\"]);\n curl_setopt($cSession,CURLOPT_POSTFIELDS, json_encode($search_param));\n curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($cSession,CURLOPT_HEADER, false);\n curl_setopt($cSession,CURLOPT_HTTPHEADER, $headers);\n \n //step3\n $jsonData = curl_exec($cSession);\n $err = curl_error($cSession);\n \n //step4\n curl_close($cSession);\n //echo ($jsonData);\n \n //step5\n return ($jsonData);\n}",
"function search(string $searchQuery, array $overrideConfig = [])\n{\n\n // Variable scope fix\n global $site;\n\n // Init variables\n $entryCount = 0;\n $resultCount = 0;\n $resultsArray = [];\n $validTokensArray = [];\n $response = [];\n\n // Config\n $defaultConfig = [\n 'showEditLinks' => true,\n // Include scheduled and draft content in results\n 'searchHiddenContent' => false,\n // Set minimum characters required for search\n 'minimumCharactersAllowed' => 3,\n // Set maximum characters allowed for search\n 'maximumCharactersAllowed' => 1000,\n 'searchUsername' => true,\n 'searchDescription' => true,\n // Recusively search by exploding \"hello world\" to \"hello\", \"world\"\n 'enableRecursiveSearch' => true,\n // Only for recursive search tokens\n 'enableStopWordFilter' => true,\n // Use InnoDb Stopwords https://mariadb.com/kb/en/mariadb/stopwords/\n // Removed 'about'\n 'stopWordsFilter' => [\n 'a', 'an', 'are', 'as', 'at', 'be', 'by', 'com', 'de', 'en', 'for', 'from',\n 'how', 'i', 'in', 'is', 'it', 'la', 'of', 'on', 'or', 'that', 'the', 'this', 'to', 'was',\n 'what', 'when', 'where', 'who', 'will', 'with', 'und', 'the', 'www'\n ],\n ];\n\n $config = array_replace($defaultConfig, $overrideConfig);\n\n // Reject Query if its length is too small\n if (strlen($searchQuery) < $config['minimumCharactersAllowed']) {\n $response['errors'] = 'ERROR: Too few characters. Add more characters to widen search.';\n return $response;\n } elseif (strlen($searchQuery) > $config['maximumCharactersAllowed']) {\n $response['errors'] = \"ERROR: Maximum characters exceeded ({$config['maximumCharactersAllowed']}). Shorten your query.\";\n return $response;\n }\n\n // Break the query into several words\n $tokensArray = explode(' ', $searchQuery);\n $enoughTokensAvailable = false;\n\n foreach ($tokensArray as $token) {\n $trimmedToken = trim($token);\n if (!empty($trimmedToken) && strlen($trimmedToken) >= $config['minimumCharactersAllowed']) {\n /**\n * Tokens with stopWordFilter enabled\n */\n if ($config['enableStopWordFilter']) {\n if (!in_array($trimmedToken, $config['stopWordsFilter'])) {\n array_push($validTokensArray, $trimmedToken);\n }\n } else {\n /**\n * Tokens with stopWordFilter disabled\n */\n array_push($validTokensArray, $trimmedToken);\n }\n }\n }\n\n // Get Unique values\n $validTokensArray = array_unique($validTokensArray);\n\n // Use recursive search only when enoughTokensAvailable is true.\n if (count($validTokensArray) > 0) {\n $enoughTokensAvailable = true;\n }\n\n $json = stripFirstLine(file_get_contents(DB_PAGES));\n $json = json_decode($json);\n\n foreach ($json as $obj => $values) {\n // Initialise\n $score = 0;\n $results = array();\n // $obj holds the page slug/key\n\n // Values to search\n $contentPath = PATH_PAGES . $obj . DS . FILENAME; // index.txt\n $title = $values->title;\n $description = $values->description;\n $username = $values->username;\n $tagsArray = (array)$values->tags;\n $category = $values->category;\n $tagsString = implode(' ', $tagsArray);\n $type = $values->type;\n $coverImage = isset($values->coverImage) ? $values->coverImage : false;\n if ($coverImage) {\n $coverImage = HTML_PATH_UPLOADS . $values->coverImage;\n }\n\n /**\n * Skip hiddenContent if searchHiddenContent is false\n */\n if (! $config['searchHiddenContent']) {\n $hiddenTypeList = ['scheduled', 'draft'];\n if (in_array($type, $hiddenTypeList)) {\n continue;\n }\n }\n\n // Search Title\n if (stripos($title, $searchQuery)!==false) {\n array_push($results, \"<b>Title:</b> $title<br>\");\n $score += 15;\n }\n\n // Recursive Search Title\n if ($config['enableRecursiveSearch'] && $enoughTokensAvailable) {\n foreach ($validTokensArray as $token) {\n if (stripos($title, $token)!==false) {\n array_push($results, \"<b>Title:</b> $title<br>\");\n $score += 0.75;\n }\n }\n }\n\n // Search Description\n if ($config['searchDescription'] && stripos($description, $searchQuery)!==false) {\n array_push($results, '<b>Description:</b>' . htmlspecialchars($description) . '<br>');\n $score += 5;\n }\n\n // Recursive Search Description\n if ($config['enableRecursiveSearch'] && $enoughTokensAvailable) {\n foreach ($validTokensArray as $token) {\n if ($config['searchDescription'] && stripos($description, $token)!==false) {\n array_push($results, '<b>Description:</b>' . htmlspecialchars($description) . '<br>');\n $score += 0.25;\n }\n }\n }\n\n // Search Username\n if ($config['searchUsername'] && stripos($username, $searchQuery)!==false) {\n array_push($results, '<b>Username: </b>' . htmlspecialchars($username) . '<br>');\n $score += 3;\n }\n\n // Recursive Search Username\n if ($config['enableRecursiveSearch'] && $enoughTokensAvailable) {\n foreach ($validTokensArray as $token) {\n if ($config['searchUsername'] && stripos($username, $token)!==false) {\n array_push($results, '<b>Username: </b>' . htmlspecialchars($username) . '<br>');\n $score += 0.15;\n }\n }\n }\n\n // Search Tags\n if (stripos($tagsString, $searchQuery)!==false) {\n array_push($results, '<b>Tag:</b> ' . htmlspecialchars($tagsString) . '<br>');\n $score += 10;\n }\n\n // Recursive Search Tags\n if ($config['enableRecursiveSearch'] && $enoughTokensAvailable) {\n foreach ($validTokensArray as $token) {\n if (stripos($tagsString, $token)!==false) {\n array_push($results, '<b>Tag:</b> ' . htmlspecialchars($tagsString) . '<br>');\n $score += 0.5;\n }\n }\n }\n\n // Search Category\n if (stripos($category, $searchQuery)!==false) {\n array_push($results, \"<b>Category:</b> $category<br>\");\n $score += 10;\n }\n\n // Recursive Search Category\n if ($config['enableRecursiveSearch'] && $enoughTokensAvailable) {\n foreach ($validTokensArray as $token) {\n if (stripos($category, $token)!==false) {\n array_push($results, \"<b>Category:</b> $category<br>\");\n $score += 0.5;\n }\n }\n }\n\n /**\n * Search Content (Case insensitive)\n * Thanks ghbarratt's | http://stackoverflow.com/questions/8032312/find-specific-text-in-multiple-txt-files-in-php\n */\n foreach (file($contentPath) as $fli => $fl) {\n if (stripos($fl, $searchQuery)!==false) {\n array_push($results, '<b>Line ' . ($fli+1) . '</b> ' . htmlspecialchars($fl) . '<br>');\n $score += 1;\n }\n\n // Recursive content search\n if ($config['enableRecursiveSearch'] && $enoughTokensAvailable) {\n foreach ($validTokensArray as $token) {\n if (stripos($fl, $token)!==false) {\n array_push($results, '<b>Line ' . ($fli+1) . '</b> ' . htmlspecialchars($fl) . '<br>');\n $score += 0.05;\n }\n }\n }\n // End Recusive content search\n }\n\n // Since we use recursive search, there might be duplicate records. Below is to clean it.\n $results = array_unique($results);\n\n // Increment search pages count\n ++$entryCount;\n\n // Add to results only if score is not 0\n if ($score != 0) {\n array_push($resultsArray, array(\n 'title' => $title,\n 'slug' => $obj,\n 'url' => DOMAIN_PAGES . $obj,\n 'editUrl' => DOMAIN_ADMIN . 'edit-content' . DS . $obj,\n 'results' => $results,\n 'score' => $score,\n 'coverImage' => $coverImage,\n 'createdAt' => $values->date\n ));\n ++$resultCount;\n }\n }\n\n // Reverse sort based on score - PHP 7+ only. Requires spaceship operator.\n usort($resultsArray, function ($a, $b) {\n return $b['score'] <=> $a['score'];\n });\n\n return [\n 'meta' => [\n 'showEditLinks' => $config['showEditLinks'],\n 'query' => $searchQuery,\n 'queryTokens' => $validTokensArray,\n 'resultsCount' => $resultCount,\n 'entryCount' => $entryCount,\n 'timeTakenInSeconds' => round((microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"]), 3)\n ],\n 'results' => $resultsArray,\n ];\n}",
"public function search($query, $year = null, $language = null);",
"function get_search_link($query = '')\n {\n }",
"public function search($args){\n\t\t//Sets defaults where input doesn't exist.\n\t\t//This will only add if the index doesn't exist?\n\t\t$args += [\n\t\t\t\"page\" => 0,\n\t\t\t\"index\" => null,\n\t\t\t\"type\" => \"books\"\n\t\t];\n\t\textract($args);\n\t\t//Now check we have a query\n\t\tif(!isset($query)){\n\t\t\techo \"NEED TO HAVE A QUERY IN SEARCH\";\n\t\t\texit(1);\n\t\t}\n\t\t//Create url for search\n\t\t$url = \"$this->apiRoot/$type?q=$query&p=$page\" . ($index === null ? \"\" : \"&i=$index\") . $this->apiTail;\n\n\t\t//Run search, return json as array\n\t\t//return file_get_contents($url);\n\t\treturn apiSampleSearch();\n\t}",
"public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}",
"function doAPISearch($params) {\n global $searchUrl;\n\n $ch = curl_init(); // initialize curl handle\n curl_setopt($ch, CURLOPT_URL,$searchUrl . $params);\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable\n curl_setopt($ch, CURLOPT_TIMEOUT, 8); // times out after 4s\n curl_setopt($ch, CURLOPT_POST, 0); // set GET method\n // curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n // Retrieve result\n $result = curl_exec($ch);\n // TODO return error if error\n // $cerror = curl_error($ch);\n\n return $result;\n}",
"function search() {}",
"function gc_get_from_api() {\n $keyword = $_POST['keyword'];\n $hub = $_POST['hub'];\n $type = $_POST['type'];\n $url = 'https://graphcommons.com/api/v1/' . $type . 's/search?query='. urlencode($keyword) . '&limit=' . $this->api_limit;\n\n if ( $hub !== '' ) {\n $url = $url . '&hub=' . $hub;\n }\n\n $this->gc_get_url_and_print_json( $url );\n }",
"private function _search(){\n\t\tif($this->curluse){\n\t\t\ttry{\n\t\t\t\t$ch = curl_init();\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $this->searchURL);\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t\t\tif(isset($this->proxy_url) && isset($this->proxy_port)){\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy_port);\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_PROXY, $this->proxy_url);\n\t\t\t\t}\n\t\t\t\t$output = curl_exec($ch);\n\t\t\t\tif(curl_errno($ch))\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Exception(curl_error($ch));\n\t\t\t\t}\n\t\t\t\tcurl_close($ch);\n\t\t\t\treturn $output;\n\t\t\t} catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif ($stream = fopen($this->searchURL, 'r')) {\n\t\t\t\treturn stream_get_contents($stream);\n\t\t\t\tfclose($stream);\n\t\t\t}\n\t\t}\n\t}",
"public function main()\n {\n if (null === $this->getRepository()) {\n throw new BuildException('\"repository\" is required parameter');\n }\n $client = $this->getGitClient(false, $this->getRepository());\n $command = $client->getCommand('tag');\n $command\n ->setOption('-l')\n ->setOption('--sort', '-v:refname');\n $result = $command->execute();\n var_dump($result);\n }",
"public function search($query);",
"function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }",
"public function api_call($query) {\n $query = $this->sanitize_str($query); \n $url = \"https://superheroapi.com/api/1180364012471833/search/\" . $query;\n \n if (!file_get_contents($url)) {\n $err = array(\n \"response\" => \"error\",\n \"error\" => \"Couldn't connect to API\",\n );\n \n $res = json_encode($err);\n }\n else {\n $res = file_get_contents($url);\n }\n \n return $res;\n }",
"function WebhookPullSubrepository(){\n \n $MagicWord=BlowfishEncrypt('Pull Subrepository From Github');\n if(\n isset($_GET[$MagicWord])\n ){\n $Path=dirname(__FILE__);\n $Path=str_replace('/core','',$Path);\n $Subrepository=BlowfishDecrypt($_GET[$MagicWord]);;\n $Path.=trim($Subrepository);\n \n echo '<p>Pulling Subrepository: '.$Path.'</p>';\n \n if(!is_dir($Path)){\n die('Path not found: '.$Path);\n }\n \n $Command = 'cd '.$Path.' && git reset --hard && git pull';\n echo '<p>'.$Command.'</p><pre>';\n echo shell_exec($Command);\n echo '</pre>';\n \n exit;\n }\n}",
"public function search();",
"public function search();",
"function SearchFood($name)\n{\n $postData = array(\n 'query' => $name,\n \n );\n\n // Setup cURL\n $ch = curl_init('https://trackapi.nutritionix.com/v2/natural/nutrients');\n curl_setopt_array($ch, array(\n CURLOPT_POST => TRUE,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_HTTPHEADER => array(\n 'Content-Type:application/json',\n 'x-app-Id: 3f0a4b18',\n 'x-app-Key:7795b68adeba3faf9a870e02a444cb59'\n ),\n CURLOPT_POSTFIELDS => json_encode($postData)\n ));\n\n // Send the request\n $response = curl_exec($ch);\n\n // Check for errors\n if($response === FALSE){\n die(curl_error($ch));\n }\n\n // Decode the response\n //$responseData = json_decode($response, TRUE);\n\n // Print the date from the response\n return $response;\n}"
]
| [
"0.6684253",
"0.64568156",
"0.63924336",
"0.6026684",
"0.60118747",
"0.5912671",
"0.56734014",
"0.56247395",
"0.55762845",
"0.5573877",
"0.55727476",
"0.55644506",
"0.5533422",
"0.55119205",
"0.5500073",
"0.54918104",
"0.54769564",
"0.5463076",
"0.541388",
"0.5401627",
"0.5395288",
"0.53600943",
"0.53226066",
"0.5291884",
"0.5254233",
"0.52394176",
"0.5228887",
"0.5209292",
"0.5209292",
"0.5204174"
]
| 0.6833719 | 0 |
coalesce_empty PHP analogue of the SQL Coalesce() function, but testing using empty() | public static function coalesce_empty()
{
foreach ( func_get_args() as $arg )
{
if ( ! empty($arg) )
{
return $arg;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function emptyCoalesce($data, $default = null)\n {\n return ($data === null || $data === false) ? $default : $data;\n }",
"public function stdWrap_ifEmptyDeterminesEmptyValuesDataProvider() {}",
"function empty2($mixed) {\n return empty($mixed);\n}",
"function empty2null($value)\n{\n return $value === '' ? null : $value;\n}",
"public function nonEmpty();",
"function is_empty()\n {\n }",
"function coalesce() {\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n }\n return $args[0];\n}",
"public function getEmpty();",
"public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}",
"public function isNull();",
"public function globalStringConditionMatchesOnEmptyExpressionWithValueSetToEmptyString() {}",
"function is_empty($value) {\n if (is_array($value)) {\n return empty($value);\n } elseif (is_string($value)) {\n return strlen($value) == 0;\n } else {\n return $value === null;\n }\n}",
"public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}",
"public function globalStringConditionMatchesOnEmptyLiteralExpressionWithValueSetToEmptyString() {}",
"function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}",
"abstract public function isNull();",
"public static function coalesce()\n\t{\n\t\tforeach ( func_get_args() as $arg )\n\t\t{\n\t\t\tif ( ! is_null($arg) )\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\t}",
"public static function ensureNullIfEmpty($value)\n\t{\n\t\treturn empty($value)?null:$value;\n\t}",
"function coalesce() {\n\tforeach (func_get_args() as $arg) {\n\t\tif (!is_null($arg)) {\n\t\t\treturn $arg;\n\t\t}\n\t}\n\treturn null;\n}",
"function coalesce($value, $default1=null, $default2=false, $default3=false, $default4=false) {\n return isnull(isnull(isnull(isnull($value, $default1), $default2), $default3), $default4);\n }",
"function is_blank($value) {\n if (is_object($value) && method_exists($value, 'is_blank')) return $value->is_blank();\n if (is_string($value)) $value = trim($value);\n return is_empty($value);\n}",
"public function orNull();",
"public function isEmpty();",
"public function isEmpty();",
"public function isEmpty();",
"public function isEmpty();",
"public function isEmpty();",
"public function isEmpty();",
"public function isEmpty();",
"public function isEmpty();"
]
| [
"0.6996738",
"0.64395374",
"0.6435617",
"0.6393643",
"0.62302077",
"0.62040013",
"0.62037736",
"0.6141909",
"0.61118096",
"0.6110162",
"0.6109612",
"0.60486203",
"0.5991668",
"0.5989255",
"0.59713304",
"0.5959974",
"0.5952991",
"0.5934893",
"0.59234565",
"0.5915025",
"0.5864501",
"0.57755923",
"0.57540107",
"0.57540107",
"0.57540107",
"0.57540107",
"0.57540107",
"0.57540107",
"0.57540107",
"0.57540107"
]
| 0.79544985 | 0 |
Get the next day that isn't a weekend, and increment offset by 1 | function next_day(&$offset)
{
do
{
$offset++;
}
while(
in_array(gmdate('D', gmmktime() + ($offset * 24 * 60 * 60)), array('Sat', 'Sun'))
||
in_array(gmdate('Y-m-d', gmmktime() + ($offset * 24 * 60 * 60)), $GLOBALS['config']['non-work_dates'])
);
return gmdate('Y-m-d', gmmktime() + ($offset * 24 * 60 * 60));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function next_weekday($weekday) {\n global $week_names;\n $date = new DateTime();\n $i = (int)$date->format(\"w\"); // 0=Sunday\n $j = array_search($weekday, $week_names); // 0=Monday\n $diff = (($j+1) - $i + 7); // days til next $weekday [0..6]\n $diff = ($diff+6)%7+1; // days til next $weekday [1..7]\n $date->modify(\"+$diff days\");\n return $date;\n}",
"private function nextDay(){\n\t\t$oneDay = new \\DateInterval('P1D');\n\t\tdo {\n\t\t\t$this->curDate->add($oneDay);\n\t\t} while($this->isVocation($this->curDate));\n\t\tif($this->curDate > $this->endDate)\n\t\t\t$this->curDate = null;\n\t}",
"function nextWeek(){ return $this->_getDate(7);\t}",
"public function nextWeek() {\n $week = $this->week + 1; \n $year = $this->year;\n if($week==53){\n \n \n $firstweek = New DateTime(\"{$year}-01-01\");\n if($firstweek->format('w')!=1) $firstweek->modify(\"next monday\");\n $lastweek = $firstweek->modify('+52 weeks'); \n $test = intval($lastweek->format('Y'));\n \n \n if($year != $test){ \n $week = 1;\n $year +=1;\n }; \n\n }elseif($week>53){\n $week = 1;\n $year +=1;\n }\n return new Week($week, $year);\n }",
"protected function findNextSuitableDay(Carbon $date)\n\t{\n\t\tif($date->isWeekend() && !$this -> cup -> play_weekends)\n\t\t{\n\t\t\t// if sunday move one day in advance, otherwise move two days\n\t\t\t$date -> addWeekdays($date->dayOfWeek == 0 ? 1 : 2);\n\t\t}\n\t\t// we do not play during the week\n\t\telseif($date->isWeekday() && !$this -> cup -> play_weekdays)\n\t\t{\n\t\t\t// 1 mon - 5 fri; adds number of days depending on week day\n\t\t\t$date -> addWeekdays(5 - $date->dayOfWeek);\n\t\t}\n\t\treturn $date;\n\t}",
"public function skipWeekend()\r\n {\r\n if ($this->getDayOfWeek() == 7)\r\n {\r\n $this->addDay(1);\r\n }\r\n else if ($this->getDayOfWeek() == 6)\r\n {\r\n $this->addDay(2);\r\n }\r\n }",
"public function getNextWeek()\n {\n if ($next = $this->week + 1 > Sunny::WEEKS_PER_YEAR) {\n $next = 1;\n }\n return $next;\n }",
"function getNextDay(){\r\n $dia = Data_Calc::proxDia($this->dia, $this->mes, $this->ano, \"%Y-%m-%d\");\r\n $data = sprintf(\"%s %02d:%02d:%02d\", $dia, $this->hora, $this->minuto, $this->segundo);\r\n $newDate = new Date();\r\n $newDate->setData($data);\r\n return $newDate;\r\n }",
"public function getNextWeek($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime(\"+1 week\", strtotime($date)));\n\t\treturn $dateNew;\n\t}",
"function addOneDay($currentDay)\n {\n if ( empty($currentDay) ) {\n $currentDay = date('Y-m-d');\n }\n\n $nextDate = strtotime ( '+ 1 day' , strtotime ( $currentDay ) ) ;\n $nextDate = date ( 'Y-m-d' , $nextDate );\n\n return $nextDate;\n }",
"public function getNextWeekDay($day) {\n $result = null;\n switch(strtolower($day)) {\n case Weekday::SUNDAY:\n $result = Weekday::MONDAY;\n break;\n case Weekday::MONDAY:\n $result = Weekday::TUESDAY;\n break;\n case Weekday::TUESDAY:\n $result = Weekday::WEDNESDAY;\n break;\n case Weekday::WEDNESDAY:\n $result = Weekday::THURSDAY;\n break;\n case Weekday::THURSDAY:\n $result = Weekday::FRIDAY;\n break;\n case Weekday::FRIDAY:\n $result = Weekday::SATURDAY;\n break;\n case Weekday::SATURDAY:\n $result = Weekday::SUNDAY;\n break;\n }\n return $result;\n }",
"function nextRdate2($curD, $rI, $rP, $rM, $i) { //$i=0: 1st occurrence; $i=1: next occurrence\n\tif ($rM) {\n\t\t$curM = $rM; //one specific month\n\t\t$curY = substr($curD,0,4)+$i+((substr($curD,5,2) <= $rM) ? 0 : 1);\n\t} else { //each month\n\t\t$curM = substr($curD,5,2)+$i;\n\t\t$curY = substr($curD,0,4);\n\t}\n\t$day1Ts = mktime(12,0,0,$curM,1,$curY);\n\t$dowDif = $rP - date('N',$day1Ts); //day of week difference\n\t$offset = $dowDif + 7 * $rI;\n\tif ($dowDif >= 0) { $offset -= 7; }\n\tif ($offset >= date('t',$day1Ts)) { $offset -= 7; } //'t' : number of days in the month\n\t$nxtD = date('Y-m-d', $day1Ts + (86400 * $offset));\n\treturn $nxtD;\n}",
"public function getNext() {\r\n $nextDate = $this->getStartDate();\r\n $nextDate->modify('+1 ' . $this->getMode());\r\n\r\n return $nextDate->getTimestamp();\r\n }",
"public static function getNextWeek(){\n\t\t\t$cur = DB::select('SELECT WEEKDAY((SELECT CURDATE())) as cur')[0]->cur;\n\n\t\t\t// SQL find this monday\n\t\t\t$fir = DB::select('SELECT DATE_SUB( (SELECT CURDATE()), INTERVAL ?-6 DAY) as fir', array($cur))[0]->fir;\n\t\t\t$firstDay = DB::select('SELECT UNIX_TIMESTAMP(?) as firstDay', array($fir))[0]->firstDay;\n\n\t\t\t// SQL find this sunday\n\t\t\t$lst = DB::select('SELECT DATE_SUB( (SELECT CURDATE()), INTERVAL ?-12 DAY) as lst', array($cur))[0]->lst;\n\t\t\t$lastDay = DB::select('SELECT UNIX_TIMESTAMP(?) as lastDay', array($lst))[0]->lastDay;\n\n\t\t\t// Number, String\n\t\t\treturn array(array($firstDay, $lastDay + 86399), array($fir, $lst));\n\n\t\t}",
"private static function nextRepeatDate($dt, $event) {\n switch ($event->type) {\n case JSchedEvent::TYPE_DAY:\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + $event->every, date(\"Y\", $dt)); \n //logit(\"dt0=\" . date(\"l, d-M-Y\", $dt));\n return $dt;\n case JSchedEvent::TYPE_WEEK:\n $dow = date(\"w\", $dt);\n for ($i = 0; $i < 7; $i++) {\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + 1, date(\"Y\", $dt)); // next day\n// logit(\"dt1=\" . date(\"l, d-M-Y\", $dt));\n $dow = ($dow + 1) % 7;\n if ($dow == JSchedEvent::ON_SUN) {\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + 7 * ($event->every - 1), date(\"Y\", $dt)); // skip (every-1) weeks\n// logit(\"dt2=\" . date(\"l, d-M-Y\", $dt));\n }\n if ($event->dowArray[$dow]) {\n return $dt;\n }\n }\n return null;\n case JSchedEvent::TYPE_MONTH:\n if ($event->by == JSchedEvent::BY_DATE) {\n \n // By date (\"15th\")\n $nextm = (date(\"n\", $dt) + $event->every - 1) % 12 + 1; // next month expected \n $dt = mktime(0, 0, 0, date(\"n\", $dt) + $event->every, date(\"j\", $dt), date(\"Y\", $dt)); \n// logit(\"dt3=\" . date(\"l, d-M-Y\", $dt));\n if (date(\"n\", $dt) > $nextm) { \n $dt = mktime(0, 0, 0, date(\"n\", $dt), 0, date(\"Y\", $dt)); // went too far, use last day of month instead\n// logit(\"dt4=\" . date(\"l, d-M-Y\", $dt)); \n }\n return $dt;\n } else {\n \n // By month day (\"4th Wednesday\")\n $week = ceil(date(\"j\", $dt) / 7);\n $dow = date(\"w\", $dt);\n if ($week == 5 || $event->by == JSchedEvent::BY_DAY_OF_LAST_WEEK) {\n $dt = mktime(0, 0, 0, date(\"n\", $dt) + $event->every + 1, 0, date(\"Y\", $dt)); // last day of next month\n// logit(\"dt5=\" . date(\"l, d-M-Y\", $dt));\n for ($i = 0; $i < 7; $i++) {\n if (date(\"w\", $dt) == $dow) {\n return $dt;\n }\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) - 1, date(\"Y\", $dt)); // prev day\n// logit(\"dt6=\" . date(\"l, d-M-Y\", $dt));\n }\n return null;\n }\n $dt = mktime(0, 0, 0, date(\"n\", $dt) + $event->every, 1, date(\"Y\", $dt)); // next month\n// logit(\"dt6=\" . date(\"l, d-M-Y\", $dt));\n $dt = mktime(0, 0, 0, date(\"n\", $dt), (8 + ($dow - date(\"w\", $dt))) % 7, date(\"Y\", $dt)); // first dow of month\n// logit(\"dt6a=\" . date(\"l, d-M-Y\", $dt));\n// logit(\"dt7=\" . date(\"l, d-M-Y\", $dt));\n for ($i = 0; $i <= 5; $i++) {\n if (ceil(date(\"j\", $dt) / 7) == $week) {\n return $dt;\n }\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt) + 7, date(\"Y\", $dt)); // skip week \n// logit(\"dt8=\" . date(\"l, d-M-Y\", $dt));\n }\n }\n return null;\n case JSchedEvent::TYPE_YEAR:\n $dt = mktime(0, 0, 0, date(\"n\", $dt), date(\"j\", $dt), date(\"Y\", $dt) + $event->every);\n// logit(\"dt9=\" . date(\"l, d-M-Y\", $dt));\n return $dt;\n }\n }",
"function getNextWeekdia()\r\n {\r\n $dia = Data_Calc::nextWeekdia($this->dia, $this->mes, $this->ano, \"%Y-%m-%d\");\r\n $data = sprintf(\"%s %02d:%02d:%02d\", $dia, $this->hora, $this->minuto, $this->segundo);\r\n $newDate = new Date();\r\n $newDate->setData($data);\r\n return $newDate;\r\n }",
"public function get_nextday_withevents($basedate, $gid = 0)\n {\n $maxcount = 365; // Prevents too high load on DB\n $mydate = $basedate;\n while ($maxcount) {\n --$maxcount;\n $basedate = strtotime('+1 day', $basedate);\n if ($this->date_has_events(date('Y-m-d', $basedate), $gid)) {\n return $basedate;\n }\n }\n return $mydate;\n }",
"public static function nextDayNotWeekend($strDate = null, $strSimbolMath = '+')\n {\n if (is_null($strDate))\n $strDate = date('Y-m-d');\n $intTimestamp = self::convertDateToTimestamp($strDate);\n if (is_null($intTimestamp))\n return;\n while (in_array(date('N', $intTimestamp), array(6, 7))) {\n $strDate = self::addDayToDate($strDate, 1, $strSimbolMath);\n $intTimestamp = self::convertDateToTimestamp($strDate);\n }\n return $strDate;\n }",
"public function getNextDate($date=null){\n\t\t$dateNew = date(\"Y-m-d H:i:s\",strtotime(\"+1 day\", strtotime($date)));\n\t\treturn $dateNew;\n\t}",
"protected function getNextCronDay(array $definition, $force_next = FALSE) {\n $times = $this->getCronTimes($definition);\n $days = $this->getCronDays($definition);\n if ($times && $days) {\n $days_of_week = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];\n\n // Check to make sure current day is supported.\n if (!in_array(strtolower(date('D')), $days) || $force_next) {\n foreach ($days_of_week as $day) {\n if (in_array($day, $days) && strtotime($day . ' this week') > time()) {\n return strtotime($day . ' this week ' . $times[0], strtotime($times[0]));\n }\n }\n // We havn't found a match which means nothing more happens this week.\n foreach ($days_of_week as $day) {\n if (in_array($day, $days)) {\n return strtotime($day . ' next week ' . $times[0], strtotime($times[0]));\n }\n }\n\n }\n }\n return NULL;\n }",
"function testRecurNextStartDay() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\t\t\r\n\t\t// Daily\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_DAILY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dateStart = \"1/1/2010\";\r\n\t\t$rp->dateEnd = \"3/1/2010\";\r\n\t\t\r\n\t\t// First instance should be today\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/01/2010\");\r\n\t\t// Set today to processed, instance should be tomorrow\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/02/2010\");\r\n\t\t// Change interval to skip a day - same processed to above\r\n\t\t$rp->dateProcessedTo = \"1/2/2010\";\r\n\t\t$rp->interval = 2;\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/03/2010\");\r\n\r\n\t\t// Weekly\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_WEEKLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dateStart = \"1/2/2011\"; // First sunday\r\n\t\t$rp->dateEnd = \"1/15/2011\";\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_SUNDAY;\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_WEDNESDAY;\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/02/2011\"); // Sun\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/05/2011\"); // Wed\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/09/2011\"); // Sun\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/12/2011\"); // Wed\r\n\t\t// Next should fail because it is beyond the endDate\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertFalse($tsNext);\r\n\r\n\t\t// Monthly\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dayOfMonth= 1;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\r\n\t\t// The frist of each month\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/01/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"02/01/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"03/01/2011\");\r\n\r\n\t\t// Skip over non-existant dates\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dayOfMonth= 30;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/30/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"03/30/2011\"); // Should skip of ver 2/30 because does not exist\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"04/30/2011\");\r\n\r\n\t\t// MonthlyNth (the nth weekday(s) of every month)\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHNTH;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->instance = 4; // The 4th Sunday of each month\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_SUNDAY;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/23/2011\"); // The 4th Sunday in January\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"02/27/2011\"); // The 4th Sunday in February\r\n\r\n\t\t// Test last\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_MONTHNTH;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->instance = 5; // The last monday of each month\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_MONDAY;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/31/2011\"); // The 4th Sunday in January\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"02/28/2011\"); // The 4th Sunday in February\r\n\r\n\r\n\t\t// Yearly - on the dayofmonth/monthofyear\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_YEARLY;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->dayOfMonth = 8;\r\n\t\t$rp->monthOfYear = 10;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"1/1/2013\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"10/08/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"10/08/2012\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertFalse($tsNext); // Past the dateEnd\r\n\r\n\t\t// YearlyNth\r\n\t\t// -----------------------------------------\r\n\t\t$rp = new CRecurrencePattern($dbh);\r\n\t\t$rp->type = RECUR_YEARNTH;\r\n\t\t$rp->interval = 1;\r\n\t\t$rp->instance = 4; // The 4th Sunday of January\r\n\t\t$rp->dayOfWeekMask = $rp->dayOfWeekMask | WEEKDAY_SUNDAY;\r\n\t\t$rp->monthOfYear = 1;\r\n\t\t$rp->dateStart = \"1/1/2011\";\r\n\t\t$rp->dateEnd = \"1/1/2013\";\r\n\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/23/2011\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertEquals($tsNext, \"01/22/2012\");\r\n\t\t$tsNext = $rp->getNextStart();\r\n\t\t$this->assertFalse($tsNext); // Past the dateEnd\r\n\t}",
"protected function getNextOccurrence($day, \\DateTime $date)\n {\n if (strtolower($date->format('l')) === strtolower($day)) {\n return $date;\n }\n\n return new \\DateTime(\"next {$day} {$date->format('c')}\");\n }",
"function find_start_of_week()\n {\n $this->move_to_start_of_day();\n $this->move_to_start_of_day();\n while ($this->get_day_of_week()>0)\n {\n $this->move_forward_n_days(-1);\n }\n }",
"public function setNextDayOfWeek($diaSemana)\r\n {\r\n $this->setDate(strtotime($this->getTimestampUnix() . ' NEXT ' . $diaSemana));\r\n return $this;\r\n }",
"public function nextDay() {\n foreach ($this->items as $i => $item) {\n ($this->items[$i] = ItemFactory::getInstance($item))->degrade();\n }\n }",
"public function next()\n {\n $this->iCurrentKey++;\n $this->strCurrentValue = strftime('%Y-%m-%d', strtotime($this->strCurrentValue . ' +1 day'));\n }",
"public static function getNextDate($date)\n {\n $date = TimezoneHelper::getDateFromString($date);\n $date->add(new DateInterval(\"P1D\"));\n return TimezoneHelper::getDateFromString($date->format('Y-m-d'));\n }",
"public function next()\n {\n if ($this->_current === null) {\n $this->_current = clone $this->_startDate;\n } else {\n $this->_current = clone $this->_current;\n $this->_current->add($this->_dateInterval);\n }\n }",
"function getDay($dayIndex)\n{\n return date('l', strtotime(\"Sunday +{$dayIndex} days\"));\n}",
"function get_next_date($this_date){\n\t$year = \"\";\n\t$month = \"\";\n\t$day = \"\";\n\tif( preg_match(\"/(\\d+)\\-(\\d+)-(\\d+)/\", $this_date, $match) ){\n\t\t$year = $match[1];\n\t\t$month = $match[2];\n\t\t$day = $match[3];\n\t};\n\t$next_date = date(\"Y-m-d\",mktime(0,0,0, $month, $day+1, $year));\n\n\treturn $next_date;\n\n}"
]
| [
"0.7612667",
"0.68836385",
"0.678421",
"0.6588184",
"0.65747416",
"0.64728457",
"0.64715475",
"0.64234346",
"0.6367625",
"0.622929",
"0.6223433",
"0.62195903",
"0.6195394",
"0.61399776",
"0.6133045",
"0.6100721",
"0.60137105",
"0.5990598",
"0.5947617",
"0.5930861",
"0.59152484",
"0.58503884",
"0.580147",
"0.57690203",
"0.57641166",
"0.57626414",
"0.5712998",
"0.5705438",
"0.56863075",
"0.5658752"
]
| 0.80644 | 0 |
/ Checkbox image opmaken | function CheckoxImage($value)
{
$ckecked = "checkbox_checked.gif";
$unckeched = "checkbox_unchecked.gif";
if ( $value == 0 )
{
return "<img src=\"images/".$unckeched."\" width=\"16\" height=\"16\" border=\"0\">";
}
else
{
return "<img src=\"images/".$ckecked."\" width=\"16\" height=\"16\" border=\"0\">";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function surgeon_save_checkbox_image_field($data, $i) {\n $addon_option_image = $_POST['product_addon_option_image'][$i];\n for ( $ii = 0; $ii < sizeof( $data['options'] ); $ii++ ) {\n $image = sanitize_text_field( stripslashes( $addon_option_image[ $ii ] ) );\n $data['options'][$ii]['image'] = $image;\n }\n return $data;\n}",
"function _get_boolean_image($boolean) {\n $imgReturn = '<img style=\"position: relative; top: -2px; margin-left: 5px;\" height=\"10px\" src=\"' . url(path_to_theme() . '/images/cross.png', array('absolute' => true)) . '\"/>';\n if (!empty($boolean) && $boolean == 1) {\n $imgReturn = '<img style=\"position: relative; top: -2px; margin-left: 5px;\" height=\"10px\" src=\"' . url(path_to_theme() . '/images/tick.png', array('absolute' => true)) . '\"/>';\n }\n return $imgReturn;\n}",
"function admin_replaceTrueByChecked( $test, $clickable = true )\n{\n\tif ($clickable)\n\t{\n\t\t$test ? $img = 'checked.png' \t: $img = 'unchecked.png';\n\t} else {\n\t\t$test ? $img = 'status_yes.gif' : $img = 'status_no.gif';\n\t}\n\n\treturn '<img src=\"'.WEBSITE_PATH.'/admin/images/'.$img.'\" alt=\"checked\" border=\"0\" />';\n}",
"function surgeon_add_checkbox_image_field($post, $product_addons, $loop, $option) {\n wp_enqueue_media();\n ob_start();\n ?>\n <td class=\"checkbox_column\">\n <input type=\"hidden\" name=\"product_addon_option_image[<?php echo $loop; ?>][]\" value=\"<?php echo esc_attr( $option['image'] ); ?>\" class=\"image_attachment_id\" />\n <?php if (is_numeric($option['image'])) { \n $image_src = wp_get_attachment_image_src($option['image']);\n ?>\n <img class=\"image-preview\" src=\"<?php echo $image_src[0]; ?>\" width=\"60\" height=\"60\" style=\"max-height: 60px; width: 60px;\">\n <?php } ?>\n <input type=\"button\" class=\"button upload_image_button\" value=\"<?php _e( 'Upload image' ); ?>\" />\n </td>\n <?php\n $output = ob_get_clean();\n echo $output;\n\n}",
"function fillPostIconEnabled(){\n\t\t\t$enabled = (int) get_option( 'post_icon_enabled' );\n\t\t?>\n\t\t\t<input type=\"checkbox\" name='post_icon_enabled' value=\"1\" <?php checked( 1, $enabled, true ); ?> >\n\n\t\t<?php\n\t}",
"public static function renderCheckbox();",
"function sb_slideshow_checkbox( $value, $key, $name, $checked = array() ) {\n\treturn '<input type=\"checkbox\" name=\"sb_' . esc_attr( $name ) . '[]\" id=\"' . esc_attr( $name . '_' . $value ) . '\"\n\t\tvalue=\"' . esc_attr( $value ) . '\"' . (in_array( $value, (array)$checked ) ? 'checked=\"checked\"' : '') . ' />\n\t\t<label for=\"' . esc_attr( $name . '_' . $value ) . '\">' . $key . '</label><br />';\n}",
"function checkbox()\n {\n ?>\n <input type=\"hidden\" <?php $this->name_tag(); ?> value=\"0\" />\n <input type=\"checkbox\" <?php $this->name_tag(); ?> value=\"1\" class=\"inferno-setting\" <?php $this->id_tag('inferno-concrete-setting-'); if($this->setting_value) echo ' checked'; ?> />\n <label <?php $this->for_tag('inferno-concrete-setting-'); ?> data-true=\"<?php _e('On'); ?>\" data-false=\"<?php _e('Off'); ?>\"><?php if($this->setting_value) _e('On'); else _e('Off'); ?></label>\n <?php \n }",
"function checkbox($args) {\r\n\t\t$args = $this->apply_default_args($args) ;\r\n\t\techo \"<input name='$this->options_name[\" . $args['id'] . \"]' type='checkbox' value='1' \";\r\n\t\tchecked('1', $this->options[$args['id']]); \r\n\t\techo \" /> <span class='description'>\" . $args['description'] . \"</span>\" ;\r\n\t\t\r\n\t}",
"abstract public function checkboxOnClick();",
"function surgeon_add_checkbox_heading_fields($post, $addon, $loop) {\n echo '<th class=\"checkbox_column\"><span class=\"column-title\">Image</span></th>';\n}",
"function elm_admin_get_show_image_options() {\n\t$options = array(\n\t\t1 => __('Yes', 'elm'),\n\t\t0 => __('No', 'elm')\n\t);\n\t\n\treturn $options;\n}",
"function construct_single_image(){\n\t\t\t\n\t\t\tvc_add_param( 'vc_single_image', \n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => __(\"Add Photo Stack Effect\", \"CURLYTHEME\"),\n\t\t\t\t\t'param_name' => 'photo_frame',\n\t\t\t\t\t'weight'\t=> 1\n\t\t\t\t) \n\t\t\t);\n\t\t\t\n\t\t\tvc_add_param( 'vc_single_image', \n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => __(\"Add Zoomify Effect\", \"CURLYTHEME\"),\n\t\t\t\t\t'param_name' => 'zoomify',\n\t\t\t\t\t'weight'\t=> 2\n\t\t\t\t) \n\t\t\t);\n\t\t\t\n\t\t}",
"function output_checkbox_row( string $label, string $key, bool $checked = false ): void {\n\twp_enqueue_style( 'wpinc-meta-field' );\n\t?>\n\t<div class=\"wpinc-meta-field-single checkbox\">\n\t\t<label>\n\t\t\t<span class=\"checkbox\"><input <?php name_id( $key ); ?> type=\"checkbox\" <?php echo esc_attr( $checked ? 'checked' : '' ); ?>></span>\n\t\t\t<span><?php echo esc_html( $label ); ?></span>\n\t\t</label>\n\t</div>\n\t<?php\n}",
"function image_button ($src, $language, $is_button = false) {\n\t// $is_button=true will cancel the check in function \"image\".\n\t\t\n\t\t$this->is_button = $is_button;\n\t\t// Check only if STS is enabled.\n if (MODULE_STS_DEFAULT_STATUS==\"true\") {\n\t\t $check_file = STS_TEMPLATE_DIR . 'images/'. $language . '/' .$this->buttons_folder . '/' .$src;\n if (file_exists($check_file)) return $check_file;\n }\n\t\treturn '';\n\n\t}",
"public function check_change_image($checked)\n {\n\n if($checked!='on')\n {\n // echo \"-----------\" . $this->input->post('user_file');\n //$this->form_validation->set_rules('user_file', '<strong> Banner image file</strong>', 'required'); \n if($_FILES['userfile']['name']==\"\")\n {\n $this->form_validation->set_message('check_change_image', 'No Image file selected.');\n return false;\n }\n }\n \n\n return true;\n // if ($str == 'test')\n // {\n // $this->form_validation->set_message('username_check', 'The %s field can not be the word \"test\"');\n // return FALSE;\n // }\n // else\n // {\n // return TRUE;\n // }\n }",
"public function render_content() { ?>\n\t\t\t<div class=\"image_checkbox_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php\t$chkbox_values = explode( ',', esc_attr( $this->value() ) ); ?>\n\t\t\t\t<input type=\"hidden\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-multi-image-checkbox\" <?php $this->link(); ?> />\n\t\t\t\t<?php foreach ( $this->choices as $key => $value ) { ?>\n\t\t\t\t\t<label class=\"checkbox-label\">\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"<?php echo esc_attr( $key ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php checked( in_array( esc_attr( $key ), $chkbox_values, true ), 1 ); ?> class=\"multi-image-checkbox\"/>\n\t\t\t\t\t\t<img src=\"<?php echo esc_attr( $value['image'] ); ?>\" alt=\"<?php echo esc_attr( $value['name'] ); ?>\" title=\"<?php echo esc_attr( $value['name'] ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t<?php\t} ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"function acf_checkbox_input($attrs = array())\n{\n}",
"function render_checkbox( $args ) {\n\t\t\t$optionValue = Link_WP_LinkID::get_option_value( $args['key'] );\n\t\t\t$checked = $optionValue === null ? '' : checked( 1, $optionValue, false );\n\n\t\t\t?>\n\t\t\t<input type=\"checkbox\" value=\"1\"\n\t\t\t name=\"<?php echo \"link_linkid_settings[\" . $args['key'] . \"]\" ?>\" <?php echo $checked ?>>\n\t\t\t<p class=\"description\"><?php echo $args[\"description\"] ?></p>\n\t\t\t<?php\n\t\t}",
"function show_metabox_post_slider($post) {\r\n\t\t$slider = (get_post_meta($post->ID, 'slider', true)) ? 'checked' : '';\r\n\t\twp_nonce_field(__FILE__, '_articulo_slider_nonce');\r\n\t\techo \"<input type='checkbox' name='slider' id='slider' value='true' $slider> <label for='slider'>Mostrar las fotos del artículo en fotogalería.</label>\";\r\n\t}",
"function acf_get_checkbox_input($attrs = array())\n{\n}",
"function image_align_input_fields($post, $checked = '')\n {\n }",
"function checkboxes(){\n if($this->ChkReal->Checked){\n $this->avance_real = 'Si';\n }else{\n $this->avance_real = 'No';\n }\n if($this->ChkProg->Checked){\n $this->avance_prog = 'Si';\n }else{\n $this->avance_prog = 'No';\n }\n if($this->ChkComent->Checked){\n $this->comentario = 'Si';\n }else{\n $this->comentario = 'No';\n }\n if($this->ChkPermiso->Checked){\n $this->permiso = 'Si';\n }else{\n $this->permiso = 'No';\n }\n if($this->ChkTipoA->Checked){\n $this->tipo_admon = 'Si';\n }else{\n $this->tipo_admon = 'No';\n }\n }",
"private function display_checkbox_field($name, $value) {\n?>\n<input type=\"checkbox\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\"<?php if ($value) echo ' checked=\"checked\"' ?> value=\"1\" /><br />\n<?php\n }",
"function checkbox_icon($var) {\r\n\r\n\tif ($var == 1) {\r\n\t\r\n\t\techo '✓';\r\n\t\t\r\n\t} else {\r\n\t\t\r\n\t\techo 'x';\r\n\t\t\r\n\t}\r\n}",
"function wpzoom_page_options() {\n global $post;\n\n ?>\n <fieldset>\n <p class=\"wpz_border\">\n <?php $isChecked = ( get_post_meta($post->ID, 'wpzoom_is_featured', true) == 1 ? 'checked=\"checked\"' : '' ); // we store checked checkboxes as 1 ?>\n <input type=\"checkbox\" name=\"wpzoom_is_featured\" id=\"wpzoom_is_featured\" value=\"1\" <?php echo esc_attr($isChecked); ?> /> <label for=\"wpzoom_is_featured\"><?php _e('Feature in Homepage Slider', 'wpzoom'); ?></label>\n </p>\n\n </fieldset>\n <?php\n}",
"function theme_checkbox(&$item) {\n\n\t\t$class = array('form-checkbox');\n\t\t_form_set_class($item, $class);\n\n\t\t$checked = \"\";\n\t\tif (!empty($item[\"#value\"])) {\n\t\t\t$checked = \"checked=\\\"checked\\\" \";\n\t\t}\n\n\t\t$retval = '<input '\n\t\t\t. 'type=\"checkbox\" '\n\t\t\t. 'name=\"'. $item['#name'] .'\" '\n\t\t\t. 'id=\"'. $item['#id'].'\" ' \n\t\t\t. 'value=\"'. $item['#return_value'] .'\" '\n\t\t\t. $checked\n\t\t\t. drupal_attributes($item['#attributes']) \n\t\t\t. ' />';\n\n\t\treturn($retval);\n\n\t}",
"function checkbox ($params) {\n\t\tif (!$params['id']) $params['id'] = $params['name'];\n if (!$params['y_value']) $params['y_value'] = 1;\n if (!$params['n_value']) $params['n_value'] = 0;\n?>\n\t\t<input type=\"hidden\" name=\"<?=$params['name']?>\" value=\"<?=$params['n_value']?>\" />\n\t\t<input\n\t\t\ttype=\"checkbox\" \n\t\t\tname=\"<?=$params['name']?>\" \n\t\t\tvalue=\"<?=$params['y_value']?>\"\n\t\t\tid=\"<?=$params['id']?>\" \n\t\t\tonclick=\"<?=$params['onclick']?>\"\n\t\t\t<? if ($params['checked']) echo 'checked=\"checked\"'; ?> \n\t\t\t<? if ($params['disabled']) echo 'disabled=\"disabled\"'; ?> \n\t\t\tstyle=\"display:inline;\"\n\t\t/>\n\t\t<label for=\"<?=$params['id']?>\" class=\"checkbox-label\"><?=$params['label']?></label>\n\t\t\n<?\n\t}",
"function checkbox($args = '', $checked = false) {\r\n $defaults = array('name' => '', 'id' => false, 'class' => false, 'group' => '', 'special' => '', 'value' => '', 'label' => false, 'maxlength' => false);\r\n extract(wp_parse_args($args, $defaults), EXTR_SKIP);\r\n\r\n $return = '';\r\n // Get rid of all brackets\r\n if (strpos(\"$name\", '[') || strpos(\"$name\", ']')) {\r\n $replace_variables = array('][', ']', '[');\r\n $class_from_name = $name;\r\n $class_from_name = \"wpi_\" . str_replace($replace_variables, '_', $class_from_name);\r\n } else {\r\n $class_from_name = \"wpi_\" . $name;\r\n }\r\n // Setup Group\r\n $group_string = '';\r\n if ($group) {\r\n if (strpos($group, '|')) {\r\n $group_array = explode(\"|\", $group);\r\n $count = 0;\r\n foreach ($group_array as $group_member) {\r\n $count++;\r\n if ($count == 1) {\r\n $group_string .= \"$group_member\";\r\n } else {\r\n $group_string .= \"[$group_member]\";\r\n }\r\n }\r\n } else {\r\n $group_string = \"$group\";\r\n }\r\n }\r\n // Use $checked to determine if we should check the box\r\n $checked = strtolower($checked);\r\n if ($checked == 'yes' ||\r\n $checked == 'on' ||\r\n $checked == 'true' ||\r\n ($checked == true && $checked != 'false' && $checked != '0')) {\r\n $checked = true;\r\n } else {\r\n $checked = false;\r\n }\r\n $id = ($id ? $id : $class_from_name);\r\n $insert_id = ($id ? \" id='$id' \" : \" id='$class_from_name' \");\r\n $insert_name = ($group_string ? \" name='\" . $group_string . \"[$name]' \" : \" name='$name' \");\r\n $insert_checked = ($checked ? \" checked='checked' \" : \" \");\r\n $insert_value = \" value=\\\"$value\\\" \";\r\n $insert_class = \" class='$class_from_name $class wpi_checkbox' \";\r\n $insert_maxlength = ($maxlength ? \" maxlength='$maxlength' \" : \" \");\r\n // Determine oppositve value\r\n switch ($value) {\r\n case 'yes':\r\n $opposite_value = 'no';\r\n break;\r\n case 'true':\r\n $opposite_value = 'false';\r\n break;\r\n }\r\n // Print label if one is set\r\n if ($label)\r\n $return .= \"<label for='$id'>\";\r\n // Print hidden checkbox\r\n $return .= \"<input type='hidden' value='$opposite_value' $insert_name />\";\r\n // Print checkbox\r\n $return .= \"<input type='checkbox' $insert_name $insert_id $insert_class $insert_checked $insert_maxlength $insert_value $special />\";\r\n if ($label)\r\n $return .= \" $label</label>\";\r\n return $return;\r\n }",
"public function form_field_images ( $args ) {\n\t\t$options = $this->get_settings();\n\t\t\n\t\tif ( isset( $args['data']['options'] ) && ( count( (array)$args['data']['options'] ) > 0 ) ) {\n\t\t\t$html = '';\n\t\t\tforeach ( $args['data']['options'] as $k => $v ) {\n\t\t\t\t$html .= '<input type=\"radio\" name=\"' . esc_attr( $this->token ) . '[' . esc_attr( $args['key'] ) . ']\" value=\"' . esc_attr( $k ) . '\"' . checked( esc_attr( $options[$args['key']] ), $k, false ) . ' /> ' . $v . '<br />' . \"\\n\";\n\t\t\t}\n\t\t\techo $html;\n\t\t\t\n\t\t\tif ( isset( $args['data']['description'] ) ) {\n\t\t\t\techo '<span class=\"description\">' . $args['data']['description'] . '</span>' . \"\\n\";\n\t\t\t}\n\t\t}\n\t}"
]
| [
"0.6598669",
"0.6596252",
"0.6528963",
"0.65153515",
"0.63958496",
"0.6358763",
"0.6354054",
"0.6294119",
"0.62889445",
"0.61716133",
"0.6163863",
"0.60828614",
"0.6028327",
"0.6000511",
"0.59055394",
"0.5900837",
"0.58353907",
"0.5830131",
"0.5828242",
"0.58257085",
"0.57927096",
"0.57831687",
"0.5767528",
"0.5717883",
"0.5709882",
"0.57012486",
"0.5684308",
"0.56842107",
"0.5679317",
"0.56759155"
]
| 0.73031205 | 0 |
Show libs for project. | public function projectLibs($projectID)
{
$this->doc->setMainMenu();
$project = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
$this->view->title = $project->name;
$this->view->project = $project;
$this->view->libs = $this->doc->getLibsByProject($projectID);
$this->display();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function includeLibs()\n {\n $string = '';\n\n if($this->css_files)\n {\n foreach( $this->css_files as &$css_file )\n {\n $string .= '<link rel=\"stylesheet\" href=\"' . $css_file . '\" type=\"text/css\" />';\n }\n }\n \n if($this->js_files)\n {\n foreach( $this->js_files as &$js_file )\n {\n $string .= PHP_EOL . '<script src=\"' . $js_file . '\" type=\"text/javascript\"></script>';\n }\n }\n $this->tpl->assign(\"libs\", $string . PHP_EOL);\n }",
"public function output_libraries()\n {\n $libraries = '';\n foreach($this->_config->item('javascript', 'libraries') as $lib){\n $libraries .= '<script type=\"text/javascript\" src=\"'.\n $this->_config->item('base_url').$lib.\"\\\"></script>\\n\";\n }\n \n return $libraries;\n }",
"function instances()\n {\n echo \"There are \" . Library::$libraries . \" libraries.\";\n }",
"function asu_isearch_libraries_info() {\n // Expected to be extracted into 'sites/all/libraries/jqtree'.\n $libraries['jqtree'] = array(\n 'name' => 'jQTree Library',\n 'vendor url' => 'http://mbraak.github.io/jqTree/',\n 'download url' => 'https://github.com/mbraak/jqTree/archive/0.22.0.zip',\n 'version callback' => 'asu_isearch_short_circuit_version',\n 'files' => array(\n 'js' => array('tree.jquery.js'),\n 'css' => array('jqtree.css'),\n ),\n );\n\n return $libraries;\n}",
"public function index()\n {\n $this->doc->setMainMenu();\n\n $projects = $this->doc->getLimitLibs('project', '9');\n $customLibs = $this->doc->getLimitLibs('custom', '9');\n $subLibs = $this->doc->getSubLibGroups(array_keys($projects));\n\n $this->view->title = $this->lang->doc->common . $this->lang->colon . $this->lang->doc->index;\n $this->view->projects = $projects;\n $this->view->customLibs = $customLibs;\n $this->view->subLibs = $subLibs;\n $this->display();\n }",
"public function index()\n {\n $libarys = Libary::all();\n return view('libary.list', compact('libarys'));\n }",
"public function getLibraries(Editor $editor);",
"public static function getFullList()\n {\n return self::$library;\n }",
"public function buildLibraries($docs = FALSE);",
"public function getLibraries()\n {\n return $this->libraries;\n }",
"public function index()\n\t{\n\n\t\t$ch = curl_init(base_url('/api/restLibraries/'));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t$data['libraries'] = json_decode(curl_exec($ch), true);\n\t\tcurl_close($ch);\n\n\t\t$this->load->view('theme/header'); \n\t\t$this->load->view('library/list', $data);\n\t\t$this->load->view('theme/footer');\n\t}",
"public function list()\n {\n $plugins = Plugin::orderBy('name', 'asc')->where('vsrepo', 0)->where('vs_included', 0)->with('categories')->get();\n\t\treturn view('vsrepo.list', compact('plugins'));\n }",
"public static function getLibrary() {}",
"function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}",
"public function show(libros $libros)\n {\n //\n }",
"protected function getLibraries(): array\n {\n return [];\n }",
"public function listaLibros() {\n $consultaListaLibros = $this->db->select(\"SELECT * FROM libro \"\n . \"ORDER BY titulo\");\n return $consultaListaLibros;\n }",
"public function loadLibraries(){\n // twig\n require_once LIBRARY_PATH.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Twig'.DIRECTORY_SEPARATOR.'Autoloader.php';\n Twig_Autoloader::register();\n \n }",
"public function index()\n {\n $libros=Libro::all();\n return view('libros.index', compact('libros'));\n }",
"private function showProjectInfo()\n {\n // URLs\n $this->output->writeln('');\n $this->output->writeln('<info>'. $this->project->getName(false) .'</info> has now been created.');\n $this->output->writeln('<comment>Development:</comment> ' . $this->project->getDevUrl());\n $this->output->writeln('<comment>Staging:</comment> ' . $this->project->getStagingUrl());\n $this->output->writeln('<comment>Production:</comment> N/A');\n\n // Database credentials\n $databaseCredentials = $this->project->getDatabaseCredentials('dev');\n $this->output->writeln('');\n $this->output->writeln('<info>Development MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n\n $databaseCredentials = $this->project->getDatabaseCredentials('staging');\n $this->output->writeln('');\n $this->output->writeln('<info>Staging MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n $this->output->writeln('');\n\n // We're done!\n $this->output->writeln('<info>You can now run \"cd '. $this->project->getName() .' && vagrant up\"</info>');\n }",
"public function show()\n {\n $service = Config::get(\"ProjectLister::service\");\n $method = \"fetch_$service\";\n // Fetch\n $projects = self::$method();\n // Sort the list\n $projects = Project::sort( $projects );\n\n $output = '';\n foreach($projects as $project)\n {\n $template = ( Config::get(\"ProjectLister::template\") ) ? Config::get(\"ProjectLister::template\") : Project::getProjectTemplate();\n\n $template = str_replace('{{PROJECT_URL}}', $project->url, $template);\n $template = str_replace('{{PROJECT_NAME}}', htmlentities($project->name), $template);\n $template = str_replace('{{PROJECT_WATCHER_COUNT}}', $project->watchers, $template);\n $template = str_replace('{{PROJECT_DESCRIPTION}}', htmlentities($project->description), $template);\n $template = str_replace('{{PROJECT_SOURCE}}', $project->source, $template);\n $template = str_replace('{{PROJECT_WATCHER_NOUN}}', $project->watcher_noun, $template);\n\n $output .= $template . \"\\n\";\n }\n return $output;\n }",
"public function getLibsByProject($projectID, $mode = '')\n {\n $projectLibs = $this->dao->select('*')->from(TABLE_DOCLIB)->where('deleted')->eq(0)->andWhere('project')->eq($projectID)->orderBy('order, id')->fetchAll('id');\n\n $libs = array();\n foreach($projectLibs as $lib)\n {\n if($this->hasRight($lib)) $libs[$lib->id] = $lib->name;\n }\n\n if(strpos($mode, 'onlylib') === false)\n {\n if(commonModel::hasPriv('doc', 'showFiles')) $libs['files'] = $this->lang->doc->files;\n }\n\n return $libs;\n }",
"private function loadLib() {\r\n $this->load->library( 'javascript' );\r\n\r\n $this->load->helper( 'url' );\r\n $this->load->helper( 'html' );\r\n }",
"public function library($lib){\n include LIB_PATH.\"$lib.php\";\n }",
"public function index()\n\t\t{\n\t\t\t$this->data['libraries'] = $this->library->getLibraries();\n\t\t $this->load->view('front/index', $this->data);\n\t\t}",
"protected function RequireLibs()\n {\n\n }",
"public function index()\n {\n $file=Library::all();\n return view('view',compact('file'));\n }",
"public function show($id)\n {\n $library = Library::find($id);\n return view('backend.library.show', compact('library'));\n }",
"public function ShowVendors()\n\t{\n\t\t$GLOBALS['BreadCrumbs'] = array(\n\t\t\tarray(\n\t\t\t\t'name' => GetLang('Vendors')\n\t\t\t)\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName').' - '.GetLang('Vendors'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendors');\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}",
"public function index()\n {\n $libros = Libro::get(); // tambien podemos utilizar paginate()\n return $libros; //view('libro', ['libros' => $libros]);\n }"
]
| [
"0.60208815",
"0.5907887",
"0.56242406",
"0.5551945",
"0.552166",
"0.54081833",
"0.53306717",
"0.5310104",
"0.52883095",
"0.52828646",
"0.52627695",
"0.5251477",
"0.5222435",
"0.5171557",
"0.5169163",
"0.5168592",
"0.5087217",
"0.50619435",
"0.5047678",
"0.50367916",
"0.50146484",
"0.5005974",
"0.49914762",
"0.49905673",
"0.49853414",
"0.49603617",
"0.49537158",
"0.4951542",
"0.49491245",
"0.49466342"
]
| 0.6026059 | 0 |
Removes the routing cache each time there is a change in page so that the new routes get cached | public function clearRouteCache()
{
$isSuccess = $this->removeRoutingCache();
$this->addRemoveNotification($isSuccess);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function clearRouteCache() { \n self::$_cache = [];\n }",
"protected function clearRewriteCache()\n {\n $cache = (int) Shopware()->Config()->routerCache;\n $cache = $cache < 360 ? 86400 : $cache;\n\n $sql = \"SELECT `id` FROM `s_core_config_elements` WHERE `name` LIKE 'routerlastupdate'\";\n $elementId = Shopware()->Db()->fetchOne($sql);\n\n $sql = \"\n SELECT v.shop_id, v.value\n FROM s_core_config_values v\n WHERE v.element_id=?\n \";\n $values = Shopware()->Db()->fetchPairs($sql, array($elementId));\n\n foreach ($values as $shopId => $value) {\n $value = unserialize($value);\n $value = min(strtotime($value), time() - $cache);\n $value = date('Y-m-d H:i:s', $value);\n $value = serialize($value);\n $sql = '\n UPDATE s_core_config_values SET value=?\n WHERE shop_id=? AND element_id=?\n ';\n Shopware()->Db()->query($sql, array($value, $shopId, $elementId));\n }\n }",
"public function clearCache()\n\t{\n\t\tYii::app()->cache->delete('customurlrules');\n\t}",
"public function clearCache()\n\t{\n\t\tYii::app()->cache->delete('customurlrules');\n\t}",
"public function resetRoutes() {\n \t$this->routes = [];\n }",
"function eve_api_clear_page_cache($name) {\n ctools_include('object-cache');\n ctools_object_cache_clear('eve_api', $name);\n}",
"public static function removeCache() {\n\t}",
"static function clear() {\n self::$_routes = array();\n }",
"public function clear()\n {\n $this->routes = array();\n }",
"public function purgePageCache()\n\t{\n\t\t// Purge the folder\n\t\t$objFolder = new \\Folder('system/cache/html');\n\t\t$objFolder->purge();\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the page cache', __METHOD__, TL_CRON);\n\t}",
"public function clearCache() {}",
"public function clearCache() {}",
"private function _clearCache()\n {\n Cache::forget(\"roaddamage-resource:{$this->id}\");\n foreach ($this->getReports() as $report) {\n Cache::forget(\"report-resource:{$report->id}\");\n }\n }",
"private function clearCache() {\n\t\t\n\t\tCore\\Cache::clear();\n\t\t\n\t}",
"function clearCache()\n {\n $cacheDir = $this->container->getParameter('kernel.cache_dir');\n\n $kernel = $this->container->get('kernel');\n\n $cacheDir = realpath($cacheDir.'/../');\n\n\n foreach (array (/*'frontdev','frontprod',*/'dev','prod') as $env)\n {\n foreach (array ('UrlGenerator','UrlMatcher') as $file)\n {\n $cachedFile = $cacheDir.'/'.$env.'/app'.ucfirst($env).$file.'.php';\n //print '<br>'.$cachedFile;\n if (file_exists($cachedFile)) @unlink ($cachedFile);\n\n\n $cachedFile = $cacheDir.'/'.$env.'/app'.$env.$file.'.php';\n //print '<br>'.$cachedFile;\n if (file_exists($cachedFile)) @unlink ($cachedFile);\n }\n }\n\n\n if (function_exists('apc_clear_cache')) apc_clear_cache('user');\n //exit();\n\n }",
"final public function clearViewsCache() {\n\t\t$this->allViews = null;\n\t}",
"public function clearCache() {\n\t\tYii::app()->user->setState('nlsLoadedResources', array());\n\t}",
"public function refreshAPCCache()\n {\n $configModel = new Default_Model_Configuration();\n $server = $configModel->getKey('api_url');\n $hash = isset($server) ? hash('sha1', $server) : '';\n \n $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);\n\n $cache->delete($hash . '-Output.default-format');\n }",
"protected function reloadRoutes()\n {\n Router::reload();\n }",
"public static function clear() \n\t\t{\n\t\t\tSite_CacheManager::flush('page');\n\t\t}",
"protected function cacheRoutesPerLocale()\n {\n // Store the default routes cache,\n // this way the Application will detect that routes are cached.\n $allLocales = $this->getSupportedLocales();\n\n array_push($allLocales, null);\n\n foreach ($allLocales as $locale) {\n\n $routes = $this->getFreshApplicationRoutesForLocale($locale);\n\n if (count($routes) == 0) {\n $this->error(\"Your application doesn't have any routes.\");\n return;\n }\n\n foreach ($routes as $route) {\n $route->prepareForSerialization();\n }\n\n $this->files->put(\n $this->makeLocaleRoutesPath($locale), $this->buildRouteCacheFile($routes)\n );\n }\n }",
"public function rebuild()\n {\n // Don't bother if there's no cache file in config\n if (empty($this->cacheFile)) {\n throw new \\Exception(\n 'Cannot rebuild route cache because no file is provided in config.'\n );\n }\n // Get all published routes\n $routes = $this->pageModel->getPublishedRoutes();\n\n // Smash them into a pipe-separated string\n $pipedRoutes = implode('|', $routes);\n\n // Write to the cache file\n file_put_contents($this->cacheFile, $pipedRoutes);\n }",
"public function removeCache() {\r\n $files = $this->caches;\r\n while (count($files) > 0) {\r\n @unlink(array_shift($files));\r\n }\r\n\r\n }",
"public function clearCache()\n {\n }",
"public function dettachCache()\n {\n if (!is_null($this->_cache)) {\n unset($this->_cache);\n }\n }",
"public function refreshAPCCache()\n {\n $configModel = new Default_Model_Configuration();\n $server = $configModel->getKey('api_url');\n $hash = isset($server) ? hash('sha1', $server) : '';\n \n $cache = Frapi_Cache::getInstance(FRAPI_CACHE_ADAPTER);\n\n $cache->delete($hash . '-Partners.emails-keys');\n $cache->delete($hash . '-configFile-partners');\n }",
"public function removeCache()\n {\n $this->getHttpClientBuilder()->removeCache();\n }",
"public function removeFromCache()\n {\n Cache::tags('file')->forget(strtolower($this->alias));\n }",
"protected function _rebuildRoutes() {\n \\Drupal::service('router.builder')->rebuild();\n }",
"public function clear()\n {\n $this->_cache->clearByNamespace('/');\n }"
]
| [
"0.79029155",
"0.69259477",
"0.6717992",
"0.6717992",
"0.6548481",
"0.6507365",
"0.65009224",
"0.64128596",
"0.6369026",
"0.63547254",
"0.63236314",
"0.63236314",
"0.62545705",
"0.62499845",
"0.62346107",
"0.62163705",
"0.62129873",
"0.62043697",
"0.61919767",
"0.6161796",
"0.61587244",
"0.6151387",
"0.61491936",
"0.6144151",
"0.61172605",
"0.60975426",
"0.60681325",
"0.60647285",
"0.60643744",
"0.60638"
]
| 0.7894451 | 1 |
Get the [prod_id] column value. | public function getProdId()
{
return $this->prod_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProdId($product){\r\n require '../../model/dbconnect.php';\r\n $prod = $db->quote($product);\r\n $rows_prod = $db->query(\"SELECT id FROM product WHERE name = $prod\");\r\n if ($rows_prod) {\r\n foreach($rows_prod as $row)\r\n return $row['id'];\r\n }\r\n }",
"public function getProductid() {\n\t\treturn $this->productid;\n\t}",
"function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}",
"public function getPrimaryKey()\n {\n return $this->getProdId();\n }",
"public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }",
"public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }",
"public function getProductId()\n {\n $value = $this->get(self::product_id);\n return $value === null ? (integer)$value : $value;\n }",
"function product_id($product_id=null)\n {\n if (isset($product_id)) $this->product_id = $product_id;\n return $this->product_id;\n }",
"public function getIdProduct()\n {\n return $this->idProduct;\n }",
"public function getIdProduct()\n {\n return $this->idProduct;\n }",
"public function getIdProduct()\n {\n return $this->idProduct;\n }",
"public function get_id_product()\n\t{\n\t\treturn $this->id_product;\n\t}",
"function getID(){ return (int)$this->productInfo['products_id']; }",
"public function getProductID()\n {\n return $this->productID;\n }",
"public function getProductID()\n {\n return $this->productID;\n }",
"public function getProductID()\n {\n return $this->productID;\n }",
"public function getProductIdFieldName() {\n return 'products_id';\n }",
"public function getId()\n {\n return $this->idProduct;\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getId_product()\n {\n return $this->id_product;\n }",
"public function getProduct_Id() {\n return $this->product_Id;\n }",
"public function getProductID()\n {\n if ($product = $this->Product()) {\n return $product->ID;\n }\n return 0;\n }",
"public function getProductId()\n {\n $productIdAttribute = $this->helper->getProductIdConfig();\n\n return $this->getAttribute($productIdAttribute);\n }",
"public function getProductId(): string\n {\n return $this->productId;\n }",
"private function getProductIdentifierField()\n {\n if (!$this->productEntityIdentifierField) {\n $this->productEntityIdentifierField = $this->getMetadataPool()\n ->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)\n ->getIdentifierField();\n }\n return $this->productEntityIdentifierField;\n }",
"public function get_productId(): int\n {\n // $res is a int;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductId();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTID_INVALID;\n }\n }\n $res = $this->_productId;\n return $res;\n }",
"public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}",
"public function getProductId() {\n\t\treturn($this->productId);\n\t}",
"public function get_product_id() {\n return $this->product_id;\n }",
"protected function getLinkedProductID () {\n $productFilter = Search::getInstance($this->data['attrs']['source_id'])->getFilter('product');\n\n return $productFilter ? $productFilter['value'] : null;\n }"
]
| [
"0.73035824",
"0.69820976",
"0.6949236",
"0.6908819",
"0.6898615",
"0.6853161",
"0.6833888",
"0.67703784",
"0.67697114",
"0.67697114",
"0.67697114",
"0.6722221",
"0.66953254",
"0.6691161",
"0.6691161",
"0.6691161",
"0.6690784",
"0.66845405",
"0.6667453",
"0.6627047",
"0.65908873",
"0.65892875",
"0.65609366",
"0.65596837",
"0.6507168",
"0.65040934",
"0.64928496",
"0.64716375",
"0.64584494",
"0.6447525"
]
| 0.7903942 | 0 |
Get the [prod_price_id] column value. | public function getProdPriceId()
{
return $this->prod_price_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getProductId()\n {\n $value = $this->get(self::product_id);\n return $value === null ? (integer)$value : $value;\n }",
"private function getPriceAttributeId()\n {\n if (!$this->priceAttributeId) {\n $this->priceAttributeId = $this->attributeRepository->get('special_price')->getAttributeId();\n }\n\n return $this->priceAttributeId;\n }",
"public function getProductid() {\n\t\treturn $this->productid;\n\t}",
"public function getIdProduct()\n {\n return $this->idProduct;\n }",
"public function getIdProduct()\n {\n return $this->idProduct;\n }",
"public function getIdProduct()\n {\n return $this->idProduct;\n }",
"function getProdId($product){\r\n require '../../model/dbconnect.php';\r\n $prod = $db->quote($product);\r\n $rows_prod = $db->query(\"SELECT id FROM product WHERE name = $prod\");\r\n if ($rows_prod) {\r\n foreach($rows_prod as $row)\r\n return $row['id'];\r\n }\r\n }",
"public function get_id_product()\n\t{\n\t\treturn $this->id_product;\n\t}",
"public function getProductIdFieldName() {\n return 'products_id';\n }",
"public function getProductId()\n {\n $productIdAttribute = $this->helper->getProductIdConfig();\n\n return $this->getAttribute($productIdAttribute);\n }",
"public function getProductID()\n {\n return $this->productID;\n }",
"public function getProductID()\n {\n return $this->productID;\n }",
"public function getProductID()\n {\n return $this->productID;\n }",
"public function getId_product()\n {\n return $this->id_product;\n }",
"public function getProductId()\n {\n return $this->product_id;\n }",
"public function getProductId()\n {\n return $this->product_id;\n }",
"public function getProductId() {\n\t\treturn($this->productId);\n\t}",
"public function get_productId(): int\n {\n // $res is a int;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductId();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTID_INVALID;\n }\n }\n $res = $this->_productId;\n return $res;\n }",
"public function get_product_id() {\n return $this->product_id;\n }",
"public function getProductID()\n {\n if ($product = $this->Product()) {\n return $product->ID;\n }\n return 0;\n }",
"public function getCustomPriceId($product_variety_id, $multiplicator) {\n\t\t\n\t\tif (!is_numeric($product_variety_id)) return false;\n\t\tif (!is_numeric($multiplicator)) return false;\n\t\t\n\t\trequire_once('models/ecommerce/ecommerce_price.php');\n\t\t$Price = new ecommerce_price();\n\t\t\n\t\t$price_id = $Price->getCustomPriceIdByMultiplicator($product_variety_id, $multiplicator);\n\t\t\n\t\tif (is_numeric($price_id)) return $price_id;\n\t\telse return false;\t\n\t}",
"public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}",
"public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }",
"public function getProduct_Id() {\n return $this->product_Id;\n }",
"public function getId()\n {\n return $this->idProduct;\n }",
"public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }",
"function getID(){ return (int)$this->productInfo['products_id']; }",
"public function getPrimaryKey()\n {\n return $this->getProdId();\n }",
"function product_id($product_id=null)\n {\n if (isset($product_id)) $this->product_id = $product_id;\n return $this->product_id;\n }"
]
| [
"0.7352852",
"0.69665",
"0.68221",
"0.6768231",
"0.669076",
"0.669076",
"0.669076",
"0.66472805",
"0.6647117",
"0.66364694",
"0.6608908",
"0.65955067",
"0.65955067",
"0.65955067",
"0.65907025",
"0.65622246",
"0.65622246",
"0.6549087",
"0.6509767",
"0.64932376",
"0.6485814",
"0.64837724",
"0.64619106",
"0.64528424",
"0.64498717",
"0.6446351",
"0.6433748",
"0.6428177",
"0.63942224",
"0.6387931"
]
| 0.819803 | 0 |
Get the [prod_name] column value. | public function getProdName()
{
return $this->prod_name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}",
"public function getProductName() {\n //return the value product name\n return $this->ProductName;\n }",
"public function getProductName()\n {\n return $this->product_name;\n }",
"public function getProductName()\n {\n return $this->product_name;\n }",
"public function getName_product()\n {\n return $this->name_product;\n }",
"protected function getProductName(): ?string\n\t{\n\t\tstatic $cache = [];\n\n\t\t$productId = $this->getProductId();\n\t\tif (!$productId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!array_key_exists($productId, $cache))\n\t\t{\n\t\t\tLoader::includeModule('iblock');\n\n\t\t\t$row = ElementTable::getRow([\n\t\t\t\t'select' => [\n\t\t\t\t\t'NAME',\n\t\t\t\t],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=ID' => $productId,\n\t\t\t\t],\n\t\t\t]);\n\t\t\t$cache[$productId] = $row ? (string)$row['NAME'] : null;\n\t\t}\n\n\t\treturn $cache[$productId];\n\t}",
"public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }",
"public function getProductName(){\n return $this->product_name;\n }",
"public function getProdName(){\n\t\treturn array_keys($this->_products);\n\t}",
"function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }",
"public function get_productName(): string\n {\n // $res is a string;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductName();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTNAME_INVALID;\n }\n }\n $res = $this->_productName;\n return $res;\n }",
"function get_product_name($pid){\n\t\tglobal $connection;\n\t\t\n\t\t\t$query = \"SELECT name FROM products WHERE id=\" .$pid;\n\t\t\t$result = mysql_query($query, $connection);\n\t\t\tconfirm_query($result);\n\t\t\t$row = mysql_fetch_array($result);\n\t\t\n\t\treturn $row['name'];\n\t}",
"public function getProductName(): ?string\n {\n return $this->productName;\n }",
"public function getProductName(): ?string\n {\n return $this->productName;\n }",
"public function getProductName(): ?string\n {\n return $this->productName;\n }",
"public function getProdTitle()\n {\n return $this->prod_title;\n }",
"public function findNameProd($id){\n return Product::where('id',$id)->first()->name;\n }",
"public function getDocumentProductName()\n {\n return (string) $this->document_product_name;\n }",
"function get_product_name($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$name = \"book_name\"; // products name\n\t$result=mysql_query(\"select $name from $products where $serial=$pid\")\n or die (\"Query $products and pid - $pid - failed error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row[$name];\n}",
"public function getProductName()\n {\n if (!isset($this->name))\n {\n if (!$this->name = $this->getHelper()->getName($this->getSlug()))\n {\n $this->name = $this->getHelper()->getNameFromPath($this->getPathname());\n }\n }\n\n return $this->name;\n }",
"public function getName() : string\n {\n return $this->get('name', 'products');\n }",
"function GetProductName ( $whichProduct )\n{\n\n\tmysql_select_db ( 'products' );\n\t$query = 'SELECT * FROM products where ID like '.$whichProduct;\n\n\t$result = mysql_query($query );\n\n\tif ( $result )\n\t{\n\t\t$num_results = mysql_num_rows ( $result );\n\t\tif ( $num_results == 1 )\n\t\t{\n\t\t\t$row = mysql_fetch_object ( $result );\n\t\t\t$productName = $row->name;\n\t\t}\n\t\telse\n\t\t\t$productName = 'General';\n\t}\n\n\treturn $productName;\n}",
"public function product_name($name,$category)\n {\n $pro_name = $this->Dbmodel->get_product_name($name,$category); \n return $pro_name;\n }",
"static function getProductProperty($prob_name,$prod_id, $wid){\n $vdo = vpdo::getVdo(DB_PREFIX.$wid) ;\n return $vdo->fetchOne(\"select ov.name from options o \n inner join options_values ov on o.id = ov.option_id where o.name = ? and product_id = ?\", array($prob_name, $prod_id));\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getProdName() {\n return $this->ProductName;\n}",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getnameAttribute() : String\n {\n $locale = LaravelLocalization::getCurrentLocale();\n $fieldName = 'name';\n $column = $fieldName.\"_\" . $locale;\n $value = $this->{$column};\n return $value;\n }",
"public static function get_name() {\n $type = static::get_type();\n return util::string(\"product:{$type}\");\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }"
]
| [
"0.73609793",
"0.73025787",
"0.69124365",
"0.68912",
"0.6861022",
"0.683174",
"0.6813809",
"0.66766363",
"0.66518664",
"0.6434648",
"0.6411795",
"0.6391148",
"0.63107395",
"0.63107395",
"0.63107395",
"0.6301035",
"0.6291906",
"0.6282099",
"0.6253907",
"0.62482584",
"0.61818254",
"0.61161774",
"0.6090071",
"0.608197",
"0.60570997",
"0.6056643",
"0.60347867",
"0.60318315",
"0.6022479",
"0.6015266"
]
| 0.77092487 | 0 |
Get the [prod_alt1] column value. | public function getProdAlt1()
{
return $this->prod_alt1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function setProdAlt1($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt1 !== $v) {\n $this->prod_alt1 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;\n }\n\n return $this;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function setProdAlt2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt2 !== $v) {\n $this->prod_alt2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT2] = true;\n }\n\n return $this;\n }",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getProductDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $productId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `productId`\n FROM `product`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [productId],\n FROM [product]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT PRODUCTID AS \\\"productId\\\",\n FROM PRODUCT\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n }\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $productId = $row['productId'];\n }\n return $productId;\n }",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getPrecio1()\n {\n return $this->precio1;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getProduct_img () {\n\t$preValue = $this->preGetValue(\"product_img\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_img;\n\treturn $data;\n}",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getPointProd1():?int\n {\n return $this->produit1 <= 0 ? 0 : $this->produit1 * 5;\n }",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getProd_niche () {\n\t$preValue = $this->preGetValue(\"prod_niche\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"prod_niche\")->preGetData($this);\n\treturn $data;\n}",
"public function getExpr1()\n {\n return $this->expr1;\n }",
"public function getProdEra()\n {\n return $this->prod_era;\n }",
"public function getAltura() \r\n\t{\r\n\t\treturn $this->iAltura;\r\n\t}",
"public static function getAltAttribute(int $id = 0){\n // vars\n $output = '';\n $lang = prefix_core_BaseFunctions::getCurrentLang();\n // check if active lang is default or not\n if($lang == SELF::$WPimgAttr_Alt_languages[0]):\n // default language\n $output .= get_post_meta($id, '_wp_attachment_image_alt', TRUE);\n else:\n // alternative text\n $name = SELF::$WPimgAttr_Alt_prefix . $lang;\n $output .= get_post_meta($id, $name, true);\n endif;\n // output\n return $output;\n }",
"static function getProductProperty($prob_name,$prod_id, $wid){\n $vdo = vpdo::getVdo(DB_PREFIX.$wid) ;\n return $vdo->fetchOne(\"select ov.name from options o \n inner join options_values ov on o.id = ov.option_id where o.name = ? and product_id = ?\", array($prob_name, $prod_id));\n }",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getDefaultVariationId()\n {\n return $this->_defaultPriceVariationId;\n }",
"public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function getProductNum()\n {\n $value = $this->get(self::product_num);\n return $value === null ? (integer)$value : $value;\n }",
"public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}",
"public function product()\n {\n return $this->m_product;\n }",
"public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }"
]
| [
"0.693212",
"0.6838282",
"0.64445156",
"0.6274969",
"0.56699014",
"0.55439097",
"0.55326116",
"0.54882497",
"0.5472325",
"0.5453856",
"0.53777385",
"0.5346117",
"0.5280656",
"0.5278605",
"0.52767426",
"0.5213206",
"0.51875067",
"0.51318526",
"0.51313627",
"0.5121668",
"0.51138204",
"0.5079701",
"0.5071473",
"0.50710446",
"0.5024749",
"0.5017806",
"0.5007659",
"0.5007334",
"0.5005676",
"0.50052905"
]
| 0.800319 | 0 |
Get the [prod_alt2] column value. | public function getProdAlt2()
{
return $this->prod_alt2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function setProdAlt2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt2 !== $v) {\n $this->prod_alt2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT2] = true;\n }\n\n return $this;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function getValue2(){\n return $this->_value2;\n }",
"public function setProdAlt1($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt1 !== $v) {\n $this->prod_alt1 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;\n }\n\n return $this;\n }",
"public function getExpr2()\n {\n return $this->expr2;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getPointProd2():?int\n {\n //Verifier si au moins un produit 1 est vendu afin de dettminer \n //le nombre de point du produit 2\n\n return $this->produit1<=0 ? 0 : ($this->produit2<=0 ? 0 : $this->produit2 * 5);\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getAttr2(){\r\n\t\treturn $this->attr2;\r\n\t}",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getP2() {\n return $this->p2;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getBestBadge2()\n\t{\n\t\treturn $this->best_badge_2;\n\t}",
"public function getProduct_img () {\n\t$preValue = $this->preGetValue(\"product_img\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_img;\n\treturn $data;\n}",
"public function getK2()\n {\n return $this->k2;\n }",
"public function getAddress2()\n {\n return $this->getValue('nb_icontact_prospect_address_2');\n }",
"public function getC2()\r\n {\r\n return $this->C2;\r\n }",
"public function getAltura() \r\n\t{\r\n\t\treturn $this->iAltura;\r\n\t}",
"public function getProdDescription()\n {\n return $this->prod_description;\n }",
"public function getProd_niche () {\n\t$preValue = $this->preGetValue(\"prod_niche\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"prod_niche\")->preGetData($this);\n\treturn $data;\n}",
"public function getID2()\n\t{\n\t\treturn $this->id2;\n\t}",
"public function getCategory2()\n {\n if (array_key_exists(\"category2\", $this->_propDict)) {\n return $this->_propDict[\"category2\"];\n } else {\n return null;\n }\n }",
"private function two() {\n $position1 = $this->inputarray[$this->position+1];\n $position2 = $this->inputarray[$this->position+2];\n $content1 = $this->inputarray[$position1];\n $content2 = $this->inputarray[$position2];\n $product = $content1 * $content2;\n return $product;\n }",
"public function getProdEra()\n {\n return $this->prod_era;\n }"
]
| [
"0.7162106",
"0.6817994",
"0.6595363",
"0.62658614",
"0.6155384",
"0.57799315",
"0.5756571",
"0.5624732",
"0.55749595",
"0.55123776",
"0.54806703",
"0.53976256",
"0.53962004",
"0.5386562",
"0.5372085",
"0.53507113",
"0.5317736",
"0.5285686",
"0.52729803",
"0.52345175",
"0.5191411",
"0.51797396",
"0.5165985",
"0.5156452",
"0.51527876",
"0.51478785",
"0.5120368",
"0.5113771",
"0.51043165",
"0.510338"
]
| 0.7935492 | 0 |
Get the [prod_alt3] column value. | public function getProdAlt3()
{
return $this->prod_alt3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdAlt3($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt3 !== $v) {\n $this->prod_alt3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT3] = true;\n }\n\n return $this;\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function getExpr3()\n {\n return $this->expr3;\n }",
"public function getAttr3(){\r\n\t\treturn $this->attr3;\r\n\t}",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"public function getProdRelatedM3()\n {\n return $this->prod_related_m3;\n }",
"public function getPointProd3():?int\n {\n //Recuperation de la partie entière de la division du nombre\n //de produit3 par 2\n $paire = (int)($this->produit3 / 2);\n return $this->produit3 <= 0 ? 0 : $paire * 15;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"protected static function iso3(): mixed\n\t{\n\t\treturn self::$query->iso3;\n\t}",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function getCategory3()\n {\n if (array_key_exists(\"category3\", $this->_propDict)) {\n return $this->_propDict[\"category3\"];\n } else {\n return null;\n }\n }",
"function getProductValue($ms3Oid, $featureName, $raw = false) {\n\t\t$this->dbgstart();\n\t\t$FeatureId = $this->calc->dbutils->getFeatureIdByName($featureName);\n\t\t$pid = $this->calc->getProdIdForMs3Oid($ms3Oid);\n\t\t$ret = $this->calc->dbutils->getProductValue($pid, $FeatureId, $raw);\n\t\t$this->dbgend();\n\t\treturn $ret;\n\t}",
"public function getC3()\r\n {\r\n return $this->C3;\r\n }",
"public function setProdAlt1($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt1 !== $v) {\n $this->prod_alt1 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;\n }\n\n return $this;\n }",
"public function getAltura() \r\n\t{\r\n\t\treturn $this->iAltura;\r\n\t}",
"public function getEtblAdresse3() {\n return $this->etblAdresse3;\n }",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getCmp3()\n {\n return $this->cmp3;\n }",
"public function getThirdVat()\n {\n return isset($this->thirdVat) ? $this->thirdVat : null;\n }",
"public function getThird()\n {\n return isset($this->third) ? $this->third : null;\n }",
"public function getCodeArticle3() {\n return $this->codeArticle3;\n }",
"public function getAlpha3BCode()\n {\n return $this->alpha3BCode;\n }",
"public static function getAltAttribute(int $id = 0){\n // vars\n $output = '';\n $lang = prefix_core_BaseFunctions::getCurrentLang();\n // check if active lang is default or not\n if($lang == SELF::$WPimgAttr_Alt_languages[0]):\n // default language\n $output .= get_post_meta($id, '_wp_attachment_image_alt', TRUE);\n else:\n // alternative text\n $name = SELF::$WPimgAttr_Alt_prefix . $lang;\n $output .= get_post_meta($id, $name, true);\n endif;\n // output\n return $output;\n }",
"public function getAlpha3TCode()\n {\n return $this->alpha3TCode;\n }",
"public function getCodeRef3() {\n return $this->codeRef3;\n }",
"public function getVolPondasiM3()\n {\n return $this->vol_pondasi_m3;\n }",
"public function setProdAlt2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt2 !== $v) {\n $this->prod_alt2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT2] = true;\n }\n\n return $this;\n }",
"public function _getLotNo3() {\n\t\treturn $this->_lotNo3;\n\t}"
]
| [
"0.6773512",
"0.66009206",
"0.6473621",
"0.6386664",
"0.59449494",
"0.56074005",
"0.5577009",
"0.5562584",
"0.5513693",
"0.5492104",
"0.54364216",
"0.539802",
"0.5391844",
"0.53265613",
"0.53190905",
"0.5295672",
"0.5286534",
"0.5243338",
"0.5226241",
"0.5189013",
"0.5187751",
"0.51805913",
"0.5159926",
"0.5152837",
"0.5136437",
"0.51301897",
"0.5116963",
"0.5116163",
"0.5112946",
"0.5099279"
]
| 0.7954392 | 0 |
Get the [prod_alt4] column value. | public function getProdAlt4()
{
return $this->prod_alt4;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function setProdAlt4($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt4 !== $v) {\n $this->prod_alt4 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT4] = true;\n }\n\n return $this;\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"public function getPointProd4():?int\n { \n return $this->produit4 <= 0 ? 0 : $this->produit4 * 35;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getProductDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $productId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `productId`\n FROM `product`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [productId],\n FROM [product]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT PRODUCTID AS \\\"productId\\\",\n FROM PRODUCT\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n }\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $productId = $row['productId'];\n }\n return $productId;\n }",
"public function getAttr4(){\r\n\t\treturn $this->attr4;\r\n\t}",
"public function setProdAlt1($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt1 !== $v) {\n $this->prod_alt1 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;\n }\n\n return $this;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function setProdAlt3($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt3 !== $v) {\n $this->prod_alt3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT3] = true;\n }\n\n return $this;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getCategory4()\n {\n if (array_key_exists(\"category4\", $this->_propDict)) {\n return $this->_propDict[\"category4\"];\n } else {\n return null;\n }\n }",
"public function getC4()\r\n {\r\n return $this->C4;\r\n }",
"public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }",
"public function getProductNum()\n {\n $value = $this->get(self::product_num);\n return $value === null ? (integer)$value : $value;\n }",
"public function getProdEra()\n {\n return $this->prod_era;\n }",
"private function getProductIdentifierField()\n {\n if (!$this->productEntityIdentifierField) {\n $this->productEntityIdentifierField = $this->getMetadataPool()\n ->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)\n ->getIdentifierField();\n }\n return $this->productEntityIdentifierField;\n }",
"public function getProductid() {\n\t\treturn $this->productid;\n\t}",
"public function getProduct_img () {\n\t$preValue = $this->preGetValue(\"product_img\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_img;\n\treturn $data;\n}",
"public static function getAltAttribute(int $id = 0){\n // vars\n $output = '';\n $lang = prefix_core_BaseFunctions::getCurrentLang();\n // check if active lang is default or not\n if($lang == SELF::$WPimgAttr_Alt_languages[0]):\n // default language\n $output .= get_post_meta($id, '_wp_attachment_image_alt', TRUE);\n else:\n // alternative text\n $name = SELF::$WPimgAttr_Alt_prefix . $lang;\n $output .= get_post_meta($id, $name, true);\n endif;\n // output\n return $output;\n }",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function getCodeArticle4() {\n return $this->codeArticle4;\n }",
"public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}",
"private function getProductLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"public function getRecommendedProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE recommended = 'yes' LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }",
"public function getProductID()\n {\n return $this->productID;\n }"
]
| [
"0.6830606",
"0.68163145",
"0.6669471",
"0.6263033",
"0.5547978",
"0.5535405",
"0.5524351",
"0.5515742",
"0.5514858",
"0.546568",
"0.5439236",
"0.5426851",
"0.54183006",
"0.5360734",
"0.53241444",
"0.5271889",
"0.52682793",
"0.52449316",
"0.5231102",
"0.52244246",
"0.52027315",
"0.5199202",
"0.5186524",
"0.51732516",
"0.5168445",
"0.5160309",
"0.51315546",
"0.5119532",
"0.5118879",
"0.51183665"
]
| 0.7901901 | 0 |
Get the [prod_code] column value. | public function getProdCode()
{
return $this->prod_code;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getProductCode()\n {\n if (array_key_exists(\"productCode\", $this->_propDict)) {\n return $this->_propDict[\"productCode\"];\n } else {\n return null;\n }\n }",
"function getProductCode()\n {\n return $this->productCode;\n }",
"public function getProductCode(): ?string\n {\n return $this->productCode;\n }",
"public function getCode()\n {\n return $this->values[\"code\"];\n }",
"public function setProdCode($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_code !== $v) {\n $this->prod_code = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_CODE] = true;\n }\n\n return $this;\n }",
"public function getCodeProduit() {\n return $this->codeProduit;\n }",
"function getProduction($production_code) {\n $data = $this->db\n ->where('LCASE(production_code)',strtolower($production_code))\n ->limit(1)\n ->get('production')\n ->row_array();\n \n return $data;\n }",
"public function get_Code_produit()\n\t\t{\n\t\t\treturn $this->Code_produit;\n\t\t}",
"public function getCode()\n {\n return $this->getValueObject('code');\n }",
"public function getCode()\n {\n return $this->getData()->code;\n }",
"function productCode($prod)\n\t{\n\t\t$product = $this->Product->findByCode($prod);\n\t\t$parent = !empty($product['Product']['parent_product_type_id']) ? $this->Product->read(null, $product['Product']['parent_product_type_id']) : null;\n\t\t$parentProd = !empty($parent) ? $parent['Product']['code'] : null;\n\n\t\tif(!empty($parentProd) && !file_exists(APP.\"/webroot/images/designs/products/$prod.svg\") && file_exists(APP.\"/webroot/images/designs/products/$parentProd.svg\"))\n\t\t{\n\t\t\t$prod = $parentProd;\n\t\t}\n\t\treturn $prod;\n\t}",
"public function getCode()\n {\n return $this->data[1];\n }",
"public function getCode() {\n return $this->get(self::CODE);\n }",
"public function getCode()\n {\n return $this->get(self::CODE);\n }",
"public function getPricecode()\n {\n return $this->pricecode;\n }",
"public function getLocalProductCode(): ?string\n {\n return $this->localProductCode;\n }",
"public function get_code() {\n\t\treturn $this->code;\n\t}",
"public function getCode()\n {\n if (is_null($this->code)) {\n /** @psalm-var ?string $data */\n $data = $this->raw(self::FIELD_CODE);\n if (is_null($data)) {\n return null;\n }\n $this->code = (string) $data;\n }\n\n return $this->code;\n }",
"public function getDocumentProductCod()\n {\n return (string) $this->document_product_cod;\n }",
"public function getCarCode(){\r\n\t\t\t$this->car_code = getValue(\"SELECT car_code FROM tbl_car WHERE car_id=\".$this->car_id);\r\n\t\t\treturn $this->car_code;\r\n\t}",
"public function getcode()\n {\n return $this->code;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getAttributeId($code = '') {\n if (! $code) {\n return;\n }\n $attribute_details = Mage::getSingleton ( \"eav/config\" )->getAttribute ( 'catalog_product', $code );\n return $attribute_details->getData ( static::ATTRIBUTE_ID );\n }",
"public function getCode()\r\n {\r\n return $this->code;\r\n }",
"public function getCode() {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }",
"public function getCode()\n {\n return $this->code;\n }"
]
| [
"0.7673927",
"0.72473294",
"0.7006389",
"0.6916624",
"0.6466807",
"0.6464332",
"0.63460916",
"0.6270903",
"0.6258426",
"0.6233503",
"0.6193467",
"0.61709696",
"0.61593795",
"0.61585677",
"0.61318225",
"0.61248577",
"0.6121542",
"0.61152744",
"0.6090303",
"0.6081627",
"0.60629296",
"0.6036923",
"0.6029756",
"0.60278314",
"0.6019222",
"0.60153526",
"0.6014834",
"0.6014834",
"0.6014834",
"0.6014834"
]
| 0.8045544 | 0 |
Get the [prod_category] column value. | public function getProdCategory()
{
return $this->prod_category;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}",
"public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}",
"public function get_category(){\n\t\treturn $this->category;\n\t}",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }",
"public function getId_cat()\n {\n return $this->id_cat;\n }",
"public static function getCategory()\n {\n return self::$category;\n }",
"function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}",
"public function getIdCat()\n {\n return $this->id_cat;\n }",
"public function getCategory()\n {\n\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->_category;\n }"
]
| [
"0.7472611",
"0.65053254",
"0.6380111",
"0.6347475",
"0.63456774",
"0.6323605",
"0.6313287",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.62840873",
"0.6281755",
"0.62638104",
"0.62632763",
"0.6262719",
"0.62487197",
"0.62408155",
"0.62346244"
]
| 0.7681955 | 0 |
Get the [prod_category_shipping] column value. | public function getProdCategoryShipping()
{
return $this->prod_category_shipping;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getShippingCategoryId();",
"protected function getShippingCity()\n {\n $formatter = new \\Dotpay\\Tool\\StringFormatter\\Name();\n return $this->checkoutSession->getLastRealOrder()->getShippingAddress() ? $formatter->format($this->checkoutSession->getLastRealOrder()->getShippingAddress()->getCity()) : null;\n }",
"private function getShippingClass() {\n $classId = $this->wooData->getShippingClassId();\n $classTerm = get_terms([\n 'taxonomy' => 'product_shipping_class',\n 'include' => $classId,\n 'number' => 1,\n 'hide_empty' => false,\n ]);\n\n if (is_wp_error($classTerm) || !$classTerm) return _wpcc('No shipping class');\n if (is_array($classTerm)) $classTerm = $classTerm[0];\n\n /** @var WP_Term $classTerm */\n return $classTerm->name;\n }",
"protected function getShippingCountry()\n {\n return $this->checkoutSession->getLastRealOrder()->getShippingAddress() ? strtoupper($this->checkoutSession->getLastRealOrder()->getShippingAddress()->getCountryId()) : null;\n }",
"public function getShippingCountry()\n {\n return $this->getParameter('shippingCountry');\n }",
"public function getShipping()\r\n {\r\n return $this->shipping;\r\n }",
"public function getDisplayTotalShippingAttribute()\n {\n return Shop::format($this->totalShipping);\n }",
"public function getShipping()\n {\n return $this->shipping;\n }",
"public function getShipping()\n {\n return $this->shipping;\n }",
"public function getShipping()\n {\n return $this->shipping;\n }",
"public function getShippedValue()\n {\n return defined('static::SHIPPED_VALUE') ? static::SHIPPED_VALUE : 'shipped';\n }",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function getShippingCost()\r\n {\r\n return $this->shipping_cost;\r\n }",
"public function getShippingCity()\n {\n return $this->getParameter('shippingCity');\n }",
"public function getStdShipToCd()\n {\n return $this->std_ship_to_cd;\n }",
"public function setProdCategoryShipping($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_category_shipping !== $v) {\n $this->prod_category_shipping = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_CATEGORY_SHIPPING] = true;\n }\n\n if ($this->aTblShippingCategories !== null && $this->aTblShippingCategories->getProdShippingPriceId() !== $v) {\n $this->aTblShippingCategories = null;\n }\n\n return $this;\n }",
"public function getShippingCode()\n {\n $result = parent::getShippingCode();\n return $result;\n }",
"function getShippingPrice(){\n\t\t$data = $this->_collectShippingInfo();\n\t\tif(Mage::getModel(\"tax/config\")->displayCartShippingExclTax()) return $data->getShippingExclTax();\n\t\telse return $data->getShippingInclTax();\n\t}",
"public function getShippingType()\n {\n return $this->shippingType;\n }",
"public function getShippingId() \n {\n if (!$this->hasShippingId())\n {\n $this->shippingId = '';\n }\n\n return $this->shippingId;\n }",
"public function getShipping();",
"public function getShippingCost();",
"public function getCalculatedShippingDiscount()\n {\n return $this->calculatedShippingDiscount;\n }",
"public function getShippingAddress(){\n return $this->_getData(self::SHIPPING_ADDRESS);\n }",
"private function getShippingCost($variation):string\n {\n $shippingCost = null;\n if(isset($this->shippingCostCache) && array_key_exists($variation['data']['item']['id'], $this->shippingCostCache))\n {\n $shippingCost = $this->shippingCostCache[$variation['data']['item']['id']];\n }\n if(!is_null($shippingCost) && $shippingCost != '0.00')\n {\n return $shippingCost;\n }\n return '';\n }",
"public function get_shipping_cost()\n {\n $products = $this->get();\n $shipping = 0;\n if (! empty($products)) {\n foreach ($products as $product) {\n if ($product['weight'] <= 200) {\n $shipping += 1.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 500) {\n $shipping += 3.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 800) {\n $shipping += 5.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1000) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } elseif ($product['weight'] <= 1500) {\n $shipping += 8.00 * ($_SESSION['cart'][$product['id']]);\n } else {\n $shipping += 20.00 * ($_SESSION['cart'][$product['id']]);\n }\n }\n return $shipping; \n }\n else {\n return 0.00;\n }\n\n }",
"public function shippingCosts(): string\n {\n return $this->rate->price;\n }",
"public function getShippingKey()\n {\n return $this->shippingKey;\n }",
"public function getShippingKey()\n {\n return $this->shippingKey;\n }",
"public function getSellerShipping() {\r\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'seller_shipping_option' );\r\n }"
]
| [
"0.6467912",
"0.63609004",
"0.6302341",
"0.62680554",
"0.6178654",
"0.61362493",
"0.61239505",
"0.6115321",
"0.6115321",
"0.6115321",
"0.6075325",
"0.6036468",
"0.5938521",
"0.5933263",
"0.590516",
"0.5889088",
"0.5855242",
"0.58290136",
"0.5825828",
"0.58234787",
"0.5716927",
"0.57014143",
"0.5666732",
"0.5613612",
"0.5606244",
"0.55914503",
"0.55908465",
"0.55702543",
"0.55702543",
"0.55473435"
]
| 0.82064396 | 0 |
Get the [prod_writeup] column value. | public function getProdWriteup()
{
return $this->prod_writeup;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_writeup !== $v) {\n $this->prod_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WRITEUP] = true;\n }\n\n return $this;\n }",
"public function getProdKeywordsWriteup()\n {\n return $this->prod_keywords_writeup;\n }",
"public function getDocumentProductUnitaryValue()\n {\n return (string) $this->document_product_unitary_value;\n }",
"public function getWriteApiUsage() {\n return @$this->attributes['write_api_usage'];\n }",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }",
"public function getShippedValue()\n {\n return defined('static::SHIPPED_VALUE') ? static::SHIPPED_VALUE : 'shipped';\n }",
"public function getOutputProperty(): ?string\n {\n return $this->output;\n }",
"public function getBuildProperty($key)\n {\n return $this->database ? $this->database->getBuildProperty($key) : '';\n }",
"public function toValue(): string\n {\n return (string) $this->pdoStatement->fetchColumn();\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getUpn(): ?string {\n $val = $this->getBackingStore()->get('upn');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'upn'\");\n }",
"public function sqlValue()\n {\n return ($this->arrConfig['operator'] == 'like' ? ('%' . $this->arrConfig['value'] . '%') : $this->arrConfig['value']);\n }",
"public function GetCartRecord_toWrite() {\n\t$rcCart = $this->GetCartRecord_ifWriteable();\n\tif (is_null($rcCart)) {\t// If current Cart is not writeable...\n\techo 'GOT TO '.__FILE__.' line '.__LINE__.'<br>';\n\t // ...then create a new one:\n\t $idSess = $this->GetKeyValue();\n\t $idCart = $this->CartTable()->Create($idSess);\n\techo \"SESSION ID=[$idSess] CART ID=[$idCart]<br>\";\n\t $this->SetCartID($idCart);\n\t $this->SetCartRecord_fromCurrentID();\n\t $rc = $this->GetCartRecord_cached();\n\t $this->Save();\n\t}\n\treturn $rcCart;\n }",
"public function getProductPurchaseDetail($colname='',$whrValue='',$type=''){\r\n if($colname != ''){\r\n if($type == 'proddownload'){\r\n $this->CI->db->select('SUM('.$colname.') AS prodcnt');\r\n $this->CI->db->from('ts_purchaserecord');\r\n $this->CI->db->where($whrValue);\r\n $rs=$this->CI->db->get();\r\n $res = $rs->result_array();\r\n return (($res[0]['prodcnt']!='') ? $res[0]['prodcnt'] : '0') ;\r\n\t\t\t}\r\n\t\t\telse if($type == 'prodpurchase'){\r\n $res = $this->CI->DatabaseModel->access_database('ts_purchaserecord','select','',$whrValue);\r\n return (!empty($res) ? count($res) : '0') ;\r\n\t\t\t}\r\n }\r\n else {\r\n return '0';\r\n }\r\n die();\r\n\t}",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getDocumentProductPisCst()\n {\n return (string) (string) $this->document_product_pis_cst;\n }",
"static function getProductProperty($prob_name,$prod_id, $wid){\n $vdo = vpdo::getVdo(DB_PREFIX.$wid) ;\n return $vdo->fetchOne(\"select ov.name from options o \n inner join options_values ov on o.id = ov.option_id where o.name = ? and product_id = ?\", array($prob_name, $prod_id));\n }",
"function get_value_db()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getValue()\n {\n return $this->_db->prepareStringToOut($this->_value);\n }",
"public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}",
"public function getDocumentProductCest()\n {\n return (string) $this->document_product_cest;\n }",
"public function getDocumentProductIpiCst()\n {\n return (string) $this->document_product_ipi_cst;\n }",
"public function getExportValue()\n {\n return $this->Value;\n }",
"public function getSqlCol()\n {\n return $this->sqlCol;\n }",
"public function getProdWingspan()\n {\n return $this->prod_wingspan;\n }",
"public function getValue($idx)\n {\n return (($dbname = $this->_getDbname($idx))!=null\n ? $this->columns[$dbname]->value\n : null);\n }",
"public function getDocumentProductEan()\n {\n return (string) $this->document_product_ean;\n }"
]
| [
"0.60206604",
"0.5464475",
"0.5196237",
"0.48941946",
"0.4861912",
"0.48147532",
"0.4788214",
"0.47757304",
"0.47574437",
"0.46825048",
"0.46481758",
"0.46395206",
"0.46394047",
"0.4621653",
"0.4621204",
"0.4612771",
"0.46043685",
"0.4603395",
"0.4593313",
"0.45583618",
"0.45327377",
"0.4518181",
"0.4511263",
"0.45051605",
"0.44832617",
"0.44806296",
"0.44757468",
"0.44704503",
"0.44370905",
"0.44300842"
]
| 0.7585709 | 0 |
Get the [prod_length] column value. | public function getProdLength()
{
return $this->prod_length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdLength($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_length !== $v) {\n $this->prod_length = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_LENGTH] = true;\n }\n\n return $this;\n }",
"public function getProdHeight()\n {\n return $this->prod_height;\n }",
"public function getColumnLength()\n {\n $columnLength = self::INITIAL_COLUMN_LENGTH;\n while ($columnLength < $this->maximumLength) {\n $columnLength *= self::COLUMN_LENGTH_STEPS;\n }\n\n return $columnLength;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength()\n {\n return $this->length;\n }",
"public function getLength() {\n \n return $this->_length;\n }",
"public function getLength() {\r\n return $this->length;\r\n }",
"public function getLength()\r\n {\r\n return $this->length;\r\n }",
"public function getFieldLength()\n {\n return $this->FieldLength;\n }",
"public function getLength() {\n return $this->_length;\n }",
"public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}",
"public function length() {\n \n return $this->getLength();\n }",
"private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}",
"public function getLen()\n {\n $value = $this->get(self::LEN);\n return $value === null ? (integer)$value : $value;\n }",
"public function getNbProd()\n {\n return $this->CollProduit->taille();\n }",
"public function width()\n {\n return $this->setRightOperand(PVar::WIDTH);\n }",
"public function length()\n {\n return $this->length;\n }",
"function getLength(): int\n {\n return $this->length;\n }",
"public function getLength() : int\n {\n return $this->b[$this->offset];\n }",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"public function getLength() {}",
"function length() {\n return $this->norm();\n }"
]
| [
"0.6777339",
"0.64025635",
"0.631446",
"0.61475265",
"0.61475265",
"0.61475265",
"0.61475265",
"0.61475265",
"0.61475265",
"0.61475265",
"0.61475265",
"0.60917467",
"0.60769767",
"0.60654753",
"0.6032441",
"0.60309994",
"0.59982646",
"0.5995489",
"0.5982477",
"0.59772617",
"0.5972856",
"0.5950017",
"0.5946882",
"0.58060277",
"0.5777614",
"0.5762238",
"0.5762238",
"0.5762238",
"0.5762051",
"0.5736043"
]
| 0.808475 | 0 |
Get the [prod_wingspan] column value. | public function getProdWingspan()
{
return $this->prod_wingspan;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdWingspan($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_wingspan !== $v) {\n $this->prod_wingspan = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WINGSPAN] = true;\n }\n\n return $this;\n }",
"public function getSpan(): int {\n $span = (int) $this->getAttribute('span');\n return $span > 1 ? $span : 1;\n }",
"public function getSpan(){\n return $this->_colspan;\n }",
"public function getSpan()\n {\n return $this->Span;\n }",
"public function getSpanId()\n {\n return $this->span_id;\n }",
"public function getW() {\n\t\t\treturn $this->_w;\n\t\t}",
"public function getProductWeightUnit()\n {\n return (string) $this->getConfig(\n 'packages/global_settings_default_weight_unit');\n }",
"public function getWhse()\n {\n return $this->whse;\n }",
"private function largestSeriesProduct($span): int\n {\n $products = [];\n for ($start = 0; $start <= $this->sequenceLength - $span; $start++) {\n $products[] = $this->multiplyStringSection(substr($this->digitSequence, $start, $span));\n }\n return max($products);\n }",
"protected function getrowspan(){\n\t\t$y_points=$this->GTemp->struct->YPoints;\n\t\treturn array_search($this->y2, $y_points)-array_search($this->y1, $y_points);\n\t}",
"public function getShippedValue()\n {\n return defined('static::SHIPPED_VALUE') ? static::SHIPPED_VALUE : 'shipped';\n }",
"public function getWolBar()\n {\n return $this->wolBar;\n }",
"public function getIntbwhse()\n {\n return $this->intbwhse;\n }",
"public function getDocumentProductUnitaryValue()\n {\n return (string) $this->document_product_unitary_value;\n }",
"function get_placement() {\n\t\treturn intval($this->settings['row']);\n\t}",
"public function getWarehouseID()\n {\n return $this->warehouseID;\n }",
"public function getEventWingType() {\n\t\treturn ($this->eventWingType);\n\t}",
"public function getWNumber()\n {\n if ($this->isConfirmed()) {\n return $this->wnumber;\n }\n\n return '';\n }",
"public function getW() {}",
"public function getWKT() {\r\n $wkt = $this->db->query(\"SELECT ST_AsText(geom) AS wkt FROM {$this->table} WHERE id=?\", array($this->id) );\r\n $wkt = $wkt->row()->wkt;\r\n return $wkt;\r\n}",
"public function getWind() {\n\n return $this->wind;\n }",
"protected function getCurrentWarehouseId()\n\t{\n\t\tstatic $warehouse = 0;\n\n\t\tif ($warehouse == 0)\n\t\t{\n\t\t\t$warehouse = -1;\n\t\t\tif ((int)Tools::getValue('warehouse'))\n\t\t\t\t$warehouse = (int)Tools::getValue('warehouse');\n\t\t\telse if ((int)$this->context->cookie->warehouse)\n\t\t\t\t$warehouse = (int)$this->context->cookie->warehouse;\n\t\t\t$this->context->cookie->warehouse = $warehouse;\n\t\t}\n\n\t\treturn $warehouse;\n\t}",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getPollingStationsNumber()\n {\n return $this->pollingStationsNumber;\n }",
"public function getProdHeight()\n {\n return $this->prod_height;\n }",
"public function getProductStock()\n {\n /** @var \\Magento\\CatalogInventory\\Model\\Stock\\ItemArray $stockItem */\n $stockItem = $this->stockRegistry->getStockItem(\n $this->getCurrentProduct()->getId(),\n $this->getCurrentProduct()->getStore()->getWebsiteId()\n );\n if ($stockItem->getManageStock() == 0) {\n return 1;\n }\n\n $qty = round($stockItem->getQty());\n if ($qty < 1) {\n if ($stockItem->getBackorders() == 1) {\n return 1;\n }\n\n if ($stockItem->getIsInStock()) {\n return '';\n }\n }\n return $qty;\n }",
"public function getLeagueWar()\n {\n $value = $this->get(self::LEAGUE_WAR);\n return $value === null ? (integer)$value : $value;\n }",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function getWarehouse(): ?string\n {\n return isset($this->Warehouse) ? $this->Warehouse : null;\n }"
]
| [
"0.67590576",
"0.56630665",
"0.5634274",
"0.5549128",
"0.51754206",
"0.51175356",
"0.5055865",
"0.50526583",
"0.5034041",
"0.49946502",
"0.4941673",
"0.4923966",
"0.48230496",
"0.48179525",
"0.4815563",
"0.47526273",
"0.4736553",
"0.4713514",
"0.4695064",
"0.46734354",
"0.464488",
"0.46237797",
"0.46011436",
"0.45568746",
"0.45499253",
"0.45467117",
"0.45303455",
"0.45287824",
"0.4521896",
"0.45171008"
]
| 0.8273792 | 0 |
Get the [prod_height] column value. | public function getProdHeight()
{
return $this->prod_height;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function height()\n {\n return $this->setRightOperand(PVar::HEIGHT);\n }",
"public function getHeight()\n {\n return $this->getProperty(\"Height\");\n }",
"public function getHeight()\n {\n if (array_key_exists(\"height\", $this->_propDict)) {\n return $this->_propDict[\"height\"];\n } else {\n return null;\n }\n }",
"public function setProdHeight($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_height !== $v) {\n $this->prod_height = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_HEIGHT] = true;\n }\n\n return $this;\n }",
"public function getHeight()\n {\n return $this->data->height;\n }",
"public function getheight(){\n $height = $this->_run('getheight');\n return $height;\n }",
"public function getHeight()\r\n {\r\n return $this->height;\r\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function getHeight()\n {\n return $this->height;\n }",
"public function height($manipulation_name = '')\n\t{\n\t\treturn $this->row_field('height');\n\t}",
"protected function height() {\n return $this->height;\n }",
"public function getHeight()\r\n {\r\n return $this->height;\r\n }",
"public function getHeight() {\n\t\treturn $this->_height;\n\t}",
"final public function get_height()\n {\n return $this->height;\n }",
"public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}",
"public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}",
"public function getHeight()\n\t{\n\t\treturn $this->height;\n\t}",
"public function getHeightSq()\n {\n if (! isset($this->heightSq)) {\n $this->heightSq = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getHeightSqQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->heightSq;\n }",
"public function getHeight()\n {\n // Support for 'n%', relative to parent\n return $this->parseGlobalValue_v($this->h);\n }",
"function spectra_block_height ()\n\t{\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT MAX(`height`) as `height` FROM `\".$GLOBALS[\"tables\"][\"block\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\treturn $result[\"height\"];\n\t}",
"public function getHeight()\n {\n if (null === $this->height && !$this->initialised) {\n $this->refreshDimensions();\n }\n\n if (null === $this->height) {\n $height = getenv('LINES');\n if (false !== $height) {\n $this->height = (int) trim($height);\n }\n }\n\n return $this->height ?: static::DEFAULT_HEIGHT;\n }"
]
| [
"0.6729948",
"0.6722317",
"0.6676694",
"0.66436493",
"0.66036385",
"0.6543087",
"0.6349073",
"0.6321409",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63086915",
"0.63078684",
"0.6292543",
"0.6244485",
"0.6242864",
"0.6236268",
"0.62106353",
"0.62106353",
"0.62106353",
"0.6208121",
"0.62015784",
"0.6128577",
"0.6119424"
]
| 0.80150294 | 0 |
Get the [prod_scale] column value. | public function getProdScale()
{
return $this->prod_scale;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getScale()\n {\n return $this->scale;\n }",
"public function getScale()\n {\n return $this->scale;\n }",
"public function getScale()\n\t{\n\t\treturn $this->scale;\n\t}",
"public function setProdScale($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_scale !== $v) {\n $this->prod_scale = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_SCALE] = true;\n }\n\n return $this;\n }",
"public function getScaling()\n {\n return $this->scaling;\n }",
"public function getScaling()\n {\n return $this->scaling;\n }",
"public function getScale()\n {\n return $this->domain->getScale();\n }",
"public function getScaling() {}",
"function load_scale() {\n if (!empty($this->scaleid)) {\n $this->scale = grade_scale::fetch('id', $this->scaleid);\n $this->scale->load_items();\n }\n return $this->scale;\n }",
"public function getScales() {\n return $this->scales;\n }",
"public function setScale($var)\n {\n GPBUtil::checkInt32($var);\n $this->scale = $var;\n\n return $this;\n }",
"public function setScale($var)\n {\n GPBUtil::checkDouble($var);\n $this->scale = $var;\n\n return $this;\n }",
"public function getProdLength()\n {\n return $this->prod_length;\n }",
"public function getScaleControl()\n {\n return $this->scaleControl;\n }",
"public function scale()\n {\n return $this->belongsTo(Scale::class);\n }",
"public function getCertificateValidityPeriodScale()\n {\n if (array_key_exists(\"certificateValidityPeriodScale\", $this->_propDict)) {\n if (is_a($this->_propDict[\"certificateValidityPeriodScale\"], \"\\Beta\\Microsoft\\Graph\\Model\\CertificateValidityPeriodScale\") || is_null($this->_propDict[\"certificateValidityPeriodScale\"])) {\n return $this->_propDict[\"certificateValidityPeriodScale\"];\n } else {\n $this->_propDict[\"certificateValidityPeriodScale\"] = new CertificateValidityPeriodScale($this->_propDict[\"certificateValidityPeriodScale\"]);\n return $this->_propDict[\"certificateValidityPeriodScale\"];\n }\n }\n return null;\n }",
"public function getPrintScaling() {}",
"public function prod($prod);",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getScale($index) {\n if (isset($this->scales[$index])) {\n return $this->scales[$index];\n }\n\n return null;\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getGemstoneScale() {\r\n\t\t$this->db->from('stone_scale');\r\n\t\t$this->db->order_by('scale_id');\r\n\t\t$query = $this->db->get();\r\n\t\t$data = array();\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\tforeach($query->result_array() as $row) {\r\n\t\t\t\t$data[$row['scale_id']] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $data;\r\n\t}",
"public function scale() { }",
"public function get_grade_scale($itemid, $userid, $courseid) {\n global $remotedb;\n $sql = \"SELECT DISTINCT gg.finalgrade, s.scale \n FROM {grade_grades} gg\n JOIN {grade_items} gi ON gg.itemid=gi.id AND gi.id=? \n AND gg.userid=? AND gi.courseid=? AND gi.gradetype = 2\n JOIN {scale} s ON gi.scaleid=s.id limit 1\";\n $params = array($itemid, $userid, $courseid);\n $scales = $remotedb->get_record_sql($sql, $params);\n $num = 0;\n if ($scales) {\n $scale = explode(',', $scales->scale);\n $num = ($num ? (int) $scales->finalgrade - 1 : 0);\n return $scale[$num];\n } else {\n return '-';\n }\n }",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }",
"public function getProductPrice() {\n\t\t\t$data = request()->all();\n\t\t\t$dataArr = explode('-', $data['idSize']);\n\t\t\t$proAttr = ProductsAttribute::where(['product_id'=>$dataArr[0], 'size'=>$dataArr[1]])->first();\n\t\t\t$productData = [\n\t\t\t\t'sku' \t=> $proAttr->sku, \n\t\t\t\t'price' => $proAttr->price,\n\t\t\t\t'stock' => $proAttr->stock\n\t\t\t]; \n\t\t\treturn $productData;\n\t\t}",
"public function getProdHeight()\n {\n return $this->prod_height;\n }",
"public function get_available_grade_scale($itemid, $userid, $courseid) {\n global $remotedb;\n $sql = \"SELECT DISTINCT s.scale \n FROM {grade_grades} gg\n JOIN {grade_items} gi ON gg.itemid=gi.id AND gi.id=? \n AND gg.userid=? AND gi.courseid=? AND gi.gradetype = 2\n JOIN {scale} s ON gi.scaleid=s.id limit 1\";\n $params = array($itemid, $userid, $courseid);\n $scales = $remotedb->get_record_sql($sql, $params);\n if ($scales) {\n $scale = explode(',', $scales->scale);\n $num = max(array_keys($scale));\n return $scale[$num];\n } else {\n return '-';\n }\n }"
]
| [
"0.67325586",
"0.67325586",
"0.6703614",
"0.6552015",
"0.6480752",
"0.6480752",
"0.6425339",
"0.6169297",
"0.61030984",
"0.5690525",
"0.5670635",
"0.56556165",
"0.56259245",
"0.5586447",
"0.54192877",
"0.5414554",
"0.5381439",
"0.53204477",
"0.5285388",
"0.527065",
"0.52501106",
"0.524985",
"0.52493733",
"0.5210245",
"0.51510584",
"0.5150684",
"0.5141089",
"0.51408434",
"0.513698",
"0.5105122"
]
| 0.8041914 | 0 |
Get the [prod_links] column value. | public function getProdLinks()
{
return $this->prod_links;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getProductLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"public function getProdLinkdescription()\n {\n return $this->prod_linkdescription;\n }",
"public function getProductEntityLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"private function getProductEntityLinkField()\n {\n if (!$this->productEntityLinkField) {\n $this->productEntityLinkField = $this->getMetadataPool()\n ->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)\n ->getLinkField();\n }\n return $this->productEntityLinkField;\n }",
"protected function getLinkedProductID () {\n $productFilter = Search::getInstance($this->data['attrs']['source_id'])->getFilter('product');\n\n return $productFilter ? $productFilter['value'] : null;\n }",
"public function getLinkPl() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(6, $this->_result)) return (string) $this->_result[6];\n\t\t\telse parent::throwGetColException('Not set ProjectsListingsModel::getLinkPl', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From ProjectsListingsModel::getLinkPl', __LINE__, __FILE__);\n\t}",
"public function getColumnLink(): HrefElement;",
"public function getLinkProperty()\n {\n $elements = Helper::findElements($this, ['thumbnailLink', 'name', 'detailsButton']);\n\n $links = [\n 'articleThumbnailLink' => $elements['thumbnailLink']->getAttribute('href'),\n 'articleNameLink' => $elements['name']->getAttribute('href'),\n 'articleDetailsButtonLink' => $elements['detailsButton']->getAttribute('href'),\n ];\n\n return Helper::getUnique($links);\n }",
"public function Link()\n {\n if ($product = $this->Product()) {\n return $product->Link;\n }\n return '';\n }",
"public function getDataLink()\n {\n return $this->dataLink;\n }",
"public function getUrl()\n {\n if (array_key_exists('link', $this->data)) {\n return $this->data['link'];\n }\n\n if ($this->getType() == Reader\\Reader::TYPE_YML) {\n $link = $this->xpath->evaluate('string(/yml_catalog/shop/url)');\n }\n\n if (! $link) {\n $link = null;\n }\n\n $this->data['link'] = $link;\n\n return $this->data['link'];\n }",
"public function getProductUrl()\n {\n return $this->product_url;\n }",
"public function getLink() {\n\t\tif (array_key_exists('channels', $this->feedElements)) {\n\t\t\treturn $this->feedElements['channels']['link'];\n\t\t}\n\t\treturn null;\n\t}",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function getProductosUrl(){\n return $this->vectorUrlsProductos;\n }",
"public function getLink()\n {\n return $this->get('Link');\n }",
"public static function getLink()\n {\n return self::$link;\n }",
"public function column_url($link)\n {\n }",
"public function getLink() {\n return $this->link;\n }",
"public function get_link()\n {\n\n return $this->link;\n }",
"public function get_link() {\r\n return $this->link;\r\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }",
"public function getLink()\n {\n return $this->link;\n }"
]
| [
"0.67851394",
"0.6463802",
"0.6350494",
"0.61769235",
"0.6084353",
"0.5959329",
"0.58454585",
"0.57841164",
"0.5718209",
"0.56869537",
"0.5650311",
"0.56126696",
"0.55887437",
"0.55419314",
"0.5527909",
"0.54618555",
"0.54607004",
"0.54516107",
"0.5442987",
"0.5419095",
"0.5406348",
"0.5398868",
"0.5398868",
"0.5398868",
"0.5398868",
"0.5398868",
"0.5398868",
"0.5398868",
"0.5398868",
"0.5398868"
]
| 0.7131735 | 0 |
Get the [prod_linkdescription] column value. | public function getProdLinkdescription()
{
return $this->prod_linkdescription;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdDescription()\n {\n return $this->prod_description;\n }",
"private function getProductLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"public function getProductDescription()\n\t{\n\t\treturn $this->getKeyValue('product_description'); \n\n\t}",
"public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}",
"public function getProductDesc()\n {\n return isset($this->productDesc) ? $this->productDesc : null;\n }",
"public function getDescription() {\n\t\t$field = $this->getDescriptionField();\n\t\treturn $field ? $field->getValue() : '';\n\t}",
"function get_description() {\n return $this->get_mapped_property('description');\n }",
"public function getDescriptionRef()\n {\n return $this->descriptionRef;\n }",
"public function getProductEntityLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"public function getDescription()\n {\n if ($this->helper->getDescriptionType()) {\n return nl2br($this->getProduct()->getData('description'));\n } else {\n return nl2br($this->getProduct()->getData('short_description'));\n }\n }",
"public function Description()\n {\n $description = $this->rssField($this->descriptionField);\n\n // HTML fields need links re-written\n if ($description instanceof DBHTMLText) {\n return $description->obj('AbsoluteLinks');\n }\n\n return $description;\n }",
"public function getDescription() \n {\n return $this->_fields['Description']['FieldValue'];\n }",
"private function getProductEntityLinkField()\n {\n if (!$this->productEntityLinkField) {\n $this->productEntityLinkField = $this->getMetadataPool()\n ->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)\n ->getLinkField();\n }\n return $this->productEntityLinkField;\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"function getDescription() {\n\t\treturn $this->data_array['description'];\n\t}",
"public function description()\n {\n if (@$this->data[\"description\"]) {\n return $this->data[\"description\"];\n }\n return null;\n }",
"public function getLinkPl() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(6, $this->_result)) return (string) $this->_result[6];\n\t\t\telse parent::throwGetColException('Not set ProjectsListingsModel::getLinkPl', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From ProjectsListingsModel::getLinkPl', __LINE__, __FILE__);\n\t}",
"public function getDescription()\n {\n return isset($this->description) ? $this->description : '';\n }"
]
| [
"0.70448965",
"0.67213416",
"0.667102",
"0.6542438",
"0.64229894",
"0.6326362",
"0.6288594",
"0.62489736",
"0.62165356",
"0.6150391",
"0.61021763",
"0.6057581",
"0.6010874",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5968445",
"0.5967386",
"0.5924968",
"0.5915518",
"0.59078395"
]
| 0.81548584 | 0 |
Get the [prod_front] column value. | public function getProdFront()
{
return $this->prod_front;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdFront($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_front !== $v) {\n $this->prod_front = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_FRONT] = true;\n }\n\n return $this;\n }",
"public function getDisplayFront()\n {\n return $this->getData(self::DISPLAY_FRONT);\n }",
"function Front() {\n if ($this->isEmpty()){\n return -1;\n }\n return $this->data[$this->front];\n }",
"public function getProdEra()\n {\n return $this->prod_era;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getPreviewto() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(11, $this->_result)) return (string) $this->_result[11];\n\t\t\telse parent::throwGetColException('Not set CampaignDefinitionsModel::getPreviewto', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignDefinitionsModel::getPreviewto', __LINE__, __FILE__);\n\t}",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getPreviewfrom() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(10, $this->_result)) return (string) $this->_result[10];\n\t\t\telse parent::throwGetColException('Not set CampaignDefinitionsModel::getPreviewfrom', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignDefinitionsModel::getPreviewfrom', __LINE__, __FILE__);\n\t}",
"public function getProd_niche () {\n\t$preValue = $this->preGetValue(\"prod_niche\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"prod_niche\")->preGetData($this);\n\treturn $data;\n}",
"function Front() {\n if($this->isEmpty()){\n return -1;\n }\n\n return $this->queue[$this->front];\n\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getEtiqDeFront() {\n return $this->etiqDeFront;\n }",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getproduct_feathered()\n\t\t{\n\t\t\t$query = \"SELECT * FROM tbl_product WHERE type = '0'\";\n\t\t\t$result = $this->db->select($query);\n\t\t\treturn $result;\n\t\t}",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getStdShipToCd()\n {\n return $this->std_ship_to_cd;\n }",
"public function getPointProd1():?int\n {\n return $this->produit1 <= 0 ? 0 : $this->produit1 * 5;\n }",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function getProdTitle()\n {\n return $this->prod_title;\n }",
"public function getShippedValue()\n {\n return defined('static::SHIPPED_VALUE') ? static::SHIPPED_VALUE : 'shipped';\n }",
"public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}",
"public function getShowInProduct()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/show_product', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"public function getStoreFrontName();",
"public function getShow_on_market () {\n\t$preValue = $this->preGetValue(\"show_on_market\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->show_on_market;\n\treturn $data;\n}",
"public function getProductDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $productId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `productId`\n FROM `product`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [productId],\n FROM [product]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT PRODUCTID AS \\\"productId\\\",\n FROM PRODUCT\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n }\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $productId = $row['productId'];\n }\n return $productId;\n }",
"public function getFirstCol() : int\n {\n\n // Convert A1:D3 to A1.\n list($startRef,) = explode(':', $this->getTableNode()->getAttribute('ref'));\n\n // Convert A1 to 1.\n $startCol = preg_replace('/([0-9])/', '', $startRef);\n\n return XlsxTools::convRefToNumber($startCol);\n }"
]
| [
"0.64133525",
"0.6372073",
"0.5874847",
"0.55258954",
"0.5494779",
"0.53923446",
"0.5351454",
"0.5240376",
"0.5237982",
"0.52220356",
"0.52051556",
"0.5170742",
"0.5153934",
"0.5147479",
"0.51456606",
"0.5111522",
"0.5097187",
"0.50857294",
"0.5075551",
"0.5074687",
"0.5043602",
"0.50115013",
"0.5008497",
"0.5006459",
"0.49918556",
"0.49594045",
"0.4949392",
"0.4949167",
"0.49429312",
"0.49410582"
]
| 0.7472384 | 0 |
Get the [prod_keywords] column value. | public function getProdKeywords()
{
return $this->prod_keywords;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdKeywordsWriteup()\n {\n return $this->prod_keywords_writeup;\n }",
"public function getKeywords(): string\n {\n return $this->keywords;\n }",
"public function setProdKeywords($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_keywords !== $v) {\n $this->prod_keywords = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS] = true;\n }\n\n return $this;\n }",
"public function getKeyword($product_id) {\n\t\t$sql = \"SELECT `keyword` FROM \" . DB_PREFIX . \"url_alias WHERE query = 'product_id=\" . (int)$product_id . \"'\";\n\t\n\t\t$query = $this->db->query($sql);\n\t\treturn !empty($query->rows) ? $query->rows[0]['keyword'] : '';\n\t}",
"public function getKeywords() : string\n {\n return $this->keywords;\n }",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function keyword()\n {\n return $this->keyword;\n }",
"public function keyword()\n {\n return $this->keyword;\n }",
"public function get_keywords()\n\t{\n\t\treturn $this->keywords;\n\t}",
"public function getKeyword()\n {\n return $this->readOneof(7);\n }",
"public function getKeywordsDc() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(5, $this->_result)) return (string) $this->_result[5];\n\t\t\telse parent::throwGetColException('Not set DiscussCategoriesModel::getKeywordsDc', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From DiscussCategoriesModel::getKeywordsDc', __LINE__, __FILE__);\n\t}",
"protected function getKeywords() {\r\n\t\treturn $this->keywords;\r\n\t}",
"protected function getKeywordsString() {\r\n\t\treturn implode(', ', $this->keywords);\r\n\t}",
"public function getKeywords(){\n return $this->keywords;\n }",
"public function getKeywords() \n {\n return $this->keywords;\n }",
"public function getKeywords()\n {\n return addslashes(trim(join($this->__keywordsDelimiter, $this->__keywords)));\n }",
"public function meta_keywords()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}",
"public function getKeywords()\n {\n return $this->keywords;\n }",
"public function getKeywords()\n {\n return $this->keywords;\n }",
"public function getKeywords()\n {\n return $this->keywords;\n }",
"public function getKeywords() \r\n { \r\n return $this->_keywords; \r\n }",
"function get_keywords()\n{\n global $KEYWORDS_TABLE;\n $q = \"select keyword, description from `$KEYWORDS_TABLE` order by keyword;\";\n $rows = dbSelect($q, 'get_keywords()');\n $keywords = array();\n foreach ($rows as $row) {\n $keywords[] = $row[0];\n }\n return $keywords;\n}",
"public function getKeywords()\n\t{\n\t\treturn $this->keywords;\n\t}",
"public function getKeywords()\n\t{\n\t\treturn $this->keywords;\n\t}",
"public function keywords()\n\t{\n\t\treturn $this->keywords;\n\t}",
"public function getKeywords() {\n return $this->_keywords;\n }",
"public function _getTags(Product $product)\n {\n return $product->getData('meta_keyword');\n }",
"protected function _getTags($productId)\n {\n return Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'meta_keyword', $this->_storeId);\n }",
"public function meta_keywords()\n\t{\n\t\treturn $this->meta_keywords;\n\t}"
]
| [
"0.66214246",
"0.62831146",
"0.6212205",
"0.6202259",
"0.619665",
"0.6194092",
"0.6194092",
"0.6150816",
"0.6150816",
"0.61369926",
"0.60610133",
"0.59511876",
"0.5928699",
"0.5916661",
"0.5900351",
"0.5859274",
"0.58412457",
"0.5835565",
"0.58313364",
"0.58313364",
"0.58313364",
"0.58279663",
"0.5777304",
"0.57660925",
"0.57660925",
"0.5736157",
"0.57128394",
"0.57009095",
"0.56998235",
"0.5699554"
]
| 0.762905 | 0 |
Get the [prod_keywords_writeup] column value. | public function getProdKeywordsWriteup()
{
return $this->prod_keywords_writeup;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdKeywordsWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_keywords_writeup !== $v) {\n $this->prod_keywords_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS_WRITEUP] = true;\n }\n\n return $this;\n }",
"public function getProdWriteup()\n {\n return $this->prod_writeup;\n }",
"public function getProdKeywords()\n {\n return $this->prod_keywords;\n }",
"public function getKeyword()\n {\n return $this->readOneof(7);\n }",
"public function setProdWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_writeup !== $v) {\n $this->prod_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WRITEUP] = true;\n }\n\n return $this;\n }",
"public function getKeywordsDc() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(5, $this->_result)) return (string) $this->_result[5];\n\t\t\telse parent::throwGetColException('Not set DiscussCategoriesModel::getKeywordsDc', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From DiscussCategoriesModel::getKeywordsDc', __LINE__, __FILE__);\n\t}",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function getKeyword()\n {\n return $this->keyword;\n }",
"public function keyword()\n {\n return $this->keyword;\n }",
"public function keyword()\n {\n return $this->keyword;\n }",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function purchasedKeyword()\n\t{\n\t\treturn $this->lang->words['taken'];\n\t}",
"public function getKeyword()\n {\n return 'SEEN';\n }",
"public function getKeywords(): string\n {\n return $this->keywords;\n }",
"protected function getKeywordsString() {\r\n\t\treturn implode(', ', $this->keywords);\r\n\t}",
"public function getKeywords() : string\n {\n return $this->keywords;\n }",
"public function getMetaKeywords(): string\n {\n return (string) $this->metaKeywords;\n }",
"public function getMetaKeywords(): string\n {\n return (string) $this->metaKeywords;\n }",
"public function getDocumentProductUnitaryValue()\n {\n return (string) $this->document_product_unitary_value;\n }",
"public function getKeywords()\n {\n return addslashes(trim(join($this->__keywordsDelimiter, $this->__keywords)));\n }",
"public function getBuildProperty($key)\n {\n return $this->database ? $this->database->getBuildProperty($key) : '';\n }",
"public function getDocumentProductName()\n {\n return (string) $this->document_product_name;\n }",
"public function getKeyword() : string\n {\n return $this->getMatchedText();\n }",
"public function getPrimaryKey()\n {\n return $this->getProdId();\n }",
"public function getDocumentProductCest()\n {\n return (string) $this->document_product_cest;\n }",
"public function get_value() {\r\n\t\tif ( $this->key === 'job_title' ) {\r\n\t\t\treturn $this->listing->get_name();\r\n\t\t}\r\n\r\n\t\tif ( $this->key === 'job_description' ) {\r\n\t\t\treturn $this->listing->get_data('post_content');\r\n\t\t}\r\n\r\n\t\t// othewise, retrieve from wp_postmeta\r\n\t\treturn get_post_meta( $this->listing->get_id(), '_'.$this->key, true );\r\n\t}",
"public function sqlValue()\n {\n return ($this->arrConfig['operator'] == 'like' ? ('%' . $this->arrConfig['value'] . '%') : $this->arrConfig['value']);\n }",
"public static function getProductsListingSql() {\n $pArr = self::__getProductsListingData();\n \n return $pArr['Qlisting']; \n }",
"public function getDocumentProductIpiCst()\n {\n return (string) $this->document_product_ipi_cst;\n }",
"public function meta_keywords()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}"
]
| [
"0.65811",
"0.63263136",
"0.5767484",
"0.5136061",
"0.50741744",
"0.500916",
"0.5000207",
"0.5000207",
"0.49774393",
"0.49774393",
"0.49627987",
"0.4952085",
"0.48945317",
"0.4880492",
"0.4848219",
"0.48303983",
"0.4823714",
"0.4823714",
"0.47777602",
"0.4702512",
"0.4691676",
"0.4681907",
"0.46715066",
"0.46357134",
"0.4622102",
"0.46166185",
"0.45539814",
"0.4533115",
"0.45145062",
"0.45052582"
]
| 0.7703854 | 0 |
Get the [prod_title] column value. | public function getProdTitle()
{
return $this->prod_title;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dispProductTitle()\n\t{\n\t\t$prodid=$_SESSION['prodid']; \n\t\t\n\t\t$sqltitle = \"SELECT title FROM products_table WHERE product_id ='\".$prodid.\"'\";\n\t\t\n\t\t$query = new Bin_Query();\n\t\t\n\t\tif($query->executeQuery($sqltitle))\n\t\t{\n\t\t\treturn Display_DManageProducts::dispProductTitle($query->records);\n\t\t}\n\t\t\n\t}",
"public function getTitle() {\n\t\t$field = $this->getTitleField();\n\t\treturn $field ? $field->getValue() : '';\n\t}",
"public function getTitle()\n {\n return $this->getValue();\n }",
"public function getTitle()\n {\n return $this->getData(self::TITLE);\n }",
"public function getTitle()\n {\n return $this->getValue('title');\n }",
"protected function get_title()\n {\n return get_string(\"column_title\", 'local_questionbanktagfilter');\n }",
"public function getTitle()\n {\n return $this->getData('title');\n }",
"public function getTitle()\n {\n $title = Mage::getModel('eav/entity_attribute')->loadByCode(\n Mage::helper('lucene')->getProductEntityTypeId(), \n $this->_key\n )->getFrontendLabel();\n return $title ? $title : $this->_key;\n }",
"public function getValueAsString()\n {\n $page = $this->getViewValue();\n\n return $page ? $page->Title : '';\n }",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getTitle()\n {\n return $this->getProduct()->getTitle();\n }",
"function get_title() {\n\t\treturn $this->get_mapped_property('title');\n }",
"public function get_title()\n {\n return $this->get_default_property(self::PROPERTY_TITLE);\n }",
"public function getTitle()\n {\n return $this->getEntityValue('title', '');\n }",
"public function getTitle()\n {\n return $this->formattedData['title'];\n }",
"public function getTitle()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\tif(!array_key_exists('title', $this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\treturn $this->data['title'];\n\t\t}",
"public function getTitle()\n {\n return $this['title'];\n }",
"public function getTitle()\n {\n return $this->get(self::_TITLE);\n }",
"public function getTitle()\n {\n return $this->get(self::_TITLE);\n }",
"public function getTitle()\n {\n return $this->getField('Title');\n }",
"public function getTitleField() {\n return $this->getFields()[$this->getTitleFieldName()];\n }",
"public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }",
"public function getTitle()\n {\n return $this->table->title;\n }",
"public function getTitle(): string {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\r\n\t\treturn $this->title;\r\n\t}",
"public function getTitle()\n {\n if (array_key_exists(\"title\", $this->_propDict)) {\n return $this->_propDict[\"title\"];\n } else {\n return null;\n }\n }",
"public function getTitle()\n {\n if (array_key_exists(\"title\", $this->_propDict)) {\n return $this->_propDict[\"title\"];\n } else {\n return null;\n }\n }",
"public function getItemTitle()\n {\n return $this->item_title;\n }",
"public function getTitle() {\n\t\treturn $this->title;\n\t}",
"public function getTitle() {\n\t\treturn $this->title;\n\t}"
]
| [
"0.68553627",
"0.68498135",
"0.6784682",
"0.6636052",
"0.66342473",
"0.65820044",
"0.657589",
"0.65646785",
"0.65497863",
"0.6536441",
"0.6532097",
"0.6489137",
"0.6471736",
"0.6444135",
"0.6438259",
"0.64323366",
"0.6417218",
"0.63861555",
"0.63861555",
"0.6385018",
"0.6377454",
"0.63645405",
"0.6360468",
"0.6357452",
"0.63571006",
"0.6350012",
"0.6350012",
"0.63478017",
"0.6345958",
"0.6345958"
]
| 0.792739 | 0 |
Get the [prod_description] column value. | public function getProdDescription()
{
return $this->prod_description;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}",
"public function getProductDescription()\n\t{\n\t\treturn $this->getKeyValue('product_description'); \n\n\t}",
"public function getProductDesc()\n {\n return isset($this->productDesc) ? $this->productDesc : null;\n }",
"public function getDescription() {\n\t\t$field = $this->getDescriptionField();\n\t\treturn $field ? $field->getValue() : '';\n\t}",
"public function getProdLinkdescription()\n {\n return $this->prod_linkdescription;\n }",
"function get_description() {\n return $this->get_mapped_property('description');\n }",
"public function getDescription() \n {\n return $this->_fields['Description']['FieldValue'];\n }",
"public function getDescription()\n {\n if ($this->helper->getDescriptionType()) {\n return nl2br($this->getProduct()->getData('description'));\n } else {\n return nl2br($this->getProduct()->getData('short_description'));\n }\n }",
"function getDescription() {\n\t\treturn $this->data_array['description'];\n\t}",
"public function getDescription()\n {\n return self::QUALITY_MAP[$this->qualityID]['description'];\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function getDescription()\n {\n if (array_key_exists(\"description\", $this->_propDict)) {\n return $this->_propDict[\"description\"];\n } else {\n return null;\n }\n }",
"public function description()\n {\n if (@$this->data[\"description\"]) {\n return $this->data[\"description\"];\n }\n return null;\n }",
"public function getDescription()\r\n {\r\n $fields = $this->def->getFields();\r\n foreach ($fields as $field)\r\n {\r\n if ($field->type == 'text')\r\n {\r\n if ($field->name == \"description\"\r\n || $field->name == \"notes\"\r\n || $field->name == \"details\"\r\n || $field->name == \"comment\")\r\n {\r\n return $this->getValue($field->name);\r\n }\r\n }\r\n\r\n }\r\n\r\n return \"\";\r\n }",
"public function getDescription()\n {\n return isset($this->description) ? $this->description : '';\n }",
"public function getDescription()\n {\n return isset($this->description) ? $this->description : '';\n }",
"public function getDescription()\n {\n return isset($this->description) ? $this->description : '';\n }",
"protected function getDescription() {\r\n\t\treturn $this->description;\r\n\t}",
"public function getDescription()\n {\n return $this->__get(self::FIELD_DESCRIPTION); \n }"
]
| [
"0.7461744",
"0.7452807",
"0.72895485",
"0.6891244",
"0.686145",
"0.6734821",
"0.6701732",
"0.65901726",
"0.65527546",
"0.645832",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64294565",
"0.64096093",
"0.64034605",
"0.6347757",
"0.6347757",
"0.6347757",
"0.6341741",
"0.6335336"
]
| 0.8036535 | 0 |
Get the [prod_general] column value. | public function getProdGeneral()
{
return $this->prod_general;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdGeneral($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_general !== $v) {\n $this->prod_general = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_GENERAL] = true;\n }\n\n if ($this->aTblGeneral !== null && $this->aTblGeneral->getProdGeneral() !== $v) {\n $this->aTblGeneral = null;\n }\n\n return $this;\n }",
"public function getProd_niche () {\n\t$preValue = $this->preGetValue(\"prod_niche\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"prod_niche\")->preGetData($this);\n\treturn $data;\n}",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function GetGeneral(){\r\r\n\t\treturn self::$general;\r\r\n\t}",
"public function getFieldFromGeneralViewConfiguration($field)\r\n {\r\n return $this->viewConfiguration['general'][$field];\r\n }",
"public function getProdDescription()\n {\n return $this->prod_description;\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getProductDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $productId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `productId`\n FROM `product`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [productId],\n FROM [product]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT PRODUCTID AS \\\"productId\\\",\n FROM PRODUCT\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n }\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $productId = $row['productId'];\n }\n return $productId;\n }",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function getCdProduto()\n {\n return $this->Cd_produto;\n }",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getIsglobal() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(5, $this->_result)) return (string) $this->_result[5];\n\t\t\telse parent::throwGetColException('Not set CampaignDefinitionsModel::getIsglobal', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignDefinitionsModel::getIsglobal', __LINE__, __FILE__);\n\t}",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }",
"function getCostPersonalTagIndividual(){\n\treturn campo('config_system','id','1','cost_individual_personal_tag');\n}",
"function getCostPersonalTagIndividual(){\n\treturn campo('config_system','id','1','cost_individual_personal_tag');\n}",
"public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getTblGeneral(ConnectionInterface $con = null)\n {\n if ($this->aTblGeneral === null && ($this->prod_general !== null)) {\n $this->aTblGeneral = ChildTblGeneralQuery::create()->findPk($this->prod_general, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblGeneral->addTblProdInfos($this);\n */\n }\n\n return $this->aTblGeneral;\n }",
"public function getCdProduto()\n {\n return $this->cd_produto;\n }",
"public function getMisccost()\n {\n return $this->misccost;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function discountOrChargeValue()\n {\n return $this->discountOrChargeValueBoleta();\n }",
"public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}",
"public function getDocumentProductDiscount()\n {\n return (string) $this->document_product_discount;\n }",
"public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}",
"function get_gp_field($gid, $field) {\n global $db;\n $results = $db->select(tbl($this->gp_tbl), $field, \"group_id='$gid'\");\n\n if ($db->num_rows > 0) {\n return $results[0];\n } else {\n return false;\n }\n }"
]
| [
"0.64083344",
"0.5757285",
"0.56836575",
"0.56682986",
"0.56022656",
"0.54463154",
"0.5435061",
"0.5416214",
"0.540648",
"0.53547364",
"0.53053606",
"0.5299206",
"0.52659315",
"0.52460337",
"0.52223754",
"0.5218671",
"0.5204163",
"0.5204163",
"0.5169946",
"0.51241773",
"0.51088077",
"0.5088878",
"0.5081658",
"0.5070434",
"0.50399697",
"0.50152665",
"0.5003554",
"0.49965006",
"0.4970978",
"0.495656"
]
| 0.77391404 | 0 |
Get the [prod_era] column value. | public function getProdEra()
{
return $this->prod_era;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDocumentProductEan()\n {\n return (string) $this->document_product_ean;\n }",
"public function setProdEra($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_era !== $v) {\n $this->prod_era = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ERA] = true;\n }\n\n if ($this->aTblEra !== null && $this->aTblEra->getEraId() !== $v) {\n $this->aTblEra = null;\n }\n\n return $this;\n }",
"public function getProductEan(): ?string\n {\n return isset($this->ProductEan) ? $this->ProductEan : null;\n }",
"public function getProductEan(): ?string\n {\n return isset($this->ProductEan) ? $this->ProductEan : null;\n }",
"public function getProductEan(): ?string\n {\n return isset($this->ProductEan) ? $this->ProductEan : null;\n }",
"public function getAno() {\n return $this->iAno;\n }",
"public function getAno() {\n return $this->iAno;\n }",
"public function getAPrix()\n {\n return $this->prix;\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getAPELLIDOPATERNOC()\r\n {\r\n return $this->APELLIDOPATERNOC;\r\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getAno()\n {\n return $this->ano;\n }",
"public function getageEc()\n {\n return $this->age_ec;\n }",
"public function getCdEtapa()\n {\n return $this->cd_etapa;\n }",
"public function getValorAnulado() {\n return $this->nValorAnulado;\n }",
"public function getAl()\n {\n return $this->al;\n }",
"public function getArabigo(){\n\t\treturn $this->arabigo;\n\t}",
"public function getEmenta()\n {\n return $this->ementa;\n }",
"public function getEscalaValor( ){\n\t\t\treturn $this->escalaValor;\n\t\t}",
"public function getAUMENTOPERDIDA()\r\n {\r\n return $this->AUMENTO_PERDIDA;\r\n }",
"public function getProductAttributeDecimal($productId, $attributeCode){\r\n\t$resource = Mage::getSingleton('core/resource');\r\n\t$readConnection = $resource->getConnection('core_read');\r\n\treturn\t\r\n\t $readConnection->fetchOne(\r\n\t 'select value from catalog_product_entity_decimal where entity_id=' . $productId . '\r\n\t\t and attribute_id = (select attribute_id from eav_attribute where attribute_code = \\'' . $attributeCode . '\\')'\r\n );\r\n}",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function getColumna() {\n return $this->columna;\n }",
"public function getAnum()\r\n {\r\n return $this->anum;\r\n }",
"public function getValorArrecadado() {\n return $this->nValorArrecadado;\n }",
"public function getAno():int{\n\t\treturn $this->ano;\n\t}",
"static public function getIvaTaxValue()\n {\n $tax = 1;\n $query = \"SELECT\n class.title,\n rate.`name`,\n round((rate.rate/100)+1,2) as value\n FROM\n oc_tax_class AS class\n INNER JOIN oc_tax_rule AS rule ON class.tax_class_id = rule.tax_class_id\n INNER JOIN oc_tax_rate AS rate ON rule.tax_rate_id = rate.tax_rate_id\";\n $results = DB::select(DB::raw($query));\n foreach ($results as $res){\n if(strtoupper($res->title)==\"IVA\"){\n $tax = $res->value;\n }\n }\n return $tax;\n }",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"public function getageEu()\n {\n return $this->age_eu;\n }",
"public function getEndbPt() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(8, $this->_result)) return (string) $this->_result[8];\n\t\t\telse parent::throwGetColException('Not set PollTemplatesModel::getEndbPt', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PollTemplatesModel::getEndbPt', __LINE__, __FILE__);\n\t}"
]
| [
"0.5740236",
"0.5581799",
"0.5446066",
"0.5446066",
"0.5446066",
"0.5366086",
"0.5366086",
"0.529994",
"0.5252882",
"0.52039737",
"0.5183803",
"0.51609564",
"0.51285684",
"0.5128119",
"0.5110731",
"0.50968665",
"0.5089454",
"0.5074302",
"0.5060015",
"0.5052776",
"0.50447977",
"0.49949372",
"0.49892527",
"0.49800995",
"0.49665573",
"0.49487564",
"0.49408382",
"0.49206352",
"0.49203438",
"0.49201313"
]
| 0.7863487 | 0 |
Get the [prod_company] column value. | public function getProdCompany()
{
return $this->prod_company;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCompanyValue()\n {\n return $this->CompanyValue;\n }",
"public function company(): string\n {\n return $this->getData('CompanyName');\n }",
"public function getCompanyId()\n\t{\n\t\t$column = self::COL_COMPANY_ID;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (int)$v;\n\t\t}\n\n\t\treturn $v;\n\t}",
"public function getCompany() : \\App\\Domain\\Model\\Company\n {\n return $this->getRef('from__company_id__to__table__companies__columns__id', 'products');\n }",
"public function get_company() \n {\n return $this->company;\n }",
"public function getCompany()\n {\n if (array_key_exists('company', $this->data)) {\n return $this->data['company'];\n }\n\n if ($this->getType() == Reader\\Reader::TYPE_YML) {\n $company = $this->xpath->evaluate('string(/yml_catalog/shop/company)');\n }\n\n if (! $company) {\n $company = null;\n }\n\n $this->data['company'] = $company;\n\n return $this->data['company'];\n }",
"function getCompanyId() {\n return $this->getAdditionalProperty('company_id');\n }",
"public function getCompany()\n {\n return isset($this->company) ? $this->company : null;\n }",
"public function getCompany()\n {\n return $this->company;\n }",
"public function getCompanyId()\n {\n return array_get($this->config, 'company_id');\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getCompany(): ?string\n {\n return $this->_company;\n }",
"public function getYomiCompany()\n {\n return $this->getProperty(\"YomiCompany\");\n }",
"public function getCompany()\n {\n return $this->getParameter('billingCompany');\n }",
"public function getCompanyName()\n {\n return $this->getProperty(\"CompanyName\");\n }",
"public function getCompanyCode(){\n\t\t/* return company code */\n\t\treturn $this->_intCompanyCode;\n\t}",
"public function getCompanyId()\n {\n return $this->company_id;\n }",
"public function getCompanyId()\n {\n return $this->company_id;\n }",
"public function getOperatingCompany()\n {\n return $this->operatingCompany;\n }",
"protected function getReactCompany()\n\t{\n\t\tif (isset($this->config_data->data['ecashapp'])\n\t\t\t|| (isset($_SESSION['react_target'])\n\t\t\t\t&& $_SESSION['react_target'] !== FALSE))\n\t\t{\n\t\t\t$single_company = (isset($this->config_data->data['ecashapp']))\n\t\t\t\t? $this->config_data->data['ecashapp']\n\t\t\t\t: $_SESSION['react_target'];\n\t\t\treturn $single_company;\n\t\t}\n\t\telseif ($this->mode == MODE_ECASH_REACT)\n\t\t{\n\t\t\treturn $this->config->property_short;\n\t\t}\n\t\treturn NULL;\n\t}",
"public function getCompany()\n\t{\n\t\tif (!isset($this->_r_company)) {\n\t\t\t$filters = [];\n\t\t\tif(!is_null($v = $this->getCompanyId())){\n\t\t\t\t$filters['company_id'] = $v;\n\t\t\t}\n\t\t\tif (empty($filters)){\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t$m = new DYCompaniesControllerRealR();\n\t\t\t$this->_r_company = $m->getItem($filters);\n\t\t}\n\n\t\treturn $this->_r_company;\n\t}",
"public function getCompanyName()\n {\n return $this->company_name;\n }",
"public function getCompanyName() {\n\t\treturn $this->company_name; \n\t}",
"public function getCompanyName() {\n\n return $this->company_name;\n\n }",
"public function getCompany_name()\n {\n return $company_name;\n }",
"public function getCompanyNameAttribute() {\n\t\treturn $this->company_name;\n\t}",
"public function getCompanyName()\n {\n return $this->companyName;\n }",
"public function getCompanyName()\n {\n return $this->companyName;\n }",
"public function getCompanyName()\r\n {\r\n return $this->companyName;\r\n }",
"public function getCompanyId()\n {\n if ($this->userContext->getUserId()\n && $this->userContext->getUserType() == UserContextInterface::USER_TYPE_CUSTOMER\n ) {\n try {\n $customer = $this->customerRepository->getById($this->userContext->getUserId());\n\n if ($customer->getExtensionAttributes()\n && $customer->getExtensionAttributes()->getCompanyAttributes()\n && $customer->getExtensionAttributes()->getCompanyAttributes()->getCompanyId()\n ) {\n return $customer->getExtensionAttributes()->getCompanyAttributes()->getCompanyId();\n }\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }\n return null;\n }"
]
| [
"0.69439805",
"0.6641938",
"0.64975184",
"0.642026",
"0.6382302",
"0.6278197",
"0.62756866",
"0.6245016",
"0.62391084",
"0.6225223",
"0.61779565",
"0.6164254",
"0.6149343",
"0.61454195",
"0.61253214",
"0.6094947",
"0.609472",
"0.609472",
"0.608427",
"0.6049034",
"0.59151477",
"0.5900368",
"0.5899937",
"0.5852196",
"0.5848084",
"0.5831993",
"0.58269817",
"0.58269817",
"0.5820614",
"0.58094186"
]
| 0.76824564 | 0 |
Get the [prod_related] column value. | public function getProdRelated()
{
return $this->prod_related;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"public function setProdRelated($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related !== $v) {\n $this->prod_related = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED] = true;\n }\n\n return $this;\n }",
"public function getRelated(): string\n {\n return $this->related;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function get_related_products() {\n if('product' != get_post_type()) {\n\n // Get an array of the resource types\n\n // Query the relationship field on all 'products' associated with the current post type\n $return = get_posts(array(\n 'post_type' => 'product',\n 'suppress_filters' => 0,\n 'meta_query' => array(\n array(\n 'key' => get_post_type(), // name of custom field\n 'value' => '\"' . get_the_ID() . '\"', // matches exactly \"123\", not just 123. This prevents a match for \"1234\"\n 'compare' => 'LIKE'\n )\n )\n ));\n } else {\n $return = get_field('related_products');\n }\n return $return;\n }",
"public function getProdGeneral()\n {\n return $this->prod_general;\n }",
"public function getProdRelatedM3()\n {\n return $this->prod_related_m3;\n }",
"public function get_relatedDocNo() {\n return $this->relatedDocNo;\n }",
"protected function getLinkedProductID () {\n $productFilter = Search::getInstance($this->data['attrs']['source_id'])->getFilter('product');\n\n return $productFilter ? $productFilter['value'] : null;\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"static function getProductProperty($prob_name,$prod_id, $wid){\n $vdo = vpdo::getVdo(DB_PREFIX.$wid) ;\n return $vdo->fetchOne(\"select ov.name from options o \n inner join options_values ov on o.id = ov.option_id where o.name = ? and product_id = ?\", array($prob_name, $prod_id));\n }",
"public function setProdRelated2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related2 !== $v) {\n $this->prod_related2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED2] = true;\n }\n\n return $this;\n }",
"private function getProductLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"public function getProducts_prid() {\n\t\treturn $this->products_prid;\n\t}",
"public function getProductEntityLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"function getRelatedProdsById($pId){\n\t\t$query = \"SELECT GROUP_CONCAT(DISTINCT relatedto_id ORDER BY relatedto_id ASC SEPARATOR ',') AS prodRelated, GROUP_CONCAT(DISTINCT relatedto_offerid ORDER BY relatedto_offerid ASC SEPARATOR ',') AS offerRelated FROM product_related WHERE `relatedfrom_id`=$pId\";\n\t\t//$data = mysql_query($query);\n\t\t//print_r($data);\n\t\t$result = $this->selectQueryForAssoc($query);\n\t\treturn $result;\t\n\t}",
"private function getProductEntityLinkField()\n {\n if (!$this->productEntityLinkField) {\n $this->productEntityLinkField = $this->getMetadataPool()\n ->getMetadata(\\Magento\\Catalog\\Api\\Data\\ProductInterface::class)\n ->getLinkField();\n }\n return $this->productEntityLinkField;\n }",
"public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}",
"public function GetIdProducto()\n\t{\n\t\treturn $this->idProd;\n\t}",
"public function getProductId(): string\n {\n return $this->productId;\n }",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function product()\n {\n return $this->m_product;\n }",
"public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }",
"public function getPriceProduct()\n {\n return $this->priceProduct;\n }",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function getCdProduto()\n {\n return $this->Cd_produto;\n }"
]
| [
"0.68726206",
"0.64084405",
"0.6190881",
"0.5949044",
"0.5945941",
"0.5834201",
"0.57762355",
"0.5718912",
"0.56880474",
"0.5659954",
"0.5657465",
"0.5543816",
"0.55207604",
"0.5515525",
"0.54667014",
"0.5452311",
"0.5321481",
"0.5315701",
"0.53066546",
"0.527686",
"0.52650476",
"0.5255369",
"0.5229786",
"0.5216577",
"0.5215796",
"0.51942813",
"0.517452",
"0.5158245",
"0.51404816",
"0.5136856"
]
| 0.7774425 | 0 |
Get the [prod_related_pa] column value. | public function getProdRelatedPa()
{
return $this->prod_related_pa;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function setProdRelatedPa($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related_pa !== $v) {\n $this->prod_related_pa = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED_PA] = true;\n }\n\n return $this;\n }",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"static function getProductProperty($prob_name,$prod_id, $wid){\n $vdo = vpdo::getVdo(DB_PREFIX.$wid) ;\n return $vdo->fetchOne(\"select ov.name from options o \n inner join options_values ov on o.id = ov.option_id where o.name = ? and product_id = ?\", array($prob_name, $prod_id));\n }",
"public function getProducts_prid() {\n\t\treturn $this->products_prid;\n\t}",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }",
"public function getProdRelatedM3()\n {\n return $this->prod_related_m3;\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"private function rtPropID(string $proprietary){\n $this->checkNotConnected();\n $qr_all = $this->connection->query(\"SELECT cd_proprietary, COUNT(cd_proprietary) AS exists_prop FROM tb_proprietaries WHERE nm_proprietary = \\\"$proprietary\\\";\")->fetch_array();\n return $qr_all['exists_prop'] > 0 ? (int) $qr_all['cd_proprietary'] : null;\n }",
"public function getProdGeneral()\n {\n return $this->prod_general;\n }",
"protected function getLinkedProductID () {\n $productFilter = Search::getInstance($this->data['attrs']['source_id'])->getFilter('product');\n\n return $productFilter ? $productFilter['value'] : null;\n }",
"public function getrep_problema()\r\n {\r\n return $this->rep_problema;\r\n }",
"public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }",
"function get_pr_for_appliance($appliance_id) {\n\t\t$db=htvcenter_get_db_connection();\n\t\t$cloudprofile_array = $db->Execute(\"select pr_id from \".$this->_db_table.\" where pr_appliance_id=$appliance_id\");\n\t\tforeach ($cloudprofile_array as $index => $cloudprofile) {\n\t\t\treturn $cloudprofile[\"pr_id\"];\n\t\t}\n\t}",
"public function getFkPpaPpa()\n {\n return $this->fkPpaPpa;\n }",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getPriceProduct()\n {\n return $this->priceProduct;\n }",
"public function getPa()\n {\n return $this->pa;\n }",
"public function getPa()\n {\n return $this->pa;\n }",
"public function getPrecinctId()\n\t{\n\n\t\treturn $this->precinct_id;\n\t}",
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio()\n {\n return $this->precio;\n }",
"public function getPrecio()\n {\n return $this->precio;\n }",
"private function getProductLinkField()\n {\n return $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();\n }"
]
| [
"0.70613486",
"0.6141458",
"0.6135137",
"0.582457",
"0.5773666",
"0.57014686",
"0.5696823",
"0.552517",
"0.5504893",
"0.5472273",
"0.5452239",
"0.5416829",
"0.5397572",
"0.5355227",
"0.53499776",
"0.53248036",
"0.53041506",
"0.5296495",
"0.5285842",
"0.5243668",
"0.51948",
"0.51712716",
"0.51712716",
"0.5163369",
"0.5157205",
"0.5157205",
"0.5157205",
"0.5157205",
"0.5157205",
"0.5155583"
]
| 0.7920244 | 0 |
Get the [prod_related_m3] column value. | public function getProdRelatedM3()
{
return $this->prod_related_m3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdRelatedM3($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related_m3 !== $v) {\n $this->prod_related_m3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED_M3] = true;\n }\n\n return $this;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function getM3()\n {\n return $this->m3;\n }",
"public function getCategory3()\n {\n if (array_key_exists(\"category3\", $this->_propDict)) {\n return $this->_propDict[\"category3\"];\n } else {\n return null;\n }\n }",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"public function getC3()\r\n {\r\n return $this->C3;\r\n }",
"public function getThird()\n {\n return isset($this->third) ? $this->third : null;\n }",
"public function getCmp3()\n {\n return $this->cmp3;\n }",
"function getProductValue($ms3Oid, $featureName, $raw = false) {\n\t\t$this->dbgstart();\n\t\t$FeatureId = $this->calc->dbutils->getFeatureIdByName($featureName);\n\t\t$pid = $this->calc->getProdIdForMs3Oid($ms3Oid);\n\t\t$ret = $this->calc->dbutils->getProductValue($pid, $FeatureId, $raw);\n\t\t$this->dbgend();\n\t\treturn $ret;\n\t}",
"public function getExpr3()\n {\n return $this->expr3;\n }",
"public function getApplicantReferenceThree()\n {\n return $this->getProperty('applicant_reference_three');\n }",
"public function getAttr3(){\r\n\t\treturn $this->attr3;\r\n\t}",
"public function getVolPondasiM3()\n {\n return $this->vol_pondasi_m3;\n }",
"public function getSp3disp()\n {\n return $this->sp3disp;\n }",
"public function getCcmp3()\n {\n return $this->ccmp3;\n }",
"public function getThird()\n\t{\t\treturn $this->third;\n\t}",
"public function setM3($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->m3 !== $v) {\n $this->m3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_M3] = true;\n }\n\n return $this;\n }",
"public function getPromotionAmount()\r\n\t{\r\n\t\treturn $this->root->getAttribute('mtpromo');\r\n\t}",
"public function getOpcion3() {\n return $this->opcion3;\n }",
"public function getReqOtherPhone3()\n\t{\n\t\treturn $this->req_other_phone3;\n\t}",
"public function getPointProd3():?int\n {\n //Recuperation de la partie entière de la division du nombre\n //de produit3 par 2\n $paire = (int)($this->produit3 / 2);\n return $this->produit3 <= 0 ? 0 : $paire * 15;\n }",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function getCodeRef3() {\n return $this->codeRef3;\n }",
"public function get_related($limit = 3){\n\n\t\t// TODO: \tFigure out where to set limit\n\t\t// \t\t\tPerhaps plugin settings?\n\t\t// \t\t\tOr just stay as parameter?\n\t\t\n\t\t// We get random products that are in the same category as this product\n\t\treturn local_moodec_get_random_products($limit, $this->_categoryid, $this->_id);\n\t}",
"public function _getLotNo3() {\n\t\treturn $this->_lotNo3;\n\t}",
"public function getDocumentProductNcm()\n {\n return (string) $this->document_product_ncm;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }"
]
| [
"0.665403",
"0.6173712",
"0.599795",
"0.59316546",
"0.5800028",
"0.5560859",
"0.55192137",
"0.53414327",
"0.53336835",
"0.5324943",
"0.5291588",
"0.52813375",
"0.52590287",
"0.5242515",
"0.5226886",
"0.5200016",
"0.51214665",
"0.5041952",
"0.50236434",
"0.50145686",
"0.500629",
"0.4975051",
"0.49665567",
"0.4960145",
"0.49420044",
"0.49122235",
"0.49081075",
"0.48838252",
"0.48710635",
"0.48563805"
]
| 0.80634874 | 0 |
Get the [prod_related2] column value. | public function getProdRelated2()
{
return $this->prod_related2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function setProdRelated2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related2 !== $v) {\n $this->prod_related2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED2] = true;\n }\n\n return $this;\n }",
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function getValue2(){\n return $this->_value2;\n }",
"public function getP2() {\n return $this->p2;\n }",
"public function getCategory2()\n {\n if (array_key_exists(\"category2\", $this->_propDict)) {\n return $this->_propDict[\"category2\"];\n } else {\n return null;\n }\n }",
"public function getC2()\r\n {\r\n return $this->C2;\r\n }",
"public function getAddress2()\n {\n return $this->getValue('nb_icontact_prospect_address_2');\n }",
"public function getExpr2()\n {\n return $this->expr2;\n }",
"public function getProdRelatedM3()\n {\n return $this->prod_related_m3;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"public function getAttr2(){\r\n\t\treturn $this->attr2;\r\n\t}",
"public function getID2()\n\t{\n\t\treturn $this->id2;\n\t}",
"public function get_relatedDocNo() {\n return $this->relatedDocNo;\n }",
"public function getRef2() {\n return $this->_ref2;\n }",
"public function getApplicantReferenceTwo()\n {\n return $this->getProperty('applicant_reference_two');\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getOpcion2() {\n return $this->opcion2;\n }",
"public function getProdGeneral()\n {\n return $this->prod_general;\n }",
"public function getRelation2()\n {\n return $this->getEmbeddedResource('relation2');\n }",
"public function getId2()\n {\n return $this->id2;\n }",
"public function getPointProd2():?int\n {\n //Verifier si au moins un produit 1 est vendu afin de dettminer \n //le nombre de point du produit 2\n\n return $this->produit1<=0 ? 0 : ($this->produit2<=0 ? 0 : $this->produit2 * 5);\n }",
"public function setProdRelated($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related !== $v) {\n $this->prod_related = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED] = true;\n }\n\n return $this;\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getRelated(): string\n {\n return $this->related;\n }",
"public function getType2()\n {\n return $this->type2;\n }",
"protected function getLinkedProductID () {\n $productFilter = Search::getInstance($this->data['attrs']['source_id'])->getFilter('product');\n\n return $productFilter ? $productFilter['value'] : null;\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }"
]
| [
"0.68929267",
"0.6697329",
"0.64396703",
"0.6073547",
"0.58474195",
"0.5828501",
"0.5799311",
"0.5697055",
"0.55656576",
"0.5549174",
"0.55155736",
"0.5512123",
"0.54855615",
"0.5469979",
"0.5427511",
"0.5406815",
"0.53962827",
"0.53939426",
"0.5386874",
"0.53689206",
"0.5364862",
"0.53466713",
"0.5342636",
"0.53206414",
"0.5311421",
"0.5292369",
"0.528087",
"0.5242922",
"0.5221631",
"0.5209676"
]
| 0.8154724 | 0 |
Get the [prod_saveas] column value. | public function getProdSaveas()
{
return $this->prod_saveas;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdSaveas($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_saveas !== $v) {\n $this->prod_saveas = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_SAVEAS] = true;\n }\n\n return $this;\n }",
"public function getProdWriteup()\n {\n return $this->prod_writeup;\n }",
"public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }",
"public function getDocumentProductPisCst()\n {\n return (string) (string) $this->document_product_pis_cst;\n }",
"public function getDocumentProductCod()\n {\n return (string) $this->document_product_cod;\n }",
"public function getSaveAsFlag()\n {\n return $this->getRequest()->getParam('_save_as_flag') ? '1' : '';\n }",
"public function toValue(): string\n {\n return (string) $this->pdoStatement->fetchColumn();\n }",
"public function getDocumentProductEan()\n {\n return (string) $this->document_product_ean;\n }",
"public function getSaveMode()\n {\n return $this->queryMaker->getSaveMode();\n }",
"public function get_saved_value() {\n\t\treturn $this->saved_value;\n\t}",
"public function getSaveToDatabase()\n {\n return $this->_saveToDatabase;\n }",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getDocumentProductCest()\n {\n return (string) $this->document_product_cest;\n }",
"public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}",
"public function getDocumentProductUnitaryValue()\n {\n return (string) $this->document_product_unitary_value;\n }",
"public function getDocumentProductPisAliquota()\n {\n return (string) $this->document_product_pis_aliquota;\n }",
"public function sqlValue()\n {\n return ($this->arrConfig['operator'] == 'like' ? ('%' . $this->arrConfig['value'] . '%') : $this->arrConfig['value']);\n }",
"public function getDocumentProductName()\n {\n return (string) $this->document_product_name;\n }",
"public function getShowInProduct()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/show_product', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"protected function getKeyForSaveQuery(){\n\t\treturn $this->getKey();\n\t}",
"public function getDocumentProductQtd()\n {\n return (string) $this->document_product_qtd;\n }",
"public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }",
"public function getShippedValue()\n {\n return defined('static::SHIPPED_VALUE') ? static::SHIPPED_VALUE : 'shipped';\n }",
"public function getDocumentProductIpiCst()\n {\n return (string) $this->document_product_ipi_cst;\n }",
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}"
]
| [
"0.60238826",
"0.5549283",
"0.54794115",
"0.5462092",
"0.5382857",
"0.5367298",
"0.5354463",
"0.52927715",
"0.52359426",
"0.5222625",
"0.5208846",
"0.5136961",
"0.5106385",
"0.5102098",
"0.508306",
"0.5048688",
"0.5014713",
"0.4998552",
"0.49984923",
"0.4993149",
"0.4976919",
"0.49708033",
"0.49507907",
"0.49504334",
"0.49488202",
"0.49464226",
"0.49450895",
"0.49360612",
"0.49278566",
"0.4927559"
]
| 0.6912204 | 0 |
Get the [prod_aircraftreg] column value. | public function getProdAircraftreg()
{
return $this->prod_aircraftreg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProduct_code () {\n\t$preValue = $this->preGetValue(\"product_code\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_code;\n\treturn $data;\n}",
"public function getProdCode()\n {\n return $this->prod_code;\n }",
"public function getProdEra()\n {\n return $this->prod_era;\n }",
"public function getAirportCode()\n {\n return $this->airportCode;\n }",
"function get_army_value()\n\t{\n\t\t$result = pg_query(\"SELECT sum(point_cost) as point_total FROM warhammer.user_army\");\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\treturn $result_a[\"point_total\"];\n\t}",
"public function getKieGuruMinumAir()\n {\n return $this->kie_guru_minum_air;\n }",
"public function setProdAircraftreg($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_aircraftreg !== $v) {\n $this->prod_aircraftreg = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_AIRCRAFTREG] = true;\n }\n\n return $this;\n }",
"public function getEquipment()\n {\n $value = $this->get(self::EQUIPMENT);\n return $value === null ? (integer)$value : $value;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function getCellular()\n {\n return $this->getValue('nb_icontact_prospect_cellular');\n }",
"public function getEquipmentCode()\n {\n return isset($this->EquipmentCode) ? $this->EquipmentCode : null;\n }",
"public function getAssignProduct() {\n return $this->scopeConfig->getValue ( static::XML_ASSIGN_PRODUCT, ScopeInterface::SCOPE_STORE );\n }",
"public function getAttributeCode(){\n\t\t$code = 'brand_name';\n\t\treturn $code;\n\t}",
"public function getSumberAirMinumId()\n {\n return $this->sumber_air_minum_id;\n }",
"public function getCellValue($row);",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"function getProductCode()\n {\n return $this->productCode;\n }",
"public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}",
"public function getProductAttributeInt($productId, $attributeCode){\r\n\t$resource = Mage::getSingleton('core/resource');\r\n\t$readConnection = $resource->getConnection('core_read');\r\n\treturn\t\r\n\t $readConnection->fetchOne(\r\n\t 'select value from catalog_product_entity_int where entity_id=' . $productId . '\r\n\t\t and attribute_id = (select attribute_id from eav_attribute where attribute_code = \\'' . $attributeCode . '\\')'\r\n );\r\n}",
"public function getImpactCode() {\n $row = $this->getInnerRow();\n return (int)$row['impact_code'];\n }",
"public function getKieKantinMinumAir()\n {\n return $this->kie_kantin_minum_air;\n }",
"public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}",
"public function getKieSelasarMinumAir()\n {\n return $this->kie_selasar_minum_air;\n }",
"public function getASabunAirMengalir()\n {\n return $this->a_sabun_air_mengalir;\n }",
"public function getCodeRegimeBaseObl() {\n return $this->codeRegimeBaseObl;\n }",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function getProdId()\n {\n return $this->prod_id;\n }",
"public function getCarCode(){\r\n\t\t\t$this->car_code = getValue(\"SELECT car_code FROM tbl_car WHERE car_id=\".$this->car_id);\r\n\t\t\treturn $this->car_code;\r\n\t}",
"public function getProductValueById()\n\t{\n\t\t$product_id = $this->input->post('product_id');\n\t\tif ($product_id) {\n\t\t\t$product_data = $this->model_products->getProductData($product_id);\n\t\t\techo json_encode($product_data);\n\t\t}\n\t}",
"public function getProductNum()\n {\n $value = $this->get(self::product_num);\n return $value === null ? (integer)$value : $value;\n }"
]
| [
"0.55193996",
"0.54365224",
"0.5284347",
"0.5085287",
"0.5083368",
"0.5048481",
"0.5035778",
"0.5034762",
"0.49865147",
"0.49640322",
"0.4954516",
"0.49132788",
"0.489967",
"0.48987478",
"0.4898491",
"0.48643905",
"0.48569196",
"0.48234445",
"0.48186368",
"0.4804307",
"0.48038647",
"0.47959062",
"0.4792585",
"0.47822866",
"0.4766752",
"0.47569197",
"0.47541866",
"0.47476658",
"0.47449785",
"0.46988544"
]
| 0.72287625 | 0 |
Get the [mb] column value. | public function getMb()
{
return $this->mb;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRmb()\n {\n return $this->get(self::_RMB);\n }",
"public function getRmb()\n {\n return $this->get(self::_RMB);\n }",
"public function getRmb()\n {\n return $this->get(self::RMB);\n }",
"public function getMaxchar() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(3, $this->_result)) return (string) $this->_result[3];\n\t\t\telse parent::throwGetColException('Not set CampaignDefinitionsModel::getMaxchar', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From CampaignDefinitionsModel::getMaxchar', __LINE__, __FILE__);\n\t}",
"public function getWastedInMb()\n {\n return $this->wastedInMb;\n }",
"public function setMb($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->mb !== $v) {\n $this->mb = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_MB] = true;\n }\n\n return $this;\n }",
"public function getTaxaLMB() {\n return $this->getChaveValor('TAXA_SERVICO_LMB');\n }",
"public static function mb_to_gb($mb){\n $mb = Strings::lower($mb);\n $mb = str_replace([' ', 'mb', 'mib'],'', $mb);\n\n return (float)$mb * (1/1024);\n }",
"function mb_to_bytes($mb) {\n\treturn $mb*1048576;\n}",
"public function modifierMbyte($num)\n {\n if (strtolower($this->getIsp()) == 'tnc') {\n $kNum = round(ceil($num/10000));\n $mNum = $kNum/100;\n }else{\n $mNum = round($num/pow(1024,2),2);\n }\n return $mNum.\"MB\";\n }",
"public function memno()\n {\n return $this->memno;\n }",
"public function fetchColumn() {\n if ($this->result === true) {\n return false;\n }\n\n // Are we running PHP >=8.1?\n if (PHP_VERSION_ID >= 80100) {\n $value = $this->result->fetch_column();\n return ($value === null || $value === false) ? $value : (string) $value;\n }\n\n // Fallback to traditional approach\n $row = $this->result->fetch_row();\n return $row ? $row[0] : false;\n }",
"public function getColumn(): string\n {\n return $this->_column;\n }",
"public function getBytesField()\n {\n $value = $this->get(self::BYTES_FIELD);\n return $value === null ? (string)$value : $value;\n }",
"public function getMembre()\n {\n return $this->membre;\n }",
"public function getMDB2DataValue()\n\t{\n\t\tif($this->mdb2DataValue != '')\n\t\t{\n\t\t\treturn $this->mdb2DataValue;\n\t\t}\n\t}",
"public function getCellValue()\n {\n return $this->get('CellValue');\n }",
"public function getCellValue()\n {\n return $this->get('CellValue');\n }",
"private function get_sizeMib()\n\t{\n\t\treturn $this->m_sizeMib;\n\t}",
"public function sqlValue()\n {\n return ($this->arrConfig['operator'] == 'like' ? ('%' . $this->arrConfig['value'] . '%') : $this->arrConfig['value']);\n }",
"public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}",
"public function getColumn(): string\n {\n return $this->column;\n }",
"public function maximalVal( string $column = '' )\n {\n return $this->show()->max( $column );\n }",
"function return_bytes($val)\n {\n $val = trim($val);\n $last = strtoupper($val[strlen($val)-1]);\n switch($last)\n {\n case 'G': $val *= 1024;\n case 'M': $val *= 1024;\n case 'K': $val *= 1024;\n }\n return $val;\n }",
"function GetColVal($col_name) {\n\t\treturn $this->$col_name;\n\t}",
"public function modelColumn();",
"public function getBU()\n {\n $value = $this->get(self::BU);\n return $value === null ? (integer)$value : $value;\n }",
"public function getPSBMAU()\n\t{\n\t\t$query = $this->db->query\n\t\t(\"\n\t\t\tSELECT COUNT(lembaga) as psbmau\n\t\t\tFROM psb_calonsiswa\n\t\t\tWHERE lembaga='MA Unggulan Amanatul Ummah' AND statusfinalisasi = 'y'\n\t\t\t\t\tAND tahunmasuk='$this->tahunmasuk'\n\n\t\t\");\n\t\tif ($query->num_rows()>0){\n\t\t\t\t\tforeach ($query->result() as $row)\n\t\t\t\t\t\t$data['psbmau'] = $row->psbmau;\n\t\t\t\t}\n\t\t\t\treturn $data['psbmau'];\n\t}",
"public function getMysql()\n {\n return $this->readOneof(100);\n }",
"public static function configSizeToMB($value){\n\t\t$value=trim($value);\n\t\t$lastchar = substr($value, -1);\n\t\t\n\t\tswitch($lastchar){\n\t\t\tcase 'M':\n\t\t\t\treturn substr($value,0,-1);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'G':\n\t\t\t\treturn substr($value,0,-1)*1024;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'K':\n\t\t\t\treturn substr($value,0,-1)/1024;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t//assume bytes\n\t\t\t\treturn $value/1024/1024;\n\t\t\t\tbreak;\n\t\t}\n\t}"
]
| [
"0.6330123",
"0.6330123",
"0.6317458",
"0.60013413",
"0.58947235",
"0.5823811",
"0.5755394",
"0.57236534",
"0.5718326",
"0.56497175",
"0.5642225",
"0.5624337",
"0.56006444",
"0.55937636",
"0.55825603",
"0.55716205",
"0.5570821",
"0.5570821",
"0.5561704",
"0.55581874",
"0.5557684",
"0.5509865",
"0.5501959",
"0.54944587",
"0.54713756",
"0.5462551",
"0.54440033",
"0.5443108",
"0.5427773",
"0.54201233"
]
| 0.6870478 | 0 |
Get the [pa] column value. | public function getPa()
{
return $this->pa;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_pa(){ return $this->_pa;}",
"public function getItemaPt() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(4, $this->_result)) return (string) $this->_result[4];\n\t\t\telse parent::throwGetColException('Not set PollTemplatesModel::getItemaPt', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PollTemplatesModel::getItemaPt', __LINE__, __FILE__);\n\t}",
"public function getItembPt() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(7, $this->_result)) return (string) $this->_result[7];\n\t\t\telse parent::throwGetColException('Not set PollTemplatesModel::getItembPt', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PollTemplatesModel::getItembPt', __LINE__, __FILE__);\n\t}",
"public function value($column)\r\n {\r\n $rs = (array) $this->first();\r\n return $rs[$column];\r\n }",
"public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}",
"public function getColumna() {\n return $this->columna;\n }",
"function getValueFromField()\r\n\t{\r\n\t\treturn $this->row[ key( $this->mapping ) ];\r\n\t}",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }",
"public function sqlValue()\n {\n return ($this->arrConfig['operator'] == 'like' ? ('%' . $this->arrConfig['value'] . '%') : $this->arrConfig['value']);\n }",
"public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}",
"public function value($column)\n {\n $result = (array) $this->first([$column => 1]);\n\n return count($result) > 0 ? $result[$column] : null;\n }",
"public function toValue(): string\n {\n return (string) $this->pdoStatement->fetchColumn();\n }",
"public function getDataFromColumn($col)\n {\n return $this->attributes[app()->getLocale() == 'ar' ? 'ar_'.$col : $col] ?? $this->attributes[$col];\n }",
"public function getFkPpaPpa()\n {\n return $this->fkPpaPpa;\n }",
"public function getPaidValue()\n {\n return defined('static::PAID_VALUE') ? static::PAID_VALUE : 'paid';\n }",
"protected function value()\n {\n return $this->row($this->row);\n }",
"public function getIdPt() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(0, $this->_result)) return (string) $this->_result[0];\n\t\t\telse parent::throwGetColException('Not set PollTemplatesModel::getIdPt', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PollTemplatesModel::getIdPt', __LINE__, __FILE__);\n\t}",
"function sequence_value() {\n\t\treturn $this->data[$this->sequence_field];\n\t}",
"public function getItemPl() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(10, $this->_result)) return (string) $this->_result[10];\n\t\t\telse parent::throwGetColException('Not set ProjectsListingsModel::getItemPl', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From ProjectsListingsModel::getItemPl', __LINE__, __FILE__);\n\t}",
"public function getPventa()\n {\n return $this->pventa;\n }",
"public function protein()\n\t{\n\t\treturn $this->macronutrients()['protein'];\n\t}",
"public function getPerpagePl() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(5, $this->_result)) return (int) $this->_result[5];\n\t\t\telse parent::throwGetColException('Not set ProjectsListingsModel::getPerpagePl', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From ProjectsListingsModel::getPerpagePl', __LINE__, __FILE__);\n\t}",
"function get_army_value()\n\t{\n\t\t$result = pg_query(\"SELECT sum(point_cost) as point_total FROM warhammer.user_army\");\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\treturn $result_a[\"point_total\"];\n\t}",
"public function getNamePt() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(1, $this->_result)) return (string) $this->_result[1];\n\t\t\telse parent::throwGetColException('Not set PollTemplatesModel::getNamePt', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PollTemplatesModel::getNamePt', __LINE__, __FILE__);\n\t}",
"public function getData()\n\t{\n\t\t$column = self::COL_DATA;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}",
"public function getData()\n\t{\n\t\t$column = self::COL_DATA;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}",
"public function value() {\n if ($this->_m_value !== null)\n return $this->_m_value;\n $this->_m_value = $this->lookupTable()[($this->tag() - 213)];\n return $this->_m_value;\n }",
"public function getValue()\n {\n return $this->_db->prepareStringToOut($this->_value);\n }",
"function Get($col)\n {\n return $this->row ? $this->row[$col] : NULL;\n }"
]
| [
"0.65248847",
"0.6429114",
"0.62256396",
"0.6214711",
"0.59470123",
"0.5908936",
"0.5878738",
"0.5849751",
"0.58424395",
"0.57630295",
"0.5742067",
"0.5729768",
"0.5717165",
"0.56972927",
"0.5682865",
"0.5642016",
"0.55278367",
"0.551758",
"0.5470435",
"0.5462668",
"0.54625446",
"0.54420507",
"0.54321",
"0.5411246",
"0.5391",
"0.5383039",
"0.5383039",
"0.5370022",
"0.5365214",
"0.53410023"
]
| 0.6731205 | 1 |
Get the [m3] column value. | public function getM3()
{
return $this->m3;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAttr3(){\r\n\t\treturn $this->attr3;\r\n\t}",
"public function getThird()\n {\n return isset($this->third) ? $this->third : null;\n }",
"public function getC3()\r\n {\r\n return $this->C3;\r\n }",
"public function getVolPondasiM3()\n {\n return $this->vol_pondasi_m3;\n }",
"public function getThird()\n\t{\t\treturn $this->third;\n\t}",
"public function getExpr3()\n {\n return $this->expr3;\n }",
"public function getVolKudakudaM3()\n {\n return $this->vol_kudakuda_m3;\n }",
"public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }",
"public function value($column)\r\n {\r\n $rs = (array) $this->first();\r\n return $rs[$column];\r\n }",
"public function getLine3()\n {\n return (string) $this->json()->line3;\n }",
"public function getThirdVat()\n {\n return isset($this->thirdVat) ? $this->thirdVat : null;\n }",
"public function getCcmp3()\n {\n return $this->ccmp3;\n }",
"public function getCmp3()\n {\n return $this->cmp3;\n }",
"public function getBmdate3()\n {\n return $this->bmdate3;\n }",
"public function getCbmdate3()\n {\n return $this->cbmdate3;\n }",
"public function getProdRelatedM3()\n {\n return $this->prod_related_m3;\n }",
"public function value($column)\n {\n $result = (array) $this->first([$column => 1]);\n\n return count($result) > 0 ? $result[$column] : null;\n }",
"public function getCategory3()\n {\n if (array_key_exists(\"category3\", $this->_propDict)) {\n return $this->_propDict[\"category3\"];\n } else {\n return null;\n }\n }",
"public function toValue() {\r\n\t\treturn $this->PDOStatement->fetchColumn();\r\n\t}",
"public function getCodeRef3() {\n return $this->codeRef3;\n }",
"protected static function iso3(): mixed\n\t{\n\t\treturn self::$query->iso3;\n\t}",
"public function getData()\n\t{\n\t\t$column = self::COL_DATA;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}",
"public function getData()\n\t{\n\t\t$column = self::COL_DATA;\n\t\t$v = $this->$column;\n\n\t\tif( $v !== null){\n\t\t\t$v = (string)$v;\n\t\t}\n\n\t\treturn $v;\n\t}",
"public function getPosCur3()\n {\n return $this->pos_cur3;\n }",
"public function magic3() { return $this->_m_magic3; }",
"public function getCellValue()\n {\n return $this->get('CellValue');\n }",
"public function getCellValue()\n {\n return $this->get('CellValue');\n }",
"public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}",
"public function getColumn(): string\n {\n return $this->_column;\n }",
"public function get_game_three_content () {\n\t\treturn get_field('field_5b4770a12c38c', $this->get_id());\n\t}"
]
| [
"0.6373233",
"0.63342357",
"0.63031006",
"0.6284794",
"0.62509793",
"0.6193938",
"0.60760117",
"0.6063072",
"0.5980403",
"0.59717166",
"0.59104234",
"0.5855225",
"0.5824797",
"0.57830477",
"0.57789826",
"0.5734393",
"0.5727807",
"0.57263476",
"0.57253385",
"0.57196",
"0.56810313",
"0.56522924",
"0.56522924",
"0.5627962",
"0.56123936",
"0.55891013",
"0.55891013",
"0.5559315",
"0.55583507",
"0.5556832"
]
| 0.7438391 | 0 |
setProdName() Set the value of [prod_alt1] column. | public function setProdAlt1($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_alt1 !== $v) {
$this->prod_alt1 = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProductName($product_name){\n $this->product_name = $product_name;\n }",
"public function setProductName(?string $value): void {\n $this->getBackingStore()->set('productName', $value);\n }",
"public function setItemName()\n {\n if ($product = $this->product) {\n $name = $product->productPrint->name;\n $name = $product->mailingOption->name . ' ' . $name;\n $name = $name . ' ' . $product->stockOption->name;\n $this->name = $name;\n $this->save();\n }\n }",
"function setSyncProdName()\n {\n }",
"public function setProductName(string $productName): void\n {\n $this->productName = $productName;\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function setProdName($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_name !== $v) {\n $this->prod_name = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_NAME] = true;\n }\n\n return $this;\n }",
"public function setName_product($name_product)\n {\n $this->name_product = $name_product;\n\n return $this;\n }",
"public function setName(string $name) : void\n {\n $this->set('name', $name, 'products');\n }",
"public function setProdID($prodID){\r\n\t\t$this->prodID= $prodID;\r\n\t}",
"public function getProdName()\n {\n return $this->prod_name;\n }",
"protected function setProductName($productID, $productName)\r\n {\r\n \r\n // SQL query\r\n $sql = \"UPDATE tbl_products SET product_name= '\" . $productName . \"'WHERE id_products= '\" . $productID . \"'\";\r\n \r\n // Connect to database and run query\r\n $result = $this->connect->query($sql);\r\n \r\n // Check to see if query passed and registered\r\n if ($result) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public function setProdAlt2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt2 !== $v) {\n $this->prod_alt2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT2] = true;\n }\n\n return $this;\n }",
"public function setProduct_name ($product_name) {\n\t$this->product_name = $product_name;\n\treturn $this;\n}",
"public function setProductName($product_name)\n {\n $this->product_name = $product_name;\n\n return $this;\n }",
"public function useAlternativeName(): void\n {\n $this->useAlternateName = true;\n }",
"public function setProductName(?string $productName): self\n {\n $this->initialized['productName'] = true;\n $this->productName = $productName;\n\n return $this;\n }",
"public function setByName($name, $value, $type = TableMap::TYPE_PHPNAME)\n {\n $pos = TblProdInfoTableMap::translateFieldName($name, $type, TableMap::TYPE_NUM);\n\n return $this->setByPosition($pos, $value);\n }",
"public function setName ($name){\n\t\tif($name){\n\t\t\t$this->Item['name'] = substr($name, 0,100);\n\t\t}\n\t}",
"public function SetName ($name = \\MvcCore\\IEnvironment::PRODUCTION) {\n\t\t$this->name = $name;\n\t\tforeach (static::GetAllNames() as $envName)\n\t\t\t$this->values[$envName] = FALSE;\n\t\t$this->values[$this->name] = TRUE;\n\t\treturn $name;\n\t}",
"public function setName($name){\n $this->__set('name',$name);\n }",
"public function getProductName()\n {\n return $this->product_name;\n }",
"public function getProductName(){\n return $this->product_name;\n }",
"public function getProductName() {\n //return the value product name\n return $this->ProductName;\n }",
"public function getName_product()\n {\n return $this->name_product;\n }",
"private function _setProcessName(string $proName)\n {\n if( PHP_OS=='Darwin')\n {\n return ;\n }\n\n $proName = self::$appName.'_'.$proName;\n if(function_exists('cli_set_process_title'))\n {\n @cli_set_process_title($proName);\n }\n if(extension_loaded('proctitle') && function_exists('setproctitle'))\n {\n @setproctitle($proName);\n }\n }",
"public function getProductName()\n {\n return $this->product_name;\n }",
"public function setProdAlt4($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt4 !== $v) {\n $this->prod_alt4 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT4] = true;\n }\n\n return $this;\n }",
"public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}"
]
| [
"0.6593856",
"0.6285217",
"0.62269306",
"0.6096228",
"0.60695195",
"0.606547",
"0.5979651",
"0.5859483",
"0.582439",
"0.5737067",
"0.5679284",
"0.56781083",
"0.56542873",
"0.55866635",
"0.5538256",
"0.54139674",
"0.53877753",
"0.5353698",
"0.53095037",
"0.5265667",
"0.5261859",
"0.51827234",
"0.51398957",
"0.51156974",
"0.51147985",
"0.50922406",
"0.5062693",
"0.5057743",
"0.5050312",
"0.5036973"
]
| 0.67809516 | 0 |
setProdAlt1() Set the value of [prod_alt2] column. | public function setProdAlt2($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_alt2 !== $v) {
$this->prod_alt2 = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT2] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdAlt1($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt1 !== $v) {\n $this->prod_alt1 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;\n }\n\n return $this;\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function setAlt($alt)\n {\n $this->alt = $alt;\n $this->setAttributes(\"Alt\");\n }",
"public function setAltText($alt)\n {\n $this->_alt = $alt;\n }",
"public function setRowAlt($rowAlt)\n {\n $this->rowAlt = $this->checkRowAltRange($rowAlt);\n $this->childNodes = [];\n $this->append($this->makeTableRows());\n }",
"public function setProdAlt3($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt3 !== $v) {\n $this->prod_alt3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT3] = true;\n }\n\n return $this;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function setProdAlt4($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt4 !== $v) {\n $this->prod_alt4 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT4] = true;\n }\n\n return $this;\n }",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function setPromotion($first,$second)\n {\n $this->promotion->setPromotion($first,$second);\n //product Id for identify products\n $this->promotion->setProductId($this->id);\n }",
"public function setProduct_V1(Product_V1 $produit_V1)\n {\n $this->produit_V1 = $produit_V1;\n }",
"public function setProdID($prodID){\r\n\t\t$this->prodID= $prodID;\r\n\t}",
"private function SetProductImages()\n\t{\n\n\t\t$GLOBALS['ProductThumbWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_STANDARD);\n\t\t$GLOBALS['ProductThumbHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_STANDARD);\n\n\t\t$GLOBALS['ProductMaxTinyWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\t\t$GLOBALS['ProductMaxTinyHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\n\n\t\t$GLOBALS['ProductTinyBoxWidth'] = $GLOBALS['ProductMaxTinyWidth']+4;\n\t\t$GLOBALS['ProductTinyBoxHeight'] = $GLOBALS['ProductMaxTinyHeight']+4;\n\n\n\t\t$GLOBALS['ProductMaxZoomWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t$GLOBALS['ProductMaxZoomHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\n\t\t$GLOBALS['ProductZoomWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t$GLOBALS['ProductZoomHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\n\n\t\t$productImages = ISC_PRODUCT_IMAGE::getProductImagesFromDatabase($GLOBALS['ProductId'], null, false, true);\n\t\t$GLOBALS['NumProdImages'] = count($productImages);\n\n\t\t$GLOBALS['CurrentProdThumbImage'] = 0;\n\t\t$thumb = '';\n\t\t$curZoomImage = '';\n\t\t$GLOBALS['SNIPPETS']['ProductTinyImages'] = '';\n\t\t$GLOBALS['HideImageCarousel'] = 'display:none;';\n\t\t$GLOBALS['HideMorePicturesLink'] = 'display:none;';\n\t\t$thumbImageDescription = '';\n\t\t$i = 0;\n\n\t\t$GLOBALS['ProdImageJavascript'] = '';\n\t\t$GLOBALS['ProdImageZoomJavascript'] = '';\n\t\t$GLOBALS['LightBoxImageList'] = '';\n\t\t$GLOBALS['ZoomImageMaxWidth'] = 0;\n\t\t$GLOBALS['ZoomImageMaxHeight'] = 0;\n\t\t$GLOBALS['ZoomImageMaxWidthHeight'] = 0;\n\t\t$GLOBALS['HideAlwaysLinkedMorePicturesLink'] = 'display: none';\n\n\t\tif ($GLOBALS['NumProdImages']) {\n\t\t\t//Show image carousel\n\n\t\t\tif ($GLOBALS['NumProdImages'] == 2) {\n\t\t\t\t$var = \"MorePictures1\";\n\t\t\t} else if ($GLOBALS['NumProdImages'] == 1) {\n\t\t\t\t$var = \"SeeLargerImage\";\n\t\t\t} else {\n\t\t\t\t$var = \"MorePictures2\";\n\t\t\t}\n\n\t\t\t$GLOBALS['SeeMorePictures'] = sprintf(GetLang($var), count($productImages) - 1);\n\t\t\t$GLOBALS['HideAlwaysLinkedMorePicturesLink'] = '';\n\n\t\t\tif (GetConfig('ProductImagesTinyThumbnailsEnabled')) {\n\t\t\t\t$GLOBALS['HideImageCarousel'] = '';\n\t\t\t} else {\n\t\t\t\t$GLOBALS['HideMorePicturesLink'] = '';\n\t\t\t}\n\n\t\t\t$continue=false;\n\n\t\t\tforeach ($productImages as $productImage) {\n\n\t\t\t\t$thumbURL = '';\n\t\t\t\t$zoomImageURL = '';\n\n\t\t\t\ttry{\n\t\t\t\t\t$thumbURL = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_STANDARD, true);\n\t\t\t\t\t//$GLOBALS['ProductThumbURL'] = $thumbURL;\n\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t}\n\n\t\t\t\ttry{\n\t\t\t\t\t$zoomImageURL = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_ZOOM, true);\n\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t}\n\n\t\t\t\tif($thumbURL == '' && $zoomImageURL == '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$resizedZoomDimension = $productImage->getResizedFileDimensions(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t\t\t$resizedTinyDimension = $productImage->getResizedFileDimensions(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\n\t\t\t\t//calculate the max zoom image width and height\n\t\t\t\tif ($GLOBALS['ZoomImageMaxWidth'] < $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH]) {\n\n\t\t\t\t\t$GLOBALS['ZoomImageMaxWidth'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH];\n\t\t\t\t\t//the height of the image has got the max width needed to calulate the image fancy box size.\n\t\t\t\t\t$GLOBALS['ZoomImageMaxWidthHeight'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t}\n\n\t\t\t\tif ($GLOBALS['ZoomImageMaxHeight'] < $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT]) {\n\t\t\t\t\t$GLOBALS['ZoomImageMaxHeight'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t\t//the width of the image has got the max height needed to calulate the image fancy box size.\n\t\t\t\t\t$GLOBALS['ZoomImageMaxHeightWidth'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t}\n\n\t\t\t\t$GLOBALS['ImageDescription'] = isc_html_escape($productImage->getDescription());\n\t\t\t\tif($GLOBALS['ImageDescription'] == '') {\n\t\t\t\t\t$GLOBALS['ImageDescription'] = GetLang(\"Image\") . \" \" . ($i + 1);\n\t\t\t\t}\n\n\t\t\t\t//show image carousel\n\t\t\t\tif(GetConfig('ProductImagesTinyThumbnailsEnabled')==1) {\n\n\t\t\t\t\t$GLOBALS['ProdImageJavascript'] .= \"\n\t\t\t\t\t\tThumbURLs[\".$i.\"] = \" . isc_json_encode($thumbURL) . \";\n\t\t\t\t\t\tProductImageDescriptions[\".$i.\"] = \" . isc_json_encode($GLOBALS['ImageDescription']) . \";\n\t\t\t\t\t\";\n\t\t\t\t\t$GLOBALS['TinyImageOverJavascript'] = \"showProductThumbImage(\".$i.\")\";\n\t\t\t\t\t//$GLOBALS['ProductTinyImageURL'] = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_TINY, true);\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$GLOBALS['ProductTinyImageURL'] = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_TINY, true);\n\t\t\t\t\t\t//$GLOBALS['ProductThumbURL'] = $thumbURL;\n\t\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['ProductThumbIndex'] = $i;\n\t\t\t\t\tif(GetConfig('ProductImageMode') == 'lightbox') {\n\t\t\t\t\t\t$GLOBALS['TinyImageClickJavascript'] = \"showProductImageLightBox(\".$i.\"); return false;\";\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$GLOBALS['TinyImageClickJavascript'] = \"showProductImage('\".GetConfig('ShopPath').\"/productimage.php', \".$GLOBALS['ProductId'].\", \".$i.\");\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['TinyImageWidth'] = $resizedTinyDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH];\n\t\t\t\t\t$GLOBALS['TinyImageHeight'] = $resizedTinyDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t\t$GLOBALS['TinyImageTopPadding'] = floor(($GLOBALS['ProductMaxTinyHeight'] - $GLOBALS['TinyImageHeight']) / 2);\n\t\t\t\t\t$GLOBALS['SNIPPETS']['ProductTinyImages'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductTinyImage\");\n\t\t\t\t\t$continue = true;\n\t\t\t\t}\n\n\t\t\t\tif(GetConfig('ProductImagesImageZoomEnabled') == 1) {\n\t\t\t\t\t//check if zoom image is large enough for image zoomer\n\t\t\t\t\tif($resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH]<ISC_PRODUCT_IMAGE_MIN_ZOOM_WIDTH && $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT]<ISC_PRODUCT_IMAGE_MIN_ZOOM_HEIGHT) {\n\t\t\t\t\t\t$zoomImageURL = '';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ProdImageZoomJavascript'] .= \"\n\t\t\t\t\t\tZoomImageURLs[\".$i.\"] = \" . isc_json_encode($zoomImageURL) . \";\n\t\t\t\t\t\";\n\t\t\t\t\t$continue = true;\n\t\t\t\t}\n\n\t\t\t\t//\t$GLOBALS['ProductZoomImageURL'] = $zoomImageURL;\n\n\t\t\t\t//this image is the product page thumbnail\n\t\t\t\tif($i==0) {\n\t\t\t\t\t//get the thumb image for product page\n\t\t\t\t\t$thumb = $thumbURL;\n\t\t\t\t\t$curZoomImage = $zoomImageURL;\n\t\t\t\t\t$thumbImageDescription = $GLOBALS['ImageDescription'];\n\t\t\t\t\t//if there is no need to loop through images anymore, get out from the loop.\n\t\t\t\t\tif($continue === false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['VisibleImageTotal'] = $i+1;\n\n\t\t$GLOBALS['ShowImageZoomer'] = GetConfig('ProductImagesImageZoomEnabled');\n\t\tif ($GLOBALS['ShowImageZoomer']) {\n\t\t\t$GLOBALS['SNIPPETS']['ProductImageZoomer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductImageZoomer\");\n\t\t}\n\t\t$GLOBALS['ZoomImageURL'] = $curZoomImage;\n\n\t\t//if no product thumb images\n\t\tif($thumb == '') {\n\t\t\tif(GetConfig('DefaultProductImage') == 'template') {\n\t\t\t\t$thumb = $GLOBALS['IMG_PATH'].'/ProductDefault.gif';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$thumb = GetConfig('ShopPath').'/'.GetConfig('DefaultProductImage');\n\t\t\t}\n\t\t}\n\n\t\t// need to check for variation images\n\t\t$GLOBALS['ImageDescription'] = $thumbImageDescription;\n\t\t$GLOBALS['ThumbImageURL'] = $thumb;\n\n\t\tif ($GLOBALS['NumProdImages']) {\n\t\t\t$GLOBALS['SNIPPETS']['ProductThumbImage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('FastProductThumbImage');\n\t\t} else {\n\t\t\t$GLOBALS['SNIPPETS']['ProductThumbImage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductThumbImagePlaceholder');\n\t\t}\n\t}",
"public function setAltura($iAltura, $sUnidade = \"px\") \r\n\t{\r\n\t\t$this->iAltura = $iAltura;\r\n\t\t$this->sUnidadeAltura = $sUnidade;\r\n\t}",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function edit_2Action(Produits_1 $produit1)\n {\n $user = $this->getUser();\n $em = $this->getDoctrine()->getManager();\n \n $produits = $em->getRepository('KountacBundle:Produits_2')->getProduct_2($produit1);\n \n return $this->render('produits/edit_2.html.twig', array(\n 'produit1' => $produit1,\n 'produits' => $produits,\n 'user' => $user,\n ));\n }",
"public function setAltura($iAltura) {\n $this->iAltura = $iAltura;\n }",
"public function set_alt_rows() { $this->alt_rows = true; }",
"public function setSearchArgumentAlt($value)\n {\n $this->searchArgumentAlt = $value;\n }",
"public function setValue2($value){\n $this->_value2 = $value;\n }",
"public function setPriceProduct($value)\n {\n $this->priceProduct = $value;\n }",
"public function prod($prod);",
"public function setNewCurrentMeals($mealName1, $mealName2) {\r\n $this->querySimpleExecute(\r\n \"UPDATE t_meal SET meaIsCurrentMeal = 0 WHERE meaIsCurrentMeal = 1\"\r\n );\r\n // Set true to the new current meals\r\n $this->queryPrepareExecute(\r\n \"UPDATE t_meal SET meaIsCurrentMeal = 1 WHERE meaName = :varMeaName\",\r\n array(\r\n array(\r\n \"marker\" => \"varMeaName\",\r\n \"var\" => $mealName1,\r\n \"type\" => PDO::PARAM_STR\r\n )\r\n )\r\n );\r\n $this->queryPrepareExecute(\r\n \"UPDATE t_meal SET meaIsCurrentMeal = 1 WHERE meaName = :varMeaName\",\r\n array(\r\n array(\r\n \"marker\" => \"varMeaName\",\r\n \"var\" => $mealName2,\r\n \"type\" => PDO::PARAM_STR)\r\n )\r\n );\r\n }",
"public function updateExperience($id, $PE1, $PE2=0){\n\t\t\t$query = new Query();\n\n\t\t\t$query->tables = array('pgdb');\n\t\t\t$query->fields = array('PE', 'PE2');\n\t\t\t$query->values = array($PE1, $PE2);\n\t\t\t$query->filters = \"id=\".$id;\n\n\t\t\t$query->DoUpdate();\n\t\t}",
"public function _setLotNo1($lotNo1) {\n\t\t$this->_lotNo1 = $lotNo1;\n\t}",
"public function alt(){\n\t\tif( $this->alt ) {\n\t\t\treturn $this->alt;\n\t\t}//end if\n\n\t\t$this->alt = @file_get_contents( $this->base_dir.'/'.$this->dir . $this->filename . '.alt');\n\n\t\treturn $this->alt;\n\t}",
"public function setMagia2Attribute($value) {\n $this->attributes['magia2'] = $this->verificaAtributo($value, true);\n }",
"public function extraChoice1 ($extra1, $extra1Price){\n $this->extra1=$extra1;\n $this->extra1Price=$extra1Price;\n }"
]
| [
"0.7776202",
"0.7136761",
"0.66220325",
"0.6023549",
"0.56174666",
"0.55277437",
"0.5434818",
"0.53381836",
"0.52828383",
"0.52592254",
"0.5098499",
"0.5059096",
"0.50057876",
"0.49232057",
"0.48664072",
"0.4824234",
"0.47598723",
"0.4753642",
"0.4729912",
"0.46856177",
"0.4637249",
"0.45942315",
"0.45626798",
"0.45529437",
"0.4529309",
"0.44883448",
"0.4481445",
"0.44625384",
"0.44480982",
"0.4446649"
]
| 0.7140115 | 1 |
setProdAlt2() Set the value of [prod_alt3] column. | public function setProdAlt3($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_alt3 !== $v) {
$this->prod_alt3 = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT3] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdAlt2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt2 !== $v) {\n $this->prod_alt2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT2] = true;\n }\n\n return $this;\n }",
"public function getProdAlt2()\n {\n return $this->prod_alt2;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"public function setProdAlt1($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt1 !== $v) {\n $this->prod_alt1 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT1] = true;\n }\n\n return $this;\n }",
"public function setAlt($alt)\n {\n $this->alt = $alt;\n $this->setAttributes(\"Alt\");\n }",
"public function getProdAlt1()\n {\n return $this->prod_alt1;\n }",
"public function setAltText($alt)\n {\n $this->_alt = $alt;\n }",
"public function setRowAlt($rowAlt)\n {\n $this->rowAlt = $this->checkRowAltRange($rowAlt);\n $this->childNodes = [];\n $this->append($this->makeTableRows());\n }",
"public function setProdAlt4($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt4 !== $v) {\n $this->prod_alt4 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT4] = true;\n }\n\n return $this;\n }",
"public function setAltura($iAltura, $sUnidade = \"px\") \r\n\t{\r\n\t\t$this->iAltura = $iAltura;\r\n\t\t$this->sUnidadeAltura = $sUnidade;\r\n\t}",
"public function getProdAlt4()\n {\n return $this->prod_alt4;\n }",
"public function edit_3Action(Produits_2 $produit2)\n {\n $user = $this->getUser();\n $em = $this->getDoctrine()->getManager();\n \n $produits = $em->getRepository('KountacBundle:Produits_3')->getProduct_3($produit2);\n \n return $this->render('produits/edit_3.html.twig', array(\n 'produit2' => $produit2,\n 'produits' => $produits,\n 'user' => $user,\n ));\n }",
"public function setAltura($iAltura) {\n $this->iAltura = $iAltura;\n }",
"public function setCategory2($val)\n {\n $this->_propDict[\"category2\"] = $val;\n return $this;\n }",
"public function setEditorial2($v)\n\t{\n\n\t\tif ($this->editorial2 !== $v || $v === false) {\n\t\t\t$this->editorial2 = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::EDITORIAL2;\n\t\t}\n\n\t}",
"public function setValue2($value){\n $this->_value2 = $value;\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function update_lp_palettes_v2( $palettes_v2 ) {\n\t\tupdate_post_meta( $this->lp_id, static::LP_PALETTES, $palettes_v2 );\n\n\t\t$this->skin_palettes = $palettes_v2;\n\t}",
"public function setMagia2Attribute($value) {\n $this->attributes['magia2'] = $this->verificaAtributo($value, true);\n }",
"public function setEditorial3($v)\n\t{\n\n\t\tif ($this->editorial3 !== $v || $v === false) {\n\t\t\t$this->editorial3 = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::EDITORIAL3;\n\t\t}\n\n\t}",
"private function SetProductImages()\n\t{\n\n\t\t$GLOBALS['ProductThumbWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_STANDARD);\n\t\t$GLOBALS['ProductThumbHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_STANDARD);\n\n\t\t$GLOBALS['ProductMaxTinyWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\t\t$GLOBALS['ProductMaxTinyHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\n\n\t\t$GLOBALS['ProductTinyBoxWidth'] = $GLOBALS['ProductMaxTinyWidth']+4;\n\t\t$GLOBALS['ProductTinyBoxHeight'] = $GLOBALS['ProductMaxTinyHeight']+4;\n\n\n\t\t$GLOBALS['ProductMaxZoomWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t$GLOBALS['ProductMaxZoomHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\n\t\t$GLOBALS['ProductZoomWidth'] = ISC_PRODUCT_IMAGE::getSizeWidth(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t$GLOBALS['ProductZoomHeight'] = ISC_PRODUCT_IMAGE::getSizeHeight(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\n\n\t\t$productImages = ISC_PRODUCT_IMAGE::getProductImagesFromDatabase($GLOBALS['ProductId'], null, false, true);\n\t\t$GLOBALS['NumProdImages'] = count($productImages);\n\n\t\t$GLOBALS['CurrentProdThumbImage'] = 0;\n\t\t$thumb = '';\n\t\t$curZoomImage = '';\n\t\t$GLOBALS['SNIPPETS']['ProductTinyImages'] = '';\n\t\t$GLOBALS['HideImageCarousel'] = 'display:none;';\n\t\t$GLOBALS['HideMorePicturesLink'] = 'display:none;';\n\t\t$thumbImageDescription = '';\n\t\t$i = 0;\n\n\t\t$GLOBALS['ProdImageJavascript'] = '';\n\t\t$GLOBALS['ProdImageZoomJavascript'] = '';\n\t\t$GLOBALS['LightBoxImageList'] = '';\n\t\t$GLOBALS['ZoomImageMaxWidth'] = 0;\n\t\t$GLOBALS['ZoomImageMaxHeight'] = 0;\n\t\t$GLOBALS['ZoomImageMaxWidthHeight'] = 0;\n\t\t$GLOBALS['HideAlwaysLinkedMorePicturesLink'] = 'display: none';\n\n\t\tif ($GLOBALS['NumProdImages']) {\n\t\t\t//Show image carousel\n\n\t\t\tif ($GLOBALS['NumProdImages'] == 2) {\n\t\t\t\t$var = \"MorePictures1\";\n\t\t\t} else if ($GLOBALS['NumProdImages'] == 1) {\n\t\t\t\t$var = \"SeeLargerImage\";\n\t\t\t} else {\n\t\t\t\t$var = \"MorePictures2\";\n\t\t\t}\n\n\t\t\t$GLOBALS['SeeMorePictures'] = sprintf(GetLang($var), count($productImages) - 1);\n\t\t\t$GLOBALS['HideAlwaysLinkedMorePicturesLink'] = '';\n\n\t\t\tif (GetConfig('ProductImagesTinyThumbnailsEnabled')) {\n\t\t\t\t$GLOBALS['HideImageCarousel'] = '';\n\t\t\t} else {\n\t\t\t\t$GLOBALS['HideMorePicturesLink'] = '';\n\t\t\t}\n\n\t\t\t$continue=false;\n\n\t\t\tforeach ($productImages as $productImage) {\n\n\t\t\t\t$thumbURL = '';\n\t\t\t\t$zoomImageURL = '';\n\n\t\t\t\ttry{\n\t\t\t\t\t$thumbURL = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_STANDARD, true);\n\t\t\t\t\t//$GLOBALS['ProductThumbURL'] = $thumbURL;\n\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t}\n\n\t\t\t\ttry{\n\t\t\t\t\t$zoomImageURL = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_ZOOM, true);\n\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t}\n\n\t\t\t\tif($thumbURL == '' && $zoomImageURL == '') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$resizedZoomDimension = $productImage->getResizedFileDimensions(ISC_PRODUCT_IMAGE_SIZE_ZOOM);\n\t\t\t\t$resizedTinyDimension = $productImage->getResizedFileDimensions(ISC_PRODUCT_IMAGE_SIZE_TINY);\n\n\t\t\t\t//calculate the max zoom image width and height\n\t\t\t\tif ($GLOBALS['ZoomImageMaxWidth'] < $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH]) {\n\n\t\t\t\t\t$GLOBALS['ZoomImageMaxWidth'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH];\n\t\t\t\t\t//the height of the image has got the max width needed to calulate the image fancy box size.\n\t\t\t\t\t$GLOBALS['ZoomImageMaxWidthHeight'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t}\n\n\t\t\t\tif ($GLOBALS['ZoomImageMaxHeight'] < $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT]) {\n\t\t\t\t\t$GLOBALS['ZoomImageMaxHeight'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t\t//the width of the image has got the max height needed to calulate the image fancy box size.\n\t\t\t\t\t$GLOBALS['ZoomImageMaxHeightWidth'] = $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t}\n\n\t\t\t\t$GLOBALS['ImageDescription'] = isc_html_escape($productImage->getDescription());\n\t\t\t\tif($GLOBALS['ImageDescription'] == '') {\n\t\t\t\t\t$GLOBALS['ImageDescription'] = GetLang(\"Image\") . \" \" . ($i + 1);\n\t\t\t\t}\n\n\t\t\t\t//show image carousel\n\t\t\t\tif(GetConfig('ProductImagesTinyThumbnailsEnabled')==1) {\n\n\t\t\t\t\t$GLOBALS['ProdImageJavascript'] .= \"\n\t\t\t\t\t\tThumbURLs[\".$i.\"] = \" . isc_json_encode($thumbURL) . \";\n\t\t\t\t\t\tProductImageDescriptions[\".$i.\"] = \" . isc_json_encode($GLOBALS['ImageDescription']) . \";\n\t\t\t\t\t\";\n\t\t\t\t\t$GLOBALS['TinyImageOverJavascript'] = \"showProductThumbImage(\".$i.\")\";\n\t\t\t\t\t//$GLOBALS['ProductTinyImageURL'] = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_TINY, true);\n\n\t\t\t\t\ttry{\n\t\t\t\t\t\t$GLOBALS['ProductTinyImageURL'] = $productImage->getResizedUrl(ISC_PRODUCT_IMAGE_SIZE_TINY, true);\n\t\t\t\t\t\t//$GLOBALS['ProductThumbURL'] = $thumbURL;\n\t\t\t\t\t} catch (Exception $exception) {\n\t\t\t\t\t\t// do nothing, will result in returning blank string, which is fine\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['ProductThumbIndex'] = $i;\n\t\t\t\t\tif(GetConfig('ProductImageMode') == 'lightbox') {\n\t\t\t\t\t\t$GLOBALS['TinyImageClickJavascript'] = \"showProductImageLightBox(\".$i.\"); return false;\";\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$GLOBALS['TinyImageClickJavascript'] = \"showProductImage('\".GetConfig('ShopPath').\"/productimage.php', \".$GLOBALS['ProductId'].\", \".$i.\");\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['TinyImageWidth'] = $resizedTinyDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH];\n\t\t\t\t\t$GLOBALS['TinyImageHeight'] = $resizedTinyDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT];\n\t\t\t\t\t$GLOBALS['TinyImageTopPadding'] = floor(($GLOBALS['ProductMaxTinyHeight'] - $GLOBALS['TinyImageHeight']) / 2);\n\t\t\t\t\t$GLOBALS['SNIPPETS']['ProductTinyImages'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductTinyImage\");\n\t\t\t\t\t$continue = true;\n\t\t\t\t}\n\n\t\t\t\tif(GetConfig('ProductImagesImageZoomEnabled') == 1) {\n\t\t\t\t\t//check if zoom image is large enough for image zoomer\n\t\t\t\t\tif($resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_WIDTH]<ISC_PRODUCT_IMAGE_MIN_ZOOM_WIDTH && $resizedZoomDimension[ISC_PRODUCT_IMAGE_DIMENSIONS_HEIGHT]<ISC_PRODUCT_IMAGE_MIN_ZOOM_HEIGHT) {\n\t\t\t\t\t\t$zoomImageURL = '';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ProdImageZoomJavascript'] .= \"\n\t\t\t\t\t\tZoomImageURLs[\".$i.\"] = \" . isc_json_encode($zoomImageURL) . \";\n\t\t\t\t\t\";\n\t\t\t\t\t$continue = true;\n\t\t\t\t}\n\n\t\t\t\t//\t$GLOBALS['ProductZoomImageURL'] = $zoomImageURL;\n\n\t\t\t\t//this image is the product page thumbnail\n\t\t\t\tif($i==0) {\n\t\t\t\t\t//get the thumb image for product page\n\t\t\t\t\t$thumb = $thumbURL;\n\t\t\t\t\t$curZoomImage = $zoomImageURL;\n\t\t\t\t\t$thumbImageDescription = $GLOBALS['ImageDescription'];\n\t\t\t\t\t//if there is no need to loop through images anymore, get out from the loop.\n\t\t\t\t\tif($continue === false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['VisibleImageTotal'] = $i+1;\n\n\t\t$GLOBALS['ShowImageZoomer'] = GetConfig('ProductImagesImageZoomEnabled');\n\t\tif ($GLOBALS['ShowImageZoomer']) {\n\t\t\t$GLOBALS['SNIPPETS']['ProductImageZoomer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductImageZoomer\");\n\t\t}\n\t\t$GLOBALS['ZoomImageURL'] = $curZoomImage;\n\n\t\t//if no product thumb images\n\t\tif($thumb == '') {\n\t\t\tif(GetConfig('DefaultProductImage') == 'template') {\n\t\t\t\t$thumb = $GLOBALS['IMG_PATH'].'/ProductDefault.gif';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$thumb = GetConfig('ShopPath').'/'.GetConfig('DefaultProductImage');\n\t\t\t}\n\t\t}\n\n\t\t// need to check for variation images\n\t\t$GLOBALS['ImageDescription'] = $thumbImageDescription;\n\t\t$GLOBALS['ThumbImageURL'] = $thumb;\n\n\t\tif ($GLOBALS['NumProdImages']) {\n\t\t\t$GLOBALS['SNIPPETS']['ProductThumbImage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('FastProductThumbImage');\n\t\t} else {\n\t\t\t$GLOBALS['SNIPPETS']['ProductThumbImage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductThumbImagePlaceholder');\n\t\t}\n\t}",
"public function update_lp_palettes_config_v2( $palettes_config_v2 ) {\n\t\tupdate_post_meta( $this->lp_id, static::LP_PALETTES_CONFIG, $palettes_config_v2 );\n\n\t\t$this->skin_palettes_config = $palettes_config_v2;\n\t}",
"public function setRef2($ref2) {\n $this->_ref2 = $ref2;\n }",
"public function setSearchArgumentAlt($value)\n {\n $this->searchArgumentAlt = $value;\n }",
"public function getAlt()\n {\n return $this->alt;\n }",
"public function WPimgAttr_Alt_saveAltAttributes(int $id = 0){\n // save field for each language\n foreach (SELF::$WPimgAttr_Alt_languages as $key => $lang) {\n if($key > 0):\n // get field name\n $var_name = SELF::$WPimgAttr_Alt_prefix . $lang;\n // save value\n if ( isset( $_REQUEST['attachments'][ $id ][$var_name] ) ):\n $new_value = $_REQUEST['attachments'][ $id ][$var_name];\n update_post_meta( $id, $var_name, $new_value );\n endif;\n endif;\n }\n }",
"public function setMagia3Attribute($value) {\n $this->attributes['magia3'] = $this->verificaAtributo($value, true);\n }",
"function product_variable_attributes_countries_prices_wc2_2( $loop, $variation_data, $variation ) {\r\n\r\n\t\t\tif ( count( TFLS()->get_regions() ) ) {\r\n\r\n\t\t\t\t?>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td colspan=\"2\"><strong>Price Based on Country<strong></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<?php\r\n\r\n\t\t\t\tforeach ( TFLS()->get_regions() as $key => $value ) {\r\n\r\n\t\t\t\t\t$placeholder = ( $value['empty_price_method'] == 'exchange_rate' ? __( 'Apply a exchange rate' ) : '' );\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"2\"><?php echo __( 'Price for', 'woocommerce-tfls' ) . ' ' . $value['name']; ?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t$id = '_' . $key . '_variable_price';\r\n\r\n\t\t\t\t\t\t\t$price = wc_format_localized_price( isset( $variation_data[ $id ] ) ? esc_attr( $variation_data[ $id ][0] ) : '' );\r\n\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<label><?php echo __( 'Regular Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol( $value['currency'] ) . ')'; ?></label>\r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"<?php echo $id . '[' . $loop . ']'; ?>\"\r\n\t\t\t\t\t\t\t value=\"<?php echo $price; ?>\" class=\"wc_input_price\"\r\n\t\t\t\t\t\t\t placeholder=\"<?php echo $placeholder; ?>\"/>\r\n\t\t\t\t\t\t</td>\r\n\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t$id = '_' . $key . '_variable_sale_price';\r\n\r\n\t\t\t\t\t\t\t$price = wc_format_localized_price( isset( $variation_data[ $id ] ) ? esc_attr( $variation_data[ $id ][0] ) : '' );\r\n\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<label><?php echo __( 'Sale Price', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol( $value['currency'] ) . ')'; ?></label>\r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"<?php echo $id . '[' . $loop . ']'; ?>\"\r\n\t\t\t\t\t\t\t value=\"<?php echo $price; ?>\" class=\"wc_input_price\"/>\r\n\t\t\t\t\t\t</td>\r\n\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<?php\r\n\r\n\t\t\t\t\t\t\t$id = '_' . $key . '_variable_wholesale_price';\r\n\r\n\t\t\t\t\t\t\t$price = wc_format_localized_price( usset( $variation_data[$id] ) ? esc_attr( $variation_data[$id][0] ) : '' );\r\n\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t\t<label><?php echo __( 'Wholesale Price', 'woocommerce' ) . ' )' . get_woocommerce_currency_symbol( $value['currency'] ) . ')'; ?></label>\r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"<?php echo $id . '[' . $loop .']'; ?>\" value=\"<?php echo $price; ?>\" class=\"wc_input_price\" />\r\n\t\t\t\t\t\t</td>\r\n\r\n\t\t\t\t\t</tr>\r\n\r\n\t\t\t\t<?php\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}",
"public function _setLotNo2($lotNo2) {\n\t\t$this->_lotNo2 = $lotNo2;\n\t}",
"public function setCategory3($val)\n {\n $this->_propDict[\"category3\"] = $val;\n return $this;\n }"
]
| [
"0.75924057",
"0.68237805",
"0.6456513",
"0.6325634",
"0.5845677",
"0.57959306",
"0.5472798",
"0.5328683",
"0.5271459",
"0.5163879",
"0.5098532",
"0.5085216",
"0.50206274",
"0.4955039",
"0.4924999",
"0.48574647",
"0.48318753",
"0.48195463",
"0.46643573",
"0.46482506",
"0.4640233",
"0.4622647",
"0.45867538",
"0.45559126",
"0.45549557",
"0.45490298",
"0.45292103",
"0.4525578",
"0.45200074",
"0.45036116"
]
| 0.6930826 | 1 |
setProdCategory() Set the value of [prod_category_shipping] column. | public function setProdCategoryShipping($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->prod_category_shipping !== $v) {
$this->prod_category_shipping = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_CATEGORY_SHIPPING] = true;
}
if ($this->aTblShippingCategories !== null && $this->aTblShippingCategories->getProdShippingPriceId() !== $v) {
$this->aTblShippingCategories = null;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdCategoryShipping()\n {\n return $this->prod_category_shipping;\n }",
"public function setShipping($shipping);",
"public function setTblShippingCategories(ChildTblShippingCategories $v = null)\n {\n if ($v === null) {\n $this->setProdCategoryShipping(NULL);\n } else {\n $this->setProdCategoryShipping($v->getProdShippingPriceId());\n }\n\n $this->aTblShippingCategories = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblShippingCategories object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function setProductCategory(?ProductCategory $productCategory): void\n {\n $this->productCategory = $productCategory;\n }",
"public function setShippingCost($shippingCost);",
"public function setShipping($shipping)\n {\n $this->shipping = $shipping;\n }",
"public function setUpdateCategory(?UpdateCategory $value): void {\n $this->getBackingStore()->set('updateCategory', $value);\n }",
"public function setProduct_category ($product_category) {\n\t$this->product_category = $this->getClass()->getFieldDefinition(\"product_category\")->preSetData($this, $product_category);\n\treturn $this;\n}",
"public function setShippingCity($shippingCity = '') {\n $city = array(\n 'x_ship_to_city'=>$this->truncateChars($shippingCity, 40),\n );\n $this->NVP = array_merge($this->NVP, $city); \n }",
"public function setPriceProduct($value)\n {\n $this->priceProduct = $value;\n }",
"public function setShippingPrice() {\n if ($this->price > 200) {\n $this->shippingPrice = 0;\n }\n }",
"public function setCategory(?SubmissionCategory $value): void {\n $this->getBackingStore()->set('category', $value);\n }",
"public function setShippingCountry($shippingCountry = '') {\n $country = array(\n 'x_ship_to_country'=>$this->truncateChars($shippingCountry, 60),\n );\n $this->NVP = array_merge($this->NVP, $country); \n }",
"public function setShippingCity($value)\n {\n return $this->setParameter('shippingCity', $value);\n }",
"protected function setCategory($productID, $category)\r\n {\r\n \r\n // SQL query\r\n $sql = \"UPDATE tbl_products SET categories= '\" . $category . \"'WHERE id_products= '\" . $productID . \"'\";\r\n \r\n // Connect to database and run query\r\n $result = $this->connect->query($sql);\r\n \r\n // Check to see if query passed and registered\r\n if ($result) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"public function setShippingMethod(ShippingMethodInterface $shipping_method);",
"public function setShippingCountry($value)\n {\n return $this->setParameter('shippingCountry', $value);\n }",
"private function setShippingOptions() {\n // Reset the settings if this is a recrawl\n if ($this->getSaverData()->isRecrawl()) {\n // Set dimensions and weight\n $this->product->set_weight('');\n $this->product->set_length('');\n $this->product->set_width('');\n $this->product->set_height('');\n\n // Set shipping class\n $this->product->set_shipping_class_id(0);\n }\n\n // No shipping for virtual products.\n if ($this->wcData->isVirtual()) {\n $this->product->set_virtual(true);\n return;\n }\n\n // Not a virtual product.\n $this->product->set_virtual(false);\n\n // Set dimensions and weight\n $this->product->set_weight($this->wcData->getWeight());\n $this->product->set_length($this->wcData->getLength());\n $this->product->set_width($this->wcData->getWidth());\n $this->product->set_height($this->wcData->getHeight());\n\n // Set shipping class\n $this->product->set_shipping_class_id($this->wcData->getShippingClassId());\n }",
"public function getShippingCategoryId();",
"public function getProdCategory()\n {\n return $this->prod_category;\n }",
"public function setShippingDescription($description);",
"public function assignProductsToCategory(array $productSkus, $categoryCode);",
"public function setAxis($category)\n {\n parent::setAttr(\"axis\", $category);\n }",
"public function setCartShippingMethodID($shippingMethodId)\n {\n }",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"public function setShipping($shippingAddress)\n {\n $this->_shipping['Name'] = $shippingAddress['shipping_firstname'].' '.$shippingAddress['shipping_lastname'];\n $this->_shipping['Address'] = array('AddressLine' => $shippingAddress['shipping_address1'].' '.$shippingAddress['shipping_address2'],\n 'City' => $shippingAddress['shipping_city'],\n 'StateProvinceCode' => $shippingAddress['shipping_state'],\n 'PostalCode' => $shippingAddress['shipping_zipcode'],\n 'CountryCode' => $shippingAddress['shipping_country'],\n );\n $this->_shipping['address_id'] = $shippingAddress['address_id'];\n $this->_shipping['contact_phone'] = $shippingAddress['contact_phone'];\n $this->_shipping['contact_email'] = $shippingAddress['contact_email'];\n $this->persist();\n }",
"public function setCategoryAttribute($value)\n {\n $this->attributes['category'] = strtoupper($value);\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function setShippingValues(Order $order): void;",
"public function setShippingService(ShippingService $service)\n {\n $this->shippingService = $service;\n }"
]
| [
"0.6141061",
"0.59430236",
"0.5873597",
"0.57895935",
"0.57112473",
"0.55874574",
"0.5430686",
"0.53130174",
"0.52411",
"0.5189779",
"0.5141314",
"0.50951695",
"0.50834197",
"0.5068371",
"0.50339675",
"0.50216115",
"0.5000084",
"0.49748537",
"0.4946954",
"0.4944385",
"0.49200687",
"0.4912106",
"0.4888119",
"0.48795158",
"0.48740843",
"0.4873063",
"0.4869108",
"0.48635015",
"0.4849957",
"0.4843056"
]
| 0.69374114 | 0 |
setProdWriteup() Set the value of [prod_length] column. | public function setProdLength($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_length !== $v) {
$this->prod_length = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_LENGTH] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_writeup !== $v) {\n $this->prod_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WRITEUP] = true;\n }\n\n return $this;\n }",
"public function getProdLength()\n {\n return $this->prod_length;\n }",
"public function testSetWidthProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setWidth($value);\n $this->assertEquals($value, $product->getWidth());\n }",
"function set_length($length) {\n $this->length = $length;\n }",
"public function setLength($length);",
"public function setLength() { \n $this->_rectLength = $_POST[\"Length\"]; // Gets the length from the HTML program and stores in \"_rectLength\"\n echo(\"The length of the rectangle is: \".$this->_rectLength); // Outputs the length to the console\n echo(\"<br>\");\n }",
"public static function setLength ($length){\n\t\tself::$_length = $length;\n\t}",
"public function getProdWriteup()\n {\n return $this->prod_writeup;\n }",
"function updateSize(){\n $this->cols = exec(\"tput cols\");\n }",
"public function setProdKeywordsWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_keywords_writeup !== $v) {\n $this->prod_keywords_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS_WRITEUP] = true;\n }\n\n return $this;\n }",
"function setSyncProdWeight()\n {\n }",
"public function setLength($length)\n {\n $this->length = $length;\n }",
"public function setLength($length)\n {\n $this->length = $length;\n }",
"public function setLength($length) {\r\n $this->length = $length;\r\n }",
"private function countLength() {\n\n $this->_length = strlen($this->_value);\n }",
"function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }",
"function setSubLength($classId, $length) {\r\n $data['classSubLength'] = $length;\r\n $this->db->where('id', $classId);\r\n $this->db->update('class', $data);\r\n }",
"public function setLen($value)\n {\n return $this->set(self::LEN, $value);\n }",
"public static function update()\n {\n if (self::checkIfSpecifiedTimePassed()) {\n DB::table('apimo_properties')->truncate();\n self::addOrEditPropertiesToDB(self::getAllRealEstate('properties'));\n }\n }",
"public function testSetHeightProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setHeight($value);\n $this->assertEquals($value, $product->getHeight());\n }",
"public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }",
"public function setWidth($value)\n {\n $this->_width = $value;\n }",
"public function setProdID($prodID){\r\n\t\t$this->prodID= $prodID;\r\n\t}",
"public function setJustification(?string $value): void {\n $this->getBackingStore()->set('justification', $value);\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function setCertificateKeyLength(?int $value): void {\n $this->getBackingStore()->set('certificateKeyLength', $value);\n }",
"public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }",
"function setSize($size)\n\t{\n\t\t$this->size = 0+$size;\n\t}",
"public function setMaxLength($length);",
"public function setFieldLength($fieldLength)\n {\n try {\n if ($this->validateFieldLength($fieldLength) === true) {\n $this->FieldLength = $fieldLength;\n }\n } catch (\\Exception $ex) {\n throw new \\Bridge\\Components\\Exporter\\ExporterException($ex->getMessage());\n }\n }"
]
| [
"0.5849533",
"0.5845091",
"0.54983926",
"0.52451783",
"0.5227475",
"0.5193568",
"0.517603",
"0.5154529",
"0.5015874",
"0.49748063",
"0.492936",
"0.49030176",
"0.49030176",
"0.48893374",
"0.48866785",
"0.48366562",
"0.4830328",
"0.48200265",
"0.47911918",
"0.47856182",
"0.4678454",
"0.4678172",
"0.46774098",
"0.46666297",
"0.46467885",
"0.46351805",
"0.4634647",
"0.45904708",
"0.4555062",
"0.45450664"
]
| 0.62863356 | 0 |
setProdLength() Set the value of [prod_wingspan] column. | public function setProdWingspan($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_wingspan !== $v) {
$this->prod_wingspan = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WINGSPAN] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdLength($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_length !== $v) {\n $this->prod_length = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_LENGTH] = true;\n }\n\n return $this;\n }",
"public function setWidth($value)\n {\n $this->_width = $value;\n }",
"public function setWidth($val)\n {\n $this->_propDict[\"width\"] = floatval($val);\n return $this;\n }",
"public function getProdLength()\n {\n return $this->prod_length;\n }",
"public function setWidthProportionLg(?string $widthProportionLg): FieldsetInterface;",
"public function setLength($length);",
"public function getProdWingspan()\n {\n return $this->prod_wingspan;\n }",
"public function testSetWidthProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setWidth($value);\n $this->assertEquals($value, $product->getWidth());\n }",
"function set_length($length) {\n $this->length = $length;\n }",
"function SetWidths($w) {\n\t$this->widths=$w;\n}",
"function SetWidths($w)\n{\n\t$this->widths=$w;\n}",
"function SetWidths($w)\n{\n\t$this->widths=$w;\n}",
"function SetWidths($w)\n{\n\t$this->widths=$w;\n}",
"function SetWidths($w)\r\n{\r\n\t$this->widths=$w;\r\n}",
"function SetWidths($w)\r\n{\r\n\t$this->widths=$w;\r\n}",
"public function setLength() { \n $this->_rectLength = $_POST[\"Length\"]; // Gets the length from the HTML program and stores in \"_rectLength\"\n echo(\"The length of the rectangle is: \".$this->_rectLength); // Outputs the length to the console\n echo(\"<br>\");\n }",
"function SetWidths($w)\r\n{\r\n $this->widths=$w;\r\n}",
"public static function setLength ($length){\n\t\tself::$_length = $length;\n\t}",
"function SetWidths($w){\r\n \t//Set the array of column widths\r\n \t$this->widths=$w;\r\n }",
"function SetWidths($w)\n{\n $this->widths=$w;\n}",
"function SetWidths($w)\n{\n $this->widths=$w;\n}",
"function SetWidths($w)\n{\n $this->widths=$w;\n}",
"public function SetWidths($w)\n {\n $this->widths=$w;\n\n }",
"public function setLength($length)\n {\n $this->length = $length;\n }",
"public function setLength($length)\n {\n $this->length = $length;\n }",
"function SetWidths($w)\n {\n $this->widths=$w;\n }",
"function SetWidths($w)\n {\n $this->widths=$w;\n }",
"function SetWidths($w)\n {\n $this->widths=$w;\n }",
"function SetWidths($w)\n {\n $this->widths=$w;\n }",
"public function setWidth($width = 40)\n {\n $this->width = $width;\n $this->setAttributes(\"Width\");\n }"
]
| [
"0.63263345",
"0.5552692",
"0.54678917",
"0.5453686",
"0.5408111",
"0.53934956",
"0.538516",
"0.5351815",
"0.5284943",
"0.52590734",
"0.5251854",
"0.5251854",
"0.5251854",
"0.5240267",
"0.5240267",
"0.52246445",
"0.5220869",
"0.52199066",
"0.5212671",
"0.5199404",
"0.5199404",
"0.5199404",
"0.5199311",
"0.51901954",
"0.51901954",
"0.5181107",
"0.5181107",
"0.5181107",
"0.5181107",
"0.51622635"
]
| 0.61031413 | 1 |
setProdWingspan() Set the value of [prod_height] column. | public function setProdHeight($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_height !== $v) {
$this->prod_height = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_HEIGHT] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdWingspan($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_wingspan !== $v) {\n $this->prod_wingspan = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WINGSPAN] = true;\n }\n\n return $this;\n }",
"public function getProdWingspan()\n {\n return $this->prod_wingspan;\n }",
"public function setHeight($val)\n {\n $this->_propDict[\"height\"] = floatval($val);\n return $this;\n }",
"public function testSetHeightProduct()\n {\n $product = new Product();\n $value = 9;\n $product->setHeight($value);\n $this->assertEquals($value, $product->getHeight());\n }",
"public function setHeight($height) {}",
"function set_rowspan($rowspan=0) {\n\n if (is_numeric($rowspan) && $rowspan > 1) {\n $this->_rowspan = $rowspan;\n }\n }",
"function set_height($height) {\n $this->height = $height;\n }",
"public function getProdHeight()\n {\n return $this->prod_height;\n }",
"public function setHeight($height);",
"public function setHeight($height);",
"public function setRowspan($num)\n {\n parent::setAttr(\"rowspan\", $num);\n }",
"public function setSpan( $span )\n\t{\n\t\t$this->setAttribute( \"span\", $span );\n\t}",
"public function setHeightStyle($val = '\"content\"')\n {\n $this->addParams('heightStyle', $val);\n\n return $this;\n }",
"public function setHeight($value)\n {\n return $this->setProperty(\"Height\", $value, true);\n }",
"public function setColspan($num)\n {\n parent::setAttr(\"colspan\", $num);\n }",
"public function r_height($value = null)\n {\n $this->r_height = $value;\n }",
"public function setHeightAttribute($height = null)\n\t{\n\t\t$this->attributes['height'] = intval($height);\n\t}",
"public function setHeight($height)\r\n {\r\n if (is_numeric($height))\r\n {\r\n $this->height = (int)$height;\r\n }\r\n }",
"public function setHeight($height)\n {\n $this->height = (int) $height;\n }",
"public function height($manipulation_name = '')\n\t{\n\t\treturn $this->row_field('height');\n\t}",
"public function setSpan(int $value) {\n if ($value >= 2) {\n return $this->setAttribute('span', $value);\n } else {\n return $this->removeAttribute('span');\n }\n }",
"public function height($value) {\n return $this->setProperty('height', $value);\n }",
"public function height($value) {\n return $this->setProperty('height', $value);\n }",
"public function height($value) {\n return $this->setProperty('height', $value);\n }",
"public function height($value) {\n return $this->setProperty('height', $value);\n }",
"public function setHeight($height)\n {\n $this->height = $height;\n }",
"public function setHeight($height)\n {\n $this->height = $height;\n }",
"public function max_size( $span ) {\n\t\t$breakpoint_value = end( $this->breakpoints );\n\t\t// Breakpoint name.\n\t\t$breakpoint = key( $this->breakpoints );\n\n\t\t$margin_size = $this->margins[ $breakpoint ];\n\t\t$gutter_size = $this->gutters[ $breakpoint ];\n\t\t$cols = $this->columns[ $breakpoint ];\n\n\t\t$max_container_width = $this->max_width();\n\t\t$max_container_width_in_ems = $this->px_to_em( $max_container_width );\n\t\t$calc = $this->calc( $span, $cols, $max_container_width_in_ems, $margin_size, $gutter_size );\n\t\t$max_size = '(min-width: ' . $max_container_width_in_ems . ') ' . $calc;\n\n\t\treturn $max_size;\n\t}",
"#[@fromDia(xpath= 'dia:attribute[@name=\"height\"]/dia:real/@val', value= 'real')]\n public function setHeight($height) {\n $this->setReal('height', $height);\n }",
"public function setHeight($height = 40)\n {\n $this->height = $height;\n $this->setAttributes(\"Height\");\n }"
]
| [
"0.6281454",
"0.57447827",
"0.56941557",
"0.5417464",
"0.5362587",
"0.53486466",
"0.52647144",
"0.52207506",
"0.5218132",
"0.5218132",
"0.51957536",
"0.5160573",
"0.51359445",
"0.50391763",
"0.50091803",
"0.49210945",
"0.49064335",
"0.48985052",
"0.48844203",
"0.48312396",
"0.47820854",
"0.47796226",
"0.47796226",
"0.47796226",
"0.47796226",
"0.47506467",
"0.47506467",
"0.4735877",
"0.47244775",
"0.47093737"
]
| 0.60052425 | 1 |
setProdLinks() Set the value of [prod_linkdescription] column. | public function setProdLinkdescription($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_linkdescription !== $v) {
$this->prod_linkdescription = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_LINKDESCRIPTION] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdLinks($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_links !== $v) {\n $this->prod_links = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_LINKS] = true;\n }\n\n return $this;\n }",
"public function getProdLinkdescription()\n {\n return $this->prod_linkdescription;\n }",
"function setLinks($link) \n {\n $this->links = $link;\n }",
"public function getProdLinks()\n {\n return $this->prod_links;\n }",
"public function setProductDescription(string $productDescription)\n\t{\n\t\t$this->addKeyValue('product_description', $productDescription); \n\n\t}",
"public function setProdDescription($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_description !== $v) {\n $this->prod_description = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_DESCRIPTION] = true;\n }\n\n return $this;\n }",
"function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }",
"function setLink($url)\n\t{\n\t\t$this->link = $url;\n\t}",
"private function setCustomProductLinks(ProductInterface $product, array $productData): void\n {\n $productLinks = [];\n foreach ($productData as $linkType => $links) {\n foreach ($links as $data) {\n /** @var ProductLinkInterface|Link $productLink */\n $productLink = $this->productLinkInterfaceFactory->create();\n $productLink->setSku('simple');\n $productLink->setLinkedProductSku($data['sku']);\n if (isset($data['position'])) {\n $productLink->setPosition($data['position']);\n }\n $productLink->setLinkType($linkType);\n $productLinks[] = $productLink;\n }\n }\n $product->setProductLinks($productLinks);\n }",
"public function setDescriptionRef($descriptionRef)\n {\n $this->descriptionRef = $descriptionRef;\n }",
"function setLinks($links) \r\n {\r\n\r\n $this->activity_list->setLinks($links); \r\n \t\t \r\n// \t\t echo print_r($this->linkValues,true);\t \r\n \t parent::setLinks($links);\r\n \r\n }",
"function setLink($link) {\r\n $this->_link = $link;\r\n }",
"function setLink($link) {\r\n $this->_link = $link;\r\n }",
"public function setLinks($value)\n {\n return $this->setProperty(\"Links\", $value, true);\n }",
"function setSyncProdDesc()\n {\n }",
"public function setLink($link);",
"public function setLink($link){\n\t\t$this->link = $link;\n\t}",
"public function setColumnLink($link){\n $this->addVar('COL_LINK', $link);\n }",
"function setLink(&$link)\n {\n $this->_link = $link;\n }",
"public function setLink(string $link): void\n {\n $this->link = $link;\n }",
"public function setProduct_desc ($product_desc) {\n\t$this->product_desc = $product_desc;\n\treturn $this;\n}",
"public function set_link($link){\n\t\t$this->set_channel_element('link', $link);\n\t}",
"public function adminLinks($table, array $row)\n {\n if ($table !== 'tx_commerce_products') {\n return parent::adminLinks($table, $row);\n } else {\n $language = $this->getLanguageService();\n\n // Edit link:\n $adminLink = '<a href=\"#\" onclick=\"' .\n htmlspecialchars(\n BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit', $this->getBackPath())\n ) .\n '\">' .\n IconUtility::getSpriteIcon(\n 'actions-document-open',\n array('title' => $language->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', true))\n ) . '</a>';\n\n // Delete link:\n $adminLink .= '<a href=\"' .\n htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) .\n '\">' .\n IconUtility::getSpriteIcon(\n 'actions-edit-delete',\n array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:cm.delete', true))\n ) . '</a>';\n\n if ($row['pid'] == -1) {\n // get page TSconfig\n $pagesTyposcriptConfig = BackendUtility::getPagesTSconfig(GeneralUtility::_POST('popViewId'));\n if ($pagesTyposcriptConfig['tx_commerce.']['singlePid']) {\n $previewPageId = $pagesTyposcriptConfig['tx_commerce.']['singlePid'];\n } else {\n $previewPageId = SettingsFactory::getInstance()->getExtConf('previewPageID');\n }\n\n $sysLanguageUid = (int) $row['sys_language_uid'];\n\n /**\n * Product.\n *\n * @var \\CommerceTeam\\Commerce\\Domain\\Model\\Product $product\n */\n $product = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\n 'CommerceTeam\\\\Commerce\\\\Domain\\\\Model\\\\Product',\n $row['t3ver_oid'],\n $sysLanguageUid\n );\n $product->loadData();\n\n $getVars = ($sysLanguageUid > 0 ? '&L=' . $sysLanguageUid : '') .\n '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'] .\n '&no_cache=1&tx_commerce_pi1[showUid]=' . $product->getUid() .\n '&tx_commerce_pi1[catUid]=' . current($product->getMasterparentCategory());\n\n $adminLink .= '<a href=\"#\" onclick=\"' .\n htmlspecialchars(\n BackendUtility::viewOnClick(\n $previewPageId,\n $this->getBackPath(),\n BackendUtility::BEgetRootLine($row['_REAL_PID']),\n '',\n '',\n $getVars\n )\n ) .\n '\">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';\n }\n\n return $adminLink;\n }\n }",
"function setItem_description($description){\n $this->item_description = $description;\n }",
"function set_description($description)\r\n {\r\n $this->set_default_property(self :: PROPERTY_DESCRIPTION, $description);\r\n }",
"public function setLink($value)\n {\n return $this->set('Link', $value);\n }",
"public function setLink($value)\n {\n return $this->set('Link', $value);\n }",
"public function setLink($value)\n {\n return $this->set('Link', $value);\n }",
"public function setLink($value)\n {\n return $this->set('Link', $value);\n }",
"public function setLink($value)\n {\n return $this->set('Link', $value);\n }"
]
| [
"0.64033",
"0.604494",
"0.57057804",
"0.56472003",
"0.56418395",
"0.55622405",
"0.5550153",
"0.5524947",
"0.5508063",
"0.54721165",
"0.5402973",
"0.538458",
"0.538458",
"0.5348114",
"0.5340541",
"0.5314391",
"0.5231209",
"0.5230729",
"0.5209203",
"0.51936924",
"0.5107778",
"0.50906885",
"0.50800186",
"0.5079358",
"0.50686383",
"0.506123",
"0.5059969",
"0.5058766",
"0.50587016",
"0.50587016"
]
| 0.612149 | 1 |
setProdFront() Set the value of [prod_keywords] column. | public function setProdKeywords($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_keywords !== $v) {
$this->prod_keywords = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdFront($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_front !== $v) {\n $this->prod_front = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_FRONT] = true;\n }\n\n return $this;\n }",
"protected function setKeywords() {\r\n\t\t$keywords = $this->newsItem->getKeywords();\r\n\t\t$keywordsAction = $this->settings['news']['semantic']['general']['keywords']['action'];\r\n\t\t$pageKeywords = $GLOBALS['TSFE']->page['keywords'];\r\n\t\tif (!empty($keywordsAction) && !empty($pageKeywords)) {\r\n\t\t\tswitch ($keywordsAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $keywords . ', ' . $pageKeywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $pageKeywords . ',' . $keywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t}\r\n\t\t$keywordsArray = t3lib_div::trimExplode(',', $keywords);\r\n\t\t$keywordsLimit = intval($this->settings['news']['semantic']['general']['keywords']['limit']);\r\n\t\t$this->keywords = (empty($keywordsLimit)) ? array_unique($keywordsArray) : $this->keywords = array_slice(array_unique($keywordsArray), 0, $keywordsLimit);\r\n\t}",
"protected function setKeyword($value)\n\t{\n\t\t$this->keyword = $value;\n\t}",
"public function setKeywords($keywords)\n {\n $this->keywords = (array)$keywords;\n }",
"public function getProdKeywords()\n {\n return $this->prod_keywords;\n }",
"public function getProdFront()\n {\n return $this->prod_front;\n }",
"public function setProdKeywordsWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_keywords_writeup !== $v) {\n $this->prod_keywords_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS_WRITEUP] = true;\n }\n\n return $this;\n }",
"public function setKeywords($keywords)\n\t{\n\t\t$this->keywords = $keywords;\n\n\t\tif($this->pageInitialized)\n\t\t\t$this->setMetaTag('keywords', $this->keywords);\n\t}",
"public function setKeywords(string $keywords)\n {\n $this->keywords = $keywords;\n }",
"public function setKeyWord($key){\n $this->keyword = $key;\n }",
"public function setKeywords($val)\n {\n $this->_propDict[\"keywords\"] = $val;\n return $this;\n }",
"public function setKeywords($keywords)\n\t{\n\t\tif( ! is_array($keywords))\n\t\t{\n\t\t\t$keywords = explode(',', $keywords);\n\t\t}\n\n\t\t// Flatten the array into single column\n\t\t$keywords = array_flatten($keywords);\n\t\t// Trim & lowercase the array\n\t\t$keywords = array_map('trim', $keywords);\n\t\t$keywords = array_map('strtolower', $keywords);\n\n\t\t$this->keywords = $keywords;\n\n\t\treturn $keywords;\n\t}",
"public function setKeywords($keywords, $encoding = 'UTF-8') {}",
"public function setFrontUrl(string $front)\n {\n $this->front = $front;\n return $this;\n }",
"public function setDisplayFront($display_front)\n {\n return $this->setData(self::DISPLAY_FRONT, $display_front);\n }",
"public function setKeyword($keyword){\r\n $this->keyword = $keyword;\r\n }",
"public function SetStart()\n\t\t{\n\t\t\t$start = 0;\n\n\t\t\tswitch ($this->_pricepage) {\n\t\t\t\tcase 1: {\n\t\t\t\t\t$start = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// Page 2 or more\n\t\t\t\tdefault: {\n\t\t\t\t\t$start = ($this->GetPage() * GetConfig('CategoryProductsPerPage')) - GetConfig('CategoryProductsPerPage');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->_pricestart = $start;\n\t\t}",
"protected function cleanupFeedMetaKeywords(Product $product)\n\t{\n\t\t$keywords = $product->getMetaKeywords();\n\n\t\t// Trim size\n\t\t$keywords = substr($keywords, 0, 254);\n\n\t\t$product->setMetaKeywords($keywords);\n\t}",
"function setKeywords($keywords) {\n $this->fields['keywords'] = $keywords;\n return $this;\n }",
"public function add_keywords ( $new_keywords )\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->errno = DB_OK;\r\n\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query( \"SELECT cat_keywords FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( $result->num_rows == 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tas the id is unique one row should have been returned\r\n\t\t\t{\r\n\t\t\t\t$row = $result->fetch_row();\r\n\t\t\t\t$kw = $row[0];\r\n\t\t\t}\t\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* gathering all keywords into one variable with # as delimiter to insert it to the database */\r\n\t\t\t$kw_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the keywords array hasn't been set\r\n\t\r\n\t\t\tif ( isset ( $new_keywords ) )\r\n\t\t\t\t$kw_length = count( $new_keywords );\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_INPUT;\r\n\t\t\t\treturn ;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor ( $i = 0; $i < $kw_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgenerating the keyword string which will enter to the database\r\n\t\t\t\t$kw = $kw.\"#\".$new_keywords[$i];\t\t\t\r\n\t\t\t\r\n\t\t\tif( !$this->con->query( \"UPDATE category SET cat_keywords=\\\"$kw\\\" WHERE cat_id=$this->cat_id;\" ) )\t\t\t\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to query\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t$this->cat_keywords = NULL;\r\n\t\t\t\r\n\t\t\t$tok = strtok( $kw, \"#\" );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tturning the keywords string into an array\r\n\t\t\t\r\n\t\t\twhile ( $tok !== false ) \r\n\t\t\t{\r\n\t\t\t\t$this->cat_keywords [] = $tok;\r\n\t\t\t\t$tok = strtok( \"#\" );\r\n\t\t\t}\t\t\t\r\n\t\r\n\t\t}",
"public function front( bool $front = true ): self {\n\t\t$this->front = $front;\n\t\treturn $this;\n\t}",
"static public function setKeywords($new_keywords) {\n\t\tif (is_string($new_keywords)) {\n\t\t\t$new_keywords = explode(',', $new_keywords);\n\t\t\tforeach($new_keywords as &$keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t}\n\t\t}\n\t\tself::$page_keywords = (array)$new_keywords;\n\t}",
"public function setKeyword($value)\n {\n return $this->set('Keyword', $value);\n }",
"public function setKeyword($value)\n {\n return $this->set('Keyword', $value);\n }",
"public function getProdKeywordsWriteup()\n {\n return $this->prod_keywords_writeup;\n }",
"public function testSetAndGetKeyword()\n {\n $keyword = 'key';\n $value = 'this should be saved and retrieved';\n\n // Execute.\n $this->testObject->setKeyword($keyword, $value);\n\n // Get the keyword out.\n $result = $this->testObject->getKeyword($keyword);\n\n // Assert Result.\n $this->assertEquals($value, $result);\n $this->assertEquals($value, $_SESSION['behat']['GenesisSqlExtension']['keywords'][$keyword]);\n }",
"public function front( bool $is_front = true ): self {\n\t\t$this->is_front = $is_front;\n\t\treturn $this;\n\t}",
"public function AddHeadKeywords($keywords){\r\n\t\t$this->head->AddKeywords($keywords);\r\n\t}",
"function _set_search_keywords ($referer = \"\") {\n\t\n\t\tif (empty($referer)) {\n\t\t\t$referer = $_SERVER[\"HTTP_REFERER\"];\n\t\t\t$batch_mode = true;\n\t\t}\n\t\t// Return error message if no referer\n\t\tif (!strlen($referer)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// process parsing referer field\n\t\t$parsed_url\t= @parse_url($referer);\n\t\t$host\t\t= $parsed_url[\"host\"];\n\t\t$query\t\t= $parsed_url[\"query\"].\"\\r\\n\";\n\t\t\n\t\t// Check if search engine is known by system\n\t\tif (!isset($this->_search_engines[$host])) {\n\t\t\treturn false;\n\t\t}\n\t\t$cur_se\t\t\t= $this->_search_engines[$host];\n\t\t// Process keywords\n\t\t$parsed_url[\"query\"] = str_replace([\"./?\",\"./\"], \"\", $parsed_url[\"query\"]);\n\t\tparse_str($parsed_url[\"query\"], $parsed_query);\n\t\t$q_s_charset\t= $parsed_query[$cur_se[\"q_s_charset\"]];\n\t\t$q_s_word\t\t= $parsed_query[$cur_se[\"q_s_word\"]];\n\t\t$charset\t\t= isset($q_s_charset) ? $q_s_charset : $cur_se[\"def_charset\"];\n\t\t$search_query\t= isset($q_s_word) ? $q_s_word : $parsed_query[$cur_se[\"q_s_word2\"]];\n\t\t$search_query\t= trim(stripslashes(strlen($charset) ? iconv($charset, conf('charset'), $search_query) : $search_query));\n\t\t// Check for search query\n\t\tif (empty($search_query)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Set referral cookie\n\t\t$COOKIE_VAR_NAME = \"ref_code\";\n\t\tif (!$batch_mode && empty($_COOKIE[$COOKIE_VAR_NAME])) {\n\t\t\t$code = $cur_se[\"name\"];\n\t\t\tsetcookie($COOKIE_VAR_NAME, $code, time() + 86400 * 30, \"/\");\n\t\t}\n\t\t// Limit number of keywords\n\t\tif (!empty($this->MAX_TOTAL_KEYWORDS)) {\n\t\t\tlist($current_keywords_num) = db()->query_fetch(\"SELECT COUNT(*) AS `0` FROM \".db('search_keywords').\"\");\n\t\t}\n\t\tif (!empty($this->MAX_TOTAL_KEYWORDS) && $current_keywords_num >= $this->MAX_TOTAL_KEYWORDS) {\n\t\t\tdb()->_add_shutdown_query(\n\t\t\t\t\"UPDATE \".db('search_keywords').\" \n\t\t\t\tSET hits = hits + 1, \n\t\t\t\t\tlast_update = \".time().\"\n\t\t\t\tWHERE text='\"._es($search_query).\"'\"\n\t\t\t);\n\t\t} else {\n\t\t\t// Check if such record already exists\n\t\t\t$sql = \"INSERT INTO \".db('search_keywords').\" (\n\t\t\t\t\tengine,\n\t\t\t\t\ttext,\n\t\t\t\t\tref_url,\n\t\t\t\t\tsite_url,\n\t\t\t\t\tlast_update,\n\t\t\t\t\thits\n\t\t\t\t) VALUES (\n\t\t\t\t\t\".intval($this->_search_engines[$host][\"id\"]).\",\n\t\t\t\t\t'\"._es($search_query).\"',\n\t\t\t\t\t'\"._es($referer).\"',\n\t\t\t\t\t'\"._es(\"http://\".$_SERVER[\"HTTP_HOST\"].$_SERVER[\"REQUEST_URI\"]).\"',\n\t\t\t\t\t\".time().\",\n\t\t\t\t\thits + 1 \n\t\t\t\t) ON DUPLICATE KEY UPDATE hits = hits + 1\\r\\n\";\n\t\t\tdb()->_add_shutdown_query($sql);\n\t\t}\n\t\t// Check if we need to update most popular right now\n\t\tif ($this->UPDATE_POPULAR_RAND > 1) {\n\t\t\tif (rand(1, $this->UPDATE_POPULAR_RAND) != 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t// Update system cache\n\t\tif (!$batch_mode && main()->USE_SYSTEM_CACHE) {\n\t\t\tmain()->_add_shutdown_code('cache()->refresh(\"search_keywords_most_popular\");');\n\t\t}\n\t}",
"public function setKeywords($value)\n {\n return $this->set('Keywords', $value);\n }"
]
| [
"0.62230873",
"0.5660296",
"0.528664",
"0.52622104",
"0.52593166",
"0.520222",
"0.5185681",
"0.514636",
"0.5017951",
"0.4985818",
"0.49574465",
"0.49111634",
"0.4826392",
"0.4802036",
"0.479346",
"0.47746015",
"0.4754732",
"0.47427076",
"0.47252396",
"0.47087258",
"0.46881655",
"0.46804896",
"0.46390367",
"0.46390367",
"0.46260834",
"0.4612819",
"0.46069697",
"0.45949706",
"0.45804146",
"0.4575977"
]
| 0.5975671 | 1 |
setProdKeywords() Set the value of [prod_keywords_writeup] column. | public function setProdKeywordsWriteup($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_keywords_writeup !== $v) {
$this->prod_keywords_writeup = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS_WRITEUP] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdKeywords($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_keywords !== $v) {\n $this->prod_keywords = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS] = true;\n }\n\n return $this;\n }",
"public function getProdKeywordsWriteup()\n {\n return $this->prod_keywords_writeup;\n }",
"protected function setKeywords() {\r\n\t\t$keywords = $this->newsItem->getKeywords();\r\n\t\t$keywordsAction = $this->settings['news']['semantic']['general']['keywords']['action'];\r\n\t\t$pageKeywords = $GLOBALS['TSFE']->page['keywords'];\r\n\t\tif (!empty($keywordsAction) && !empty($pageKeywords)) {\r\n\t\t\tswitch ($keywordsAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $keywords . ', ' . $pageKeywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $pageKeywords . ',' . $keywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t}\r\n\t\t$keywordsArray = t3lib_div::trimExplode(',', $keywords);\r\n\t\t$keywordsLimit = intval($this->settings['news']['semantic']['general']['keywords']['limit']);\r\n\t\t$this->keywords = (empty($keywordsLimit)) ? array_unique($keywordsArray) : $this->keywords = array_slice(array_unique($keywordsArray), 0, $keywordsLimit);\r\n\t}",
"public function setKeywords($keywords)\n {\n $this->keywords = (array)$keywords;\n }",
"public function setKeywords($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->keywords = $arr;\n\n return $this;\n }",
"static function save_keywords($post_id, $keywords){\n\t\t\tupdate_post_meta($post_id, 'affiliate_keywords', $keywords);\n\t\t}",
"public function testAssignKeywords()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",
"public function setKeywords($keywords)\n\t{\n\t\t$this->keywords = $keywords;\n\n\t\tif($this->pageInitialized)\n\t\t\t$this->setMetaTag('keywords', $this->keywords);\n\t}",
"public function setKeywords(string $keywords)\n {\n $this->keywords = $keywords;\n }",
"public function setKeywords($keywords, $encoding = 'UTF-8') {}",
"public function setKeywords($val)\n {\n $this->_propDict[\"keywords\"] = $val;\n return $this;\n }",
"public function setKeywords(?AnswerKeyword $value): void {\n $this->getBackingStore()->set('keywords', $value);\n }",
"public function getProdKeywords()\n {\n return $this->prod_keywords;\n }",
"public function setKeywords($keywords, int $maxLength = null);",
"public function setKeywords($value)\n {\n return $this->set('Keywords', $value);\n }",
"static public function setKeywords($new_keywords) {\n\t\tif (is_string($new_keywords)) {\n\t\t\t$new_keywords = explode(',', $new_keywords);\n\t\t\tforeach($new_keywords as &$keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t}\n\t\t}\n\t\tself::$page_keywords = (array)$new_keywords;\n\t}",
"protected function setKeyword($value)\n\t{\n\t\t$this->keyword = $value;\n\t}",
"public function setKeywords($keywords)\n\t{\n\t\tif( ! is_array($keywords))\n\t\t{\n\t\t\t$keywords = explode(',', $keywords);\n\t\t}\n\n\t\t// Flatten the array into single column\n\t\t$keywords = array_flatten($keywords);\n\t\t// Trim & lowercase the array\n\t\t$keywords = array_map('trim', $keywords);\n\t\t$keywords = array_map('strtolower', $keywords);\n\n\t\t$this->keywords = $keywords;\n\n\t\treturn $keywords;\n\t}",
"public function add_keywords ( $new_keywords )\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->errno = DB_OK;\r\n\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query( \"SELECT cat_keywords FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( $result->num_rows == 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tas the id is unique one row should have been returned\r\n\t\t\t{\r\n\t\t\t\t$row = $result->fetch_row();\r\n\t\t\t\t$kw = $row[0];\r\n\t\t\t}\t\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* gathering all keywords into one variable with # as delimiter to insert it to the database */\r\n\t\t\t$kw_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the keywords array hasn't been set\r\n\t\r\n\t\t\tif ( isset ( $new_keywords ) )\r\n\t\t\t\t$kw_length = count( $new_keywords );\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_INPUT;\r\n\t\t\t\treturn ;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor ( $i = 0; $i < $kw_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgenerating the keyword string which will enter to the database\r\n\t\t\t\t$kw = $kw.\"#\".$new_keywords[$i];\t\t\t\r\n\t\t\t\r\n\t\t\tif( !$this->con->query( \"UPDATE category SET cat_keywords=\\\"$kw\\\" WHERE cat_id=$this->cat_id;\" ) )\t\t\t\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to query\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t$this->cat_keywords = NULL;\r\n\t\t\t\r\n\t\t\t$tok = strtok( $kw, \"#\" );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tturning the keywords string into an array\r\n\t\t\t\r\n\t\t\twhile ( $tok !== false ) \r\n\t\t\t{\r\n\t\t\t\t$this->cat_keywords [] = $tok;\r\n\t\t\t\t$tok = strtok( \"#\" );\r\n\t\t\t}\t\t\t\r\n\t\r\n\t\t}",
"public function testSetAndGetKeyword()\n {\n $keyword = 'key';\n $value = 'this should be saved and retrieved';\n\n // Execute.\n $this->testObject->setKeyword($keyword, $value);\n\n // Get the keyword out.\n $result = $this->testObject->getKeyword($keyword);\n\n // Assert Result.\n $this->assertEquals($value, $result);\n $this->assertEquals($value, $_SESSION['behat']['GenesisSqlExtension']['keywords'][$keyword]);\n }",
"public function setKeyWord($key){\n $this->keyword = $key;\n }",
"public function set_keywords($keywords)\n\t{\n\t\tif (is_null($keywords)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Keywords Invalid!\");\n\t\t}\n\t\t$this->keywords = $keywords;\n\t}",
"protected function _syncKeywords() {}",
"function setKeywords($keywords) {\n $this->fields['keywords'] = $keywords;\n return $this;\n }",
"public function setProdWriteup($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_writeup !== $v) {\n $this->prod_writeup = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_WRITEUP] = true;\n }\n\n return $this;\n }",
"public function setSeoKeywords($v)\n { $this->getCurrentTranslation()->setSeoKeywords($v);\n\n return $this;\n }",
"public function setKeywords($keywords) {\n $this->properties['keywords'] = $keywords;\n\n return $this;\n }",
"public function setOffensiveWords($offensiveWords)\n {\n $this->offensiveWords = $offensiveWords;\n }",
"public function setKeywords(string $keywords) : self\n {\n $this->keywords = $keywords;\n return $this;\n }",
"protected function _setSearchKeywords()\n {\n try {\n\n if (is_null($this->_keywords)) {\n if ($this->getSearchKeyword()) {\n $this->_keywords['searchKeyword'] = $this->getSearchKeyword();\n }\n $searchCriterias = $this->getSearchCriterias();\n if (isset($searchCriterias['q'])) {\n unset($searchCriterias['q']);\n }\n if (!empty($searchCriterias)) {\n foreach ($searchCriterias as $key => $criteria) {\n if ($key == 'price') {\n\n if (isset($criteria['from'])) {\n $this->_keywords['minPrice'] = $criteria['from'];\n }\n if (isset($criteria['to'])) {\n $this->_keywords['maxPrice'] = $criteria['to'];\n }\n\n } else {\n if (is_array($criteria)) {\n $this->_keywords[$key] = $this->escapeHtml(strtolower(implode(',', $criteria)));\n } else {\n $this->_keywords[$key] = $this->escapeHtml(strtolower($criteria));\n }\n\n }\n\n }\n }\n\n }\n\n return $this->_keywords;\n\n } catch (Mage_Core_Exception $e) {\n $this->getGravityHelper()->getLogger($e->getMessage());\n } catch (Exception $e) {\n $this->getGravityHelper()->getLogger(\n $e->getMessage(),\n $this->getGravityHelper()->__('An error occurred while setting search keywords.')\n );\n }\n }"
]
| [
"0.70644057",
"0.64567083",
"0.6108269",
"0.602328",
"0.5781163",
"0.5770702",
"0.5770089",
"0.5766622",
"0.5761055",
"0.5748266",
"0.57237107",
"0.5694472",
"0.56857413",
"0.56722146",
"0.56080747",
"0.559631",
"0.55493444",
"0.5544019",
"0.5402991",
"0.52204406",
"0.52123386",
"0.521093",
"0.52055377",
"0.51985663",
"0.51877624",
"0.5141273",
"0.51089185",
"0.49706793",
"0.49345335",
"0.4926358"
]
| 0.8035094 | 0 |
setProdCompany() Set the value of [prod_related] column. | public function setProdRelated($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_related !== $v) {
$this->prod_related = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCompany(\\App\\Domain\\Model\\Company $object) : void\n {\n $this->setRef('from__company_id__to__table__companies__columns__id', $object, 'products');\n }",
"public function setProdCompany($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_company !== $v) {\n $this->prod_company = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_COMPANY] = true;\n }\n\n return $this;\n }",
"public function setCompany($company_nid);",
"public function setProdRelated2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related2 !== $v) {\n $this->prod_related2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED2] = true;\n }\n\n return $this;\n }",
"public function setCompany(string $company): void\n {\n $this->_company = $company;\n }",
"public function getProdCompany()\n {\n return $this->prod_company;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function setCompany($company)\n {\n $this->company = $company;\n }",
"public function set_relatedDocNo($relatedDocNo) {\n $this->relatedDocNo = (string) $relatedDocNo;\n }",
"public function setCustomerCompany($companyName = '') {\n $company = array(\n 'x_company'=>$this->truncateChars($companyName, 50),\n );\n $this->NVP = array_merge($this->NVP, $company); \n }",
"public function setYomiCompany($value)\n {\n $this->setProperty(\"YomiCompany\", $value, true);\n }",
"public function setShippingCompany($companyName = '') {\n $company = array(\n 'x_ship_to_company'=>$this->truncateChars($companyName, 50),\n );\n $this->NVP = array_merge($this->NVP, $company); \n }",
"private function setRecountProduct() {\n\n //$this->model->setDocumentNumber($this->getDocumentNumber);\n $sql = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n INSERT INTO `productrecount` \n (\n `companyId`,\n `warehouseId`,\n `productCode`,\n `productDescription`,\n `productRecountDate`,\n `productRecountSystemQuantity`,\n `productRecountPhysicalQuantity`,\n `isDefault`,\n `isNew`,\n `isDraft`,\n `isUpdate`,\n `isDelete`,\n `isActive`,\n `isApproved`,\n `isReview`,\n `isPost`,\n `executeBy`,\n `executeTime`\n ) VALUES ( \n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n INSERT INTO [productRecount]\n (\n [productRecountId],\n [companyId],\n [warehouseId],\n [productCode],\n [productDescription],\n [productRecountDate],\n [productRecountSystemQuantity],\n [productRecountPhysicalQuantity],\n [isDefault],\n [isNew],\n [isDraft],\n [isUpdate],\n [isDelete],\n [isActive],\n [isApproved],\n [isReview],\n [isPost],\n [executeBy],\n [executeTime]\n) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n INSERT INTO PRODUCTRECOUNT\n (\n COMPANYID,\n WAREHOUSEID,\n PRODUCTCODE,\n PRODUCTDESCRIPTION,\n PRODUCTRECOUNTDATE,\n PRODUCTRECOUNTSYSTEMQUANTITY,\n PRODUCTRECOUNTPHYSICALQUANTITY,\n ISDEFAULT,\n ISNEW,\n ISDRAFT,\n ISUPDATE,\n ISDELETE,\n ISACTIVE,\n ISAPPROVED,\n ISREVIEW,\n ISPOST,\n EXECUTEBY,\n EXECUTETIME\n ) VALUES (\n '\" . $this->getCompanyId() . \"',\n '\" . $this->model->getWarehouseId() . \"',\n '\" . $this->model->getProductCode() . \"',\n '\" . $this->model->getProductDescription() . \"',\n '\" . $this->model->getProductRecountDate() . \"',\n '\" . $this->model->getProductRecountSystemQuantity() . \"',\n '\" . $this->model->getProductRecountPhysicalQuantity() . \"',\n '\" . $this->model->getIsDefault(0, 'single') . \"',\n '\" . $this->model->getIsNew(0, 'single') . \"',\n '\" . $this->model->getIsDraft(0, 'single') . \"',\n '\" . $this->model->getIsUpdate(0, 'single') . \"',\n '\" . $this->model->getIsDelete(0, 'single') . \"',\n '\" . $this->model->getIsActive(0, 'single') . \"',\n '\" . $this->model->getIsApproved(0, 'single') . \"',\n '\" . $this->model->getIsReview(0, 'single') . \"',\n '\" . $this->model->getIsPost(0, 'single') . \"',\n '\" . $this->model->getExecuteBy() . \"',\n \" . $this->model->getExecuteTime() . \"\n );\";\n }\n }\n }\n try {\n $this->q->create($sql);\n } catch (\\Exception $e) {\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n }",
"public function setCompany($quote, $company)\n {\n $quote->getBillingAddress()->setCompany($company)->save();\n $quote->getShippingAddress()->setCompany($company)->save();\n $customerAddressId = $quote->getBillingAddress()->getCustomerAddressId();\n if ($customerAddressId) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n $customerAddress->setCompany($company)->save();\n }\n }",
"public function setCompany($quote, $company)\n {\n $quote->getBillingAddress()->setCompany($company)->save();\n $quote->getShippingAddress()->setCompany($company)->save();\n $customerAddressId = $quote->getBillingAddress()->getCustomerAddressId();\n if ($customerAddressId) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n $customerAddress->setCompany($company)->save();\n }\n }",
"function setProduct( $product )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $product ) == \"ezproduct\" )\n {\n $this->ProductID = $product->id();\n }\n }",
"public function setRelatedBundlesForSimpleProducts($bundleProduct)\n {\n $selectionCollection = $bundleProduct->getTypeInstance(true)->getSelectionsCollection(\n $bundleProduct->getTypeInstance(true)->getOptionsIds($bundleProduct), $bundleProduct\n );\n foreach($selectionCollection as $option) {\n try {\n $_product = Mage::getModel('catalog/product')->load($option->getEntityId());\n if($_product->getId()) {\n $customLinkData = array();\n foreach($_product->getRelatedBundleCollection() as $customLink) {\n $customLinkData[$customLink->getLinkedProductId()]['position'] = $customLink->getPosition();\n }\n $customLinkData[$bundleProduct->getId()] = array('position' => 0);\n $_product->setRelatedBundleData($customLinkData)->save();\n Mage::getSingleton('adminhtml/session')->addSuccess('Added ' . $bundleProduct->getSku() . ' as a Related Bundle to product ' . $_product->getSku());\n }\n } catch(Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Could not set bundled product as Related Bundle for product ' . $option->getSku() . '; ' . $e->getMessage());\n }\n }\n\n }",
"public function salesQuoteItemSetProduct($observer)\n\t{\n\t\t$quoteItem = $observer->getQuoteItem();\n\t\t$product = $observer->getProduct();\n\n\t\tif ($product->isConfigurable() && $quoteItem->getHasChildren())\n\t\t{\n\t\t\tforeach ($quoteItem->getChildren() as $child)\n\t\t\t{\n\t\t\t\tforeach ($child->getProduct()->getProductOptionsCollection() as $option)\n\t\t\t\t{\n\t\t\t\t\t$option->setProduct($product);\n\t\t\t\t\t$product->addOption($option);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function setProduct(Product $product);",
"public function setPromotion($first,$second)\n {\n $this->promotion->setPromotion($first,$second);\n //product Id for identify products\n $this->promotion->setProductId($this->id);\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function setEntityRelatedPk($pk) {\n\t\t$this->_entityRelatedPk = $pk;\n\t}",
"public function setProdID($prodID){\r\n\t\t$this->prodID= $prodID;\r\n\t}",
"public function setRelated ($related)\n {\n $this->_related = (string) $related;\n return $this;\n }",
"public function setPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we){\n\t\t\n\t\tif ($this->isPricing($id_ressource, $id_pricing)){\n\t\t\t$this->editPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t\telse{\n\t\t\t$this->addPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t}",
"public function setCompanyShort($company)\n\t\t{\n\t\t\t$this->company = $company;\n\t\t}",
"protected function setRelatedEntity(array $url): void\n {\n $this->url = new URL($url);\n }",
"static function updateCompanyPolicy($companyno, $newpolicyno) {\n\t\t$sql = \"\";\n\t\t$sql=\"UPDATE Client SET Policy_No='$newpolicyno'\";\n\t\t$sql = $sql.\" WHERE Company='$companyno'\";\n\t\tmysql_query($sql) or die(mysql_error());\n\t\treturn true;//return true\n\t}",
"public function setProyecto( $proyecto ){\n\t\t\t$this->proyecto= $proyecto;\n\t\t}"
]
| [
"0.5744732",
"0.5615619",
"0.5607032",
"0.5473374",
"0.5396891",
"0.5380241",
"0.52787215",
"0.52650183",
"0.52082616",
"0.5201005",
"0.51487803",
"0.51316184",
"0.51280874",
"0.50925136",
"0.50925136",
"0.50497395",
"0.5036039",
"0.5009995",
"0.49305117",
"0.49057612",
"0.4869979",
"0.4849696",
"0.48268914",
"0.47977543",
"0.47968146",
"0.47906786",
"0.478672",
"0.47859788",
"0.47834614",
"0.477092"
]
| 0.655294 | 0 |
setProdRelated() Set the value of [prod_related_pa] column. | public function setProdRelatedPa($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_related_pa !== $v) {
$this->prod_related_pa = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED_PA] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdRelated($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related !== $v) {\n $this->prod_related = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED] = true;\n }\n\n return $this;\n }",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function product($prod) {\n\t\t$this->upsProductCode = $prod;\n\t}",
"public function setProduct(Product $product);",
"public function setProdRelated2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related2 !== $v) {\n $this->prod_related2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED2] = true;\n }\n\n return $this;\n }",
"public function setProducto($pro){ $this->producto = $pro;}",
"function setProduct( $product )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $product ) == \"ezproduct\" )\n {\n $this->ProductID = $product->id();\n }\n }",
"public function setPromotion($first,$second)\n {\n $this->promotion->setPromotion($first,$second);\n //product Id for identify products\n $this->promotion->setProductId($this->id);\n }",
"public function setEntityRelatedPk($pk) {\n\t\t$this->_entityRelatedPk = $pk;\n\t}",
"public function setRelatedBundlesForSimpleProducts($bundleProduct)\n {\n $selectionCollection = $bundleProduct->getTypeInstance(true)->getSelectionsCollection(\n $bundleProduct->getTypeInstance(true)->getOptionsIds($bundleProduct), $bundleProduct\n );\n foreach($selectionCollection as $option) {\n try {\n $_product = Mage::getModel('catalog/product')->load($option->getEntityId());\n if($_product->getId()) {\n $customLinkData = array();\n foreach($_product->getRelatedBundleCollection() as $customLink) {\n $customLinkData[$customLink->getLinkedProductId()]['position'] = $customLink->getPosition();\n }\n $customLinkData[$bundleProduct->getId()] = array('position' => 0);\n $_product->setRelatedBundleData($customLinkData)->save();\n Mage::getSingleton('adminhtml/session')->addSuccess('Added ' . $bundleProduct->getSku() . ' as a Related Bundle to product ' . $_product->getSku());\n }\n } catch(Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError('Could not set bundled product as Related Bundle for product ' . $option->getSku() . '; ' . $e->getMessage());\n }\n }\n\n }",
"public function setRelated ($related)\n {\n $this->_related = (string) $related;\n return $this;\n }",
"public function setPriceProduct($value)\n {\n $this->priceProduct = $value;\n }",
"public function setRelatedLink($value)\n {\n $this->relatedLink = $value;\n }",
"public function setPaid()\n {\n $this->update([\n 'status' => self::STATUS_PAID,\n 'paid_date' => Carbon::now(),\n ]);\n }",
"public function __set($propriedade, $valor) {\n $this->data[$propriedade] = $valor;\n }",
"function custom_numberpro_related_products_args( $args ) {\n\tglobal $sh_option;\n\t$args['posts_per_page'] = $sh_option['number-product-related']; // number related products\n\t// $args['columns'] \t= 2; // arranged in number columns\n\treturn $args;\n}",
"public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"function editRelated()\n\t{\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql = \"SELECT \t* FROM products_table \";\n\t\t\t$query = new Bin_Query();\n\t\t\t$query->executeQuery($sql);\n\t\t\t\n\t\t\t$sql='select cross_product_ids from cross_products_table where product_id='.$id;\n\t\t\t$obj=new Bin_Query();\n\t\t\t$obj->executeQuery($sql);\n\t\t\t$p_id=$obj->records[0];\n\t\t\t$value=explode(\",\",$p_id['cross_product_ids']);\n\t\t\treturn Display_DManageProducts::editRelated($query->records,$value);\n\t\t}\t\n\t\t\t//return '<div class=\"exc_msgbox\">No Products Found! Please Click Product Entry Link to Add Products!</div>';\n\n\n\t\n\t}",
"public function setProductApproval($productApproval, $product, $productData, $productId) {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n $product = $objectManager->create ( 'Magento\\Catalog\\Model\\Product' )->load ( $productId );\n if ($productApproval == 1) {\n $product->setStatus ( 1 );\n $product->setProductApproval(1);\n \n } else {\n $product->setProductApproval ( 0 );\n $product->setStatus(2);\n }\n \n $product->save();\n }",
"public function setProduct(LineItemProduct $product)\n\t{\n\t\t$this->addKeyValue('product', $product); \n\n\t}",
"public function setProductSequence($coupon_id, $prod_id, $seq)\n {\n CI::db()->where(array('coupon_id'=>$coupon_id, 'product_id'=>$prod_id));\n CI::db()->update('coupons_products', array('sequence'=>$seq));\n }",
"public function setProduct(Product $product)\n {\n $this->product_id = $product->id;\n $this->_calculateTotal();\n }",
"function jk_related_products_args( $args ) {\n$args['posts_per_page'] = 8; // 4 related products\nreturn $args;\n}",
"public function testSetPriceProduct()\n {\n $product = new Product();\n $value = 10.99;\n $product->setPrice($value);\n $this->assertEquals($value, $product->getPrice());\n }",
"public function set_relatedDocNo($relatedDocNo) {\n $this->relatedDocNo = (string) $relatedDocNo;\n }",
"public function setProductPrice($product_price){\n $this->product_price = $product_price;\n }",
"public function setProdID($prodID){\r\n\t\t$this->prodID= $prodID;\r\n\t}",
"public function setPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we){\n\t\t\n\t\tif ($this->isPricing($id_ressource, $id_pricing)){\n\t\t\t$this->editPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t\telse{\n\t\t\t$this->addPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t}",
"function set_product_sequence($voucher_id, $prod_id, $seq)\n\t{\n\t\t$this->db->where(array('voucher_id'=>$voucher_id, 'product_id'=>$prod_id));\n\t\t$this->db->update('vouchers_products', array('sequence'=>$seq));\n\t}"
]
| [
"0.66406214",
"0.60493654",
"0.5804168",
"0.5312828",
"0.5242306",
"0.5207813",
"0.5200956",
"0.5172608",
"0.5162874",
"0.51125324",
"0.5039864",
"0.5013742",
"0.49739423",
"0.4956736",
"0.49339598",
"0.4877813",
"0.4867028",
"0.48509744",
"0.47976115",
"0.4788886",
"0.4770211",
"0.47644097",
"0.47560832",
"0.47524586",
"0.4745058",
"0.47436106",
"0.46719128",
"0.46514854",
"0.46370843",
"0.46349517"
]
| 0.6730233 | 0 |
setProdRelatedPa() Set the value of [prod_related_m3] column. | public function setProdRelatedM3($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->prod_related_m3 !== $v) {
$this->prod_related_m3 = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED_M3] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProdRelatedM3()\n {\n return $this->prod_related_m3;\n }",
"public function setProdRelatedPa($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related_pa !== $v) {\n $this->prod_related_pa = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED_PA] = true;\n }\n\n return $this;\n }",
"public function getProdRelatedPa()\n {\n return $this->prod_related_pa;\n }",
"public function setM3($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->m3 !== $v) {\n $this->m3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_M3] = true;\n }\n\n return $this;\n }",
"public function setProdRelated($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related !== $v) {\n $this->prod_related = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED] = true;\n }\n\n return $this;\n }",
"public function setProdAlt3($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_alt3 !== $v) {\n $this->prod_alt3 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ALT3] = true;\n }\n\n return $this;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function setEntityRelatedPk($pk) {\n\t\t$this->_entityRelatedPk = $pk;\n\t}",
"public function setPa($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->pa !== $v) {\n $this->pa = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PA] = true;\n }\n\n return $this;\n }",
"function jk_related_products_args( $args ) {\n$args['posts_per_page'] = 8; // 4 related products\nreturn $args;\n}",
"function sydney_related_products_args( $args ) {\n $args['posts_per_page'] = 3;\n $args['columns'] = 3;\n return $args;\n}",
"function dmc_woo_related_products_limit() {\n\tglobal $product;\n\t$args['posts_per_page'] = 6;\n\treturn $args;\n}",
"function custom_numberpro_related_products_args( $args ) {\n\tglobal $sh_option;\n\t$args['posts_per_page'] = $sh_option['number-product-related']; // number related products\n\t// $args['columns'] \t= 2; // arranged in number columns\n\treturn $args;\n}",
"public function setPromotion($first,$second)\n {\n $this->promotion->setPromotion($first,$second);\n //product Id for identify products\n $this->promotion->setProductId($this->id);\n }",
"public function setPrecinct($v)\n\t{\n\n\n\t\tif ($v === null) {\n\t\t\t$this->setPrecinctId(NULL);\n\t\t} else {\n\t\t\t$this->setPrecinctId($v->getId());\n\t\t}\n\n\n\t\t$this->aPrecinct = $v;\n\t}",
"function setProduct( $product )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $product ) == \"ezproduct\" )\n {\n $this->ProductID = $product->id();\n }\n }",
"public function setPR($r) {}",
"public function testSetPrime3() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setPrime3(10.092018);\n $this->assertEquals(10.092018, $obj->getPrime3());\n }",
"public function setVolPondasiM3($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->vol_pondasi_m3 !== $v) {\n $this->vol_pondasi_m3 = $v;\n $this->modifiedColumns[] = BangunanPeer::VOL_PONDASI_M3;\n }\n\n\n return $this;\n }",
"public function getProdAlt3()\n {\n return $this->prod_alt3;\n }",
"function woo_related_products_limit()\n{\n global $product;\n\n $args['posts_per_page'] = 4;\n return $args;\n}",
"public function setPrecinctId($v)\n\t{\n\r\n\t\t// Since the native PHP type for this column is integer,\r\n\t\t// we will cast the input value to an int (if it is not).\r\n\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->precinct_id !== $v) {\n\t\t\t$this->precinct_id = $v;\n\t\t\t$this->modifiedColumns[] = MmPeer::PRECINCT_ID;\n\t\t}\n\n\t\tif ($this->aPrecinct !== null && $this->aPrecinct->getId() !== $v) {\n\t\t\t$this->aPrecinct = null;\n\t\t}\n\n\t}",
"function qode_woo_related_products_args( $args ) {\n global $qode_options_proya;\n\n\t\t$args['posts_per_page'] = 4;\n\n if(isset($qode_options_proya['woo_products_list_number']) && $qode_options_proya['woo_products_list_number'] != ''){\n switch($qode_options_proya['woo_products_list_number']){\n case('columns-3') :\n $args['posts_per_page'] = 3;\n break;\n case('columns-4') :\n $args['posts_per_page'] = 4;\n break;\n default :\n $args['posts_per_page'] = 4;\n break;\n }\n }\n\n\t\treturn $args;\n\t}",
"public function setProduct(Product $product);",
"public function setReqOtherPhone3($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->req_other_phone3 !== $v) {\n\t\t\t$this->req_other_phone3 = $v;\n\t\t\t$this->modifiedColumns[] = VpoRequestPeer::REQ_OTHER_PHONE3;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setCirculante_P(){\n\t\t$this->Circulante_P = $this->getFornecedores() \n\t\t+ $this->getEmprestimos_Bancarios() \n\t\t+ $this->getObrigacoes_Sociais_e_Impostos_a_Recolher() \n\t\t+ $this->getContas_a_Pagar_C() \n\t\t+ $this->getLucros_a_Distribuir() \n\t\t+ $this->getProvisoes();\n\t}",
"public function testSetPrime3() {\n\n $obj = new PointBonTrav();\n\n $obj->setPrime3(10.092018);\n $this->assertEquals(10.092018, $obj->getPrime3());\n }",
"public function _setLotNo3($lotNo3) {\n\t\t$this->_lotNo3 = $lotNo3;\n\t}",
"public function setJadwalPaudRelatedByJadwalPmtas(JadwalPaud $v = null)\n {\n if ($v === null) {\n $this->setJadwalPmtas(NULL);\n } else {\n $this->setJadwalPmtas($v->getJadwalId());\n }\n\n $this->aJadwalPaudRelatedByJadwalPmtas = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the JadwalPaud object, it will not be re-added.\n if ($v !== null) {\n $v->addSekolahPaudRelatedByJadwalPmtas($this);\n }\n\n\n return $this;\n }",
"public function setProdRelated2($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_related2 !== $v) {\n $this->prod_related2 = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_RELATED2] = true;\n }\n\n return $this;\n }"
]
| [
"0.6565166",
"0.64982957",
"0.5982139",
"0.53901494",
"0.52000916",
"0.5100894",
"0.48719493",
"0.47665218",
"0.47338653",
"0.4715882",
"0.4633002",
"0.45733258",
"0.45598158",
"0.45519248",
"0.45097595",
"0.45083198",
"0.4500966",
"0.44987512",
"0.44761905",
"0.44567454",
"0.44164553",
"0.44163892",
"0.43829274",
"0.4367606",
"0.43558115",
"0.43523392",
"0.4332241",
"0.4331892",
"0.43300518",
"0.4323725"
]
| 0.70077443 | 0 |
setProdAircraftreg() Set the value of [mb] column. | public function setMb($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->mb !== $v) {
$this->mb = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_MB] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProdAircraftreg($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_aircraftreg !== $v) {\n $this->prod_aircraftreg = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_AIRCRAFTREG] = true;\n }\n\n return $this;\n }",
"public function getProdAircraftreg()\n {\n return $this->prod_aircraftreg;\n }",
"public function setRmb($value)\n {\n return $this->set(self::_RMB, $value);\n }",
"public function setRmb($value)\n {\n return $this->set(self::_RMB, $value);\n }",
"public function setRegnoAttribute($value)\n\t{\n\t\t$this->attributes['regno'] = strtoupper($value);\n\t}",
"public function testSetMtSalaireBrut() {\n\n $obj = new AttestationCacm();\n\n $obj->setMtSalaireBrut(10.092018);\n $this->assertEquals(10.092018, $obj->getMtSalaireBrut());\n }",
"public function setMagia9Attribute($value) {\n $this->attributes['magia9'] = $this->verificaAtributo($value, true);\n }",
"public function setRmb($value)\n {\n return $this->set(self::RMB, $value);\n }",
"public function setTxMarcaHardware($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->tx_marca_hardware !== $v) {\n\t\t\t$this->tx_marca_hardware = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::TX_MARCA_HARDWARE;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setCurrentAmmo($currentAmmo) {\n $this->currentAmmo = $currentAmmo;\n }",
"public function set_barbe($_barbe){\n $this->_barbe = $_barbe;\n\n return $this;\n }",
"public function setMemprosesAir($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->memproses_air !== $v) {\n $this->memproses_air = $v;\n $this->modifiedColumns[] = SanitasiPeer::MEMPROSES_AIR;\n }\n\n\n return $this;\n }",
"function setMbrid($value) {\n $this->_mbrid = trim($value);\n }",
"public static function setMemoryLimit($mb){\n\t\t$max = \\GO\\Base\\Util\\Number::configSizeToMB(ini_get(\"memory_limit\"));\n\n\t\tif($max > 0 && $mb>$max){\n\t\t\treturn ini_set(\"memory_limit\", $mb.'M');\n\t\t}else\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}",
"public function setFree($free)\n {\n $this->_setFree = (integer)$free;\n }",
"public function setMinistryAttribute($value)\n {\n $this->attributes['ministry'] = $value ? $value : null;\n }",
"public function testSetCumBrutAbatNonLim() {\n\n $obj = new Employes();\n\n $obj->setCumBrutAbatNonLim(10.092018);\n $this->assertEquals(10.092018, $obj->getCumBrutAbatNonLim());\n }",
"function setChambrehospi($chambre){\n $this->chambre = $chambre;\n }",
"public function setMembre($membre)\n {\n $this->membre = $membre;\n\n return $this;\n }",
"public function setMarca($marca)\n {\n $this->marca = $marca;\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }",
"public function setMbID($value)\n {\n return $this->set('MbID', $value);\n }"
]
| [
"0.53541887",
"0.5190568",
"0.4915646",
"0.4915646",
"0.49065912",
"0.49050942",
"0.48836616",
"0.48359486",
"0.48322132",
"0.47462043",
"0.47079426",
"0.470247",
"0.46806985",
"0.46769604",
"0.46723476",
"0.46598464",
"0.46386623",
"0.46343005",
"0.46147653",
"0.46031472",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184",
"0.45867184"
]
| 0.5460624 | 0 |
setPa() Set the value of [m3] column. | public function setM3($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->m3 !== $v) {
$this->m3 = $v;
$this->modifiedColumns[TblProdInfoTableMap::COL_M3] = true;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVolPondasiM3($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->vol_pondasi_m3 !== $v) {\n $this->vol_pondasi_m3 = $v;\n $this->modifiedColumns[] = BangunanPeer::VOL_PONDASI_M3;\n }\n\n\n return $this;\n }",
"public function setColumna($col){\n if($col>3 ){\n $this->columna = 3;\n }\n elseif ($col<0) {\n $this->columna = 0;\n }\n else{\n $this->columna = $col;\n }\n }",
"public function setPa($pa)\n {\n $this->pa = $pa;\n\n return $this;\n }",
"public function set($column,$value);",
"public function testSetPrime3() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setPrime3(10.092018);\n $this->assertEquals(10.092018, $obj->getPrime3());\n }",
"function setValue($m)\n\t{\n\t\t$this->value = $m;\n\t\treturn $this;\n\t}",
"public function setMataPelajaran($mata_pelajaran);",
"public function setPa($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->pa !== $v) {\n $this->pa = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PA] = true;\n }\n\n return $this;\n }",
"public function testSetPv3() {\n\n $obj = new CollabTache();\n\n $obj->setPv3(10.092018);\n $this->assertEquals(10.092018, $obj->getPv3());\n }",
"public function setVolKudakudaM3($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->vol_kudakuda_m3 !== $v) {\n $this->vol_kudakuda_m3 = $v;\n $this->modifiedColumns[] = BangunanPeer::VOL_KUDAKUDA_M3;\n }\n\n\n return $this;\n }",
"function set_pm_defecto($punto)\n\t{\n\t\t$db = $this->get_db();\n\t\t$id_punto = $db->quote($punto->get_id());\n\t\t$sql = \"UPDATE apex_proyecto\n\t\t\t\tSET pm_impresion = $id_punto,\n\t\t\t\t\tpm_sesion = $id_punto,\n\t\t\t\t\tpm_contexto = $id_punto,\n\t\t\t\t\tpm_usuario = $id_punto\n\t\t\t\tWHERE proyecto = \".$db->quote($this->identificador);\n\t\t$db->ejecutar($sql);\n\t}",
"public function setPaisAttribute($value)\n\t{\n\t\t$this->attributes['pais'] = mb_strtoupper($value);\n\t}",
"public function setMagia3Attribute($value) {\n $this->attributes['magia3'] = $this->verificaAtributo($value, true);\n }",
"function set_par($p,$v)\n {\n $this->__par[$p] = $v;\n }",
"public function testSetPrime3() {\n\n $obj = new PointBonTrav();\n\n $obj->setPrime3(10.092018);\n $this->assertEquals(10.092018, $obj->getPrime3());\n }",
"public function testSetMtPrime3Chantier() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setMtPrime3Chantier(10.092018);\n $this->assertEquals(10.092018, $obj->getMtPrime3Chantier());\n }",
"public function testSetHs3() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setHs3(10.092018);\n $this->assertEquals(10.092018, $obj->getHs3());\n }",
"public function set_pais(Pais $object)\n {\n $this->pais = $object;\n $this->pais_id = $object->id;\n }",
"public function set_pa(Int $_pa){\n $this->_pa = $_pa;\n\n return $this;\n }",
"public function getVolPondasiM3()\n {\n return $this->vol_pondasi_m3;\n }",
"public function setLine3($line3)\n {\n $this->json()->line3 = $line3;\n }",
"public function setPais(string $pais)\n {\n $this->pais = $pais;\n }",
"public function setMpPerc($value)\n {\n return $this->set(self::_MP_PERC, $value);\n }",
"public function setProperty($name, $value)\n\t{\n\n\t\t$this->mpdf->{$name} = $value;\n\n\t}",
"function setSumarPais(){\n\t\t$this->cantidad_paises++;\n\t}",
"public function getM3()\n {\n return $this->m3;\n }",
"public function __set ($psProperty, $pmValue)\n\t{\n\t\t$this->set($psProperty, $pmValue);\n\t}",
"public function getPa()\n {\n return $this->pa;\n }",
"public function getPa()\n {\n return $this->pa;\n }",
"public function set($parameter, $value);"
]
| [
"0.5301286",
"0.5158746",
"0.5145565",
"0.5095278",
"0.5074508",
"0.4962503",
"0.49347463",
"0.48823524",
"0.48543042",
"0.4841946",
"0.48369637",
"0.4831748",
"0.47708684",
"0.4744158",
"0.47396854",
"0.47375438",
"0.47370604",
"0.47306383",
"0.47064963",
"0.46893445",
"0.46727076",
"0.46587527",
"0.4630103",
"0.4606767",
"0.45859697",
"0.4544624",
"0.45423052",
"0.4490528",
"0.4490528",
"0.4435343"
]
| 0.54975516 | 0 |
Generic method to set the primary key (prod_id column). | public function setPrimaryKey($key)
{
$this->setProdId($key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function product_id($product_id=null)\n {\n if (isset($product_id)) $this->product_id = $product_id;\n return $this->product_id;\n }",
"public function getPrimaryKey()\n {\n return $this->getProdId();\n }",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setId($key);\n\t}",
"private function alterPrimaryKey()\n {\n if(is_array($this->primaryKeyValue)){\n // check for auto increment\n $autoIncrement = $this->primaryKeyValue['auto_increment'];\n if($autoIncrement){\n $increment = \" AUTO_INCREMENT, AUTO_INCREMENT=1\";\n }\n\n $this->addCollectionQuery(\n \"\n --\n -- AUTO_INCREMENT for table `{$this->tableName}`\n --\n ALTER TABLE `{$this->tableName}`\n MODIFY {$this->createColumnDefinition($this->primaryKeyValue)}{$increment};\n \"\n );\n }\n }",
"public function setPrimaryKey($key)\n {\n $this->setId($key);\n }",
"public function setPrimaryKey($key)\n {\n $this->setId($key);\n }",
"public function setPrimaryKey($key)\n {\n $this->setId($key);\n }",
"public function setPrimaryKey($key)\n {\n $this->setId($key);\n }",
"public function setPrimaryKey($key)\n {\n $this->setId($key);\n }",
"protected function setProduct_id($value)\n\t{\n\t\tif (isInt($value) || is_null($value)) { $this->product_id = $value; }\n\t}",
"public function setPrimaryKey($key) {\n $this->primaryKey = $key;\n }",
"function setPrimaryKey($inKey) {\n\t\tlist($ID) = explode(self::PRIMARY_KEY_SEPARATOR, $inKey);\n\t\t$this->setID($ID);\n\t}",
"function setPrimaryKey($inKey) {\n\t\tlist($ID) = explode(self::PRIMARY_KEY_SEPARATOR, $inKey);\n\t\t$this->setID($ID);\n\t}",
"public function setPrimary_key($a_id = '')\n {\n if (is_array($a_id)) {\n $this->aPrimary_key = $a_id;\n foreach ($a_id as $nom_id => $val_id) {\n if (($nom_id == 'id_item') && $val_id !== '') $this->iid_item = (int)$val_id; \n }\n }\n }",
"public function setPrimary_key($a_id = '')\n {\n if (is_array($a_id)) {\n $this->aPrimary_key = $a_id;\n foreach ($a_id as $nom_id => $val_id) {\n if (($nom_id == 'id_item') && $val_id !== '') $this->iid_item = (int)$val_id; \n }\n }\n }",
"public function setPrimaryKey($key)\n {\n $this->setSekolahId($key);\n }",
"private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }",
"private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }",
"public function setProductId($product_id){\n $this->product_id = $product_id;\n }",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setCoNumInventario($key);\n\t}",
"public function setPrimaryKey($key)\n {\n $this->setid($key);\n }",
"public function setPrimaryKey($key)\n {\n $this->setArticleId($key);\n }",
"public function setPrimaryKey($key)\n\t{\n\t\t$this->setCoParticipante($key);\n\t}"
]
| [
"0.6696248",
"0.6689001",
"0.6688477",
"0.6688477",
"0.6688477",
"0.6688477",
"0.6688477",
"0.6688477",
"0.6688477",
"0.6688477",
"0.6633477",
"0.66040504",
"0.66040504",
"0.66040504",
"0.66040504",
"0.66040504",
"0.65759486",
"0.650717",
"0.64487755",
"0.64487755",
"0.6399288",
"0.6399288",
"0.639818",
"0.63800156",
"0.63800156",
"0.6369565",
"0.6369084",
"0.6355498",
"0.6355471",
"0.634384"
]
| 0.7543459 | 0 |
Declares an association between this object and a ChildTblEra object. | public function setTblEra(ChildTblEra $v = null)
{
if ($v === null) {
$this->setProdEra(NULL);
} else {
$this->setProdEra($v->getEraId());
}
$this->aTblEra = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildTblEra object, it will not be re-added.
if ($v !== null) {
$v->addTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function initialize()\n {\n $this->belongsTo('id_deuda', 'NbDeudas', 'id_deuda', array('alias' => 'NbDeudas'));\n $this->belongsTo('id_deuda', 'Nbdeudas', 'id_deuda', array('foreignKey' => true));\n }",
"public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }",
"public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }",
"public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}",
"public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }",
"public function toForeignKey($primaryTable = null, $foreignKey = null, $onDelete = \"CASCADE\", $onUpdate = \"CASCADE\") {\n parent::toForeignKey($primaryTable, $foreignKey, $onDelete, $onUpdate);\n \n if($foreignKey == null) {\n $foreignKey = $this->_currentColumn;\n }\n\n if($primaryTable == null) {\n $otherTableName = explode(\"_\", $foreignKey);\n $otherTableName = $otherTableName[0];\n $primaryTable = $otherTableName;\n }\n\n $class = ucfirst(strtolower($this->_currentTable));\n $secondClass = ucfirst(strtolower($primaryTable));\n\n $this->addClass($class);\n $this->addClass($secondClass);\n \n $column = substr($this->_currentColumn, 0, strlen($this->_currentColumn) - 3);\n\n if($class == $secondClass) {\n \n $belongsToName = \"parent\";\n $hasManyName = \"children\";\n \n \n if($this->_currentColumn == \"instance_id\") {\n $belongsToName = \"instance\";\n $hasManyName = \"revisions\";\n }\n \n \n $belongsTo = array($belongsToName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $hasMany = array($hasManyName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n if($hasManyName == \"revisions\") {\n // if it's a revision relationship sort by revision\n $hasMany[\"order\"] = \"revision desc\";\n } elseif($this->columnExist($this->_currentTable, \"position\")) {\n // if there is a column position sort by this column\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$class][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$class][\"has_many\"]);\n } else {\n \n $belongsTo = array(substr($foreignKey, 0, -3), \"class_name\" => $this->_modelNamespace.$secondClass, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $primaryColumnName = explode(\"_\", $this->_currentTable);\n array_shift($primaryColumnName);\n $primaryColumnName = join(\"_\", $primaryColumnName);\n \n $hasMany = array($primaryColumnName.\"s\", \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n \n if($this->columnExist($this->_currentTable, \"position\")) {\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$secondClass][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$secondClass][\"has_many\"]);\n }\n\n // fluent interface\n return $this;\n }",
"public function Child() {\n return $this->belongsTo(Child::class);\n }",
"public function initialize()\n {\n\t\t$this->belongsTo('sfafba_partner_id', 'SfAffiliationPartener', 'sfafpa_id', array('alias' => 'sf_affiliation_partener_partner_id'));\n\n parent::initialize();\n }",
"public function initialize()\r\n {\r\n $this->belongsTo('encuesta_personalId', 'Personal', 'personal_id', array('alias' => 'Personal'));\r\n $this->belongsTo('encuesta_alojamientoId', 'Alojamiento', 'alojamiento_id', array('alias' => 'Alojamiento'));\r\n $this->belongsTo('encuesta_recepcionId', 'Recepcion', 'recepcion_id', array('alias' => 'Recepcion'));\r\n $this->belongsTo('encuesta_unidadId', 'Unidad', 'unidad_id', array('alias' => 'Unidad'));\r\n $this->belongsTo('encuesta_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\r\n $this->belongsTo('encuesta_sorteoId', 'Sorteo', 'sorteo_id', array('alias' => 'Sorteo'));\r\n }",
"protected function addForeignKeys()\n {\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(InitiativeRecord::tableName(), 'id'),\n InitiativeRecord::tableName(),\n 'id',\n ElementRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'elementId'),\n TargetRecord::tableName(),\n 'elementId',\n InitiativeRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'userId'),\n TargetRecord::tableName(),\n 'userId',\n UserRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n }",
"public function associate($entity)\n {\n // The Mapper will retrieve this association within the object model, we won't be using\n // the foreign key attribute inside the parent Entity.\n //\n //$this->parent->setEntityAttribute($this->foreignKey, $entity->getEntityAttribute($this->otherKey));\n //\n // Instead, we'll just add the object to the Entity's attribute\n\n $this->parent->setEntityAttribute($this->relation, $entity->getEntityObject());\n }",
"protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }",
"public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }",
"public function initialize()\n {\n $this->hasMany(\n 'id',\n AuditDetail::class,\n 'audit_id',\n [\n 'alias' => 'details',\n ]\n );\n }",
"public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }",
"public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }",
"public function initialize()\n {\n $this->setSource('tblEntry');\n\n $this->hasOne('userId', '\\Soul\\Model\\User', 'userId', ['alias' => 'user']);\n $this->belongsTo('eventId', '\\Soul\\Model\\Event', 'eventId', ['alias' => 'event']);\n $this->hasOne('paymentId', '\\Soul\\Model\\Payment', 'paymentId', ['alias' => 'payment']);\n }",
"public function initialize()\n {\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaExcusa', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo_persona', 'CobActaconteoPersonaFacturacion', 'id_actaconteo_persona', array(\n 'reusable' => true\n ));\n $this->belongsTo('id_actaconteo', 'CobActaconteo', 'id_actaconteo', array(\n 'reusable' => true\n ));\n }",
"public function initialize()\n {\n $this->belongsTo('cd_nfe', 'PdvNfe', 'cd_nfe', array('alias' => 'PdvNfe'));\n }",
"public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }",
"public function initialize()\n {\n $this->hasMany('cd', 'ShouhinMrs', 'shu_souko_mr_cd', array('alias' => 'ShouhinMrs'));\n $this->hasMany('cd', 'ShiireMeisaiDts', 'souko_mr_cd', array('alias' => 'ShiireMeisaiDts'));\n $this->hasMany('cd', 'UriageMeisaiDts', 'souko_mr_cd', array('alias' => 'UriageMeisaiDts'));\n $this->belongsTo('tantou_mr_cd', 'TantouMrs', 'cd', array('alias' => 'TantouMrs'));\n }",
"public function initialize()\n {\n $this->hasMany('id', 'Aulas', 'id_materia', array('alias' => 'Aulas'));\n $this->hasMany('id', 'Aulas', 'id_materia', NULL);\n }",
"public function setRelationChildId($id);",
"public function initialize()\n {\n $this->hasMany('idmov', 'App\\Models\\MovEstoque', 'movimentacao_manual_estoque_idmov', array('alias' => 'MovEstoque'));\n $this->hasMany('idmov', 'App\\Models\\MovimentacaoManualEstoqueItem', 'idmov', array('alias' => 'MovimentacaoManualEstoqueItem'));\n $this->belongsTo('cd_ordem_servico_reparo', 'App\\Models\\OrdemServicoReparo', 'cd_ordem_servico', array('alias' => 'OrdemServicoReparo'));\n $this->belongsTo('cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('requerente', 'App\\Models\\Empresa', 'cd_empresa', array('alias' => 'Empresa'));\n $this->belongsTo('usuario_responsavel', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }",
"public function initialize()\n {\n $this->belongsTo('posicao_id', 'Ecommerce\\Admin\\Models\\Posicao', 'id', array('alias' => 'Posicao'));\n }",
"public function initialize()\n {\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', array('alias' => 'Documentosbeneficios'));\n $this->hasMany('id_tipobeneficio', 'Documentosbeneficios', 'id_tipobeneficio', NULL);\n }",
"public function initialize()\n {\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', array('alias' => 'Cargaestudiantes'));\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', array('alias' => 'Datosprofesiona'));\n $this->hasMany('id_niveldinst', 'Cargaestudiantes', 'id_niveldinst', NULL);\n $this->hasMany('id_niveldinst', 'Datosprofesiona', 'nive_instr', NULL);\n }",
"public function buildRelations()\n {\n $this->addRelation('ArtRequest', 'ArtRequestORM\\\\ArtRequest', RelationMap::ONE_TO_MANY, array('event_id' => 'event_id', ), 'CASCADE', 'CASCADE', 'ArtRequests');\n }",
"public function initialize()\n {\n $this->hasMany('id', 'Movie', 'classification_id', array('alias' => 'Movie'));\n }",
"public function foreign(string $foreignKey)\n {\n $this->addColumn();\n $this->foreignKey = $foreignKey;\n return $this;\n }"
]
| [
"0.5762646",
"0.5698438",
"0.5666273",
"0.56294125",
"0.556644",
"0.55421746",
"0.550281",
"0.5498231",
"0.54922104",
"0.545242",
"0.5428864",
"0.5423846",
"0.5423403",
"0.5422257",
"0.54184324",
"0.53828377",
"0.536755",
"0.5362396",
"0.53601164",
"0.53587234",
"0.533962",
"0.53186595",
"0.5308971",
"0.5287996",
"0.52835536",
"0.5279782",
"0.5279691",
"0.5276488",
"0.5260376",
"0.52599895"
]
| 0.63477343 | 0 |
Declares an association between this object and a ChildTblGeneral object. | public function setTblGeneral(ChildTblGeneral $v = null)
{
if ($v === null) {
$this->setProdGeneral(NULL);
} else {
$this->setProdGeneral($v->getProdGeneral());
}
$this->aTblGeneral = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildTblGeneral object, it will not be re-added.
if ($v !== null) {
$v->addTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}",
"public function toForeignKey($primaryTable = null, $foreignKey = null, $onDelete = \"CASCADE\", $onUpdate = \"CASCADE\") {\n parent::toForeignKey($primaryTable, $foreignKey, $onDelete, $onUpdate);\n \n if($foreignKey == null) {\n $foreignKey = $this->_currentColumn;\n }\n\n if($primaryTable == null) {\n $otherTableName = explode(\"_\", $foreignKey);\n $otherTableName = $otherTableName[0];\n $primaryTable = $otherTableName;\n }\n\n $class = ucfirst(strtolower($this->_currentTable));\n $secondClass = ucfirst(strtolower($primaryTable));\n\n $this->addClass($class);\n $this->addClass($secondClass);\n \n $column = substr($this->_currentColumn, 0, strlen($this->_currentColumn) - 3);\n\n if($class == $secondClass) {\n \n $belongsToName = \"parent\";\n $hasManyName = \"children\";\n \n \n if($this->_currentColumn == \"instance_id\") {\n $belongsToName = \"instance\";\n $hasManyName = \"revisions\";\n }\n \n \n $belongsTo = array($belongsToName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $hasMany = array($hasManyName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n if($hasManyName == \"revisions\") {\n // if it's a revision relationship sort by revision\n $hasMany[\"order\"] = \"revision desc\";\n } elseif($this->columnExist($this->_currentTable, \"position\")) {\n // if there is a column position sort by this column\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$class][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$class][\"has_many\"]);\n } else {\n \n $belongsTo = array(substr($foreignKey, 0, -3), \"class_name\" => $this->_modelNamespace.$secondClass, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $primaryColumnName = explode(\"_\", $this->_currentTable);\n array_shift($primaryColumnName);\n $primaryColumnName = join(\"_\", $primaryColumnName);\n \n $hasMany = array($primaryColumnName.\"s\", \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n \n if($this->columnExist($this->_currentTable, \"position\")) {\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$secondClass][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$secondClass][\"has_many\"]);\n }\n\n // fluent interface\n return $this;\n }",
"public function foreign(string $foreignKey)\n {\n $this->addColumn();\n $this->foreignKey = $foreignKey;\n return $this;\n }",
"public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }",
"public function getTblGeneral(ConnectionInterface $con = null)\n {\n if ($this->aTblGeneral === null && ($this->prod_general !== null)) {\n $this->aTblGeneral = ChildTblGeneralQuery::create()->findPk($this->prod_general, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblGeneral->addTblProdInfos($this);\n */\n }\n\n return $this->aTblGeneral;\n }",
"public function setTableDefinition() {\n\t\tparent::setTableDefinition();\n\t\t\n\t\t// set the table\n\t\t$this->setTableName('company');\n\t\t$this->hasColumn('type', 'integer', null, array('notblank' => true, 'default' => '1')); // 1 Partner, 2 to be continue\n\t\t$this->hasColumn('name', 'string', 255, array('notblank' => true));\n\t\t$this->hasColumn('description', 'string', 500);\n\t\t$this->hasColumn('contactperson', 'string', 255);\n\t\t$this->hasColumn('phone', 'string', 15);\n\t\t$this->hasColumn('email', 'string', 255);\n\t\t$this->hasColumn('country', 'string', 2, array('default' => 'UG'));\n\t\t$this->hasColumn('locationid', 'integer', null);\n\t\t$this->hasColumn('status', 'integer', null, array('default' => '1'));\n\t\t$this->hasColumn('farmistype', 'integer', null, array('default' => '1'));\n\t\t// 0=>'None', 1=>'All Farmers', 2=>'One Region', 3=>'Multiple Regions', 4=>'One District', 5=>'Multiple Districts', 6=>'One DNA', 7=>'Multiple DNAs'\n\t\t$this->hasColumn('regionid', 'integer', null);\n\t\t$this->hasColumn('regionids', 'string', 50);\n\t\t$this->hasColumn('districtid', 'integer', null);\n\t\t$this->hasColumn('districtids', 'string', 50);\n\t\t$this->hasColumn('dnaid', 'integer', null);\n\t\t$this->hasColumn('dnaids', 'string', 50);\n\t\t$this->hasColumn('showind', 'integer', null, array('default' => '1')); // 1=Enabled, 0=Disabled\n\t}",
"public function belongsTo($class, $foreignKey = null, $otherKey = null);",
"public function setParent(self $parent, string $parentAssociationMapping): void;",
"public function has_many_and_belongs_to($model, $table = null, $foreign = null, $other = null) {\n\t\treturn new Has_Many_And_Belongs_To($this, $model, $table, $foreign, $other);\n\t}",
"protected function addForeignKeys()\n {\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(InitiativeRecord::tableName(), 'id'),\n InitiativeRecord::tableName(),\n 'id',\n ElementRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n\n // TargetRecord\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'elementId'),\n TargetRecord::tableName(),\n 'elementId',\n InitiativeRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n $this->addForeignKey(\n $this->db->getForeignKeyName(TargetRecord::tableName(), 'userId'),\n TargetRecord::tableName(),\n 'userId',\n UserRecord::tableName(),\n 'id',\n 'CASCADE'\n );\n }",
"private function hasOne($table, $foreignTableName) {\n $foreignTableName = strtolower($foreignTableName);\n assert('!empty($table->primaryKey); // table needs to have primary key defined for table join');\n\n // can we load the foreign table?\n if (class_exists(ucfirst($foreignTableName))) {\n // capitalize\n $foreignTableName = ucfirst($foreignTableName);\n // note the foreign table might have relationships of its own...\n $foreignTable = new $foreignTableName();\n assert('!empty($foreignTable->primaryKey); // foreign table needs to have primary key defined');\n\n // create the join on custom primary key and (optionally) custom table name\n $table->join($foreignTable->tableName, array(\n \"{$table->tableName}.{$foreignTable->tableName}_{$table->primaryKey}\"\n => \"{$foreignTable->tableName}.{$foreignTable->primaryKey}\"\n ));\n // as an added bonus, we might have a relationship in the foreign table, add it...\n $table->join .= $foreignTable->join;\n } else {\n // we will have to rely on our primary key\n // create the join where \"foreignTable_id = id\"\n $table->join($foreignTableName, array(\n \"{$table->tableName}.{$foreignTableName}_{$table->primaryKey}\"\n => \"{$foreignTableName}.{$table->primaryKey}\"\n ));\n }\n }",
"public function setRelationChildRealId($realId);",
"private function hasMany($table, $foreignTableName) {\n $foreignTableName = strtolower($foreignTableName);\n assert('!empty($table->primaryKey); // table needs to have primary key defined for table join');\n\n // can we load the foreign table?\n if (class_exists(ucfirst($foreignTableName))) {\n // capitalize\n $foreignTableName = ucfirst($foreignTableName);\n // note the foreign table might have relationships of its own...\n $foreignTable = new $foreignTableName();\n assert('!empty($foreignTable->primaryKey); // foreign table needs to have primary key defined');\n\n // create the join where \"ourTable.ourId=foreignTable.ourTable_ourId\"\n $table->join($foreignTable->tableName, array(\n \"{$table->tableName}.{$table->primaryKey}\"\n => \"{$foreignTable->tableName}.{$table->tableName}_{$table->primaryKey}\"\n ));\n // as an added bonus, we might have a relationship in the foreign table, add it...\n $table->join .= $foreignTable->join;\n } else {\n // we will have to rely on our primary key\n // create the join where \"ourTable.ourId=foreignTable.ourTable_ourId\"\n $table->join($foreignTableName->tableName, array(\n \"{$table->tableName}.{$table->primaryKey}\"\n => \"{$foreignTableName->tableName}.{$table->tableName}_{$table->primaryKey}\"\n ));\n }\n }",
"public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }",
"public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }",
"public function initialize()\r\n {\r\n $this->belongsTo('encuesta_personalId', 'Personal', 'personal_id', array('alias' => 'Personal'));\r\n $this->belongsTo('encuesta_alojamientoId', 'Alojamiento', 'alojamiento_id', array('alias' => 'Alojamiento'));\r\n $this->belongsTo('encuesta_recepcionId', 'Recepcion', 'recepcion_id', array('alias' => 'Recepcion'));\r\n $this->belongsTo('encuesta_unidadId', 'Unidad', 'unidad_id', array('alias' => 'Unidad'));\r\n $this->belongsTo('encuesta_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\r\n $this->belongsTo('encuesta_sorteoId', 'Sorteo', 'sorteo_id', array('alias' => 'Sorteo'));\r\n }",
"public function initialize()\n {\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('alias' => 'Datospersonales'));\n $this->belongsTo('nu_cedula', 'Datospersonales', 'nu_cedula', array('foreignKey' => true));\n }",
"public function initialize()\n {\n $this->belongsTo('id_deuda', 'NbDeudas', 'id_deuda', array('alias' => 'NbDeudas'));\n $this->belongsTo('id_deuda', 'Nbdeudas', 'id_deuda', array('foreignKey' => true));\n }",
"public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }",
"public function initialize()\n {\n $this->hasMany('id', 'Movie', 'classification_id', array('alias' => 'Movie'));\n }",
"protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }",
"public function addRelation($tablename, $arg1, $arg2=FALSE) {\n\t\tif ($arg2) {\n\t\t\t$origKey = $arg1;\n\t\t\t$targetKey = $arg2;\n\t\t}\n\t\telse {\n\t\t\t$origKey = self::$primaryKey[$this->table];\n\t\t\t$targetKey = $arg1;\n\t\t}\n\t\tif (isset(self::$global['dbCon']) && self::$global['dbCon']==$this->connection) \n\t\t\t$table = new table ($tablename);\n\t\telse {\n\t\techo 'ceva'.$tablename;\n\t\t\t$table = new table ($tablename,FALSE,FALSE,$this->connection);\n\t\t}\n\t\tif (isset($table->$targetKey)) {\n\t\t\tself::$relations[$this->table][$tablename] = new stdClass();\n\t\t\tself::$relations[$this->table][$tablename]->origKey = $origKey;\n\t\t\tself::$relations[$this->table][$tablename]->targetKey = $targetKey;\n\t\t\tself::$relations[$tablename][$this->table] = new stdClass();\n\t\t\tself::$relations[$tablename][$this->table]->origKey = $targetKey;\n\t\t\tself::$relations[$tablename][$this->table]->targetKey = $origKey;\n\t\t\tself::$relations[$tablename][$this->table]->type = self::$relations[$this->table][$tablename]->type = NOT_ANALYZED;\n\t\t}\n\t\telse {\n\t\t\tthrow new Exception(\"$targetKey column doesn't exist in $tablename\");\n\t\t}\n\t\t$this->analyzeRelations();\n\t\treturn $this;\n\t}",
"function name_child_relationship($class_name,$foreign_key)\n\t{\n\t\tif($class_name == 'vehicle' && $foreign_key == 'supplier_id')\n\t\t{\n\t\t\treturn \"supplier\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'vehicle_id')\n\t\t{\n\t\t\treturn \"vehicle\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'venue_id')\n\t\t{\n\t\t\treturn \"venue\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'status_id')\n\t\t{\n\t\t\treturn \"status\";\n\t\t}\n\t\telse if($class_name == 'driver' && $foreign_key == 'supplier_id')\n\t\t{\n\t\t\treturn \"supplier\";\n\t\t}\n\t\t\n\t}",
"public function buildRelations()\n {\n $this->addRelation('Contrarecibo', 'Contrarecibo', RelationMap::MANY_TO_ONE, array('idcontrarecibo' => 'idcontrarecibo', ), 'CASCADE', 'CASCADE');\n }",
"public function setTableDefinition() {\n\t\tparent::setTableDefinition();\n\t\t\n\t\t// set the table\n\t\t$this->setTableName('commoditycategory');\n\t\t\n\t\t// unique constraint on name\n\t\t$this->unique(array(\"name\")); \n\t}",
"public function setForeignKey($foreignKey)\n {\n $this->foreignKey = $foreignKey;\n\n return $this;\n }",
"public function setRelationChildId($id);",
"public function initialize()\n {\n $this->hasMany(\n 'id',\n AuditDetail::class,\n 'audit_id',\n [\n 'alias' => 'details',\n ]\n );\n }",
"public function initialize()\n {\n $this->setSchema(\"bd_diagnostico\");\n $this->setSource(\"categoria\");\n $this->hasMany('id_categoria', 'diag\\cc\\Pregunta', 'id_categoria', ['alias' => 'Pregunta']);\n $this->hasMany('id_categoria', 'diag\\cc\\Visita', 'id_categoria', ['alias' => 'Visita']);\n }",
"public function buildRelations()\n\t{\n $this->addRelation('Genero', 'Genero', RelationMap::MANY_TO_ONE, array('id_genero' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tematica', 'Tematica', RelationMap::MANY_TO_ONE, array('id_tematica' => 'id', ), null, 'CASCADE');\n $this->addRelation('Autor', 'Autor', RelationMap::MANY_TO_ONE, array('id_autor' => 'id', ), null, 'CASCADE');\n $this->addRelation('Materia', 'Materia', RelationMap::MANY_TO_ONE, array('id_materia' => 'id', ), null, 'CASCADE');\n $this->addRelation('Tipopublicacion', 'Tipopublicacion', RelationMap::MANY_TO_ONE, array('id_tipopublicacion' => 'id', ), null, 'CASCADE');\n\t}"
]
| [
"0.5680653",
"0.53593063",
"0.5337398",
"0.52782416",
"0.5243401",
"0.52148837",
"0.5202885",
"0.51744944",
"0.51673913",
"0.512093",
"0.51165974",
"0.50935745",
"0.50695413",
"0.5061241",
"0.5019683",
"0.5008641",
"0.49908268",
"0.49813455",
"0.4980881",
"0.49652037",
"0.4950604",
"0.49466407",
"0.4945266",
"0.4934825",
"0.49194336",
"0.49029076",
"0.48972633",
"0.48771298",
"0.4873573",
"0.48726937"
]
| 0.66842127 | 0 |
Get the associated ChildTblGeneral object | public function getTblGeneral(ConnectionInterface $con = null)
{
if ($this->aTblGeneral === null && ($this->prod_general !== null)) {
$this->aTblGeneral = ChildTblGeneralQuery::create()->findPk($this->prod_general, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aTblGeneral->addTblProdInfos($this);
*/
}
return $this->aTblGeneral;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getSubTable(){\n return $this->buildArrayData( Company::orderBy('id', 'asc')->get());\n }",
"public function setTblGeneral(ChildTblGeneral $v = null)\n {\n if ($v === null) {\n $this->setProdGeneral(NULL);\n } else {\n $this->setProdGeneral($v->getProdGeneral());\n }\n\n $this->aTblGeneral = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblGeneral object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"function name_child_relationship($class_name,$foreign_key)\n\t{\n\t\tif($class_name == 'vehicle' && $foreign_key == 'supplier_id')\n\t\t{\n\t\t\treturn \"supplier\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'vehicle_id')\n\t\t{\n\t\t\treturn \"vehicle\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'venue_id')\n\t\t{\n\t\t\treturn \"venue\";\n\t\t}\n\t\telse if($class_name == 'delivery' && $foreign_key == 'status_id')\n\t\t{\n\t\t\treturn \"status\";\n\t\t}\n\t\telse if($class_name == 'driver' && $foreign_key == 'supplier_id')\n\t\t{\n\t\t\treturn \"supplier\";\n\t\t}\n\t\t\n\t}",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('HandlingMoreInfo');\n }",
"public function Child() {\n return $this->belongsTo(Child::class);\n }",
"public function getChild()\n {\n return $this->child;\n }",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('GeneralLibraryCategory');\n }",
"public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }",
"public function getParentItemfromDatabase()\n {\n $dataTableName = Data::mapDataType($this->parentType);\n\n\n $dataTable = new $dataTableName();\n\n $parentItem = $this->parentItem = $dataTable->find($this->parentId)->current();\n return $parentItem;\n }",
"public function get_related_tables(){\n\t\treturn $this->related;\n\t}",
"public function dtPrimary()\n {\n return $this->belongsTo(DatatablePrimary::class, 'parent_id');\n }",
"public function getRelatedDescriptor()\n\t{\n\t\treturn Db::getDescriptor($this->getRelatedClass());\n\t}",
"public function getTable()\n {\n return $this->parentTable;\n }",
"public function child(){\n return $this->morphTo(null,'recharge_type','recharge_type_id');\n }",
"public function GetItem()\r\n\t{\r\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_reference_item1\");\r\n\t}",
"static public function getParentTable(){\n return TABLE_EMPRESA . \"_relacion\";\n }",
"public function getRelationChildRealId();",
"public function Child()\n\t{\n\t\treturn $this->hasMany(Category::class);\n\t}",
"public function get_groupe_fk(){ return $this->_groupe_fk;}",
"public function getTblObj(){\r\n if(is_null(self::$tblObj)){\r\n self::$tblObj = new ImageTable();\r\n }\r\n return self::$tblObj;\r\n }",
"public function getRelationChildId();",
"public function getMotherAttribute()\n {\n return $this->families()->where('type', 'mother')->first();\n }",
"public function getOne(){\n $categorias = $this ->db->query(\"SELECT * FROM categorias WHERE id={$this->getId()}\");\n return $categorias->fetch_object(); //devuelvo un objeto ya utilizable\n }",
"public function get_child($child_id)\n {\n }",
"public function getForeignTable()\n {\n return $this->foreignTable;\n }",
"public function getOtherMorphClass()\n {\n return $this->relatedMorphClass;\n }",
"public function child(){\n return $this->belongsTo('App\\Child', 'child_id');\n }",
"private function getdetailbyparentid($idparent){\r\n\t\t$this->load->model('submission');\r\n\t\t$h = $this->submission->selectdetail44($idparent);\r\n\t\treturn $h;\r\n\t}",
"public function getFk()\n {\n return $this->_fk;\n }",
"protected function getHasOneRelation($table,$foreignKey,$otherKey,$otherKeyValue)\n {\n $this->setSql(\"SELECT `b`.* FROM `{$table}` AS `a` JOIN \" . $this->getTableName() . \" AS `b` ON `a`.`{$otherKey}` = `b`.`{$foreignKey}` \");\n $this->setWhere(\"AND\",\"`a`.`$otherKey` = ? \");\n $this->table = \"b\";\n $this->addValue($otherKey,$otherKeyValue);\n $statement = $this->executeQuery();\n $data = $statement->fetch();\n if ($data){\n return $this->arrayToObj($data);\n }\n return null;\n }"
]
| [
"0.57971954",
"0.57651067",
"0.573825",
"0.5638981",
"0.5601552",
"0.55805635",
"0.5539091",
"0.5519887",
"0.5484783",
"0.548063",
"0.54800844",
"0.5467514",
"0.54373556",
"0.5424376",
"0.5414079",
"0.54017437",
"0.53866476",
"0.5369319",
"0.5347422",
"0.5341997",
"0.5329818",
"0.5307697",
"0.5302007",
"0.5299703",
"0.52911365",
"0.5275922",
"0.5269029",
"0.52624625",
"0.52588505",
"0.5241783"
]
| 0.6617312 | 0 |
Declares an association between this object and a ChildTblMenus object. | public function setTblMenus(ChildTblMenus $v = null)
{
if ($v === null) {
$this->setProdCategory(NULL);
} else {
$this->setProdCategory($v->getMenuAlias());
}
$this->aTblMenus = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildTblMenus object, it will not be re-added.
if ($v !== null) {
$v->addTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function attachModelToParent(int $id, Menu $menu);",
"public function attachModelToParent(int $id, Menu $menu);",
"public function Menus(){\n return $this->belongsToMany(Menu::class);\n }",
"public function getSubmenu()\n {\n return $this->hasOne(Menu::className(), ['id'=>'menu_id']);\n }",
"public function menu()\n {\n return $this->hasMany(\"App\\Menu\");\n }",
"public function menuItems(){\n return $this->hasMany('App\\Models\\MasterRecords\\MenuItem');\n }",
"public\tfunction menu() {\n\t\treturn\t$this->belongsTo('App\\Menu');\n\t}",
"public function menus()\n {\n return $this->hasMany('App\\Models\\Menu');\n }",
"public function menu(){\n return $this->belongsTo('App\\Front\\Menu','menu_id','id');\n }",
"public function parent()\n {\n return $this->belongsTo('Amerhendy\\Employment\\App\\Models\\Base\\Menu', 'parent_id');\n }",
"private function parent()\n {\n return $this->belongsTo(Menu::class);\n }",
"public function menu()\n {\n return $this->belongsTo(Menu::class, 'menuID', 'id');\n }",
"public function menus()\n {\n // belongsToMany(RelatedModel, foreignKey = menu_id, keyOnRelatedModel = id)\n return $this->belongsToMany(Menu::class);\n }",
"private function createMenu() {\n $menu = new Menu;\n $menu->name = $this->page['title'];\n if ($this->page['parent_id']) {\n $parent = ModelsPage::findOrFail($this->page['parent_id']);\n $menu->link = env('APP_URL') . '/' . $parent->slug . '/' . $this->page['slug'];\n } else {\n $menu->link = env('APP_URL') . '/' . $this->page['slug'];\n }\n $menu->parent_id = null;\n $order = Menu::select('order')->where('parent_id', null)->orderBy('order', 'desc')->first();\n $menu->order = (($order) ? $order->order : 0) + 1;\n $menu->target = '_self';\n $menu->status = true;\n $menu->save();\n }",
"public function toForeignKey($primaryTable = null, $foreignKey = null, $onDelete = \"CASCADE\", $onUpdate = \"CASCADE\") {\n parent::toForeignKey($primaryTable, $foreignKey, $onDelete, $onUpdate);\n \n if($foreignKey == null) {\n $foreignKey = $this->_currentColumn;\n }\n\n if($primaryTable == null) {\n $otherTableName = explode(\"_\", $foreignKey);\n $otherTableName = $otherTableName[0];\n $primaryTable = $otherTableName;\n }\n\n $class = ucfirst(strtolower($this->_currentTable));\n $secondClass = ucfirst(strtolower($primaryTable));\n\n $this->addClass($class);\n $this->addClass($secondClass);\n \n $column = substr($this->_currentColumn, 0, strlen($this->_currentColumn) - 3);\n\n if($class == $secondClass) {\n \n $belongsToName = \"parent\";\n $hasManyName = \"children\";\n \n \n if($this->_currentColumn == \"instance_id\") {\n $belongsToName = \"instance\";\n $hasManyName = \"revisions\";\n }\n \n \n $belongsTo = array($belongsToName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $hasMany = array($hasManyName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n if($hasManyName == \"revisions\") {\n // if it's a revision relationship sort by revision\n $hasMany[\"order\"] = \"revision desc\";\n } elseif($this->columnExist($this->_currentTable, \"position\")) {\n // if there is a column position sort by this column\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$class][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$class][\"has_many\"]);\n } else {\n \n $belongsTo = array(substr($foreignKey, 0, -3), \"class_name\" => $this->_modelNamespace.$secondClass, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $primaryColumnName = explode(\"_\", $this->_currentTable);\n array_shift($primaryColumnName);\n $primaryColumnName = join(\"_\", $primaryColumnName);\n \n $hasMany = array($primaryColumnName.\"s\", \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n \n if($this->columnExist($this->_currentTable, \"position\")) {\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$secondClass][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$secondClass][\"has_many\"]);\n }\n\n // fluent interface\n return $this;\n }",
"public function initialize()\n {\n $this->hasMany(\"id\", \"Modules\\Models\\Orders\", \"member_id\", array(\n 'alias' => 'orders'\n ));\n }",
"public function getTblMenus(ConnectionInterface $con = null)\n {\n if ($this->aTblMenus === null && (($this->prod_category !== \"\" && $this->prod_category !== null))) {\n $this->aTblMenus = ChildTblMenusQuery::create()\n ->filterByTblProdInfo($this) // here\n ->findOne($con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblMenus->addTblProdInfos($this);\n */\n }\n\n return $this->aTblMenus;\n }",
"public function getMenu()\n {\n return $this->hasOne(\\wdmg\\menu\\models\\Menu::class, ['id' => 'menu_id']);\n }",
"public function initialize()\n {\n $this->hasMany(\"members_id\", \"\\Event\\Model\\Events\", \"members_id\", ['alias' => 'Events']);\n }",
"public function init()\n {\n $menus = P4Cms_Menu::fetchAll();\n $menuNames = array();\n foreach ($menus as $menu) {\n $menuNames[$menu->getId()] = $menu->getLabel();\n }\n\n // tack on the various dynamic items so they can\n // pick from those as well\n $group = 'Dynamic';\n $menuNames[$group] = array();\n $dynamicTypes = P4Cms_Navigation_DynamicHandler::fetchAll();\n foreach ($dynamicTypes as $dynamicType) {\n $label = $dynamicType->getLabel();\n $value = 'P4Cms_Navigation_DynamicHandler/' . $dynamicType->getId();\n\n $menuNames[$group][$value] = $label;\n }\n natcasesort($menuNames[$group]);\n\n $this->addElement(\n 'select',\n 'menu',\n array(\n 'label' => 'Menu',\n 'value' => P4Cms_Menu::DEFAULT_MENU,\n 'required' => true,\n 'description' => \"Choose a menu to display\",\n 'multiOptions' => $menuNames,\n 'onChange' => \"p4cms.menu.refreshSubForm(this.form);\"\n )\n );\n\n // add option to select the display root\n $this->addElement(\n 'select',\n P4Cms_Menu::MENU_ROOT,\n array(\n 'value' => '',\n 'label' => 'Display Root',\n )\n );\n $this->getElement(P4Cms_Menu::MENU_ROOT)\n ->getDecorator('htmlTag')\n ->setOption('class', 'menu-root');\n $this->_loadRootOptions();\n\n // add option to toggle inclusion of root item, when rooting a menu.\n $this->addElement(\n 'checkbox',\n P4Cms_Menu::MENU_KEEP_ROOT,\n array(\n 'label' => 'Include Root Item',\n 'description' => 'Set the display root (starting point) to display from.<br/>'\n . 'Optionally show the root item in the displayed menu.'\n )\n );\n P4Cms_Form::moveCheckboxLabel($this->getElement(P4Cms_Menu::MENU_KEEP_ROOT));\n $this->getElement(P4Cms_Menu::MENU_KEEP_ROOT)\n ->getDecorator('htmlTag')\n ->setOption('class', 'keep-root');\n $this->getElement(P4Cms_Menu::MENU_KEEP_ROOT)\n ->getDecorator('Description')\n ->setEscape(false);\n\n // add option to limit depth of the displayed menu.\n $options = array('' => 'Unlimited') + range(1, 10);\n $this->addElement(\n 'select',\n P4Cms_Menu::MENU_MAX_DEPTH,\n array(\n 'value' => '',\n 'label' => 'Maximum Depth',\n 'description' => 'Set the maximum depth of items to display.',\n 'multiOptions' => $options\n )\n );\n\n // add option to limit depth of the displayed menu.\n $options = array('' => 'Unlimited')\n + array_combine(range(1, 10), range(1, 10))\n + array_combine(range(15, 50, 5), range(15, 50, 5))\n + array_combine(range(60, 100, 10), range(60, 100, 10));\n $this->addElement(\n 'select',\n P4Cms_Menu::MENU_MAX_ITEMS,\n array(\n 'value' => '',\n 'label' => 'Maximum Items',\n 'description' => 'Set the maximum number of items to display.',\n 'multiOptions' => $options\n )\n );\n }",
"public function menu() {\n return $this->belongsTo('App\\Menu');//belongsToは$reservekから$menuに入れることができる便利なやつ\n }",
"protected function addRelation()\n {\n $fromTable = $this->ask('Enter the name of the parent table');\n $this->checkInput($fromTable);\n $toTable = $this->ask('Enter the name of the child table');\n $this->checkInput($toTable);\n $relationColumn = $this->ask('Enter the column which is going to be referenced (default is \\'id\\')', 'id');\n $action = $this->choice('Action to be taken for column (default is \\'cascade\\')', ['cascade', 'restrict', 'set null'], 'cascade');\n $this->service->addRelation($fromTable, $toTable, $relationColumn, $action);\n }",
"public function menuLinks()\n {\n return $this->hasMany('MenuLink', 'menu_id');\n }",
"public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}",
"public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }",
"private function sons()\n {\n return $this->hasMany(Menu::class, 'id', 'parent_id');\n }",
"protected function define(MapperDefinition $map)\n {\n $map->type(ParentEntity::class);\n $map->toTable('parents');\n\n $map->idToPrimaryKey('id');\n\n $map->embedded('one')->withColumnsPrefixedBy('one_')->using(new LevelOneMapper());\n }",
"public function getId_Menu()\n{\nreturn $this->Id_Menu;\n}",
"public function initialize()\n {\n $this->hasMany('informacion_id', 'Informacionadicional', 'informacion_id', array('alias' => 'Informacionadicional'));\n $this->belongsTo('informacion_adicionalId', 'Adicional', 'adicional_id', array('alias' => 'Adicional'));\n }",
"public function add_menus()\n {\n }"
]
| [
"0.5783814",
"0.5783814",
"0.57027423",
"0.5670512",
"0.5636242",
"0.55329037",
"0.5529758",
"0.5467495",
"0.54092646",
"0.534998",
"0.5348717",
"0.5308784",
"0.52461445",
"0.5150251",
"0.5146164",
"0.5130045",
"0.5123683",
"0.5091496",
"0.5087677",
"0.50760776",
"0.507139",
"0.5045687",
"0.5041219",
"0.5028855",
"0.50254816",
"0.50218976",
"0.50180066",
"0.5011175",
"0.5011004",
"0.4998309"
]
| 0.6340689 | 0 |
Get the associated ChildTblMenus object | public function getTblMenus(ConnectionInterface $con = null)
{
if ($this->aTblMenus === null && (($this->prod_category !== "" && $this->prod_category !== null))) {
$this->aTblMenus = ChildTblMenusQuery::create()
->filterByTblProdInfo($this) // here
->findOne($con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aTblMenus->addTblProdInfos($this);
*/
}
return $this->aTblMenus;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSubmenu()\n {\n return $this->hasOne(Menu::className(), ['id'=>'menu_id']);\n }",
"public function getMenu()\n {\n return $this->hasOne(\\wdmg\\menu\\models\\Menu::class, ['id' => 'menu_id']);\n }",
"private function parent()\n {\n return $this->belongsTo(Menu::class);\n }",
"static function getParentMenu($openSession){\n// \t\t$openSession = null;\n\t\t$consulta = 'select * from menline_parent order by order_line';\n\t\ttry {\n// \t\t\t$openSession = managedConnection::openConnection();\n\t\t\t\t$dao = $openSession->query($consulta);\n\t\t\t\t//Retornamos la lista de Objetos\n// \t\t\tmanagedConnection::closeConnection($openSession);\n\t\t\treturn ($dao);\n\t\t} catch (PDOException $exception) {\n\t\t\techo $exception->getMessage();\n\t\t}\n\t}",
"public function getMenu(){\n\n\t\treturn $this->get();\n\t}",
"public function parentmenus() {\n $this->db->where('menuparentid', \" \"); \n $this->db->order_by('serialid', \"asc\");\n $query = $this->db->get('menu');\n return $query->result();\n }",
"function get_cmenu($parent_id)\n{\n $ci = & get_instance();\n $menu_c = $ci->db->select('*')\n ->where('parent_id', $parent_id)\n ->order_by('show_order', 'asc')\n ->get('menu')->result();\n return $menu_c;\n}",
"public function getMenu()\n {\n $this->db->order_by('id_menu', 'DESC');\n return $this->db->get('tabel_menu')->result();\n }",
"public\tfunction menu() {\n\t\treturn\t$this->belongsTo('App\\Menu');\n\t}",
"public static function menu(){\n $sql = \"select * from pageweb where id_parent = 1 AND menu = 1 ORDER BY ordre\";\n $parents = DB::get_sql_tab($sql);\n for($i=0;$i<count($parents);$i++) {\n $sql2 = \"select * from pageweb where id_parent = '\".$parents[$i][\"id\"].\"'AND menu = 1\";\n $enfants = DB::get_sql_tab($sql2);\n $parents[$i][\"enfants\"] = $enfants;\n }\n return $parents;\n }",
"public function parent()\n {\n return $this->belongsTo('Amerhendy\\Employment\\App\\Models\\Base\\Menu', 'parent_id');\n }",
"function getMenus($parent_menu=false,$parent_id=null){\r\n\t\t$this->db->select(TBL_MASTER_MENUS.'.*');\r\n\t\tif($parent_menu==true){\r\n\t\t\t$this->db->where(array('menu_parent_id'=>0));\r\n\t\t}\r\n\t\tif($parent_id!=null && $parent_id!=''){\r\n\t\t\t$this->db->where(array('menu_parent_id'=>$parent_id));\r\n\t\t}\r\n\t\t$this->db->where(array('is_active'=>1));\r\n\t\t\t\r\n\t\t$this->db->from(TBL_MASTER_MENUS);\r\n\t\t$recordSets = $this->db->get();\r\n\t\t$data = $recordSets->result();\r\n\t\treturn $data;\r\n\t}",
"public function getmenu( ) {\n \t$parent = $this->find('all', array(\n 'conditions' => array(\n 'Page.parent_id IS NULL',\n 'Page.is_menu' => 1,\n 'Page.is_active' => 1\n ),\n 'contain'=>array(\n ),\n 'fields'=>array('Page.lft', 'Page.rght'),\n 'order'=>array('Page.lft' => 'ASC')\n ));\n\t\t\n\t\t$recs = array(); \n foreach($parent as $v){\n \t$info = $this->find('threaded', array(\n\t 'conditions' => array(\n\t 'Page.lft >=' => $v['Page']['lft'], \n\t 'Page.rght <=' => $v['Page']['rght'],\n\t 'Page.is_menu' => 1,\n\t 'Page.is_active' => 1\n\t ),\n\t 'contain'=>array()\n\t ));\n\t \n\t $recs = array_merge($recs, $info);\n\t }\n\t\t\n\t\treturn $recs;\n }",
"public function getParentMenu(){\n return $this->parentMenu;\n }",
"public function getMenus() {}",
"abstract protected function getMenuTree();",
"public function getSubmenu()\n {\n $this->db->join('tabel_menu', 'tabel_menu.id_menu = tabel_submenu.id_menu');\n $this->db->order_by('id_submenu', 'DESC');\n return $this->db->get('tabel_submenu')->result();\n }",
"public function menu()\n {\n return $this->belongsTo(Menu::class, 'menuID', 'id');\n }",
"public function menus()\n {\n // belongsToMany(RelatedModel, foreignKey = menu_id, keyOnRelatedModel = id)\n return $this->belongsToMany(Menu::class);\n }",
"public function getMenus()\n {\n return $this->hasMany(Menu::className(), ['id' => 'menu_id'])->viaTable('menu_cook', ['cook_id' => 'id']);\n }",
"public function menus()\n {\n return $this->hasMany('App\\Models\\Menu');\n }",
"public function Menus(){\n return $this->belongsToMany(Menu::class);\n }",
"private function sons()\n {\n return $this->hasMany(Menu::class, 'id', 'parent_id');\n }",
"public function menu()\n {\n return $this->hasMany(\"App\\Menu\");\n }",
"public function getMenu($parent = 0 ,$id = 0, $admin_type = 0) {\n//echo ' $parent='.$parent.' $id='.$id.' $admin_type='.$admin_type; Die();\n\t\t$lang = $this->_ci->lang->language['lang'];\n\t\t$status = 1;\n\t\t$row = array();\n\t\t\n \tif ($admin_type > 1) {\n/*\n \t\t//Getting an individual user\n \t\t//$query = $this->_ci->db->get_where(\"_admin_menu\", array(\"admin_menu_id\" => $id, \"parent\" => $parent, \"status\" => $status, \"lang\" => $lang));\n \t\t\n \t\t$sql = 'SELECT\n\t\t\tsd_admin_menu.admin_menu_id,\t sd_admin_menu.admin_menu_id2,\n\t\t\tsd_admin_menu.title, sd_admin_menu.url,\tsd_admin_menu.parent,\tsd_admin_menu.order_by,\n\t\t\tsd_admin_menu.status,\tsd_admin_menu.lang,\tsd_admin_access_menu.admin_access_id,\n\t\t\tsd_admin_access_menu.admin_type_id\n\t\t\tFROM sd_admin_menu Inner Join sd_admin_access_menu ON (sd_admin_access_menu.admin_menu_id = sd_admin_menu.admin_menu_id2 AND sd_admin_menu.status = 1)\n\t\t\tWHERE admin_type_id='.$admin_type;\n \t\t\n \t\t$query = $this->_ci->db->query($sql);\n\t\t\t//Debug($this->_ci->db->last_query());\n\t\t\t\n \t\t//Check if any results were returned\n \t\tif ($query->num_rows() > 0) {\n \t\t\t//Pass the data to our local function to create an object for us and return this new object\n \t\t\tforeach ($query->result() as $data) {\n \t\t\t\tif($lang == $data->lang) $row[] = $data;\n \t\t\t}\n \t\t\t\n \t\t\t//Debug($query->row());\n \t\t\t//Debug($row);\n \t\t\t//die();\n \t\t\treturn $row;\n \t\t\t//return $this->createObjectFromData($query->row());\n \t\t}\n \t\treturn false;\n*/\n\n/////////////////////////////////////////////////\n \n \t\t//Getting all the users\n\t\t$orderby = \"order_by\";\n \t\t$query = $this->_ci->db->select(\"*\")->from(\"_admin_menu\")->where('admin_menu_id2<>','27')->where(array(\"parent\" => $parent, \"status\" => $status, \"lang\" => $lang))->order_by($orderby, 'ASC')->get();\n\t\t\t //echo $this->_ci->db->last_query();\n\n \t\t//Check if any results were returned\n \t\tif ($query->num_rows() > 0) {\n \t\t\t//Create an array to store users\n \t\t\t$users = array();\n \t\t\t//Loop through each row returned from the query\n \t\t\t\n \t\t\tforeach ($query->result() as $row) {\n \t\t\t\t//Pass the row data to our local function which creates a new user object with the data provided and add it to the users array\n \t\t\t\t$users[] = $this->createObjectFromData($row);\n \t\t\t}\n \t\t\t\n \t\t\t/*foreach ($query->result() as $data) {\n \t\t\t\tif($lang == $data->lang) $row[] = $data;\n \t\t\t}*/\n \t\t\t \t\t\t\n \t\t\t//Return the users array\n \t\t\t//Debug($users);\n \t\t\t//die();\n \t\t\treturn $users;\n \t\t}\n \t\treturn false;\n/////////////////////////////////////////////////\n \t}else{\n \t\t\n \t\t//Getting all the users\n\t\t\t$orderby = \"order_by\";\n \t\t$query = $this->_ci->db->select(\"*\")->from(\"_admin_menu\")->where(array(\"parent\" => $parent, \"status\" => $status, \"lang\" => $lang))->order_by($orderby, 'ASC')->get();\n\t\t\t//echo $this->_ci->db->last_query();\n\n \t\t//Check if any results were returned\n \t\tif ($query->num_rows() > 0) {\n \t\t\t//Create an array to store users\n \t\t\t$users = array();\n \t\t\t//Loop through each row returned from the query\n \t\t\t\n \t\t\tforeach ($query->result() as $row) {\n \t\t\t\t//Pass the row data to our local function which creates a new user object with the data provided and add it to the users array\n \t\t\t\t$users[] = $this->createObjectFromData($row);\n \t\t\t}\n \t\t\t\n \t\t\t/*foreach ($query->result() as $data) {\n \t\t\t\tif($lang == $data->lang) $row[] = $data;\n \t\t\t}*/\n \t\t\t \t\t\t\n \t\t\t//Return the users array\n \t\t\t//Debug($users);\n \t\t\t//die();\n \t\t\treturn $users;\n \t\t}\n \t\treturn false;\n \t}\n }",
"public static function getSiteMenu() {\n $menu = Yii::$app->cacheManage->site_menu;\n if (!$menu) {\n $context = new ViewHelper();\n $config = [\n 'model' => 'app\\models\\action\\Nav',\n 'parentKey' => 'parentid',\n 'primaryKey' => 'id',\n 'rootParent' => 0,\n 'orderBy' => 'listorder desc',\n ];\n $obj = new Tree($config);\n $tree = $obj->getTree(true);\n $menu = $context->getMenuChild($tree);\n Yii::$app->cacheManage->site_menu = $menu;\n }\n return $menu;\n }",
"public function getMenu(){\n $bigCategory = $this->getBigCategory();\n $medCategory = $this->getMediumCategory();\n foreach($bigCategory as $bigKey => $value){\n foreach($medCategory as $medKey => $val){\n if($val['parentId'] == $value['id']){\n $bigCategory[$bigKey]['subCategory'][] = $val;\n }\n }\n }\n return $bigCategory;\n }",
"public function get_list() {\n\t\t$this->db->select('mnu.*, icon.nama AS nama_icon, mnu_parent.nama AS nama_parent');\n\t\t$this->db->from('menu AS mnu');\n\t\t$this->db->join('icon AS icon', 'icon.id = mnu.id_icon', 'LEFT');\n\t\t$this->db->join('menu AS mnu_parent', 'mnu_parent.id = mnu.parent_id', 'LEFT');\n\n\t\treturn parent::get_list();\n\t}",
"public function menus(){\n return $this->belongsToMany('ChecklistSilfa\\Entities\\MainMenu', 'permisos_menu', 'user_id', 'permisos_id')->where('menu.estado','=','1')->orderBy('menu.id');\n }",
"public static function getBottomMenu(){\n return ObjectDB::getAllOnField(self::$table, __CLASS__, \"type\", false,\"id\");\n\n }"
]
| [
"0.71868193",
"0.6739627",
"0.66164696",
"0.6570604",
"0.65208596",
"0.6472349",
"0.63874024",
"0.63673025",
"0.6352337",
"0.63307333",
"0.63164353",
"0.6294624",
"0.629274",
"0.62774754",
"0.623657",
"0.6232077",
"0.6226547",
"0.620865",
"0.620269",
"0.6194057",
"0.61677814",
"0.61519104",
"0.61489195",
"0.6141153",
"0.6108486",
"0.6104092",
"0.6102895",
"0.61010325",
"0.6095308",
"0.60881954"
]
| 0.68729335 | 1 |
Declares an association between this object and a ChildTblProdPhotos object. | public function setTblProdPhotos(ChildTblProdPhotos $v = null)
{
if ($v === null) {
$this->setProdId(NULL);
} else {
$this->setProdId($v->getProdId());
}
$this->aTblProdPhotos = $v;
// Add binding for other direction of this 1:1 relationship.
if ($v !== null) {
$v->setTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }",
"public function photos() {\n return $this->hasMany('App\\Models\\ProductPhoto');\n }",
"public function getTblProdPhotos(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPhotos === null && ($this->prod_id !== null)) {\n $this->aTblProdPhotos = ChildTblProdPhotosQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPhotos->setTblProdInfo($this);\n }\n\n return $this->aTblProdPhotos;\n }",
"public function photo_product()\n {\n return $this->belongsTo(Photo_product::class);\n }",
"public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}",
"public function photo()\n {\n return $this->belongsToMany(Photos::class,'photo_product','photo_id', 'product_id');\n }",
"public function photographs()\n {\n return $this->hasMany('App\\Photograph');\n }",
"public function SPPhotos()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPPhoto','sp_id','sp_id');\n }",
"public function images(): HasMany\n {\n return $this->hasMany('App\\Models\\ProductImage');\n }",
"public function photos() {\n return $this->hasMany('\\P4\\Photo');\n }",
"public function image()\n {\n\n return $this->hasMany(ProductImage::class);\n \n }",
"public function initialize()\n {\n $this->hasMany('cd_upload', 'App\\Models\\Empresa', 'logo', array('alias' => 'Empresa'));\n $this->hasMany('cd_upload', 'App\\Models\\EmpresaHasArquivos', 'cd_upload', array('alias' => 'EmpresaHasArquivos'));\n $this->hasMany('cd_upload', 'App\\Models\\EmpresaHasLinkCentralcompras', 'cd_upload', array('alias' => 'EmpresaHasLinkCentralcompras'));\n $this->hasMany('cd_upload', 'App\\Models\\LancamentoHasUpload', 'cd_upload', array('alias' => 'LancamentoHasUpload'));\n $this->hasMany('cd_upload', 'App\\Models\\LiquidacaoHasUpload', 'cd_upload', array('alias' => 'LiquidacaoHasUpload'));\n $this->hasMany('cd_upload', 'App\\Models\\NfentradaHasUpload', 'cd_upload', array('alias' => 'NfentradaHasUpload'));\n $this->hasMany('cd_upload', 'App\\Models\\UploadHas', 'upload_cd_upload', array('alias' => 'UploadHas'));\n $this->belongsTo('cd_unidade', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n }",
"public function images()\n {\n return $this->hasMany('fooCart\\src\\ProductImage', 'product_id', 'product_id');\n }",
"public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }",
"public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }",
"public function photos(){\n\n\t\treturn $this->hasMany('App\\Photo');\n\n\t}",
"public function photos(): HasMany\n\t{\n\t\treturn $this->hasMany('App\\Models\\Photo', 'album_id', 'id');\n\t}",
"public function photos()\n {\n return $this->hasMany('App\\Photo');\n }",
"public function photos()\n {\n return $this->hasMany('App\\Photo');\n }",
"public function pictures() {\n return $this->hasMany('App\\Models\\Picture');\n }",
"public function images()\n\t{\n\t\treturn $this->hasMany(ProductImage::class);\n\t}",
"public function photos()\n {\n return $this->hasMany('App\\Entities\\QuoteOptionHotelRoomPhoto', 'quote_option_room_id', 'quote_option_room_id');\n }",
"public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }",
"public function fotos()\n {\n return $this->hasMany(foto::class,'fk_id_producto');\n }",
"public function foto(){\n \treturn $this->hasOne('App\\Foto');\n }",
"public function getGallery(){\n return $this->hasMany(ProductGallery::class, 'product_id','id');\n }",
"public function photo() {\n return $this->hasOne('Photo','id','photo_id');\n }",
"public function __construct()\n\t{\n\t\t$this->has_one['product'] = array('Products_m', 'id', 'product_id');\n\t\t// $this->soft_deletes = TRUE;\n\t\tparent::__construct();\n\t}",
"public function photo()\n {\n return $this->hasOne('App\\DescriptionPhoto','description_id');\n }",
"public function product_galleries() {\n return $this->hasMany(ProductGallery::class, 'product_id', 'id');\n }"
]
| [
"0.5997008",
"0.5925393",
"0.5756778",
"0.57131916",
"0.5632418",
"0.5589473",
"0.54623234",
"0.5427783",
"0.53538245",
"0.5344459",
"0.53411",
"0.5283743",
"0.52625775",
"0.52566516",
"0.5233465",
"0.5230972",
"0.5197283",
"0.5193044",
"0.5193044",
"0.5186329",
"0.517417",
"0.5150636",
"0.508615",
"0.5015865",
"0.50065684",
"0.49921855",
"0.49784967",
"0.4975352",
"0.49678668",
"0.49441487"
]
| 0.68439764 | 0 |
Get the associated ChildTblProdPhotos object | public function getTblProdPhotos(ConnectionInterface $con = null)
{
if ($this->aTblProdPhotos === null && ($this->prod_id !== null)) {
$this->aTblProdPhotos = ChildTblProdPhotosQuery::create()->findPk($this->prod_id, $con);
// Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.
$this->aTblProdPhotos->setTblProdInfo($this);
}
return $this->aTblProdPhotos;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function photos() {\n return $this->hasMany('App\\Models\\ProductPhoto');\n }",
"public function getPhoto() {\n return $this->hasOne(Photo::className(), ['id' => 'photo_id']);\n }",
"public function photo_product()\n {\n return $this->belongsTo(Photo_product::class);\n }",
"public function photo()\n {\n return $this->belongsToMany(Photos::class,'photo_product','photo_id', 'product_id');\n }",
"public function setTblProdPhotos(ChildTblProdPhotos $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPhotos = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function getPicturesProduct()\n {\n $aVariantSelections = $this->getVariantSelections();\n if ($aVariantSelections && $aVariantSelections['oActiveVariant'] && !$aVariantSelections['blPerfectFit']) {\n return $aVariantSelections['oActiveVariant'];\n }\n\n return $this->getProduct();\n }",
"public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}",
"public function getImage()\n {\n return $this->hasOne(ProductImage::class, ['product_id' => 'id'])->where([\n 'product_image.main' => true\n ]);\n }",
"public function featuredPhoto() {\n return $this->hasOne('App\\Models\\ProductPhoto')->whereFeatured(true);\n }",
"public function getPhotos()\n {\n return $this->hasMany(Photo::className(), ['owner_id' => 'id']);\n }",
"public function photo() {\n return $this->hasOne('Photo','id','photo_id');\n }",
"public function SPPhotos()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPPhoto','sp_id','sp_id');\n }",
"public function getGallery(){\n return $this->hasMany(ProductGallery::class, 'product_id','id');\n }",
"public function images()\n {\n return $this->hasMany('fooCart\\src\\ProductImage', 'product_id', 'product_id');\n }",
"public function photo(){\n // Not \"hasOne\" which would try and match for a post_id column in the \"photos\" table\n \treturn $this->belongsTo('App\\Photo');\n }",
"public function photos()\n {\n return $this->hasMany('App\\Entities\\QuoteOptionHotelRoomPhoto', 'quote_option_room_id', 'quote_option_room_id');\n }",
"public function images()\n\t{\n\t\treturn $this->hasMany(ProductImage::class);\n\t}",
"public function photos() {\n return $this->hasMany('\\P4\\Photo');\n }",
"public function photographs()\n {\n return $this->hasMany('App\\Photograph');\n }",
"public function photo()\n {\n \treturn $this->article->photos->first();\n }",
"public function foto(){\n \treturn $this->hasOne('App\\Foto');\n }",
"public function getImages()\n {\n return $this->hasMany(ProductImage::class, ['product_id' => 'id']);\n }",
"public function photos(){\n\n\t\treturn $this->hasMany('App\\Photo');\n\n\t}",
"public function getPicture(){\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = \"emp_id = :EMPID\";\n\t\t$criteria->params[':EMPID'] = $this->emp_id;\n\t\t$criteria->select = \"pic,location_pic\";\n\t\t$empl_pic = Employees::model()->find($criteria);\n\t\treturn \t$empl_pic;\n\t}",
"public function photos()\n {\n return $this->hasOne('App\\Customerfile','customer_id','id');\n }",
"public function images()\n {\n return $this->hasMany(ProductImageProxy::modelClass(), 'seller_product_id');\n }",
"function getThumbInfo($imageid) { \t\n \t$sql = \"SELECT opm_products.productname, properties.property\n \t\t\tFROM opm_images\n \t\t\tLEFT JOIN opm_products ON opm_products.opm_productid = opm_images.opm_productid\n \t\t\tLEFT JOIN properties ON properties.propertyid = opm_products.propertyid\n \t\t\tWHERE opm_images.imageid = \" . $this->db->escape($imageid);\n \t\t\t\n \t$query = $this->db->query($sql);\n \t$row = $query->row();\n\t\t\n \techo $row->property .\" // \".$row->productname;\n \n }",
"public function getFotoProducto()\n {\n return $this->fotoProducto;\n }",
"public function photo()\n {\n return $this->hasOne('App\\DescriptionPhoto','description_id');\n }",
"public function pictures() {\n return $this->hasMany('App\\Models\\Picture');\n }"
]
| [
"0.63446426",
"0.6282922",
"0.62145877",
"0.62004745",
"0.6195938",
"0.61836874",
"0.618317",
"0.61496836",
"0.6145557",
"0.6032552",
"0.60284215",
"0.6003343",
"0.5901852",
"0.58515775",
"0.58360404",
"0.5822309",
"0.5792609",
"0.5789036",
"0.57851845",
"0.5773946",
"0.5770099",
"0.5767073",
"0.5752159",
"0.5751963",
"0.57390106",
"0.57319015",
"0.5691649",
"0.56824434",
"0.56725866",
"0.56523633"
]
| 0.7099568 | 0 |
Declares an association between this object and a ChildTblProdPrices object. | public function setTblProdPrices(ChildTblProdPrices $v = null)
{
if ($v === null) {
$this->setProdId(NULL);
} else {
$this->setProdId($v->getProdId());
}
$this->aTblProdPrices = $v;
// Add binding for other direction of this 1:1 relationship.
if ($v !== null) {
$v->setTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}",
"public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}",
"public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }",
"public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}",
"public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }",
"public function getTblProdPrices(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {\n $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPrices->setTblProdInfo($this);\n }\n\n return $this->aTblProdPrices;\n }",
"public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }",
"public function setProdPriceId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_price_id !== $v) {\n $this->prod_price_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_PRICE_ID] = true;\n }\n\n if ($this->aTblProdPricing !== null && $this->aTblProdPricing->getProdPriceId() !== $v) {\n $this->aTblProdPricing = null;\n }\n\n return $this;\n }",
"public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }",
"public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }",
"public function prices()\n {\n return $this->hasMany(Price::class);\n }",
"public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }",
"public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }",
"public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }",
"public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }",
"public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }",
"public function prices() {\n return $this->hasMany('Auction_price'); // this matches the Eloquent model\n }",
"public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }",
"public function products()\n {\n return $this->hasMany('App\\Core\\Catalog\\Entities\\Product', 'company_id', 'id');\n }",
"public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }",
"public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }",
"public function __construct()\n\t{\n\t\t$this->has_one['product'] = array('Products_m', 'id', 'product_id');\n\t\t// $this->soft_deletes = TRUE;\n\t\tparent::__construct();\n\t}",
"protected function _saveProductTierPrices(array $tierPriceData)\n {\n static $tableName = null;\n\n if (!$tableName) {\n $tableName = $this->_resourceFactory->create()->getTable('catalog_product_entity_tier_price');\n }\n if ($tierPriceData) {\n $tierPriceIn = [];\n $delProductId = [];\n\n foreach ($tierPriceData as $delSku => $tierPriceRows) {\n $productId = $this->skuProcessor->getNewSku($delSku)[$this->getProductEntityLinkField()];\n $delProductId[] = $productId;\n\n foreach ($tierPriceRows as $row) {\n $row[$this->getProductEntityLinkField()] = $productId;\n $tierPriceIn[] = $row;\n }\n }\n if (Import::BEHAVIOR_APPEND != $this->getBehavior()) {\n $this->_connection->delete(\n $tableName,\n $this->_connection->quoteInto(\"{$this->getProductEntityLinkField()} IN (?)\", $delProductId)\n );\n }\n if ($tierPriceIn) {\n $this->_connection->insertOnDuplicate($tableName, $tierPriceIn, ['value']);\n }\n }\n return $this;\n }",
"public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }",
"public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}",
"public function setProdId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_id !== $v) {\n $this->prod_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_ID] = true;\n }\n\n if ($this->aTblProdPhotos !== null && $this->aTblProdPhotos->getProdId() !== $v) {\n $this->aTblProdPhotos = null;\n }\n\n if ($this->aTblProdPrices !== null && $this->aTblProdPrices->getProdId() !== $v) {\n $this->aTblProdPrices = null;\n }\n\n if ($this->aTblProdSmaller !== null && $this->aTblProdSmaller->getProdId() !== $v) {\n $this->aTblProdSmaller = null;\n }\n\n return $this;\n }",
"function setPrice($classId, $price) {\r\n $data['classPrice'] = $price;\r\n $this->db->where('id', $classId);\r\n $this->db->update('class', $data);\r\n }"
]
| [
"0.63016796",
"0.6223418",
"0.6204816",
"0.6000629",
"0.59313536",
"0.5778192",
"0.56525975",
"0.5646186",
"0.5440802",
"0.54381895",
"0.5391214",
"0.5386854",
"0.536747",
"0.53599423",
"0.5315806",
"0.5291904",
"0.52196646",
"0.5207516",
"0.51851255",
"0.5033819",
"0.4998194",
"0.49568936",
"0.4949518",
"0.49296084",
"0.48759788",
"0.48715353",
"0.48412722",
"0.48034155",
"0.4801979",
"0.48012406"
]
| 0.695329 | 0 |
Get the associated ChildTblProdPrices object | public function getTblProdPrices(ConnectionInterface $con = null)
{
if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {
$this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);
// Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.
$this->aTblProdPrices->setTblProdInfo($this);
}
return $this->aTblProdPrices;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }",
"public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}",
"public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}",
"public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}",
"public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }",
"public function getPriceProduct()\n {\n return $this->priceProduct;\n }",
"public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }",
"public function prices()\n {\n return $this->hasMany(Price::class);\n }",
"public function getPriceModel()\n {\n return Mage::getSingleton('catalog/product_type')->priceFactory($this->getTypeId());\n }",
"public function getPriceId($id)\n { \n $product = $this->postFactory->create();\n $productPriceById = $product->load($id)->getPrice();\n return $productPriceById;\n }",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function prices()\n {\n return $this->morphToMany(Price::class, 'price_able');\n }",
"public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }",
"public function SPPriceHistory()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sellerProduct_id, localKey = id)\n return $this->hasMany('App\\SPPriceHitory','sp_id','sp_id');\n }",
"function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function products() : object\n {\n\n // also, we'll need different product prices per market so we need another layer on top of Products to do this\n return $this->hasMany(MarketProduct::class, 'id');\n }",
"public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }",
"public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }",
"public function getPrice()\n {\n return $this->object->Price;\n }",
"public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }",
"function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}",
"public static function loadProductByProId($p_proId)\n {\n $sql = \"select * from products where ProID = $p_proId\";\n $list = DataProviderMain::execQuery($sql);\n if ($row = mysqli_fetch_array($list)) {\n\n //$proId = $row[\"ProID\"];\n //$proId = $p_proId;\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($p_proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n return $p;\n }\n\n return NULL;\n }",
"public function getPrice()\n {\n return parent::getPrice();\n }",
"public function getProducto(){\n $sql='SELECT idProducto, nombre, precio, descripcion, foto, estado, idCategoria, cantidad, idProveedor from producto WHERE idProducto = ?';\n $params=array($this->id);\n return Database::getRow($sql,$params);\n }",
"public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }"
]
| [
"0.6941069",
"0.6823047",
"0.6805496",
"0.6513882",
"0.6431518",
"0.6427587",
"0.63864625",
"0.6214919",
"0.6198193",
"0.6152482",
"0.60753256",
"0.5975118",
"0.59222186",
"0.5812921",
"0.57905215",
"0.5766011",
"0.5751223",
"0.57447857",
"0.5741802",
"0.57308674",
"0.57257515",
"0.5722714",
"0.5684744",
"0.5678904",
"0.5651499",
"0.564085",
"0.56335366",
"0.56173694",
"0.56136775",
"0.5605341"
]
| 0.7106863 | 0 |
Declares an association between this object and a ChildTblProdPricing object. | public function setTblProdPricing(ChildTblProdPricing $v = null)
{
if ($v === null) {
$this->setProdPriceId(NULL);
} else {
$this->setProdPriceId($v->getProdPriceId());
}
$this->aTblProdPricing = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildTblProdPricing object, it will not be re-added.
if ($v !== null) {
$v->addTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTblProdPrices(ChildTblProdPrices $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdPrices = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function getTblProdPricing(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {\n $this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblProdPricing->addTblProdInfos($this);\n */\n }\n\n return $this->aTblProdPricing;\n }",
"public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}",
"public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}",
"public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }",
"public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }",
"public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }",
"public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}",
"public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }",
"public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }",
"private function SetPricingDetails()\n\t{\n\t\t$product = $this->productClass->getProduct();\n\n\t\t$GLOBALS['PriceLabel'] = GetLang('Price');\n\n\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t$GLOBALS['ProductPrice'] = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseGL($this->productClass->GetProductCallForPricingLabel());\n\t\t}\n\t\t// If prices are hidden, then we don't need to go any further\n\t\telse if($this->productClass->ArePricesHidden()) {\n\t\t\t$GLOBALS['HidePrice'] = \"display: none;\";\n\t\t\t$GLOBALS['HideRRP'] = 'none';\n\t\t\t$GLOBALS['ProductPrice'] = '';\n\t\t\treturn;\n\t\t}\n\t\telse if (!$this->productClass->IsPurchasingAllowed()) {\n\t\t\t$GLOBALS['ProductPrice'] = GetLang('NA');\n\t\t}\n\t\telse {\n\t\t\t$options = array('strikeRetail' => false);\n\t\t\t$GLOBALS['ProductPrice'] = formatProductDetailsPrice($product, $options);\n\t\t}\n\n\t\t// Determine if we need to show the RRP for this product or not\n\t\t// by comparing the price of the product including any taxes if\n\t\t// there are any\n\t\t$GLOBALS['HideRRP'] = \"none\";\n\t\t$productPrice = $product['prodcalculatedprice'];\n\t\t$retailPrice = $product['prodretailprice'];\n\t\tif($retailPrice) {\n\t\t\t// Get the tax display format\n\t\t\t$displayFormat = getConfig('taxDefaultTaxDisplayProducts');\n\t\t\t$options['displayInclusive'] = $displayFormat;\n\n\t\t\t// Convert to the browsing currency, and apply group discounts\n\t\t\t$productPrice = formatProductPrice($product, $productPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\t\t\t$retailPrice = formatProductPrice($product, $retailPrice, array(\n\t\t\t\t'localeFormat' => false, 'displayInclusive' => $displayFormat\n\t\t\t));\n\n\t\t\tif($productPrice < $retailPrice) {\n\t\t\t\t$GLOBALS['HideRRP'] = '';\n\n\t\t\t\t// Showing call for pricing, so just show the RRP and that's all\n\t\t\t\tif($this->productClass->GetProductCallForPricingLabel()) {\n\t\t\t\t\t$GLOBALS['RetailPrice'] = CurrencyConvertFormatPrice($retailPrice);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// ISC-1057: do not apply customer discount to RRP in this case\n\t\t\t\t\t$retailPrice = formatProductPrice($product, $product['prodretailprice'], array(\n\t\t\t\t\t\t'localeFormat' => false,\n\t\t\t\t\t\t'displayInclusive' => $displayFormat,\n\t\t\t\t\t\t'customerGroup' => 0,\n\t\t\t\t\t));\n\t\t\t\t\t$GLOBALS['RetailPrice'] = '<strike>' . formatPrice($retailPrice) . '</strike>';\n\t\t\t\t\t$GLOBALS['PriceLabel'] = GetLang('YourPrice');\n\t\t\t\t\t$savings = $retailPrice - $productPrice;\n\t\t\t\t\t$string = sprintf(getLang('YouSave'), '<span class=\"YouSaveAmount\">'.formatPrice($savings).'</span>');\n\t\t\t\t\t$GLOBALS['YouSave'] = '<span class=\"YouSave\">'.$string.'</span>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setProdPriceId($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_price_id !== $v) {\n $this->prod_price_id = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_PRICE_ID] = true;\n }\n\n if ($this->aTblProdPricing !== null && $this->aTblProdPricing->getProdPriceId() !== $v) {\n $this->aTblProdPricing = null;\n }\n\n return $this;\n }",
"public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }",
"public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }",
"public function setPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we){\n\t\t\n\t\tif ($this->isPricing($id_ressource, $id_pricing)){\n\t\t\t$this->editPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t\telse{\n\t\t\t$this->addPricing($id_ressource, $id_pricing, $price_day, $price_night, $price_we);\n\t\t}\n\t}",
"public function subsidiary(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = subsidiary_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Subsidiary::class);\n\t}",
"public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }",
"public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getTblProdPrices(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {\n $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPrices->setTblProdInfo($this);\n }\n\n return $this->aTblProdPrices;\n }",
"public function prices(){\n \t return this->belongsToMany('App\\prices','price_service_time');\n }",
"public function productPrices()\n {\n return $this->belongsToMany(ProductPrice::class, 'product_prices', null, 'product_id');\n }",
"public function joinPricingRule();",
"public function coupon_product()\n {\n return $this->belongsTo(Coupon_product::class);\n }",
"public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }",
"function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}",
"public function instancePricing(string $instance_id, Pricing $pricing): QueryInterface;",
"public function CommercialComprehensiveBelongsToCommercialClass()\n {\n return $this->belongsTo('App\\MotorInsuranceModels\\CommercialVehicles\\CommercialClass', 'commercial_class_id', 'id');\n }",
"public function priceLists()\n {\n return $this->hasOne('App\\Models\\PriceList');\n }",
"public function product()\n {\n \t// belongsTo(RelatedModel, foreignKey = p_id, keyOnRelatedModel = id)\n \treturn $this->belongsTo('App\\Product','p_id','p_id');\n }"
]
| [
"0.5932853",
"0.589223",
"0.57133454",
"0.56799984",
"0.55095327",
"0.5463812",
"0.5450568",
"0.5410425",
"0.52214575",
"0.51516396",
"0.5081539",
"0.5068964",
"0.503356",
"0.4991991",
"0.49831095",
"0.4912381",
"0.4882917",
"0.487314",
"0.4843328",
"0.4822642",
"0.48085475",
"0.47920847",
"0.47902662",
"0.47901443",
"0.47868198",
"0.47812504",
"0.47785068",
"0.4776877",
"0.47509754",
"0.47400898"
]
| 0.7180729 | 0 |
Get the associated ChildTblProdPricing object | public function getTblProdPricing(ConnectionInterface $con = null)
{
if ($this->aTblProdPricing === null && ($this->prod_price_id !== null)) {
$this->aTblProdPricing = ChildTblProdPricingQuery::create()->findPk($this->prod_price_id, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aTblProdPricing->addTblProdInfos($this);
*/
}
return $this->aTblProdPricing;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPricing() {\r\n\t\t\treturn $this->_pricing;\r\n\t\t}",
"public function setTblProdPricing(ChildTblProdPricing $v = null)\n {\n if ($v === null) {\n $this->setProdPriceId(NULL);\n } else {\n $this->setProdPriceId($v->getProdPriceId());\n }\n\n $this->aTblProdPricing = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblProdPricing object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function productPrice(){\n\t\treturn $this->hasOne('App\\ProductPrices','product_id');\n\t}",
"public function getTblProdPrices(ConnectionInterface $con = null)\n {\n if ($this->aTblProdPrices === null && ($this->prod_id !== null)) {\n $this->aTblProdPrices = ChildTblProdPricesQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdPrices->setTblProdInfo($this);\n }\n\n return $this->aTblProdPrices;\n }",
"public function Prices(){\n\t\treturn $this->hasMany('App\\ProductPrice','ID_Product');\n\t}",
"public function stockCost(){\n return $this->belongsTo( StockCost::class, 'pj_stock_cost_parent_id' );\n }",
"public function cost(){\n return $this->belongsTo( StockCost::class , 'pj_stock_cost_parent_id' );\n }",
"public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }",
"public function price(){\n return $this->hasMany('App\\Pricebookentry','product2id','sfid');\n }",
"public function getProdPriceId()\n {\n return $this->prod_price_id;\n }",
"public function getPriceProduct()\n {\n return $this->priceProduct;\n }",
"public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}",
"public function getPricing()\n {\n // get current quantity as its the basis for pricing\n $quantity = $this->quantity;\n\n // Get pricing but maintain original unitPrice (only if post-CASS certification quantity drop is less than 10%),\n $adjustments = $this->quantity_adjustment + $this->count_adjustment;\n if ($adjustments < 0) {\n $originalQuantity = 0;\n $originalQuantity = $this->itemAddressFiles()->sum('count');\n $originalQuantity += $this->mail_to_me;\n if ((($originalQuantity + $adjustments) / $originalQuantity) > 0.90) { // (less than 10%)\n $quantity = $originalQuantity;\n }\n }\n\n // Get pricing based on quantity.\n // If quantity is less than minimum quantity required (only if post-CASS certification),\n // then use the minimum quantity required to retrieve pricing\n if ((\n $this->quantity_adjustment != 0 || $this->count_adjustment != 0) &&\n $this->quantity < $this->getMinimumQuantity()\n ) {\n $quantity = $this->getMinimumQuantity();\n }\n\n // Pricing date is based on submission date or now.\n $pricingDate = (!is_null($this->date_submitted) ? $this->date_submitted : time());\n\n if (!is_null($this->product_id) && !is_null($this->product)) {\n $newPricing = $this->product->getPricing(\n $quantity, $pricingDate,\n $this->invoice->getBaseSiteId()\n );\n $oldPricing = $this->getProductPrice();\n // TODO: refactor this pricing history section, it really shouldn't belong in this method\n if (!is_null($newPricing)) {\n $insert = true;\n if (!is_null($oldPricing) && $newPricing->id == $oldPricing->product_price_id) {\n $insert = false;\n }\n if ($insert) {\n try {\n InvoiceItemProductPrice::firstOrCreate(\n [\n 'invoice_item_id' => $this->id,\n 'product_price_id' => $newPricing->id,\n 'date_created' => date('Y-m-d H:i:s', time()),\n 'is_active' => 1\n ]\n );\n } catch (QueryException $e) {\n // TODO: fix this hack (e.g. why do we need integrity constraint on this table )\n if (strpos($e->getMessage(), 'Duplicate entry') === false) {\n throw $e;\n } else {\n Logger::error($e->getMessage());\n }\n }\n\n if (!is_null($oldPricing)) {\n $oldPricing->is_active = 0;\n $oldPricing->save();\n }\n }\n }\n\n return $newPricing;\n }\n if (!is_null($this->data_product_id) && $this->data_product_id != 0) {\n return $this->dataProduct->getPricing($pricingDate, $this->invoice->site_id);\n }\n if (!is_null($this->line_item_id) && $this->line_item_id != 0) {\n return $this->line_item->getPricing($pricingDate, $this->invoice->getBaseSiteId());\n }\n if ($this->isAdHocLineItem() && $this->unit_price) {\n return (object)array('price' => $this->unit_price);\n }\n return null;\n }",
"public function getPricing($service_id) {\n $stmt = $this->conn->prepare(\"SELECT * FROM `pricing` where service_id = ?\");\n $stmt->bind_param(\"i\", $service_id);\n $stmt->execute();\n $pricing = $stmt->get_result();\n $stmt->close();\n return $pricing;\n }",
"public function instancePricing(string $instance_id, Pricing $pricing): QueryInterface;",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function getPricing($data)\n {\n $query = Price::where('sellable_id', '=', (int)$data['sellable_id']);\n $returnData = $query->where('sellable_type', '=', $data['sellable_type'])\n ->get()\n ->toArray();\n if (!empty($returnData)) {\n return $returnData[0];\n } else {\n return null;\n }\n }",
"public function cost()\n {\n return $this->hasOne(CostService::class,\n SchemaConstant::PRIMARY_KEY,\n SchemaConstant::COST_FOREIGN_KEY);\n }",
"private function getModuleClassByPricingId($package_pricing_id)\n {\n if (!isset($this->Record)) {\n Loader::loadComponents($this, ['Record']);\n }\n\n return $this->Record->select(['modules.*', 'packages.id' => 'package_id'])->from('package_pricing')->\n innerJoin('packages', 'packages.id', '=', 'package_pricing.package_id', false)->\n innerJoin('modules', 'modules.id', '=', 'packages.module_id', false)->\n where('package_pricing.id', '=', $package_pricing_id)->\n fetch();\n }",
"public function subsidiary(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = subsidiary_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Subsidiary::class);\n\t}",
"public function getPriceId($id)\n { \n $product = $this->postFactory->create();\n $productPriceById = $product->load($id)->getPrice();\n return $productPriceById;\n }",
"public function product()\n {\n //retorna un solo objeto product, la capacitacion solo tiene un producto\n return $this->belongsTo('Vest\\Tables\\Product');\n }",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getPrice()\n {\n return $this->object->Price;\n }",
"public function getPrice()\n {\n $price_is_tax_inc = \\App\\Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n $price = $price_is_tax_inc ? \n $this->price_tax_inc :\n $this->price ;\n\n $priceObject = new \\App\\Price( $price, $price_is_tax_inc, \\App\\Context::getContext()->currency, \\App\\Context::getContext()->currency->conversion_rate);\n\n return $priceObject;\n }"
]
| [
"0.6585547",
"0.64412904",
"0.6298926",
"0.628615",
"0.6239225",
"0.62340397",
"0.61298776",
"0.61049235",
"0.60788137",
"0.59433645",
"0.59053785",
"0.5872398",
"0.58614546",
"0.5850542",
"0.57735664",
"0.56533194",
"0.56014764",
"0.5586905",
"0.55719686",
"0.5564868",
"0.55628353",
"0.5500416",
"0.54838395",
"0.5483212",
"0.5477757",
"0.5477757",
"0.5477757",
"0.5477757",
"0.5458603",
"0.5444041"
]
| 0.7456949 | 0 |
Declares an association between this object and a ChildTblProdSmaller object. | public function setTblProdSmaller(ChildTblProdSmaller $v = null)
{
if ($v === null) {
$this->setProdId(NULL);
} else {
$this->setProdId($v->getProdId());
}
$this->aTblProdSmaller = $v;
// Add binding for other direction of this 1:1 relationship.
if ($v !== null) {
$v->setTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTblProdSmaller(ConnectionInterface $con = null)\n {\n if ($this->aTblProdSmaller === null && ($this->prod_id !== null)) {\n $this->aTblProdSmaller = ChildTblProdSmallerQuery::create()->findPk($this->prod_id, $con);\n // Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.\n $this->aTblProdSmaller->setTblProdInfo($this);\n }\n\n return $this->aTblProdSmaller;\n }",
"public function initialize()\n {\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('Cd_produto', 'App\\Models\\Produto', 'cd_produto', array('foreignKey' => true,'alias' => 'Produto'));\n }",
"public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }",
"public function __construct()\n {\n $this->table = 'products';\n $this->primary_key = 'id';\n \n $this->has_many['pictures'] = array(\n 'foreign_model' => 'Pictures_model',\n 'foreign_table' => 'pictures',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n \n $this->has_many['options'] = array(\n 'foreign_model' => 'Product_options_model',\n 'foreign_table' => 'product_options',\n 'foreign_key' => 'product_id',\n 'local_key' => 'id'\n );\n\n \n \n parent::__construct();\n }",
"public function __construct()\n\t{\n\t\t$this->has_one['product'] = array('Products_m', 'id', 'product_id');\n\t\t// $this->soft_deletes = TRUE;\n\t\tparent::__construct();\n\t}",
"public function initialize()\n {\n\t\t$this->belongsTo('sfafba_partner_id', 'SfAffiliationPartener', 'sfafpa_id', array('alias' => 'sf_affiliation_partener_partner_id'));\n\n parent::initialize();\n }",
"public function toForeignKey($primaryTable = null, $foreignKey = null, $onDelete = \"CASCADE\", $onUpdate = \"CASCADE\") {\n parent::toForeignKey($primaryTable, $foreignKey, $onDelete, $onUpdate);\n \n if($foreignKey == null) {\n $foreignKey = $this->_currentColumn;\n }\n\n if($primaryTable == null) {\n $otherTableName = explode(\"_\", $foreignKey);\n $otherTableName = $otherTableName[0];\n $primaryTable = $otherTableName;\n }\n\n $class = ucfirst(strtolower($this->_currentTable));\n $secondClass = ucfirst(strtolower($primaryTable));\n\n $this->addClass($class);\n $this->addClass($secondClass);\n \n $column = substr($this->_currentColumn, 0, strlen($this->_currentColumn) - 3);\n\n if($class == $secondClass) {\n \n $belongsToName = \"parent\";\n $hasManyName = \"children\";\n \n \n if($this->_currentColumn == \"instance_id\") {\n $belongsToName = \"instance\";\n $hasManyName = \"revisions\";\n }\n \n \n $belongsTo = array($belongsToName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $hasMany = array($hasManyName, \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n if($hasManyName == \"revisions\") {\n // if it's a revision relationship sort by revision\n $hasMany[\"order\"] = \"revision desc\";\n } elseif($this->columnExist($this->_currentTable, \"position\")) {\n // if there is a column position sort by this column\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$class][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$class][\"has_many\"]);\n } else {\n \n $belongsTo = array(substr($foreignKey, 0, -3), \"class_name\" => $this->_modelNamespace.$secondClass, \"foreign_key\" => $this->_currentColumn);\n $this->_classes[$class][\"belongs_to\"][] = $belongsTo;\n \n $primaryColumnName = explode(\"_\", $this->_currentTable);\n array_shift($primaryColumnName);\n $primaryColumnName = join(\"_\", $primaryColumnName);\n \n $hasMany = array($primaryColumnName.\"s\", \"class_name\" => $this->_modelNamespace.$class, \"foreign_key\" => $this->_currentColumn);\n \n if($this->columnExist($this->_currentTable, \"position\")) {\n $hasMany[\"order\"] = \"position asc\";\n }\n \n $this->_classes[$secondClass][\"has_many\"][] = $hasMany;\n \n self::makeArrayUnique($this->_classes[$class][\"belongs_to\"]);\n self::makeArrayUnique($this->_classes[$secondClass][\"has_many\"]);\n }\n\n // fluent interface\n return $this;\n }",
"public function setParent(self $parent, string $parentAssociationMapping): void;",
"public function addProductInfo()\n {\n $attribute = $this->attributeRepository->get('name');\n\n $this->getSelect()->joinLeft(\n ['product_table' => $this->getTable('catalog_product_entity_varchar')],\n \"main_table.product_id = product_table.entity_id AND product_table.store_id = 0\",['product_name' => 'product_table.value']\n )->where('product_table.attribute_id = ?', $attribute->getAttributeId());\n\n return $this;\n }",
"public function packageProductRelations()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SellerProductRelation','sp_id','sp_id');\n }",
"public function initialize()\n {\n $this->setSchema(\"atiempo_prod\");\n $this->hasMany('id', 'AcCartaAvalDetalle', 'id_carta', ['alias' => 'AcCartaAvalDetalle']);\n }",
"public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"product_category\");\n $this->hasMany('id', 'App\\Models\\Product', 'product_category_id', ['alias' => 'Product']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }",
"public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }",
"public function product()\n {\n return $this->belongsTo(BaseProduct::class);\n }",
"public function productSellers(){\n return $this->hasMany(\"App\\Product_Seller\", \"id_seller\");\n }",
"public function buildRelations()\n {\n $this->addRelation('Marca', 'Marca', RelationMap::MANY_TO_ONE, array('idmarca' => 'idmarca', ), 'CASCADE', 'CASCADE');\n $this->addRelation('Proveedor', 'Proveedor', RelationMap::MANY_TO_ONE, array('idproveedor' => 'idproveedor', ), 'CASCADE', 'CASCADE');\n }",
"public function defineRelations()\n {\n return array(\n 'product' => array(static::BELONGS_TO, 'Commerce_ProductRecord', 'required' => true, 'onDelete'=> static::CASCADE),\n 'wishlist' => array(static::BELONGS_TO, 'WishlistRecord', 'required' => true, 'onDelete'=> static::CASCADE)\n );\n }",
"function ajouteProdToRub() { \r\n\t\tglobal $R0;\r\n\t\tlist($table,$tableRel,$tableProd,$relRubId_rubId,$relProdId_prodId,$catTitre,$prodTitre) = explode(':',$R0['childRel']);\r\n\t\tlist($relRubId,$rubId) = explode('=',$relRubId_rubId);\r\n\t\tlist($relProdId,$prodId) = explode('=',$relProdId_prodId);\r\n\r\n\t\t$C = new SQL($tableRel);\r\n\t\t$champs = array(array($relRubId,$relProdId,'ordre'),array($this->rub_id,intval($_POST[$prodId]),'999')); // Array champsName // Array champsVal\r\n\t\t$C->insertSql($champs,1);\r\n\t\t$this->info = 'ajout';\r\n\t}",
"public function initialize()\n {\n $this->belongsTo('cons_order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n $this->belongsTo('order_id', '\\Orders', 'id', array('alias' => 'Orders'));\n }",
"public function primaryProduct() : object\n {\n return $this->hasOne(Species::class, 'id');\n }",
"PUBLIC function Proveedor(){\n return $this->belongsto('App\\Models\\proveedor','id');\n }",
"public function joinProduct($classId);",
"public function product(): BelongsTo\n {\n return $this->belongsTo(Product::class, 'id_product', 'id_product');\n }",
"function createProduct($parent = null);",
"public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }",
"public function initialize()\n {\n $this->hasMany('cd_desconto', 'App\\Models\\PdvVendasHasItens', 'cd_desconto', array('alias' => 'PdvVendasHasItens'));\n $this->belongsTo('cd_caixa', 'App\\Models\\PdvCaixa', 'cd_caixa', array('alias' => 'PdvCaixa'));\n $this->belongsTo('cd_produto', 'App\\Models\\Produto', 'cd_produto', array('alias' => 'Produto'));\n $this->belongsTo('cd_unidade_negocio', 'App\\Models\\UnidadeNegocio', 'cd_unidade', array('alias' => 'UnidadeNegocio'));\n $this->belongsTo('cd_usuario_criacao', 'App\\Models\\Usuario', 'cd_usuario', array('alias' => 'Usuario'));\n }",
"public function productDetail()\n {\n return $this->belongsTo(ProductDetail::class);\n }",
"public function initialize()\n {\n $this->setSchema(\"ieslluis_gestiovfc\");\n $this->setSource(\"lines_comandes\");\n $this->hasMany('ncomanda', 'Comandes', 'numero', ['alias' => 'Comandes']);\n $this->hasMany('producte', 'Productes', 'codi', ['alias' => 'Productes']);\n }",
"public function autoProductDivision()\n {\n // hasOne(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasOne('App\\AutoProductDivision','sp_id','sp_id');\n }",
"public function belongsToMany($class, $joinTable = null, $localForeignKey = null, $otherForeignKey = null, $localKey = null, $otherKey = null);"
]
| [
"0.5755038",
"0.54846007",
"0.5314013",
"0.53102195",
"0.51196",
"0.51009697",
"0.50886047",
"0.49849883",
"0.4979125",
"0.4959543",
"0.49168986",
"0.48226443",
"0.48084807",
"0.47947544",
"0.47486645",
"0.47406623",
"0.47361344",
"0.47281274",
"0.4702288",
"0.46898404",
"0.4685568",
"0.4682122",
"0.4652987",
"0.46504796",
"0.46409628",
"0.46402404",
"0.46386582",
"0.46336344",
"0.4632392",
"0.46322215"
]
| 0.6833271 | 0 |
Get the associated ChildTblProdSmaller object | public function getTblProdSmaller(ConnectionInterface $con = null)
{
if ($this->aTblProdSmaller === null && ($this->prod_id !== null)) {
$this->aTblProdSmaller = ChildTblProdSmallerQuery::create()->findPk($this->prod_id, $con);
// Because this foreign key represents a one-to-one relationship, we will create a bi-directional association.
$this->aTblProdSmaller->setTblProdInfo($this);
}
return $this->aTblProdSmaller;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTblProdSmaller(ChildTblProdSmaller $v = null)\n {\n if ($v === null) {\n $this->setProdId(NULL);\n } else {\n $this->setProdId($v->getProdId());\n }\n\n $this->aTblProdSmaller = $v;\n\n // Add binding for other direction of this 1:1 relationship.\n if ($v !== null) {\n $v->setTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function getProdRelated()\n {\n return $this->prod_related;\n }",
"public function getParentItemfromDatabase()\n {\n $dataTableName = Data::mapDataType($this->parentType);\n\n\n $dataTable = new $dataTableName();\n\n $parentItem = $this->parentItem = $dataTable->find($this->parentId)->current();\n return $parentItem;\n }",
"public function product_detail()\n {\n return $this->has_one('Product_Detail');\n }",
"function get_child_product($entity_id)\n\t{\n\t\t$relTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_relation');\n\t\t$sql = \"SELECT child_id FROM `\" . $relTable . \"`\n\t\t\t\t\t\tWHERE parent_id = '\" . (int) $entity_id . \"'\";\n\t\t$prods = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\tif ($prods) {\n\t\t\treturn $prods;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getProduct()\r\n {\r\n return $this->item->getParentObject()->getProduct();\r\n }",
"public function getProdRelated2()\n {\n return $this->prod_related2;\n }",
"public function primaryProduct() : object\n {\n return $this->hasOne(Species::class, 'id');\n }",
"public function GetItem()\r\n\t{\r\n\t\treturn $this->_phreezer->GetManyToOne($this, \"fk_reference_item1\");\r\n\t}",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getProduct()\n {\n return $this->hasOne(Product::className(), ['id' => 'product_id']);\n }",
"public function getParentProductByChildId($ChildProdId)\n {\n $ParentProdArr = DB::table($this->DBTables['Group_Products'] . ' as GP')\n ->join($this->DBTables['Products'] . ' as P', 'GP.parent_productid', '=', 'P.id')\n ->where('P.disable', '=', 0)\n ->where('GP.product_id', '=', (int)$ChildProdId)\n ->select('P.*')\n ->get();\n\n return $ParentProdArr;\n }",
"public function getChildProducts(Product $parent);",
"public function getProduct() {\n return $this->getValueOrDefault('Product');\n }",
"function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }",
"public function product() {\n return $this->morphTo();\n }",
"public function getProduct0()\n {\n return $this->hasOne(Products::className(), ['id' => 'product']);\n }",
"function getClassroomRelatedByClassroomId() {\n\t\t$fk_value = $this->getclassroom_id();\n\t\tif (null === $fk_value) {\n\t\t\treturn null;\n\t\t}\n\t\treturn Classroom::retrieveByPK($fk_value);\n\t}",
"public function get_parent();",
"public function getProducts() {\n return $this->hasMany(Product::className(), ['brand_id' => 'id']); // second param - field in dependent table\n }",
"function get_parent() {\n return $this->get_mapped_property('parent');\n }",
"public function product()\n {\n return $this->m_product;\n }",
"public function getGrandParent();",
"public static function loadProductByProId($p_proId)\n {\n $sql = \"select * from products where ProID = $p_proId\";\n $list = DataProviderMain::execQuery($sql);\n if ($row = mysqli_fetch_array($list)) {\n\n //$proId = $row[\"ProID\"];\n //$proId = $p_proId;\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($p_proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n return $p;\n }\n\n return NULL;\n }",
"public function productDetail()\n {\n return $this->belongsTo(ProductDetail::class);\n }",
"function Product() {\r\n\t\treturn $this->owner;\r\n\t}",
"protected function retrieveParent()\n {\n }",
"public function getChild()\n {\n return $this->child;\n }"
]
| [
"0.63195765",
"0.58784056",
"0.55714196",
"0.5557377",
"0.55366707",
"0.55361897",
"0.537516",
"0.5317671",
"0.5232316",
"0.5226625",
"0.5226625",
"0.5226625",
"0.5226625",
"0.522193",
"0.5190114",
"0.51654303",
"0.5153909",
"0.5153823",
"0.5143266",
"0.5140183",
"0.51077807",
"0.50969785",
"0.5088534",
"0.50826865",
"0.50705713",
"0.50595826",
"0.5059423",
"0.50487447",
"0.5045477",
"0.5032566"
]
| 0.73373497 | 0 |
Declares an association between this object and a ChildTblShippingCategories object. | public function setTblShippingCategories(ChildTblShippingCategories $v = null)
{
if ($v === null) {
$this->setProdCategoryShipping(NULL);
} else {
$this->setProdCategoryShipping($v->getProdShippingPriceId());
}
$this->aTblShippingCategories = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the ChildTblShippingCategories object, it will not be re-added.
if ($v !== null) {
$v->addTblProdInfo($this);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getShippingCategoryId();",
"public function getTblShippingCategories(ConnectionInterface $con = null)\n {\n if ($this->aTblShippingCategories === null && ($this->prod_category_shipping !== null)) {\n $this->aTblShippingCategories = ChildTblShippingCategoriesQuery::create()->findPk($this->prod_category_shipping, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aTblShippingCategories->addTblProdInfos($this);\n */\n }\n\n return $this->aTblShippingCategories;\n }",
"public function order_shipping()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesShipping', 'sales_order_id', 'id');\n }",
"public function getProdCategoryShipping()\n {\n return $this->prod_category_shipping;\n }",
"public function setProdCategoryShipping($v)\n {\n if ($v !== null) {\n $v = (int) $v;\n }\n\n if ($this->prod_category_shipping !== $v) {\n $this->prod_category_shipping = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_CATEGORY_SHIPPING] = true;\n }\n\n if ($this->aTblShippingCategories !== null && $this->aTblShippingCategories->getProdShippingPriceId() !== $v) {\n $this->aTblShippingCategories = null;\n }\n\n return $this;\n }",
"public function SPShippings()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\SPShipping','sp_id','sp_id');\n }",
"public function shipping(): BelongsTo\n {\n return $this->belongsTo(Shipping::class)->withDefault(function($shipping){\n $shipping->sameAsBilling($this->user->customer);\n });\n }",
"public function setShipping($shipping);",
"public function shippingMethod()\n {\n return $this->belongsTo('App\\ShippingMethod');\n }",
"public function shippingMethod()\n {\n return $this->belongsTo('ShippingMethod');\n }",
"public function shippingMethod()\n {\n return $this->belongsTo(ShippingMethod::class);\n }",
"public function shippingMethod()\n {\n return $this->belongsTo('App\\Models\\ShippingMethod', 'shipping_id', 'id');\n }",
"public function gETShipmentIdShippingCategoryRequest($shipment_id)\n {\n // verify the required parameter 'shipment_id' is set\n if ($shipment_id === null || (is_array($shipment_id) && count($shipment_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipment_id when calling gETShipmentIdShippingCategory'\n );\n }\n\n $resourcePath = '/shipments/{shipmentId}/shipping_category';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipment_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shipmentId' . '}',\n ObjectSerializer::toPathValue($shipment_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function shipping(): HasOne\n {\n return $this->hasOne(StripeCustomerShippingDetails::class);\n }",
"public function setShipping($shipping)\r\n {\r\n $this->shipping = $shipping;\r\n\r\n return $this;\r\n }",
"public function gETSkuIdShippingCategoryRequest($sku_id)\n {\n // verify the required parameter 'sku_id' is set\n if ($sku_id === null || (is_array($sku_id) && count($sku_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $sku_id when calling gETSkuIdShippingCategory'\n );\n }\n\n $resourcePath = '/skus/{skuId}/shipping_category';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($sku_id !== null) {\n $resourcePath = str_replace(\n '{' . 'skuId' . '}',\n ObjectSerializer::toPathValue($sku_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setShipping($shippingAddress)\n {\n $this->_shipping['Name'] = $shippingAddress['shipping_firstname'].' '.$shippingAddress['shipping_lastname'];\n $this->_shipping['Address'] = array('AddressLine' => $shippingAddress['shipping_address1'].' '.$shippingAddress['shipping_address2'],\n 'City' => $shippingAddress['shipping_city'],\n 'StateProvinceCode' => $shippingAddress['shipping_state'],\n 'PostalCode' => $shippingAddress['shipping_zipcode'],\n 'CountryCode' => $shippingAddress['shipping_country'],\n );\n $this->_shipping['address_id'] = $shippingAddress['address_id'];\n $this->_shipping['contact_phone'] = $shippingAddress['contact_phone'];\n $this->_shipping['contact_email'] = $shippingAddress['contact_email'];\n $this->persist();\n }",
"public function supplierCategories()\n {\n return $this->hasMany(SupplierCategory::class);\n }",
"public function initialize(){\n $this->hasMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\",\n array(\n \"reusable\" => true\n )\n );\n \n $this->hasManyToMany(\n \"category_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Products\", \n \"category\", \n \"vendor_id\", \n \"Multiple\\\\Frontend\\\\Models\\\\Vendor\", \n \"vendor_id\",\n array(\n \"reusable\" => true,\n \"alias\" => \"AliasVendorPro\"\n )\n );\n }",
"public function shippingaddress()\n {\n return $this->belongsTo('App\\Models\\BookAddress','shipping_address_id');\n }",
"public function setShippingCost($shippingCost);",
"public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }",
"public function setShipping($shipping)\n {\n $this->shipping = $shipping;\n }",
"public function RelationBetweenCategory()\n {\n return $this->hasOne('App\\Models\\Category', 'id', 'category_id');\n }",
"public function initialize()\n {\n parent::initialize();\n $this->setSchema(\"salesDB\");\n $this->setSource(\"product_category\");\n $this->hasMany('id', 'App\\Models\\Product', 'product_category_id', ['alias' => 'Product']);\n $this->belongsTo('user_updated', 'App\\Models\\User', 'id', ['alias' => 'UserUpdated']);\n $this->belongsTo('user_created', 'App\\Models\\User', 'id', ['alias' => 'UserCreated']);\n $this->belongsTo('client_id', 'App\\Models\\Client', 'id', ['alias' => 'Client']);\n $this->belongsTo('sync_status_id', 'App\\Models\\SyncStatus', 'id', ['alias' => 'SyncStatus']);\n }",
"public function shippingAddress()\n {\n return $this->belongsTo('App\\Address');\n }",
"public function setShippingType($shippingType)\n {\n $this->shippingType = $shippingType;\n return $this;\n }",
"public function setShipping($shipping)\n {\n $this->shipping = $shipping;\n\n return $this;\n }",
"public function addForeignKeys()\n\t{\n\t\t$table = $this->getTableName();\n\n\t\tforeach ($this->getBelongsToRelations() as $name => $config)\n\t\t{\n\t\t\t$otherModel = new $config[1];\n\t\t\t$otherTable = $otherModel->getTableName();\n\t\t\t$fkName = \"{$table}_{$name}_fk\";\n\n\t\t\tif (isset($config['onDelete']))\n\t\t\t{\n\t\t\t\t$onDelete = $config['onDelete'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (empty($config['required']))\n\t\t\t\t{\n\t\t\t\t\t$onDelete = static::SET_NULL;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$onDelete = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tblx()->db->createCommand()->addForeignKey($fkName, $table, $config[2], $otherTable, 'id', $onDelete);\n\t\t}\n\t}",
"public function shoe_category()\n {\n return $this->hasOne(ShoeCategory::class);\n }"
]
| [
"0.60233307",
"0.585173",
"0.5684485",
"0.5615994",
"0.5429658",
"0.5173888",
"0.5172341",
"0.5149478",
"0.51297504",
"0.5097469",
"0.5013813",
"0.4951383",
"0.49422163",
"0.4922968",
"0.4881246",
"0.48500246",
"0.4848185",
"0.4839036",
"0.48374784",
"0.48279616",
"0.47960475",
"0.4791598",
"0.47858498",
"0.47768998",
"0.4765359",
"0.47632664",
"0.47286004",
"0.47223687",
"0.4713718",
"0.47131324"
]
| 0.69599843 | 0 |
Get the associated ChildTblShippingCategories object | public function getTblShippingCategories(ConnectionInterface $con = null)
{
if ($this->aTblShippingCategories === null && ($this->prod_category_shipping !== null)) {
$this->aTblShippingCategories = ChildTblShippingCategoriesQuery::create()->findPk($this->prod_category_shipping, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aTblShippingCategories->addTblProdInfos($this);
*/
}
return $this->aTblShippingCategories;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getShippingCategoryId();",
"public function getProdCategoryShipping()\n {\n return $this->prod_category_shipping;\n }",
"public function getCategory() {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); // second - field in dependent table\n }",
"public function setTblShippingCategories(ChildTblShippingCategories $v = null)\n {\n if ($v === null) {\n $this->setProdCategoryShipping(NULL);\n } else {\n $this->setProdCategoryShipping($v->getProdShippingPriceId());\n }\n\n $this->aTblShippingCategories = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildTblShippingCategories object, it will not be re-added.\n if ($v !== null) {\n $v->addTblProdInfo($this);\n }\n\n\n return $this;\n }",
"public function order_shipping()\n {\n return $this->hasMany('App\\Models\\Sales\\SalesShipping', 'sales_order_id', 'id');\n }",
"public function getCategory()\n {\n return $this->hasMany(Category::className(), ['category_id' => 'id']);\n }",
"public function getCategory()\n\t\t{\n\t\t\treturn $this->hasOne(Categories::className(), ['id' => 'category_id']);\n\t\t}",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getShipping();",
"public function shippingMethod()\n {\n return $this->belongsTo('ShippingMethod');\n }",
"public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }",
"public function getCategory()\n {\n return $this->hasOne(MgfSelectionCategory::className(), ['id' => 'category_id']);\n }",
"public function getSubtotalShipping()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('shipping', $this->data->amount->subtotals);\n }",
"public function sub_category()\n {\n\n return $this->hasOne(Category::class, 'id', 'sub_categories_id');\n }",
"public function getCategory(){\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getSubCategory(){\n return $this->hasOne(Category::class, 'id','subcategory_id');\n }",
"public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }",
"public function shippingMethod()\n {\n return $this->belongsTo('App\\Models\\ShippingMethod', 'shipping_id', 'id');\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"function getCategory() \n {\n return $this->instance->getCategory();\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function shippingMethod()\n {\n return $this->belongsTo('App\\ShippingMethod');\n }",
"public function getTaxCategoryId();",
"public function Child()\n\t{\n\t\treturn $this->hasMany(Category::class);\n\t}"
]
| [
"0.73087746",
"0.7071618",
"0.60448307",
"0.60062724",
"0.58968705",
"0.5847817",
"0.57620245",
"0.57533",
"0.57533",
"0.57349205",
"0.57349205",
"0.57349205",
"0.566958",
"0.56336474",
"0.56125754",
"0.5608226",
"0.5597498",
"0.5596045",
"0.55864865",
"0.5584981",
"0.55732864",
"0.55285746",
"0.5516021",
"0.54919297",
"0.5490949",
"0.5490949",
"0.5490949",
"0.54797536",
"0.54794586",
"0.5458157"
]
| 0.7219948 | 1 |
Boot real compiled field. Append children to parentroot. | public function create()
{
// Load only root elements.
$this->loadRoots($this->elements, $this->roots);
// Make sure that first element isn't child. If child then throw a exception about that.
if ($this->elements[0]->isChild())
TypeRegression::cantBe('child', 'First');
// Set elements compiled field with relations
$this->makeRelationsToCompiled($this->elements);
// After append process by root-child then compile all stuffs into 'page' field.
foreach ($this->roots as $key => $element) {
$this->page .= $element->compiled;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }",
"private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}",
"function populate() {\n $this->populateInputElements($this->children);\n }",
"protected function buildRenderChildrenClosure() {}",
"public function build()\n {\n $this->classMetadata->appendExtension($this->getExtensionName(), [\n 'groups' => [\n $this->fieldName,\n ],\n ]);\n }",
"protected function buildMainFields()\n {\n $this->meta[static::FIELD_CARRIER_NAME] = [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'componentType' => Fieldset::NAME,\n 'label' => __('%1', 'Carrier Settings'),\n 'collapsible' => true,\n 'opened' => true,\n 'dataScope' => self::DATA_SCOPE_CARRIER,\n 'sortOrder' => 10,\n ],\n ],\n ],\n 'children' => [\n static::FIELD_ENTITY_ID_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Id'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_ENTITY_ID_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 0,\n ],\n ],\n ],\n ],\n static::FIELD_TITLE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Default Title'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_TITLE_NAME,\n 'dataType' => Text::NAME,\n 'sortOrder' => 10,\n 'validation' => [\n 'required-entry' => true,\n ],\n ],\n ],\n ],\n ],\n static::FIELD_IS_ACTIVE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Is Active'),\n 'componentType' => Field::NAME,\n 'formElement' => Checkbox::NAME,\n 'dataScope' => static::FIELD_IS_ACTIVE_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 20,\n 'prefer' => 'toggle',\n 'valueMap' => [\n 'true' => '1',\n 'false' => '0',\n ],\n ],\n ],\n ],\n ],\n static::FIELD_NAME_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('System Name'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_NAME_NAME,\n 'dataType' => Text::NAME,\n 'validation' => [\n 'required-entry' => true,\n ],\n 'sortOrder' => 30,\n ],\n ],\n ],\n ],\n static::FIELD_CARRIER_CODE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Carrier Code'),\n 'componentType' => Field::NAME,\n 'formElement' => Input::NAME,\n 'dataScope' => static::FIELD_CARRIER_CODE_NAME,\n 'dataType' => Text::NAME,\n 'validation' => [\n 'required-entry' => true,\n 'validate-code' => true,\n 'min_text_length' => 1,\n 'max_text_length' => 19\n ],\n 'sortOrder' => 40,\n ],\n ],\n ],\n ],\n static::FIELD_PRICE_NAME => [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Price'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_PRICE_NAME,\n 'dataType' => Number::NAME,\n 'addbefore' => $this->getBaseCurrencySymbol(),\n 'sortOrder' => 50,\n ],\n ],\n ],\n ],\n ],\n ];\n\n return $this->meta;\n }",
"function scaffold_child_init() {\n\tdo_action( 'scaffold_child_init' );\n}",
"public function load() {\n\t\tforeach ($this->childWidgets as $widget) {\n\t\t\tif ($widget->getElement() == null) {\n\t\t\t\tConsole::error($widget);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tDOM::appendChild($this->getElement(), $widget->getElement());\n\t\t\t$widget->load();\n\t\t}\n\t\tparent::load();\n\t}",
"function preinit()\r\n {\r\n //Calls children's init recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->preinit();\r\n }\r\n }",
"protected function buildCoreFields(): void\n {\n //====================================================================//\n // Register Product Configurator\n $this->fieldsFactory()->registerConfigurator(\n \"Address\",\n new AddressConfigurator()\n );\n //====================================================================//\n // Customer\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name(\"Customer\")\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isNotTested()\n ;\n //====================================================================//\n // Country ISO Code\n $this->fieldsFactory()->create(SPL_T_COUNTRY)\n ->identifier(\"country_iso\")\n ->name(\"Country ISO (Code)\")\n ->microData(\"http://schema.org/PostalAddress\", \"addressCountry\")\n ->isRequired()\n ;\n }",
"private function renderExternalSourceFieldTree()\r\n\t{\r\n\t\tglobal $lang;\r\n\t\t\r\n\t\t// HTML\r\n\t\t$html = '';\r\n\t\t\r\n\t\t// Get the external source fields in array format\r\n\t\t$external_fields_all = $this->getExternalSourceFields();\r\n\t\t\r\n\t\t// Get the external id field name\r\n\t\t$external_id_field = '';\r\n\t\tforeach ($external_fields_all as $attr) {\r\n\t\t\tif (isset($attr['identifier']) && $attr['identifier'] == '1') {\r\n\t\t\t\t$external_id_field = $attr['field'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Get the external source fields already mapped in this project\r\n\t\t$external_fields_mapped = $this->getMappedFields();\r\n\t\t\r\n\t\t// Javascript\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t// Get the external id field name\r\n\t\tvar external_id_field = '<?php echo cleanHtml($external_id_field) ?>';\r\n\t\t</script>\r\n\t\t<?php\r\n\t\t// Call javascript file\r\n\t\tcallJSfile('DynamicDataPullMapping.js');\r\n\t\t\r\n\t\t## Collect categories and subcategories into an array\r\n\t\t$categories = array();\r\n\t\tforeach ($external_fields_all as $key=>$attr) \r\n\t\t{\r\n\t\t\t// Set array key as the field name so we can find their attributes faster\r\n\t\t\tunset($external_fields_all[$key]);\r\n\t\t\t$external_fields_all[$attr['field']] = $attr;\r\n\t\t\t\r\n\t\t\t// For those not in a category\r\n\t\t\tif ($attr['category'] == '') {\r\n\t\t\t\t$categories[''][] = $attr['field'];\r\n\t\t\t} \r\n\t\t\t// For those in a category\r\n\t\t\telse {\r\n\t\t\t\tif (!isset($categories[$attr['category']])) $categories[$attr['category']] = array();\r\n\t\t\t\tif ($attr['subcategory'] != '') {\r\n\t\t\t\t\t// Add to subcategory\r\n\t\t\t\t\tif (!isset($categories[$attr['category']][$attr['subcategory']])) $categories[$attr['category']][$attr['subcategory']] = array();\r\n\t\t\t\t\t$categories[$attr['category']][$attr['subcategory']][] = $attr['field'];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Add to category\r\n\t\t\t\t\t$categories[$attr['category']][''][] = $attr['field'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//print_array($categories);\r\n\t\t\r\n\t\t// Loop through categories and subcats and build li/ul html\r\n\t\t$tree = '';\r\n\t\t$num_fields_checked = 0;\r\n\t\tforeach ($categories as $cat=>$catattr) \r\n\t\t{\r\n\t\t\t$cat_html = '';\r\n\t\t\t$num_fields_checked_cat = 0;\r\n\t\t\t// If no cat\r\n\t\t\tif ($cat == '') {\r\n\t\t\t\t// Loop through fields\r\n\t\t\t\tforeach ($catattr as $this_field) {\r\n\t\t\t\t\t$checked = '';\r\n\t\t\t\t\t$div_color = '';\r\n\t\t\t\t\tif ($this_field == $external_id_field || isset($external_fields_mapped[$this_field])) {\r\n\t\t\t\t\t\t$checked = 'checked';\r\n\t\t\t\t\t\t$num_fields_checked++;\r\n\t\t\t\t\t\t$num_fields_checked_cat++;\r\n\t\t\t\t\t\t// Set color for source id field\r\n\t\t\t\t\t\tif ($this_field == $external_id_field) $div_color = 'font-weight:bold;color:#C00000;';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$cat_html .= RCView::div(array('class'=>'extsrcfld', 'style'=>$div_color), \r\n\t\t\t\t\t\t\t\t\tRCView::checkbox(array('name'=>$this_field, 'style'=>'vertical-align:middle;', $checked=>$checked)) .\r\n\t\t\t\t\t\t\t\t\t$this_field . \" (\" . $external_fields_all[$this_field]['label'] . \")\" . RCView::SP . \r\n\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'help', 'title'=>$external_fields_all[$this_field]['description']), '?')\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\t// If in a cat\r\n\t\t\telse {\r\n\t\t\t\t// Loop through subcats\r\n\t\t\t\t$subcat_html = '';\r\n\t\t\t\t// Count subcats\r\n\t\t\t\t$num_subcats = 0;\r\n\t\t\t\tforeach ($catattr as $subcat=>$subcatattr) {\r\n\t\t\t\t\t// Loop through fields\r\n\t\t\t\t\t$subcat_fields_html = '';\r\n\t\t\t\t\t$num_fields_checked_subcat = 0;\r\n\t\t\t\t\tforeach ($subcatattr as $this_field) {\r\n\t\t\t\t\t\t$checked = '';\r\n\t\t\t\t\t\t$div_color = '';\r\n\t\t\t\t\t\tif ($this_field == $external_id_field || isset($external_fields_mapped[$this_field])) {\r\n\t\t\t\t\t\t\t$checked = 'checked';\r\n\t\t\t\t\t\t\t$num_fields_checked++;\r\n\t\t\t\t\t\t\t$num_fields_checked_cat++;\r\n\t\t\t\t\t\t\t$num_fields_checked_subcat++;\r\n\t\t\t\t\t\t\t// Set color for source id field\r\n\t\t\t\t\t\t\tif ($this_field == $external_id_field) $div_color = 'font-weight:bold;color:#C00000;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$subcat_fields_html .= \tRCView::div(array('class'=>'extsrcfld', 'style'=>$div_color), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::checkbox(array('name'=>$this_field, 'style'=>'vertical-align:middle;', $checked=>$checked)) .\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this_field . \" (\" . $external_fields_all[$this_field]['label'] . \") \" . RCView::SP . \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'help', 'title'=>$external_fields_all[$this_field]['description']), '?')\r\n\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//print \"CAT: $cat, SUBCAT: $subcat<br>$subcat_fields_html\";\r\n\t\t\t\t\t// If no subcat\r\n\t\t\t\t\tif ($subcat != '') {\r\n\t\t\t\t\t\t$num_subcats++;\r\n\t\t\t\t\t\t$displaySubcat = ($num_fields_checked_subcat == 0) ? \"\" : \"display:block;\";\r\n\t\t\t\t\t\t$displaySubcatSelectAll = ($num_fields_checked_subcat == 0) ? \"display:none;\" : \"\";\r\n\t\t\t\t\t\t$subcatIcon = ($num_fields_checked_subcat == 0) ? 'expand.png' : 'collapse.png';\r\n\t\t\t\t\t\t$subcat_html .= RCView::div(array('class'=>'rc_ext_subcat_name'), \r\n\t\t\t\t\t\t\t\t\t\t\tRCView::img(array('src'=>$subcatIcon, 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;'), $subcat) .\r\n\t\t\t\t\t\t\t\t\t\t\t// Display \"select all\" link\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'selectalllink', 'style'=>$displaySubcatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;margin-left:25px;'), $lang['ws_35']) .\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::span(array('class'=>'selectalllink_sep', 'style'=>$displaySubcatSelectAll.'color:#aaa;margin:0 5px;'), \"|\") . \r\n\t\t\t\t\t\t\t\t\t\t\t// Display \"deselect all\" link\r\n\t\t\t\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'class'=>'deselectalllink', 'style'=>$displaySubcatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;'), $lang['ws_55'])\r\n\t\t\t\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\t\t\t\tRCView::div(array('class'=>'rc_ext_subcat', 'style'=>$displaySubcat), $subcat_fields_html);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$subcat_html .= $subcat_fields_html;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Render this cat\r\n\t\t\t\t$displayCat = ($num_fields_checked_cat == 0) ? \"\" : \"display:block;\";\r\n\t\t\t\t$displayCatSelectAll = ($num_fields_checked_subcat == 0) ? \"display:none;\" : \"\";\r\n\t\t\t\t$catIcon = ($num_fields_checked_cat == 0) ? 'expand.png' : 'collapse.png';\r\n\t\t\t\t$cat_html .= RCView::div(array('class'=>'rc_ext_cat_name'), \r\n\t\t\t\t\t\t\t\tRCView::img(array('src'=>$catIcon, 'style'=>'vertical-align:middle;')) .\r\n\t\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;'), $cat) .\r\n\t\t\t\t\t\t\t\t// If cat does not have subcats, then display \"select all\" link\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::a(array('href'=>'javascript:;', 'class'=>'selectalllink', 'style'=>$displayCatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;margin-left:25px;'), $lang['ws_35'])) .\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::span(array('class'=>'selectalllink_sep', 'style'=>$displayCatSelectAll.'color:#aaa;margin:0 5px;'), \"|\")) . \r\n\t\t\t\t\t\t\t\t// If cat does not have subcats, then display \"deselect all\" link\r\n\t\t\t\t\t\t\t\t($num_subcats > 0 ? \"\" : RCView::a(array('href'=>'javascript:;', 'class'=>'deselectalllink', 'style'=>$displayCatSelectAll.'font-size:11px;text-decoration:underline;font-weight:normal;'), $lang['ws_55']))\r\n\t\t\t\t\t\t\t ) .\r\n\t\t\t\t\t\t\t RCView::div(array('class'=>'rc_ext_cat', 'style'=>$displayCat), $subcat_html);\r\n\t\t\t}\r\n\t\t\t// Add cat to tree\r\n\t\t\t$tree .= $cat_html;\r\n\t\t}\r\n\t\t\r\n\t\t// Set search textbox for search input\r\n\t\t$searchTextbox = \tRCView::span(array('style'=>'margin:0 0 5px;text-align:right;'), \r\n\t\t\t\t\t\t\t\t\"Filter:\" . \r\n\t\t\t\t\t\t\t\tRCView::text(array('id'=>'source_field_search', 'class'=>'x-form-text x-form-field', 'onkeydown'=>\"if(event.keyCode == 13) return false;\",\r\n\t\t\t\t\t\t\t\t\t'style'=>'margin-left:5px;width:300px;color:#999;', 'value'=>$lang['ws_07'],\r\n\t\t\t\t\t\t\t\t\t'onfocus'=>\"if ($(this).val() == '\".cleanHtml($lang['ws_07']).\"') { $(this).val(''); $(this).css('color','#000'); }\",\r\n\t\t\t\t\t\t\t\t\t'onblur'=>\"$(this).val( trim($(this).val()) ); if ($(this).val() == '') { $(this).val('\".cleanHtml($lang['ws_07']).\"'); $(this).css('color','#999'); }\"\r\n\t\t\t\t\t\t\t\t))\r\n\t\t\t\t\t\t\t);\r\n\t\t\r\n\t\t// Render the div container for the tree\r\n\t\t$html .= RCView::div(array('id'=>'ext_field_tree'),\r\n\t\t\t\t\tRCView::form(array('method'=>'post', 'id'=>'select_mapping_fields', 'action'=>PAGE_FULL.\"?pid=\".$this->project_id, 'enctype'=>'multipart/form-data'),\r\n\t\t\t\t\t\tRCView::div(array('style'=>'font-size:15px;font-weight:bold;padding-bottom:8px;margin-bottom:8px;'),\r\n\t\t\t\t\t\t\t$lang['ws_101']\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('style'=>'margin-bottom:5px;'), $lang['ws_102']) .\r\n\t\t\t\t\t\tRCView::div(array('class'=>'blue', 'style'=>'margin:20px 0 0;'),\r\n\t\t\t\t\t\t\t$lang['ws_34'] . \r\n\t\t\t\t\t\t\tRCView::span(array('id'=>'rc_ext_num_selected2', 'style'=>'font-weight:bold;padding-left:5px;'), \r\n\t\t\t\t\t\t\t\tcount($external_fields_mapped)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::button(array('onclick'=>\"$('#select_mapping_fields').submit();\", \r\n\t\t\t\t\t\t\t\t'class'=>'jqbuttonmed', 'style'=>'margin-left:125px;color:#111;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t$lang['ws_33']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'font-size:12px;margin-left:10px;text-decoration:underline;', \r\n\t\t\t\t\t\t\t\t'onclick'=>\"window.location.href = app_path_webroot+'\".($this->isMappingSetUp() ? \"DynamicDataPull/setup.php\" : \"ProjectSetup/index.php\").\"?pid=\".$this->project_id.\"';\"),\r\n\t\t\t\t\t\t\t\t$lang['global_53']\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\tRCView::div(array('style'=>'margin:25px 0 0;'), \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:left;vertical-align:middle;font-weight:bold;font-size:15px;'), \"Source Fields List\") . \r\n\t\t\t\t\t\t\t\tRCView::div(array('style'=>'float:right;vertical-align:middle;padding-bottom:2px;'), $searchTextbox) . \r\n\t\t\t\t\t\t\t\tRCView::div(array('class'=>'clear'), '')\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('id'=>'ext_field_tree_fields', 'style'=>'clear:both;padding:10px 6px;background-color:#fff;border:1px solid #ccc;'),\r\n\t\t\t\t\t\t\t$tree\r\n\t\t\t\t\t\t) .\r\n\t\t\t\t\t\tRCView::div(array('class'=>'blue', 'style'=>'margin:0 0 20px;'),\r\n\t\t\t\t\t\t\t$lang['ws_34'] . \r\n\t\t\t\t\t\t\tRCView::span(array('id'=>'rc_ext_num_selected', 'style'=>'font-weight:bold;padding-left:5px;'), \r\n\t\t\t\t\t\t\t\tcount($external_fields_mapped)\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::hidden(array('name'=>'select_fields', 'value'=>'1')) .\r\n\t\t\t\t\t\t\tRCView::button(array('onclick'=>\"$('#select_mapping_fields').submit();\", \r\n\t\t\t\t\t\t\t\t'class'=>'jqbuttonmed', 'style'=>'margin-left:125px;color:#111;font-size:13px;'),\r\n\t\t\t\t\t\t\t\t$lang['ws_32']\r\n\t\t\t\t\t\t\t) .\r\n\t\t\t\t\t\t\tRCView::a(array('href'=>'javascript:;', 'style'=>'margin-left:10px;text-decoration:underline;', \r\n\t\t\t\t\t\t\t\t'onclick'=>\"window.location.href = app_path_webroot+'\".($this->isMappingSetUp() ? \"DynamicDataPull/setup.php\" : \"ProjectSetup/index.php\").\"?pid=\".$this->project_id.\"';\"),\r\n\t\t\t\t\t\t\t\t$lang['global_53']\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\r\n\t\t\t\t );\r\n\t\t\t\t\r\n\t\t// Return html\r\n\t\treturn $html;\r\n\t}",
"private function loadSubWidgets()\n {\n $subWidgets = [];\n // get widgets for the fields\n foreach ($this->fields as $index => $field) :\n $subWidgets[$index] = $field->widget;\n endforeach;\n\n $this->widget->setSubWidgets($subWidgets);\n }",
"protected function renderThenChild() {}",
"public function beforeSave()\n {\n $this->rebuildTree();\n }",
"public function setup()\n {\n parent::setup();\n \n $formClass = $this->getChildFormClass();\n $collection = $this->getParentObject()->{$this->getRelationAlias()};\n $nbChilds = 0;\n $min = $this->getMinNbChilds();\n $max = $this->getMaxNbChilds();\n \n if ($min > $max && $max > 0)\n throw new RuntimeException('min cannot be greater than max.');\n \n // embed forms for each child element that is already persisted\n foreach ($collection as $childObject)\n {\n $form = new $formClass($childObject);\n $pk = $childObject->identifier();\n \n if ($childObject->exists() === false)\n throw new RuntimeException('Transient child objects are not supported.');\n \n if (count($pk) !== 1)\n throw new RuntimeException('Composite primary keys are not supported.');\n \n $this->embedForm(self::PERSISTENT_PREFIX.reset($pk), $form);\n $nbChilds += 1;\n }\n \n // embed as many additional forms as are needed to reach the minimum\n // number of required child objects\n for (; $nbChilds < $min; $nbChilds += 1)\n {\n $form = new $formClass($collection->get(null));\n $this->embedForm(self::TRANSIENT_PREFIX.$nbChilds, $form);\n }\n \n $this->validatorSchema->setPostValidator(new sfValidatorCallback(array(\n 'callback' => array($this, 'validateLogic'),\n )));\n }",
"protected function addElements() \n { \n // Add \"nom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'nom_parent',\n 'attributes' => [\n 'id' => 'nom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Nom de famille:',\n ],\n ]);\n \n // Add \"prenom\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'prenom_parent',\n 'attributes' => [\n 'id' => 'prenom_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Prénom parent:',\n ],\n ]);\n \n // Add \"domicile\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'domicile',\n 'attributes' => [\n 'id' => 'domicile',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'Domicile:',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone1',\n 'attributes' => [\n 'id' => 'telephone1'\n ],\n 'options' => [\n 'label' => 'Téléphone 1',\n ],\n ]);\n \n // Add \"telephone_number\" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'telephone2',\n 'attributes' => [\n 'id' => 'telephone2'\n ],\n 'options' => [\n 'label' => 'Téléphone 2',\n ],\n ]);\n \n // Add \"code eleve \" field\n $this->add([ \n 'type' => 'text',\n 'name' => 'email_parent',\n 'attributes' => [\n 'id' => 'email_parent',\n 'style' => 'width: 50%'\n ],\n 'options' => [\n 'label' => 'E-mail:',\n ],\n ]);\n \n // Add \"comment\" field\n $this->add([ \n 'type' => 'textarea',\n 'name' => 'commentaire',\n 'options' =>[\n 'label' => 'Commentaires:',\n ],\n 'attributes' => [\n 'id' => 'commentaire',\n 'style' => 'width: 50%'\n ], \n ]);\n \n // Add the submit button\n $this->add([\n 'type' => 'submit',\n 'name' => 'submit',\n 'attributes' => [ \n 'value' => 'Enregistrer',\n 'id' => 'submitbutton',\n ],\n ]); \n \n }",
"protected function resolveChildren()\n {\n foreach ($this->unresolvedChildren as $name => $info) {\n $this->children[$name] = $this->create($name, $info['type'], $info['init_options'], $info['exec_options']);\n }\n\n $this->unresolvedChildren = array();\n }",
"public function buildElement() {\n\n // Set the element type\n $this->addType('example');\n\n // Add the element attributes\n $this->addAttributes(array(\n // Some attributes\n ));\n\n // Example if we need to add child object\n // to this element\n $object = new VTCore_Form_Base();\n $object->addType('example_child');\n $object->addAttributes(array(\n // Some Attributes\n ));\n\n // Adding a plaing text as child of subchild\n $object->addText('some text');\n\n // Inject the child and subchild back to parent\n $this->addChildren($object);\n\n // No need to echo or print anything, all the\n // actual rendering will be performed by\n // VTCore_Form_Base() when user is invoking\n // the render or __toString method.\n }",
"function createChildrenRecursive() {\n $this->CreateChildControls();\n if ($this->HasControls()) {\n $keys = array_keys($this->Controls);\n $count = count($this->Controls);\n for ($i = 0; $i < $count; $i++) {\n @$control = &$this->Controls[$keys[$i]];\n $control->createChildrenRecursive();\n }\n }\n $this->initChildrenRecursive();\n }",
"protected function buildCoreFields(): void\n {\n //====================================================================//\n // Reference\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->identifier(\"increment_id\")\n ->name('Reference')\n ->microData(\"http://schema.org/Invoice\", \"confirmationNumber\")\n ->isReadOnly()\n ->isListed()\n ;\n //====================================================================//\n // Customer Object\n $this->fieldsFactory()->create((string) self::objects()->encode(\"ThirdParty\", SPL_T_ID))\n ->identifier(\"customer_id\")\n ->name('Customer')\n ->microData(\"http://schema.org/Organization\", \"ID\")\n ->isRequired()\n ->isReadOnly()\n ;\n //====================================================================//\n // Customer Email\n $this->fieldsFactory()->create(SPL_T_EMAIL)\n ->identifier(\"customer_email\")\n ->name(\"Email du contact\")\n ->microData(\"http://schema.org/ContactPoint\", \"email\")\n ->isReadOnly()\n ;\n //====================================================================//\n // Order Date\n $this->fieldsFactory()->create(SPL_T_DATETIME)\n ->identifier(\"created_at\")\n ->name(\"Date\")\n ->microData(\"http://schema.org/DataFeedItem\", \"dateCreated\")\n ->isReadOnly()\n ->isListed()\n ;\n }",
"public function render_admin_form_children() {\n\t\tforeach ( array_keys( bp_xprofile_get_field_types() ) as $field_type ) {\n\t\t\t$type_obj = bp_xprofile_create_field_type( $field_type );\n\t\t\t$type_obj->admin_new_field_html( $this );\n\t\t}\n\t}",
"protected function _seed_extend($array, $parent=0, $parent_field='parent', $filter_fn=NULL){\r\n if (!$this->_table_name){\r\n exit;\r\n }\r\n \r\n if (!isset($this->db)){\r\n $this->load->database();\r\n }\r\n \r\n for ($i=0; $i<count($array); $i++){\r\n $array[$i][$parent_field] = $parent;\r\n $parent_id = $this->_insert($array[$i], $filter_fn);\r\n if (isset($array[$i]['children'])&&count($array[$i]['children'])){\r\n $this->_seed_extend($array[$i]['children'], $parent_id, $parent_field);\r\n }\r\n }\r\n }",
"public function buildLightbox(){\n\n\t\t$fields = $this->getFields();\n\n\t\techo '<div class=\"main-content\">';\n\t\t\n\t\t\tforeach( $fields as $field ){\n\n\t\t\t\t$field->render();\n\n\t\t\t\tif( method_exists( $field, 'renderTemplate' ) )\n\t\t\t\t\techo $field->renderTemplate();\n\n\t\t\t}\n\n\t\techo '</div>';\n\t\techo '<div class=\"side-content\">';\n\t\t\t\n\t\t\t$this->saveButton();\n\n\t\techo '</div>';\n\t}",
"public function createNestedPagesAndCopyLiveParentPage() {}",
"public function build_tree(isys_component_tree $p_tree, $p_system_module = true, $p_parent = null)\n {\n ;\n }",
"function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function initializeTreeData() {}",
"public function initializeTreeData() {}",
"protected function _Add_Child_Fields($container_instance) {\r\n\t\t$form_instance = $this->form_instance;\r\n // Retrieve the container's children\r\n $el_children = $container_instance->el_children; \r\n // If no shortcodes were returned\r\n if (!$el_children || !is_array($el_children)) { return; } \r\n // Loop through each shortcode\r\n foreach ($el_children as $k => $el) {\r\n // If this is not a tag\r\n if (!$el->is_tag || !$el->tag) { continue; }\r\n // Retrieve the attributes\r\n $_attributes = $el->attributes;\r\n // If no machine code, move on\r\n if (!isset($_attributes['machine_code'])) { continue; }\r\n // Retrieve the field instance\r\n $field_instance = $form_instance->Get_Field($_attributes['machine_code']);\r\n // If no field instance was returned\r\n if (!$field_instance) { continue; } \r\n // Add the field instance to the container\r\n $container_instance->Add_Field($field_instance);\r\n // Do any create actions\r\n $container_instance->Do_Action('add_field',array('field_instance' => $field_instance));\r\n // Do a wordpress hook\r\n do_action('vcff_container_add_field',$container_instance,$field_instance);\r\n }\r\n }",
"private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }"
]
| [
"0.6045651",
"0.55777663",
"0.5562814",
"0.5558915",
"0.5379437",
"0.5373707",
"0.5341585",
"0.5324784",
"0.5294674",
"0.52686405",
"0.52046895",
"0.51608795",
"0.5156325",
"0.5151352",
"0.5129063",
"0.5098962",
"0.5073758",
"0.5071496",
"0.50700426",
"0.5050326",
"0.50502783",
"0.50250304",
"0.50063235",
"0.50057524",
"0.50034314",
"0.49902084",
"0.49872857",
"0.49872857",
"0.49869883",
"0.49801192"
]
| 0.57103914 | 1 |
Main Function set the hole game as long as the game status is true keep playing function validate max moves on board , user selection , full column.... in case of a winning players will recive a win message that print in the console | public function startPlay(){
$this->selectPlayer();
$this->board->printBoard();
while(!$this->gameOver){
//check if board is full
if($this->reachedMaxMoves() || $this->validateIsFullBoard()){
noWinningMsg($this->currentPlayer);
$this->gameOver = true;
break;
}
// set board with table
$userMove = $this->selectMove();
//in case that column is not full
if(!$this->validateIsFullColumn($userMove)){
$this->insertMoveToBoard($userMove);
$this->winCheck($userMove);
$this->switchPlayer();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }",
"function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}",
"function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}",
"function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}",
"function setPiece($col){\n\t\t$gameId = getCurrentGameIdFromPlayerId();\n\t\tif(!$gameId['currentGameId']){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting currentGameId of player\");\n\t\t}\n\t\n\t\t$gameId = $gameId['currentGameId'];\n\t\t$game = getCurrentGame($gameId);\n\t\tif(!$game){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error getting current game of player\");\n\t\t}\n\t\t\n\t\t//check if player is on turn\n\t\tif($game['nextTurn'] != $_SESSION['playerId']){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"its not your turn\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\t$board = json_decode($game['board']);\n\t\tfor($i = -1;$i<count($board)-1;$i++){\n\t\t\tif($board[$i+1][$col]!=0){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif($i==-1){\n\t\t\thttp_response_code(409);\n\t\t\tdie(\"column is full\");\n\t\t}\n\t\t\n\t\t//set piece on board\n\t\tif($game['player1']==$_SESSION['playerId']){\n\t\t\t$nextTurnPlayer = $game['player2'];\n\t\t\t$playerNumber = 1;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}else{\n\t\t\t$nextTurnPlayer = $game['player1'];\n\t\t\t$playerNumber = 2;\n\t\t\t$board[$i][$col] = $playerNumber;\n\t\t}\n\t\t\n\t\t//save updated board\n\t\t$my_db = mysqli_connect($GLOBALS['servername'],$GLOBALS['username'],$GLOBALS['password'],$GLOBALS['db_name']) or die(\"db connection konnte nicht hergestellt werden\");\n\t\t$updateGameQuery = \"UPDATE games SET board='\".json_encode($board).\"',nextTurn=\".$nextTurnPlayer.\" WHERE gameId=\".$game['gameId'];\n\t\t$result = $my_db->query($updateGameQuery);\n\t\tif(!$result){\n\t\t\thttp_response_code(500);\n\t\t\tdie(\"error udpating game in database\");\n\t\t}\t\t\n\t\t\n\t\t$gameOver = checkWin($board,$i,$col,$playerNumber);\n\t\tif($gameOver){\n\t\t\t$gameOverQuery = \"UPDATE games SET gameOver=1,nextTurn=0,winner=\".$_SESSION['playerId'].\" WHERE gameId=\".$game['gameId'];\n\t\t\t$result = $my_db->query($gameOverQuery);\n\t\t\t\n\t\t\tif(!$result){\n\t\t\t\thttp_response_code(500);\n\t\t\t\tdie(\"error updating gameOver field\");\n\t\t\t}\n\t\t}\n\t}",
"function move($original, $destination)\n{\n require(\"../includes/global.php\");\n\n // get the up to date board and turns information\n $board = $_SESSION['board'];\n $turns = $_SESSION['turns'];\n \n if ($board[$destination[0]][$destination[1]][\"piece\"] != \"empty\" && \n $board[$original[0]][$original[1]][\"white\"] == $board[$destination[0]][$destination[1]][\"white\"])\n {\n echo(\"<h3 id='h3'>You can't capture your own piece!</h3>\");\n render(\"playchess.php\");\n }\n if ($board[$destination[0]][$destination[1]][\"piece\"] == \"king\")\n {\n echo(\"<h3 id='h3'>You can't capture a king!</h3>\");\n render (\"playchess.php\");\n }\n \n // stores the contents of the destination square, just in case you've put yourself into check and need to change things back\n $temp = $board[$destination[0]][$destination[1]];\n // puts chess piece into destination square\n $board[$destination[0]][$destination[1]] = $board[$original[0]][$original[1]];\n // makes original square empty\n $board[$original[0]][$original[1]] = [\"ascii\" => \"\", \"white\" => \"nope not quite\", \"piece\" => \"empty\"];\n\n $_SESSION['board'] = $board;\n \n // if you've put yourself into check\n if (($turns % 2 == 0 && iswhitechecked() == true) || ($turns % 2 == 1 && isblackchecked() == true))\n {\n\n // the move is illegal, so you need to restore the board back to its original position\n $board[$original[0]][$original[1]] = $board[$destination[0]][$destination[1]];\n $board[$destination[0]][$destination[1]] = $temp;\n $_SESSION['board'] = $board;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>That move puts you in check!</h3>\");\n render(\"playchess.php\");\n }\n else\n {\n $turns++;\n $_SESSION['turns'] = $turns;\n echo(\"<h3 id='h3'>The overlords approve.</h3>\");\n render(\"playchess.php\");\n }\n}",
"public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }",
"function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}",
"function updateBoard() {\n\tglobal $game, $message;\n\t$cellClicked = $game['clicked']; //identify which button was submitted \t\t\t\t\t\n\tif ($cellClicked !== 9 ) {\n\t\t$curPos = $cellClicked; // get the actual button clicked. 0 to 8 correspond to respective cell\n\t\t$game[\"board\"][$curPos] = $game[\"player\"]; // set our game's data with player mark\n\t\t$game[\"player\"] = ($game[\"player\"]+1)%2; // switch the player turn\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t} else {\n\t\t$game[\"player\"] = 0;\n\t\t$_SESSION['player'] = $game[\"player\"];\n\t}\n\t$message = \"Player \".substr($game[\"playToken\"],$game[\"player\"],1).\" go!\";\n}",
"function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }",
"public function stepGameTurn(){\n\n $this->stepBoard = new Board();\n $this->board->showBoard();\n $gridSize = $this->board->getRowCount();\n $cell;\n $stepCell;\n\n if($this->board->isSquareGrid()){\n // for rows\n for($i = 0; $i<$gridSize; $i++){\n //for columns\n for($j = 0; $j<$gridSize; $j++){\n $cell = $this->board->getCell($i,$j);\n $liveNeighbors = $this->analyzeNeighbors($i,$j);\n $stepCell = $this->processRulesOfTheGame($cell, $liveNeighbors);\n // add the result of processRulesOfTheGame to the step board\n $this->stepBoard->addCell($i,$j,$stepCell);\n }\n }\n $this->stepBoard->showBoard();\n }\n }",
"public function openValve(){\n if ($this->game->get_current_turn()->WinStatus($this->game->getSize())){\n $this->game->set_winner();\n }else{\n $this->game->update_turn();\n $this->game->set_winner();\n }\n }",
"function board_main(){\n\t\tglobal $x7c, $x7s, $db, $prefix, $x7p, $print;\n\n\n\t\tif($x7c->settings['panic']) {\n\t\t\t$print->board_window(\"\",\"\",\"\");\n\t\t\treturn;\n\t\t}\n\n\t\tudpate_unread();\n\t\t\n\t\tif(isset($_GET['newboard'])){\n\t\t\tcreate_board();\n\t\t}\n\t\telse if(isset($_GET['board'])){\n\t\t\tshow_board($_GET['board']);\n\t\t}\n\t\telse if(isset($_GET['send'])){\n\t\t\tnew_communication($_GET['send']);\n\t\t}\n\t\telse if(isset($_GET['delete'])){\n\t\t\tdelete_message($_GET['delete']);\n\t\t}\n\t\telse if(isset($_GET['delboard'])){\n\t\t\tdelete_board($_GET['delboard']);\n\t\t}\n\t\telse if(isset($_GET['readall'])){\n\t\t\tread_all();\n\t\t}\n\t\telse if(isset($_GET['move'])){\n move_msg();\n\t\t}\n\t\telse \n\t\t\tboard_list();\n\t}",
"function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}",
"public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }",
"function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}",
"protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }",
"function play($game) {\t\n\tif($game[\"gameOver\"] == -1) {\n\t\tif ($game[\"clicked\"] !== 9 )\n\t\t\tupdateBoard(); //print_r($game); \n\t\tdisplayBoard();\t\t\n\t\tupdateSession();\t\t\n\t} \n}",
"public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }",
"function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}",
"public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChecker = [4, 3];\n $game->gameState->possibleGoChoices = [array(\"row\"=>2, \"col\"=>5), array(\"row\"=>4, \"col\"=>3)];\n $game->gameState->boardState = $this->getMultipleBeat();\n\n $gm->userMove(2, 5, 1, $game );\n $gm->userMove(0, 3, 1, $game );\n $gm->userMove(3, 0, 1, $game );\n $result = $gm->userMove(7, 4, 1, $game );\n\n\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][3]);//initial\n $this->assertEquals(0, $result[\"gameState\"]->boardState[3][4]);//beaten\n $this->assertEquals(-1, $result[\"gameState\"]->boardState[1][6]);//still there due to turkish turn rule\n $this->assertEquals(0, $result[\"gameState\"]->boardState[1][4]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[2][1]);//beaten\n $this->assertEquals(0, $result[\"gameState\"]->boardState[4][1]);//beaten\n $this->assertEquals(2, $result[\"gameState\"]->boardState[7][4]);//end position of the hero checker\n\n }",
"function _checkGame($game, $team) {\n global $_SYS;\n\n $game = intval($game);\n $team = intval($team);\n\n /* fetch game from db */\n\n $query = 'SELECT g.away AS away,\n na.team AS away_team,\n na.nick AS away_nick,\n na.acro AS away_acro,\n ta.user AS away_hc,\n g.away_sub AS away_sub,\n ta.conference AS away_conference,\n ta.division AS away_division,\n g.home AS home,\n nh.team AS home_team,\n nh.nick AS home_nick,\n nh.acro AS home_acro,\n th.user AS home_hc,\n g.home_sub AS home_sub,\n th.conference AS home_conference,\n th.division AS home_division,\n g.site AS site,\n g.week AS week,\n g.season AS season,\n s.name AS season_name\n FROM '.$_SYS['table']['game'].' AS g\n LEFT JOIN '.$_SYS['table']['team'].' AS ta ON g.away = ta.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS na ON ta.team = na.id\n LEFT JOIN '.$_SYS['table']['team'].' AS th ON g.home = th.id\n LEFT JOIN '.$_SYS['table']['nfl'].' AS nh ON th.team = nh.id\n LEFT JOIN '.$_SYS['table']['season'].' AS s ON g.season = s.id\n WHERE g.id = '.$game;\n\n $result = $_SYS['dbh']->query($query) or die($_SYS['dbh']->error());\n\n /* check if game exists */\n\n if ($result->rows() == 0) {\n return $_SYS['html']->fehler('1', 'Game does not exist.');\n }\n\n /* check if game was already played */\n\n $row = $result->fetch_assoc();\n\n if ($row['site'] != 0) {\n return $_SYS['html']->fehler('2', 'Game was already played.');\n }\n\n /* allow if user is admin OR user is hc or sub of the team */\n\n if (!(($team == 0 && $_SYS['user']['admin'])\n || ($team == $row['away'] && ($_SYS['user']['id'] == $row['away_hc'] || $_SYS['user']['id'] == $row['away_sub']))\n || ($team == $row['home'] && ($_SYS['user']['id'] == $row['home_hc'] || $_SYS['user']['id'] == $row['home_sub'])))) {\n return $_SYS['html']->fehler('3', 'You cannot upload a log for this game.');\n }\n\n $this->_game = $row;\n\n return '';\n }",
"protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }",
"public function makeMove($boardState, $playerUnit = 'X')\n {\n $opponentUnit = ($playerUnit == 'X' ? 'O' : 'X');\n $playerWinCases = array();\n $opponentWinCases = array();\n $choosePlayerWinCase = -1;\n $chooseOpponentWinCase = -1;\n foreach (self::$winningCases as $key => &$winCase) {\n\n $playerWinCase = new WinningCase($boardState, $winCase, $playerUnit);\n if (!$playerWinCase->isBlocked()) {\n if ($playerWinCase->countRemainingMoves() == 0) {\n $this->winner = $playerUnit;\n $this->winningCase = $winCase;\n return;\n } else if (!$choosePlayerWinCase instanceof WinningCase\n || (\n $choosePlayerWinCase instanceof WinningCase\n && $playerWinCase->countRemainingMoves() < $choosePlayerWinCase->countRemainingMoves()\n )\n ) {\n $choosePlayerWinCase = $playerWinCase;\n }\n }\n if ($playerWinCase->countRemainingMoves() > 0) {\n $playerWinCases[$playerWinCase->countRemainingMoves()] = $playerWinCase;\n// array_push($playerWinCases, $playerWinCase);\n }\n\n $opponentWinCase = new WinningCase($boardState, $winCase, $opponentUnit);\n if (!$opponentWinCase->isBlocked()) {\n if ($opponentWinCase->countRemainingMoves() == 0) {\n $this->winner = $opponentUnit;\n $this->winningCase = $winCase;\n return;\n } else if ($opponentWinCase->countRemainingMoves() == 1) {\n $chooseOpponentWinCase = $opponentWinCase;\n }\n }\n if ($opponentWinCase->countRemainingMoves() > 0) {\n $opponentWinCases[$opponentWinCase->countRemainingMoves()] = $opponentWinCase;\n// array_push($opponentWinCases, $opponentWinCase);\n }\n }\n\n // Winning case\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() == 1) {\n #if (DEBUG) echo 'Winning case:' . \"\\r\\n\";\n $this->winner = $playerUnit;\n $this->winningCase = $choosePlayerWinCase->winCase;\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n // Block opponent winning case (to avoid loss)\n if ($chooseOpponentWinCase instanceof WinningCase && $chooseOpponentWinCase->countRemainingMoves() > 0) {\n #if (DEBUG) echo 'Block opponent winning case -> Avoid loss:' . \"\\r\\n\";\n return array_merge($chooseOpponentWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n #if (DEBUG) echo 'No immediate winnning move found -> Best move:' . \"\\r\\n\";\n if ($choosePlayerWinCase instanceof WinningCase && $choosePlayerWinCase->countRemainingMoves() > 0) {\n return array_merge($choosePlayerWinCase->getRemainingMoves()[0], [$playerUnit]);\n }\n\n $this->winner = 'Draw';\n return;\n }",
"function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }",
"protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }",
"public function resetBoard()\n\t{\n\t\t$this->board = array();\n\t\t\n\t\t// Not available positions in the square.\n\t\t$this->board[3][-3] = false;\n\t\t$this->board[3][-2] = false;\n\t\t$this->board[2][-3] = false;\n\t\t$this->board[2][-2] = false;\n\t\t\n\t\t$this->board[-2][-3] = false;\n\t\t$this->board[-2][-2] = false;\n\t\t$this->board[-3][-3] = false;\n\t\t$this->board[-3][-2] = false;\n\t\t\n\t\t$this->board[3][2] = false;\n\t\t$this->board[3][3] = false;\n\t\t$this->board[2][2] = false;\n\t\t$this->board[2][3] = false;\n\t\t\n\t\t$this->board[-2][2] = false;\n\t\t$this->board[-2][3] = false;\n\t\t$this->board[-3][2] = false;\n\t\t$this->board[-3][3] = false;\n\t\t\n\t\t// Fill the available positions.\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\tif(!isset($this->board[$i][$j]))\n\t\t\t\t{\n\t\t\t\t\tif($i == 0 && $j == 0) // Center position empty\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->board[$i][$j] = new Hole(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }",
"public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }",
"public function rejectIfWrongMove(Board $board, User $player, $row, $col);"
]
| [
"0.7445252",
"0.6682662",
"0.66092634",
"0.64298415",
"0.6396222",
"0.6342407",
"0.63309914",
"0.63021696",
"0.62961656",
"0.62457556",
"0.6189297",
"0.616316",
"0.6143622",
"0.6142093",
"0.6102478",
"0.6064995",
"0.60588455",
"0.6046753",
"0.60364634",
"0.6004795",
"0.5947546",
"0.5917081",
"0.5861418",
"0.58612424",
"0.5847238",
"0.58133495",
"0.57826734",
"0.57781225",
"0.57665473",
"0.5750737"
]
| 0.68577087 | 1 |
Function select random player and print message to inform | protected function selectPlayer(){
$this->currentPlayer = rand(1,2);
selectRandPlayerMsg($this->currentPlayer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function onPlayerSelect();",
"public function play($choice){\n $yourChoice = trim(strtoupper($choice));\n if($yourChoice == 'ROCK'){\n $playerOne = 1;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }elseif($yourChoice == 'PAPER'){\n $playerOne = 2;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }elseif($yourChoice == 'SCISSOR'){\n $playerOne = 3;\n $playerTwo = rand(1,3);\n $this->checkForWinner($playerOne,$playerTwo);\n }else{\n throw new Exception(\"You need to make right choice!\");\n }\n }",
"public function putOnRandomGameKit(Player $p) {\n\t\t$kittype = array_rand ( $this->kits );\n\t\t$selectedKit = $this->kits [$kittype];\n\t\t$this->putOnGameKit ( $p, $selectedKit );\n\t}",
"public function random();",
"function displayPoints($randomVal1,$randomVal2,$randomVal3)\n {\n \n echo \"<div id='output'>\";\n if(($randomVal1 == $randomVal2) && ($randomVal3 == $randomVal2)){\n switch($randomVal1) //Any at this point to figure out the suit\n {\n case 0:\n $totalPoints = 1000 ;\n echo \"<h1>Jackpot</h1>\";\n $soundfile = \"./inc/JackPot.mp3\";\n break;\n case 1:\n $totalPoints = 500 ;\n $soundfile = \"./inc/WonSomething.mp3\";\n break;\n case 2:\n $totalPoints = 250 ;\n $soundfile = \"./inc/WonSomething.mp3\";\n break;\n case 3:\n /* case 4:\n case 5:\n case 6:*/\n $totalPoints = 900 ;\n $soundfile = \"./inc/WonSomething.mp3\";\n break;\n }\n echo \"<h2>You Won $totalPoints points!</h2>\";\n \n }\n else\n {\n echo \"<h3> Try Again </h3>\";\n //$soundfile = \"./inc/FailEffect.mp3\";\n }\n echo \"<audio autoplay='autoplay'>\";\n echo \"<source src='$soundfile'/>\";\n echo \"</audio>\";\n echo \"</div>\";\n }",
"private function generatePlayers() : void\n {\n $indexes = array_rand($this->availablePlayerNames, $this->numOfPlayers);\n \n $firstIndex = $indexes[0];\n $firstName = $this->availablePlayerNames[$firstIndex];\n\n $firstPlayer = new Player();\n $firstPlayer->setName($firstName);\n\n $this->firstPlayer = $firstPlayer;\n $this->curPlayer = $this->firstPlayer;\n\n for ($i=1; $i < count($indexes); $i++) {\n $curIndex = $indexes[$i];\n $curName = $this->availablePlayerNames[$curIndex];\n\n $curPlayer = new Player();\n $curPlayer->setName($curName);\n \n $this->curPlayer->setNext($curPlayer);\n\n $this->curPlayer = $this->curPlayer->getNext();\n }\n }",
"function challangeRandom() {\r\n // random number between 10 and 99\r\n $random = rand(10,99);\r\n $say = \"<Say voice='gcloud.en-GB-Standard-F' loop='2'>Please type the following number, $random, then press pound.</Say>\";\r\n return [$random, $say];\r\n}",
"private function pickWinner(OutputInterface $output)\n {\n $winner = $this->entries[rand(0, count($this->entries) - 1)];\n\n $text = '';\n $text .= $winner->user_display_name . ' - ' . substr(str_replace(PHP_EOL, ' ', $winner->comment ?: '<< no comment >>'), 0, 200) . PHP_EOL;\n $text .= ' - ' . isset($winner->uri) ? $winner->uri : $winner->event_uri;\n\n $this->io->success($text);\n }",
"public function getPlayer();",
"public function findRandom();",
"private function setMessageToPlayer()\n {\n if ($this->isUserMode()) {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng. Vill du vara med i tävlingen, spara poängen med den gröna knappen!\";\n } else {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng!\";\n }\n }",
"function zuus_player() {\n\t$directory = get_template_directory() . '/images/zuus_player/';\n\t$files = glob($directory . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\n\n\t$image = '';\n\tif($files !== false) { \n\t\t$file = array_rand($files);\n\t\t$image = basename($files[$file]);\n\t}\n\t\n\tif($image != '') {\n\t\techo '<div class=\"zuus_player\">';\n\t\t\techo '<img class=\"img-responsive\" alt=\"zuus_player\" src=\"' . THEME_DIR . '/images/zuus_player/' . $image .'\" />';\n\t\techo '</div>';\n\t}\n\t\n}",
"private function getRandomSayText()\n {\n $texts = [\n 'They see me rollin\\'',\n '*whistle*',\n 'I\\'m walking on sunshine',\n ];\n $rand = mt_rand(0, count($texts) - 1);\n\n return $texts[$rand];\n }",
"function playerSentToPenaltyBox($currentPlayer) {\n\t}",
"public function randomItem();",
"function pick_move() {\r\n $fill = false;\r\n do {\r\n //picks a random \"-\" spot and will fill it with \"x\" to represent opponent's move\r\n $next = rand(0, 8);\r\n if ($this->position[$next] == '-') {\r\n $this->position[$next] = 'x';\r\n $fill = true;\r\n }\r\n //keep filling until winning condition is found\r\n } while (!$fill);\r\n }",
"function checkPlayPos($given_pos){\n $player_ID = $_SESSION['login_user'];\n $play_pos = mysql_fetch_array(mysql_query(\"select * from Player where ID = '$player_ID';\"))['PlayPos'];\n if(!strcmp($play_pos,$given_pos))\n echo \"selected=\\\"selected\\\"\";\n }",
"public function genius(){\n $aNames = array('name-1', 'name-2', 'name-3');\n\n // Pick random index number from array aNames\n $iKey = array_rand($aNames);\n\n // Return the name using the random index\n return $aNames[$iKey];\n\n }",
"public function onRun($currentTick) {\n\t\t$onlinePlayers = \\pocketmine\\Server::getInstance()->getOnlinePlayers();\n// \t\tforeach ($onlinePlayers as $player) {\n// \t\t\tif (self::needPetMessage($player)) {\n// \t\t\t\tPets::sendPetMessage($player, Pets::PET_LOBBY_RANDOM);\n// \t\t\t}\n// \t\t}\n\t}",
"private function decideVictory()\n {\n echo 'Jugador ';\n if (!$this->human->isOver() &&\n (\n ($this->human->getPoints() == $this->machine->getPoints() && $this->human->getPoints() != PLAYER_WIN_POINTS)\n || $this->human->getPoints() > $this->machine->getPoints()\n || $this->machine->isOver()\n )\n ) echo 'Humano';\n else echo 'Máquina';\n echo ' gana la partida. ';\n }",
"public function randomFunc() {\n return \"RANDOM\";\n }",
"public function PracticeLobbySelector(Player $player){\n $form = new SimpleForm(function (Player $player, ?int $data){\n if (!is_null($data)){\n $prefix = \"§l§a» §fConnecting to the server...\";\n switch ($data){\n\n case 0:\n $player->sendMessage($prefix);\n $this->plugin->getScheduler()->scheduleRepeatingTask(new LP1($this->plugin, $player), 20);\n break;\n case 1:\n $player->sendMessage($prefix);\n $this->plugin->getScheduler()->scheduleRepeatingTask(new LP2($this->plugin, $player), 20);\n break;\n case 2:\n self::navigatorForm($player);\n break;\n default:\n return;\n }\n }\n });\n $form->setTitle(\"§l§cEndGames §7| §fPractice\");\n $images = [\n \"return\" => \"textures/ui/refresh_light\",\n \"lobby\" => \"textures/gui/newgui/mob_effects/strength_effect\"\n ];\n try {\n $lobby1 = PMQuery::query(\"207.244.228.121\", 19122);\n $lobby2 = PMQuery::query(\"207.244.228.121\", 19123);\n $lp1 = (int)$lobby1['Players'].\"§7/§a60\";\n $lp2 = (int)$lobby2['Players'].\"§7/§a60\";\n } catch (PmQueryException $e){\n $lp1 = \"§cOFFLINE\";\n $lp2 = \"§cOFFLINE\";\n }\n $form->addButton(\"§l§6LOBBY 1\\n§r§7Players Connected: §a\".$lp1, 0, $images[\"lobby\"]);\n $form->addButton(\"§l§6LOBBY 2\\n§r§7Players Connected: §a\".$lp2, 0, $images[\"lobby\"]);\n $form->addButton(\"§cReturn\", 0, $images[\"return\"]);\n\n $player->sendForm($form);\n\n }",
"function random(){\n $randomnummer = rand(1,6);\n return $randomnummer;\n}",
"function play_song($array){\n\tglobal $searchquery;\n\tglobal $song_returned_id, $number_of_moods;\n\tif ($array != NULL) {\n\t$randomnumber = rand(0, count($array)-1);\n\t//echo $randomnumber;\n\t//echo count($array);\n\tforeach ($array as $key => & $sub_array) {\n\t\tif ($key == $randomnumber) {\n\t\t\techo \"you are listening to {$sub_array[\"name\"]} by {$sub_array[\"artist\"]} tagged \" . $GLOBALS['searchquery'] .\"<br />\";\n\t\t\techo \"<audio controls id=\\\"player\\\" src=\" . $sub_array[\"path\"] .\">\n\t\t\tYour browser does not support the audio element.\n\t\t\t</audio>\"; \n\t\t\t$song_returned_id = $sub_array[\"songid\"];\n\t\t\t//echo \"song\".$song_returned_id;\n\t\t}\n\t}\n\t\techo \"tags: \";\n\t\t// echo the tags for the song\n\tforeach ($array as $key => & $sub_array) {\n\t\tif ($sub_array['songid'] == $song_returned_id) {\n\t\t\techo $sub_array['mood'] . \" \";\n\t\t}\n\n\t}\n\t} else { \n\t\tif ($searchquery != \"random\"){\n\t\t\techo \"Sorry we don't have \" . $searchquery . \" in our database. \";\n\t\t\techo \"To see all the tagged moods, please check out <a href=\\\"sensation2.php\\\"> All the moods </a><br />\";\n\t\t}\n\t\t// free mysqli result\n\t\tmysqli_free_result($GLOBALS['dbresult']);\n\t\t// make a new query to get all the songs in the database, and then to play a random one from that selection\n\t\t$sqlquery = \"SELECT * FROM moods\";\n\t\t$sqlquery .= \" INNER JOIN map\";\n \t$sqlquery .= \" ON moods.tagid = map.tagid\";\n \t$sqlquery .= \" INNER JOIN songs\";\n \t$sqlquery .= \" ON songs.songid = map.songid\";\n\n\t\t$dbresult = mysqli_query($GLOBALS['connection'], $sqlquery);\n\t// test if query succeeded./ if there was a query error\n\tif (!$dbresult){\n\t\tdie(\"Database query failed.\");\n\t}\n\n\t\t// get the first row from that result set and asign it to row, store all of those rows in an array of arrays called $dbarray, which can be used to compare to the original one\n\t$db_rand_song = array();\n\twhile($row = mysqli_fetch_assoc($dbresult)){\n \t\t$db_rand_song[] = $row;\n\t\t}\n\n\t\t// play a random song from the database\n\t\tif ($db_rand_song != NULL) {\n\t$randomnumber = rand(0, count($db_rand_song)-1);\n\t//echo $randomnumber;\n\t//echo count($array);\n\t//print_r($db_rand_song);\n\tforeach ($db_rand_song as $key => & $sub_array) {\n\t\tif ($key == $randomnumber) {\n\n\t\t\techo \"Now playing a random mood from our database: {$sub_array['name']} by {$sub_array['artist']} <audio controls id=\\\"player\\\" src=\" . $sub_array[\"path\"] .\">\n\t\t\tYour browser does not support the audio element.\n\t\t\t</audio>\";\n\t\t\t$song_returned_id = $sub_array[\"songid\"];\n\t}}}}\n\t//mysqli_free_result($dbresult);\n}",
"public function generateUsername()\n {\n $dir = \"@Give2PeerBundle/Resources/config/\";\n $path = $this->get('kernel')->locateResource($dir . 'game.yml');\n\n $words = Yaml::parse(file_get_contents($path));\n\n $adjectives = array_merge(\n $words['quantity']\n ,$words['quality']\n ,$words['size']\n ,$words['age']\n ,$words['shape']\n ,$words['color']\n ,$words['origin']\n ,$words['material']\n ,$words['qualifier']\n );\n \n $beings = $words['being'];\n\n $a1 = $a2 = '';\n $i = 0; // BAD. pop out of $adjectives instead ?\n while ($a1 == $a2 && $i < 42) {\n $i1 = array_rand($adjectives);\n $i2 = array_rand($adjectives);\n $a1 = $adjectives[min($i1, $i2)];\n $a2 = $adjectives[max($i1, $i2)];\n $i++;\n }\n\n if ($a1 == $a2) { // we have a lottery winner\n $a1 = \"Incredibly\";\n $a2 = \"Unlucky\";\n }\n\n $b = $beings[array_rand($beings)];\n\n $x = random_int(0, 9);\n $y = random_int(0, 9);\n $z = random_int(0, 9);\n \n // About 406 billion right now\n // $nb = count($beings) * (count($adjectives) ** 2) * 1000;\n // print(\"Possibilities : $nb\\n\");\n\n return \"${a1} ${a2} ${b} ${x}${y}${z}\";\n }",
"function displaySymbol($randomValue){\n //using conditions\n //$randomValue = rand(0,4);\n echo $randomValue;\n \n /*\n if($randomValue == 0){\n $symbol =\"cherry\";\n }\n else if($randomValue == 1){\n $symbol =\"grapes\";\n }\n else if($randomValue == 2){\n $symbol =\"lemon\";\n }\n else if($randomValue == 3){\n $symbol =\"orange\";\n }\n else {\n $symbol =\"seven\";\n }\n */\n \n //trhee or more if statements\n switch ($randomValue){\n case 0 :\n $symbol =\"cherry\";\n break;\n case 1 :\n $symbol =\"grapes\";\n break;\n case 2 :\n $symbol =\"lemon\";\n break;\n case 3 :\n $symbol =\"orange\";\n break;\n case 4 :\n $symbol =\"seven\";\n break;\n }\n echo \"<img src='img/$symbol.png' alt='$symbol' title='\". ucfirst($symbol) .\"' width='70' >\";\n }",
"function getRandomGames() {\n return DBcommand(\"SELECT * FROM games WHERE suggestion = 0 ORDER BY RAND() LIMIT 5\", [])['output'];\n}",
"function scrapbots_choose_fighter ($army){\n\tdebug(\"Choosing fighter, here is the army:\");\n\tdebug($army);\n\t//get a fighter at random\n\t$fighter = \"none\";\n\twhile ($fighter == \"none\"){\n\t\t$bot = e_rand(0,(count($army)-2));\n\t\tif (e_rand(1,100) < ($army[$bot]['briskness'] * 10)){\n\t\t\tdebug (\"Fighter Chosen:\");\n\t\t\t$fighter = $army[$bot];\n\t\t\tdebug ($fighter);\n\t\t} else {\n\t\tdebug(\"Fighter failed Briskness check. Choosing again.\");\n\t\t}\n\t}\n\treturn $fighter;\n}",
"function greeting()\r\n\t{\r\n\t\t$greeting = array(\r\n\t\t\t'Hi!', 'Hello,', 'Hello there,', 'Hi there,',\r\n\t\t\t'Hey yo!', 'Zzup!', 'Yo, man!', 'Sup?!',\r\n\t\t\t'Holla!', 'Hallo,', 'Bonos díes!', 'Saluton!',\r\n\t\t\t'Bonjour!', 'Salut!', 'Aloha!', 'Salute,',\r\n\t\t\t'¡Hola!', 'Ciao!',\r\n\t\t);\r\n\t\treturn $greeting[array_rand($greeting)];\r\n\t}",
"function compete($a,$b){\n $p = intval(100 * getWinProb($a['elo']-$b['elo']));\n $expected = ($a['elo']>=$b['elo']) ? $a['name'] : $b['name'];\n $percent = ($a['elo']>=$b['elo']) ? $p.'%' : (100-$p).'%';\n $n = mt_rand(1,100);\n $winner = ($n<=$p) ? $a['name'] : $b['name'];\n \n //echo sprintf(\"Now Playing: %s (%s) vs. %s (%s) \\n\", $a['name'], $a['elo'], $b['name'], $b['elo']);\n //echo sprintf(\"Expected winner: %s (%s)\\n\", $expected, $percent);\n //echo sprintf(\"Actual winner: %s\\n\\n\", $winner);\n return ($n<=$p) ? $a : $b;\n}"
]
| [
"0.6402196",
"0.62477463",
"0.61383677",
"0.6131086",
"0.6088489",
"0.6057457",
"0.60531896",
"0.580598",
"0.58006644",
"0.57715154",
"0.57694703",
"0.5689289",
"0.56084937",
"0.55991423",
"0.5590919",
"0.54940724",
"0.5458018",
"0.5455137",
"0.5443015",
"0.54023033",
"0.5392875",
"0.53710634",
"0.53582954",
"0.53517413",
"0.53511846",
"0.5342914",
"0.5318881",
"0.5314585",
"0.53119284",
"0.5303274"
]
| 0.8639816 | 0 |
Function verify that the choosen column is not full in case of a full column user message print to user | public function validateIsFullColumn($selectedColumn){
//in case of a full Column
if($this->board->gameBoard[0][$selectedColumn-1] != Board::CELL){
columnIsFullMsg($this->currentPlayer);
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function takesTwoColumns() {\n return false;\n }",
"private function validate_columns(){\n\n for($i=0;$i<9;$i++){\n $col = array_column($this->sudoku_array, $i);\n\n if(count($col) !=9 || count(array_unique($col)) !=9){\n return false;\n }\n }\n return true;\n }",
"public function validateIsFullBoard(){\r\n //in case of a full Column\r\n for($index=0; $index < Board::COLUMNS; $index++){\r\n //if there is an empty cell\r\n if($this->board->gameBoard[0][$index] == Board::CELL){\r\n //board is not full\r\n return false;\r\n }\r\n }///board is full\r\n return true;\r\n }",
"public function CheckExitColumn($table,$col){\n if(trim($col) == '') return array();\n $db_column= new db_query(\"SHOW COLUMNS FROM \" . $table . \" LIKE '\" . trim($col) . \"'\");\n //$result = mysqli_query();\n $exists = mysqli_fetch_assoc($db_column->result);\n unset($db_column);\n if(!empty($exists)){\n return $exists;\n }\n return array();\n }",
"public function validate_column($column)\n {\n }",
"private function hasNoColumns() {\n if (count($this->columns) === 0) return true;\n\n\n if (count($this->columns) === 1 && isset($this->columns['*'])) {\n return true;\n }\n\n return false;\n }",
"public function checkThatColumnsWorkToo(): void\n {\n $name = 'fluent-field';\n $label = 'Fun stuff:';\n Column::make($name)->testAttribute($label);\n\n $columns = $this->crudPanel->column($name);\n $this->assertCount(1, $columns);\n $this->assertArrayHasKey($name, $columns);\n $columnToTest = $columns[$name];\n $this->assertEquals('text', $columnToTest['type']);\n $this->assertEquals($label, $columnToTest['testAttribute']);\n }",
"public function testIsColumnAvailable()\n {\n /* ----------------------------------------------------\n * in below $csvData var we have faked the header data\n * -----------------------------------------------------*/\n $csvData = [['first_name','last_name','address']]; \n \n $column = 'first_name';\n\n /*\n |--------------------------------------------------------------------------\n | Success Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the success scenario\n |\n */\n\n $resp = $this->isColumnAvailable($column, $csvData);\n\n /* ------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable in case when column is available\n * -------------------------------------------------------------------------------*/\n $this->assertEqualsCanonicalizing($resp,[\"key\"=>0,\"name\"=>\"first_name\"]);\n \n\n /*\n |--------------------------------------------------------------------------\n | Failure Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the failure scenario\n |\n */\n\n $resp = $this->isColumnAvailable('unknown_column', $csvData);\n\n /* ----------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable method in case when column not found\n * -----------------------------------------------------------------------------------*/\n $this->assertFalse($resp);\n \n }",
"function isColumnValid(array $grid, int $x, bool $verbose = false): bool;",
"private function show_columns() {\n\t\tglobal $wpdb, $utils;\n\t\t$domain = $utils->text_domain;\n\t\t$tables = $wpdb->tables('all');\n\t\tif (!isset($_POST['table'])) {\n\t\t\t$message = __('Table name is not selected.', $domain);\n\t\t\treturn $message;\n\t\t} elseif (!in_array($_POST['table'], $tables)) {\n\t\t\t$message = __('There\\'s no such table.', $domain);\n\t\t\treturn $message;\n\t\t}\telse {\n\t\t\t$table_name = $_POST['table'];\n\t\t\t$results = $wpdb->get_results(\"SHOW COLUMNS FROM $table_name\");\n\t\t\treturn $results;\n\t\t}\n\t}",
"protected function columnMatchCheck ( $lineColumns ) {\n }",
"public function getValidColumns(array $columns);",
"function validateColums($POST) {\n if (isset( $POST['sName'] ) )\n return true;\n\n if ( (!isset($POST['label'])) &&\n (!isset($POST['asset_no'])) &&\n (!isset($POST['has_problems'])) &&\n (!isset($POST['comment'])) &&\n (!isset($POST['runs8021Q'])) &&\n (!isset($POST['location'])) &&\n (!isset($POST['MACs'])) &&\n (!isset($POST['label'])) &&\n (!isset($POST['attributeIDs'])) ) {\n return true;\n }\n\n}",
"protected function columnType()\n {\n $table = $this->ask('Enter the name of desired table');\n $this->checkInput($table);\n $column = $this->ask('Enter the desired column');\n $this->checkInput($column);\n $this->service->columnType($table, $column);\n }",
"public function checkEnableColumnEdit()\n\t{\n\t\treturn false;\n\t}",
"function verify_column( $column, $table, $db = null ) {\n\n\t\t$columns = $this->get_columns( $table, $db );\n\t\treturn in_array( $column, $columns );\n\n\t}",
"private function check_column($column, $column_value)\n {\n $column_errors = [];\n\n check_empty($column_value, $column->title, $column_errors);\n\n if( empty( $column_errors ) )\n {\n $rules = $this->rules[$column->rules];\n if (isset($rules['regex']) && !preg_match($rules['regex'], $column_value)) {\n array_push($column_errors, $column->title . '格式錯誤');\n }\n if (isset($rules['validator'])) {\n $validator = \\Validator::make([$column->id => $column_value], [$column->id => $rules['validator']]);\n $validator->fails() && array_push($column_errors, $column->title . '格式錯誤');\n }\n if (isset($rules['function'])) {\n call_user_func_array($this->checker($rules['function']), array($column_value, $column, &$column_errors));\n }\n\n if (!$column->unique && isset($rules['menu'])) {\n if (!in_array($column_value, $column->answers->lists('value'), true)) {\n array_push($column_errors, $column->title . '未在選單中');\n }\n }\n }\n\n return $column_errors;\n }",
"function other_cols($colname, $value) {\n // For security reasons we don't want to show the password hash.\n }",
"private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }",
"function ae_check_db_fields( ) {\n\n $count = 0;\n $cols = ae_get_db_fields();\n $foo = ae_db_queries();\n if( $cols ){\n foreach($cols as $col) {\n\n if( isset($foo[$col->COLUMN_NAME]) ) {\n\n if(\n $col->DATA_TYPE != $foo[$col->COLUMN_NAME]['type'] ||\n $col->CHARACTER_MAXIMUM_LENGTH < $foo[$col->COLUMN_NAME]['numb']\n ) {\n $count++;\n }\n }\n }\n }\n\n return $count;\n}",
"public function hasColumns(){\n return $this->_has(3);\n }",
"function mf_mysql_column_exist($table_name, $column_name,$dbh) {\r\n\r\n\t\t$query = \"SHOW COLUMNS FROM $table_name LIKE '$column_name'\";\r\n\t\t$sth = mf_do_query($query,array(),$dbh);\r\n\t\t$row = mf_do_fetch_result($sth);\r\n\t\t\r\n\t\tif(!empty($row)){\r\n\t\t\treturn true;\t\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function Pico_CheckTable($table_name, $column, $definition)\n{\n\tglobal $db;\n\t\n\t$fields = $db->assoc('SHOW COLUMNS FROM `'.$table_name.'`');\n\t$all_fields = array();\n\tforeach ($fields as $f)\n\t{\n\t\t$all_fields[] = $f['Field'];\n\t}\n\t\n\tif (!in_array($column, $all_fields))\n\t{\n\t\t$db->run('ALTER TABLE `'.$table_name.'` ADD COLUMN `'.$column.'` ' . $definition);\n\t}\n}",
"public function checkcol($tbl, $col) \n {\n $this->connect();\n \n //connect to database\n if (!empty($tbl)) \n {\n try\n {\n $sql = \"SELECT count(*) \n FROM information_schema.COLUMNS \n WHERE \n TABLE_SCHEMA = '\" . DN . \"' \n AND TABLE_NAME = '\" . $tbl . \"' \n AND COLUMN_NAME = '\" . $col . \"'\";\n \n return $this->GetOne($sql);\n }\n catch(PDOException $e) \n {\n return $e->getMessage();\n }\n } else\n {\n return 'No query provided';\n die;\n }\n $this->disconnect();\n \n //disconnect from database\n \n \n }",
"private function validate(){\n\t\t$row = $this->row;\n\t\t$col = $this->col;\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeRow($i,$j);\n\n\t\tfor($i=0;$i<$row;$i++)\n\t\t\tfor($j=0;$j<$col;$j++)\n\t\t\t$this->sanitzeCol($i,$j);\n\n\t}",
"public function checkInput($fields = '')\n {\n if($fields == '*') return false;\n $this->describeTable();\n\n //$fields = explode(', ', $fields);\n $fields = preg_split('/ ?[,|] ?/', $fields);\n\n $arr = [];\n foreach($fields as $f)\n {\n if(!in_array($f, $this->tableFields))\n {\n continue;//just remove unsafe fields\n }\n else\n {\n $arr[] = $f;\n }\n }\n return (!empty($arr)) ? implode(',' , $arr) : false;\n }",
"public function checkColumns($table)\n\t{\n\t\tforeach($table->columns as $column)\n\t\t{\n\t\t\tif(!preg_match('/^[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*$/',$column->name))\n\t\t\t\treturn $table->name.'.'.$column->name;\n\t\t}\n\t}",
"private function invalid($row, $column) {\n $height = count($this->matrix);\n if ($row >= $height || $row < 0) {\n return true;\n }\n $length = count($this->matrix[$row]);\n if ($column >= $length || $column < 0) {\n return true;\n }\n return false;\n }",
"function spr_exclude_column_found($column) {\nglobal $spr_exclude_db_debug;\n\n\t$rs = safe_query('SELECT * FROM '.safe_pfx('txp_section'),$spr_exclude_db_debug);\n\t$a = nextRow($rs);\n\treturn array_key_exists($column, $a);\n}",
"public function validate ($columns = null)\n {\n return true;\n }"
]
| [
"0.63556224",
"0.63001317",
"0.61818135",
"0.6166093",
"0.61368483",
"0.60902923",
"0.6022151",
"0.597522",
"0.5947488",
"0.59334356",
"0.5822366",
"0.5815296",
"0.5812504",
"0.5800726",
"0.5780297",
"0.5759884",
"0.5736777",
"0.5713075",
"0.56630063",
"0.56569",
"0.564339",
"0.5640562",
"0.56205475",
"0.5609068",
"0.5584184",
"0.55674756",
"0.5567466",
"0.5545837",
"0.5493977",
"0.5411029"
]
| 0.72448236 | 0 |
Function verify that the board is not full in case of a full Board message print to user | public function validateIsFullBoard(){
//in case of a full Column
for($index=0; $index < Board::COLUMNS; $index++){
//if there is an empty cell
if($this->board->gameBoard[0][$index] == Board::CELL){
//board is not full
return false;
}
}///board is full
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isBoardFull() {\n if ((count($this->_markers[self::X_MARK]) + count($this->_markers[self::O_MARK])) == 9) {\n echo $this->promptMessage('board_full') . PHP_EOL;\n return TRUE;\n }\n return FALSE;\n }",
"protected static function isBoardFull(array $gameBoard){\r\n\t\tforeach($gameBoard as $pos1=>$columns){\r\n\t\t\tforeach($columns as $pos2=>$player){\r\n\t\t\t\tif (false !== $player){\r\n\t\t\t\t\tcontinue ; \t\r\n\t\t\t\t}\r\n\t\t\t\t$blankPositions[] = array($pos1,$pos2);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn (!empty($blankPositions))? $blankPositions:true;\r\n\t}",
"private function isFilled(): bool {\n foreach ($this->board as $row => $cols) {\n foreach ($cols as $col => $cellValue) {\n if($this->board[$row][$col] == 0 || $this->board[$row][$col] > 9 || $this->board[$row][$col] < 1) {\n return false;\n }\n }\n }\n return true;\n }",
"function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }",
"function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}",
"function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}",
"public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }",
"private function isValidBox(): bool {\n $boxCoordinates = [\n [0,0], [0,1], [0,2],\n [1,0], [1,1], [1,2],\n [2,0], [2,1], [2,2]\n ];\n for($y=0; $y<9; $y+=3) {\n for($x=0; $x<9; $x+=3) {\n $curBox = [];\n for($i=0; $i<9; $i++) {\n $coordinates = $boxCoordinates[$i];\n $coordinates[0] += $y;\n $coordinates[1] += $x;\n if(in_array($this->board[$coordinates[0]][$coordinates[1]], $curBox)){\n return false;\n }\n array_push($curBox, $this->board[$coordinates[0]][$coordinates[1]]);\n }\n }\n }\n return true;\n }",
"function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}",
"function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}",
"public function validateIsFullColumn($selectedColumn){\r\n //in case of a full Column\r\n if($this->board->gameBoard[0][$selectedColumn-1] != Board::CELL){\r\n columnIsFullMsg($this->currentPlayer);\r\n return true;\r\n }\r\n return false;\r\n }",
"function board_list(){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$head = \"\";\n\t\t$body='';\n\t\t\n\t\t$indice = indice_board();\n\n\n\t\t$q_new = $db->DoQuery(\"SELECT count(*) AS cnt FROM {$prefix}boardunread WHERE user='{$x7s->username}'\");\n\t\t$new_msg = $db->Do_Fetch_Assoc($q_new);\n\n\t\t$body=\"<b>Ci sono $new_msg[cnt] messaggi nuovi</b>\";\n\t\t\n\t\t$print->board_window($head,$body,$indice);\n\t\t\n\t}",
"public function is_full(){\t\t$full=false;\n\t\tif( count( $this->pile ) >= $this->taille )\n\t\t\t$full = true;\n\t\treturn $full;\n\t}",
"public function setBoard(array $board): bool\n {\n if (sizeof($board) == $this->boardSize && sizeof($board[0]) == $this->boardSize) {\n $this->board = $board;\n return true;\n }\n $this->setMessage(\"Board size is wrong.\");\n return false;\n }",
"public function rejectIfWrongMove(Board $board, User $player, $row, $col);",
"function checkSudokuBoard(array $board)\n{\n if (empty($board)) {\n throw new \\InvalidArgumentException('The $board cannot be empty');\n }\n\n // Check the rows\n for ($i = 0; $i < count($board); $i++) {\n if (hasDuplicate($board, $i, $i + 1, 0, count($board), count($board))) {\n return false;\n }\n }\n\n // Check the columns\n for ($j = 0; $j < count($board); $j++) {\n if (hasDuplicate($board, 0, count($board), $j, $j + 1, count($board))) {\n return false;\n }\n }\n\n // Check the sub-grids\n $regionSize = (int) sqrt(count($board));\n for ($k = 0; $k < $regionSize; $k++) {\n for ($l = 0; $l < $regionSize; $l++) {\n if (hasDuplicate($board, $regionSize * $k, $regionSize * ($k + 1), $regionSize * $l, $regionSize * ($l + 1), count($board))) {\n return false;\n }\n }\n }\n\n return true;\n}",
"function test_display_board()\r\n{\r\n $board = new Board;\r\n\r\n $board->addPiece(0, 0, 'O');\r\n $board->addPiece(1, 1, 'O');\r\n $board->addPiece(2, 2, 'O');\r\n\r\n $actual = (string)$board;\r\n\r\n $expected = \"O--\\n-O-\\n--O\\n\"; //Please note: I had to change this. It was not displaying the expect value after debug_board correctly.\r\n\r\n\r\n if ($actual !== $expected) {\r\n echo \"Expected:\\n\", debug_board($expected);\r\n echo \"\\nActual:\\n\", debug_board($actual), \"\\n\";\r\n throw new \\Exception('test_display_board: Board should render correctly');\r\n }\r\n}",
"function show_board($bid){\n\t\tglobal $print, $x7s, $x7c, $db, $prefix;\n\t\t$indice=0;\n\t\t\n\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}boards WHERE id='{$bid}'\");\n\t\t$row = $db->Do_Fetch_Assoc($query);\n\t\t\n\t\tif(!$row){\n\t\t\t$body=\"La board richiesta non esiste\n\t\t\t\t<A HREF=\\\"javascript:javascript:history.go(-1)\\\"> Torna indietro</a>\";\n\t\t\t\n\t\t\t$head=\"Errore\";\n\t\t\t$print->board_window($head,$body,$indice);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$board['name']=$row['name'];\n\t\t$board['id']=$row['id'];\n\t\t$board['user_group']=$row['user_group'];\n\t\t$board['readonly']=$row['readonly'];\n\t\t\n\t\t\n\t\t$head=\"Board \".$board['name'];\n\t\t\n\t\t\n\n\t\tif(!checkAuth($bid)){\n\t\t\t$body=\"Non sei autorizzato a vedere questa board\n\t\t\t\t<A HREF=\\\"javascript:javascript:history.go(-1)\\\"> Torna indietro</a>\";\n\t\t\t\n\t\t\t$print->board_window($head,$body,$indice);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(!isset($_GET['message'])){\n\t\t\tshow_all_messages($board);\n\t\t}\n\t\telse{\n\t\t\tshow_single_message($_GET['message'],$board);\n\t\t}\n\t\t\n\t\t\n\t}",
"protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }",
"function checkGameEnd(){\n\tglobal $roomid, $db;\n\t$q = $db -> prepare(\"SELECT * FROM game WHERE roomid = ? LIMIT 1\");\n\t$q->execute(array($roomid));\n\t$r = $q->fetch();\n\t// When one of the players played all cards\n\tif($r['cardnorth'] == null || $r['cardeast'] == null || $r['cardsouth'] == null || $r['cardwest'] == null){\n\t\treturn '1';\n\t}\n\treturn '0';\n}",
"private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }",
"public function testRegisterMoveOnBoard()\n {\n $this->_board[0][8] = \"X\";\n $this->assertNotEmpty($this->_board[0][8]);\n }",
"public function rejectIfInvalidRowAndColumn(Board $board, User $player, $row, $col);",
"function initBoard()\n\t{\n\t\tglobal $board;\n\n\t\t/* clear board */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\tfor ($j = 0; $j < 8; $j++)\n\t\t\t{\n\t\t\t\t$board[$i][$j] = 0;\n\t\t\t}\n\t\t}\n\n\t\t/* setup white pieces */\n\t\t$board[0][0] = WHITE | ROOK;\n\t\t$board[0][7] = WHITE | ROOK;\n\t\t$board[0][1] = WHITE | KNIGHT;\n\t\t$board[0][6] = WHITE | KNIGHT;\n\t\t$board[0][2] = WHITE | BISHOP;\n\t\t$board[0][5] = WHITE | BISHOP;\n\t\t$board[0][3] = WHITE | QUEEN;\n\t\t$board[0][4] = WHITE | KING;\n\n\t\t/* setup black pieces */\n\t\t$board[7][0] = BLACK | ROOK;\n\t\t$board[7][7] = BLACK | ROOK;\n\t\t$board[7][1] = BLACK | KNIGHT;\n\t\t$board[7][6] = BLACK | KNIGHT;\n\t\t$board[7][2] = BLACK | BISHOP;\n\t\t$board[7][5] = BLACK | BISHOP;\n\t\t$board[7][3] = BLACK | QUEEN;\n\t\t$board[7][4] = BLACK | KING;\n\n\t\t/* setup pawns */\n\t\tfor ($i = 0; $i < 8; $i++)\n\t\t{\n\t\t\t$board[1][$i] = WHITE | PAWN;\n\t\t\t$board[6][$i] = BLACK | PAWN;\n\t\t}\n\t}",
"public function isValid()\n {\n $usedInRow = range(0, 8);\n $usedInColumn = range(0, 8);\n $usedInBox = range(0, 2);\n\n foreach ($usedInRow as $index) {\n $usedInRow[$index] = range(0, 8);\n foreach ($usedInRow[$index] as $i) {\n $usedInRow[$index][$i] = false;\n }\n }\n\n foreach ($usedInColumn as $index) {\n $usedInColumn[$index] = range(0, 8);\n foreach ($usedInColumn[$index] as $i) {\n $usedInColumn[$index][$i] = false;\n }\n }\n\n foreach ($usedInBox as $indexA) {\n $usedInBox[$indexA] = range(0, 2);\n foreach ($usedInBox[$indexA] as $indexB) {\n $usedInBox[$indexA][$indexB] = range(0, 8);\n foreach ($usedInBox[$indexA][$indexB] as $i) {\n $usedInBox[$indexA][$indexB][$i] = false;\n }\n }\n }\n\n for ($y = 0; $y < 9; $y++) {\n for ($x = 0; $x < 9; $x++) {\n if ($this->sudoku[$y][$x] === 0) {\n continue;\n }\n\n $value = $this->sudoku[$y][$x] - 1;\n if ($usedInRow[$y][$value] || $usedInColumn[$x][$value] || $usedInBox[floor($y / 3)][floor($x / 3)][$value]) {\n return false;\n }\n\n $usedInRow[$y][$value] = true;\n $usedInColumn[$x][$value] = true;\n $usedInBox[floor($y / 3)][floor($x / 3)][$value] = true;\n }\n }\n\n return true;\n }",
"function isCellEmpty($xPos, $yPos){\r\n\t\t\tif($this->board[$xPos][$yPos] != 1){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}",
"public function isFull(): bool;",
"function hasDuplicate($board, $startRow, $endRow, $startCol, $endCol, $numberOfElements)\n{\n $isPresent = array_fill(1, $numberOfElements + 1, false);\n\n for ($i = $startRow; $i < $endRow; $i++) {\n for ($j = $startCol; $j < $endCol; $j++) {\n if ($board[$i][$j] !== 0 && $isPresent[$board[$i][$j]]) {\n return true;\n }\n\n $isPresent[$board[$i][$j]] = true;\n }\n }\n\n return false;\n}",
"public function onBoardingIsCompleted()\n {\n return !empty($this->getIdToken());\n // Commented out because psx form is no longer used\n // && $this->psxFormIsCompleted();\n }",
"public function isFull() : bool;"
]
| [
"0.7831933",
"0.69444954",
"0.68854916",
"0.6503552",
"0.63835657",
"0.60957617",
"0.60837924",
"0.59440345",
"0.5932222",
"0.5927926",
"0.58390486",
"0.58316",
"0.5805093",
"0.5747443",
"0.57416934",
"0.5708741",
"0.5684389",
"0.56755435",
"0.5658349",
"0.56398714",
"0.563952",
"0.562841",
"0.55904096",
"0.557896",
"0.55775",
"0.5558635",
"0.5558389",
"0.55521804",
"0.55292547",
"0.5517049"
]
| 0.7821319 | 1 |
Function check vartical winning [X] [X] [X] [X] function run from the point the user choose to type his discs check : first search below the userMove, then search above the userMove In case of sequence 4 of the current player in a column player won | public function checkVerticalWin($userMove){
$varticalCounter = self::ZERO;
$gameBoards = $this->board->gameBoard;
$current_player = "[$this->currentPlayer]";
for($row = ($this->board->getRows() - 1) ; $row > -1 ; $row-- ){
if($varticalCounter == self::WIN){
return true;
}
elseif($gameBoards[$row][$userMove-1] == $current_player){
$varticalCounter++;
}
elseif($row < 2 && $varticalCounter < 1 ){
return false;
}
elseif($gameBoards[$row][$userMove-1] == Board::CELL){
$varticalCounter = self::ZERO;
continue;
}
else{
$varticalCounter = self::ZERO;
}
}
return $varticalCounter >= self::WIN ? true : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }",
"function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}",
"public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }",
"public function checkNegativeDiagonalWin($userMove){\r\n $diagonalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n return $diagonalCounter >= self::WIN ? true : false;\r\n }",
"function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }",
"function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}",
"public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }",
"protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }",
"public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }",
"public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }",
"public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }",
"public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}",
"function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}",
"public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }",
"public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }",
"public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }",
"abstract protected function winnerExists();",
"function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}",
"function buttons($instance, $owner, $doc, $dom) {\n\n $move = $dom->getElementsByTagName('currentMove');\n $currentPlayer = $move[0]->nodeValue;\n\n $sql = \"SELECT `USER`, `Move` FROM `TableCreatedBy_\" . $owner . \"`;\";\n $retval = $instance->sendRequest($sql);\n\n if ($_SESSION[\"user\"] === $currentPlayer) {\n while ($row = mysql_fetch_row($retval)) {\n if ($row[0] === $currentPlayer) {\n if ($row[1] === \"none\") {\n printCall($doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printPlayerButtons(\"Check\", \"Check\", \"checkFunction()\", $doc);\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n } else if ($row[1] !== \"fold\") {\n printPlayerButtons(\"fold\", \"Fold\", \"foldFunction()\", $doc);\n printPlayerButtons(\"rise\", \"Rise\", \"riseFunction()\", $doc);\n printCall($doc);\n }\n }\n }\n }\n}",
"abstract public function winner();",
"function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}",
"function getTurn ($board_num) {\n //get database info on player turn and player user ids\n $result = selectDB(\"SELECT PLAYERX, PLAYERO, TURN FROM BOARD WHERE BOARD_NUM='$board_num'\");\n\n //separate results into variables\n $playerx = $result['PLAYERX'];\n $playero = $result['PLAYERO'];\n $turnUser = $result['TURN'];\n \n //return 0 or 1\n if (strcmp($playerx, $turnUser) == 0) {\n return 0; //playerx's turn\n }\n else if (strcmp($playero, $turnUser) == 0) {\n return 1; //playero's turn\n }\n}",
"function playGame ($chessboard)\r\n{\r\n\t\r\n\t$matchMoves = getMovesForMatch();\r\n\t$count = count($matchMoves);\r\n\tprint (\"<br> Number of total moves: $count\");\r\n\t//display board changes\r\n\t//$chessboard -> resortDisplayBoard();\r\n\t//$pieces = $chessboard -> getDisplayBoard();\r\n\t//displayChessboard($pieces);\r\n\t\r\n\tforeach ($matchMoves as $mMove)\r\n\t{\r\n\t\t//check if from piece exists\r\n\t\t$fpiece = $chessboard->getPieceAtPosition($mMove['from']);\r\n\t\tif (!empty($fpiece))\r\n\t\t{\r\n\t\t\t//check if the to location is even on the board\r\n\t\t\tif ($chessboard->validPositionOnBoard ($mMove['to']))\r\n\t\t\t{\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is valid on the board. <br>\");\r\n\t\t\t\tif ($chessboard->validateMove($mMove['from'], $mMove['to'], $fpiece, $chessboard))\r\n\t\t\t\t{\r\n\t\t\t\t\t//move the piece to new location \r\n\t\t\t\t\tprint (\"<BR> Current Position: \" . $mMove['from'] . \" </BR>\");\r\n\t\t\t\t\tprint (\"<BR> After Position: \" . $mMove['to'] . \" </BR>\");\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//perfom captures/promotions (AI goes here to do this)\r\n\t\t\t\t\t\t//this would move appropriate pieces \"off the board\" by changing their \r\n\t\t\t\t\t\t//status $captured to true.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//display board changes\r\n\t\t\t\t\t\t$chessboard->move($mMove['from'], $mMove['to']);\r\n\t\t\t\t\t\t$chessboard -> resortDisplayBoard();\r\n\t\t\t\t\t\t$pieces = $chessboard -> getDisplayBoard();\r\n\t\t\t\t\t\tdisplayChessboard($pieces);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$type = strtolower($fpiece->getPieceType());\r\n\t\t\t\t\tprint(\"That is not a valid move for a $type, skipping move.\");\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tprint (\"<br> Move: \" . $mMove['to'] . \" is not on the board, skipping. <br>\");\r\n\t\t}\r\n\t\telse\r\n\t\t\tprint (\"<br>The piece you have selected does not exist\");\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}\r\n}",
"public static function diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, $direction, &$removedPawnIds, &$errorMsg)\n\t{\n\t\tswitch($direction)\n\t\t{\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null; \n\t\t}\n\n\t\tfor($possiblePosition = self::MIN_POSITION; $possiblePosition <= self::MAX_POSITION; $possiblePosition++)\n\t\t{\n\t\t\tif($prevX+($diffX*$possiblePosition) === $newX && $prevY+($diffY*$possiblePosition) === $newY)\n\t\t\t{\n\t\t\t\tif(($possiblePosition % 2) !== 0)\n\t\t\t\t{\n\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tif(\t$prevY+$diffY < 0 || \n\t\t\t\t\t\t$prevX+$diffX < 0 || \n\t\t\t\t\t\t$prevY+$diffY > count($boardRows)-1 || \n\t\t\t\t\t\t$prevX+$diffX > count($boardRows)-1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t//it should not search further if previous and new positions are the same\n\t\t\t\t\tif($prevX === $newX && $prevY === $newY)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t$posEvaluation = $playerNumber === FIRST_PLAYER ? \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > PLAYER_PAWNS_AMOUNT) : \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > 0 && $boardRows[$prevY+$diffY][$prevX+$diffX] <= PLAYER_PAWNS_AMOUNT);\n\n\t\t\t\t\t//checking if an opponent pawn had been spotted\n\t\t\t\t\tif($posEvaluation)\n\t\t\t\t\t{\n\t\t\t\t\t\t$removedPawnIds[] = intval($boardRows[$prevY+$diffY][$prevX+$diffX]);\n\t\t\t\t\t\t$boardRows[$prevY+$diffY][$prevX+$diffX] = 0;\n\t\t\t\t\t\t$prevX+=$diffX*2;\n\t\t\t\t\t\t$prevY+=$diffY*2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the algorithm didn't reach the end that means that the chosen position is \n\t\t\t\t\t\t//illegal since newX and newY and the last opponent are too far apart\n\t\t\t\t\t\tif($prevX !== $newX && $prevY !== $newY)\n\t\t\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }",
"public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }",
"public function rejectIfWrongMove(Board $board, User $player, $row, $col);",
"private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\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\t\n\t\treturn $moves;\n\t}",
"function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }"
]
| [
"0.68951416",
"0.662804",
"0.6547386",
"0.64372027",
"0.64133227",
"0.6302336",
"0.6201344",
"0.6185081",
"0.6123144",
"0.6109314",
"0.6096924",
"0.60954505",
"0.60832244",
"0.60800713",
"0.6068831",
"0.5909381",
"0.59088826",
"0.5907605",
"0.587992",
"0.5871337",
"0.57961196",
"0.57507026",
"0.57397455",
"0.5725687",
"0.5691813",
"0.5686842",
"0.56850785",
"0.5679979",
"0.567716",
"0.5645496"
]
| 0.69348896 | 0 |
Function check Horizontal winning [X][X][X][X] In case of sequence 4 of the current player in a row player won | public function checkHorizontalWin($userMove){
$HorizontalCounter = self::ZERO;
$gameBoards = $this->board->gameBoard;
$row = $this->lastRowInsert;
$current_player = "[$this->currentPlayer]";
for($col = $userMove-1; $col > -1 ; $col-- ){
if($gameBoards[$row][$col] != $current_player){
break;
}
$HorizontalCounter++;
}
for($col= $userMove; $col < Board::COLUMNS ; $col++){
if($gameBoards[$row][$col] != $current_player){
break;
}
$HorizontalCounter++;
}
return $HorizontalCounter >= self::WIN ? true : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}",
"public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }",
"function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}",
"public function testCheckWinner()\n {\n $rawBoard = [2,2,1,0,1,1,2,2,2];\n $feedback = [0=>8, 1=>1, 2=>6, 3=>3, 4=>5, 5=>7, 6=>4, 7=>9, 8=>2];\n $formatedBoardRow = 0;\n foreach ($feedback as $index=>$value) {\n if ($index%3==0) {\n $formatedBoardRow++;\n }\n if ($rawBoard[$index] == 1) {\n $formatedBoard[$formatedBoardRow][$value] = \"X\";\n }\n if ($rawBoard[$index] == 2) {\n $formatedBoard[$formatedBoardRow][$value] = \"O\";\n }\n }\n $this->_board = $formatedBoard;\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n //$this->assertGreaterThan($this->_maxScore, $this->_scorePlayerOne);\n //$this->assertEquals($this->_scorePlayerTwo, 10);\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertEquals(2, $whoHasWon);\n }",
"public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }",
"function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}",
"public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }",
"public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }",
"protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }",
"function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}",
"public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }",
"function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }",
"public function checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }",
"public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }",
"public function checkForWinner($playerOne, $playerTwo){\n if(($playerOne == 1 && $playerTwo == 2) || ($playerOne == 2 && $playerTwo == 3 || ($playerOne == 3 && $playerTwo == 1))){\n $this->printResult($playerOne, $playerTwo, 1);\n return 1;\n }elseif(($playerOne == 1 && $playerTwo == 1) || ($playerOne == 2 && $playerTwo == 2) || ($playerOne == 3 && $playerTwo == 3)){\n $this->printResult($playerOne, $playerTwo, 2);\n return 2;\n }else{\n $this->printResult($playerOne, $playerTwo, 3);\n return 3;\n }\n}",
"function displayBoard() {\n\tglobal $game, $output;\t\n\t$board = $game[\"board\"];\n\tif ($game[\"clicked\"] == 9) {\n\t\tfor( $i = 0; $i < 9; $i++ ) {\n\t\t\t$output .= '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>';\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\t\t\n\t}\n\tif ($game[\"clicked\"] != 9) {\n\t\t$curWinner = checkWinner($game); //print_r($curWinner);\t\t \n\t\tfor( $i = 0; $i < 9; $i++ ) {\t\t\n\t\t\tswitch ($board[$i]) {\n\t\t\t\tcase 2:\n\t\t\t\t\t$output .= ($curWinner > 990)\n\t\t\t\t\t\t? '<td><input class=\"available\" type=\"submit\" name=\"curCell\" placeholder=\"-\" value=\"' . $i . '\"></td>'\n : \"<td class='played'></td>\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>X</td>\"\n : \"<td class='played'>X</td>\";\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$output .= (substr_count($curWinner, $i)) \n\t\t\t\t\t\t? \"<td class='winner'>O</td>\"\n : \"<td class='played'>O</td>\";\t\n\t\t\t\t\tbreak;\t\t\t\n\t\t\t}\t\n\t\t\tif(($i+1)% 3 == 0 && $i < 8)\n\t\t\t\t$output .= \"</tr><tr>\";\t\n\t\t}\n\t} \n\treturn $output;\n}",
"function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}",
"public function checkVerticalWin($userMove){\r\n $varticalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = ($this->board->getRows() - 1) ; $row > -1 ; $row-- ){ \r\n if($varticalCounter == self::WIN){\r\n return true;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == $current_player){\r\n $varticalCounter++;\r\n }\r\n elseif($row < 2 && $varticalCounter < 1 ){\r\n return false;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == Board::CELL){\r\n $varticalCounter = self::ZERO;\r\n continue;\r\n }\r\n else{\r\n $varticalCounter = self::ZERO;\r\n }\r\n }\r\n return $varticalCounter >= self::WIN ? true : false;\r\n \r\n }",
"private function checkWiningRowColumn($playerUnit, $row = false, $checkRowColumn = false)\n {\n /**\n * check row/column winning for player unit\n */\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n //get array of row/column\n $array = ($row === true) ? $this->ticTacToeBoard[$i] : array_column($this->ticTacToeBoard, $i);\n\n $row_column = array_filter($array, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n if ($checkRowColumn === true && count($row_column) == $this->maxIndex) {\n return [true, $i];\n }\n if (count($row_column) == $this->boardSize) {\n return true;\n }\n }\n }",
"public function test4BallsInARow($player)\n {\n $match = $this->getNewMatch();\n\n for ($i = 0 ; $i <4 ; $i++) {\n $match->score($player);\n }\n\n $this->assertEquals(1, $match->getWonGame($player));\n }",
"function game_check() {\r\n $this->invalid_char = array_diff($this->position, $this->valid_char);\r\n if ($this->grid_size % 2 == 0 || $this->grid_size < 3 || $this->grid_size > 15) {\r\n $this->game_message('invalid-size');\r\n } else if (count($this->invalid_char, COUNT_RECURSIVE) > 0) {\r\n $this->game_message('invalid-character');\r\n } else if (strlen($this->board) <> pow($this->grid_size, 2)) {\r\n $this->game_message('invalid-board');\r\n } else if ($this->board == str_repeat('-', pow($this->grid_size, 2))) {\r\n $this->game_play(true);\r\n $this->game_message('new-game');\r\n } else if (substr_count($this->board, 'x') - substr_count($this->board, 'o') > 1) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-x');\r\n } else if (substr_count($this->board, 'o') - substr_count($this->board, 'x') > 0) {\r\n $this->game_play(false);\r\n $this->game_message('too-many-o');\r\n } else if ($this->win_check('x')) {\r\n $this->game_play(false);\r\n $this->game_message('x-win');\r\n } else if ($this->win_check('o')) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else if (stristr($this->board, '-') === FALSE) {\r\n \r\n $this->game_play(false);\r\n $this->game_message('tie-game');\r\n } else {\r\n $this->pick_move();\r\n if ($this->win_check('o')) {\r\n $this->game_play(false);\r\n $this->game_message('o-win');\r\n } else {\r\n $this->game_play(true);\r\n $this->game_message('ongoing-game');\r\n }\r\n }\r\n }",
"public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }",
"public function testVerifyToWin()\n {\n $match = $this->createMatch();\n\n foreach([0, 1, 2, 3, 4, 5, 6, 7, 8] as $position) {\n $this->createMove($position, $match->id);\n }\n\n foreach([0, 1, 2] as $position) {\n\n $move = Move::where('position', $position)\n ->where(\"match_id\", $match->id)\n ->first();\n\n $move->value = 1;\n $move->save();\n\n }\n\n $winner = new Winner();\n $winner->verify($match, $position, 1);\n\n $matchFound = Match::find($match->id);\n\n $this->assertEquals(1, $matchFound->winner);\n\n }",
"function get_player1_returning_row(){\n if(!$this->board->player_won(1)){\n return [];\n }\n\n if(count($this->board->winner_row) === 0){\n return [];\n }\n\n return $this->board->winner_row;\n }",
"public function checkNegativeDiagonalWin($userMove){\r\n $diagonalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $diagonalCounter++;\r\n }\r\n return $diagonalCounter >= self::WIN ? true : false;\r\n }",
"abstract protected function winnerExists();",
"protected function winByRow(string $playerUnit)\n {\n foreach ($this->getState() as $key => $row) {\n if (implode('', $row) === $this->getWinnerResult($playerUnit)) {\n return $key;\n }\n }\n\n return false;\n }",
"public function getRowResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByRow($playerUnit) !== false ?:\n $this->winByRow(infer_opponent($playerUnit)) !== false;\n }",
"function calculate_winners($stdin){\r\n\r\n if (isset($_POST['single'])){\r\n\r\n // Setting the stdin to the value input by the user \r\n $stdin = $_POST['input'];\r\n\r\n // Getting the vars that will store the total wins\r\n global $x;\r\n global $o;\r\n global $d; \r\n\r\n // Replacing all line breaks with nothing so we get one big long string with all results inside\r\n $stdin = str_replace(\"\\\\n\",\"\",$stdin);\r\n \r\n // create a variable equal to the length of the string so that we can separate out individual games easily\r\n $length = strlen($stdin);\r\n\r\n // loop through the entire input (here $i is set as individual moves as this point)\r\n for ($i=1; $i<=$length; $i++) {\r\n\r\n if ($i % 9 === 0){\r\n\r\n // Separate out each individual 9 game move and set it to the $outcome var\r\n $outcome = substr($stdin, $i-9, 9);\r\n\r\n // Calculate the outcome of the winner of each 9 move game\r\n // Probably an ineffient way to do this **REVISIT**\r\n if ($outcome[0] === \"x\" && $outcome[1] === \"x\" && $outcome[2] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[3] === \"x\" && $outcome[4] === \"x\" && $outcome[5] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[6] === \"x\" && $outcome[7] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[3] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[1] === \"x\" && $outcome[4] === \"x\" && $outcome[7] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[5] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"x\" && $outcome[4] === \"x\" && $outcome[8] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[2] === \"x\" && $outcome[4] === \"x\" && $outcome[6] === \"x\"){\r\n $winner = \"x\";\r\n self::add_game($winner, $outcome);\r\n $x++;\r\n } else if ($outcome[0] === \"o\" && $outcome[1] === \"o\" && $outcome[2] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[3] === \"o\" && $outcome[4] === \"o\" && $outcome[5] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[6] === \"o\" && $outcome[7] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[3] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[1] === \"o\" && $outcome[4] === \"o\" && $outcome[7] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[5] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[0] === \"o\" && $outcome[4] === \"o\" && $outcome[8] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else if ($outcome[2] === \"o\" && $outcome[4] === \"o\" && $outcome[6] === \"o\"){\r\n $winner = \"o\";\r\n self::add_game($winner, $outcome);\r\n $o++;\r\n } else {\r\n $winner = \"draw\";\r\n self::add_game($winner, $outcome);\r\n $d++;\r\n } \r\n }\r\n }\r\n \r\n // End of for loop for individual input\r\n // This will take the amount of wins and call a function that will display to the end user\r\n // No need for SQL input at this point as this information is just displayed and then not needed\r\n // All relevant information has already been added to the db \r\n self::calculate_single_input($x, $o, $d);\r\n }\r\n }",
"public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}"
]
| [
"0.6832586",
"0.6633101",
"0.66100883",
"0.6586113",
"0.6439534",
"0.64226496",
"0.64079475",
"0.639375",
"0.6374308",
"0.6293329",
"0.62067664",
"0.6015634",
"0.5979617",
"0.59258115",
"0.59214294",
"0.59026545",
"0.5896327",
"0.588674",
"0.58455724",
"0.58320796",
"0.578149",
"0.5750894",
"0.5718521",
"0.56764543",
"0.5676315",
"0.5655238",
"0.56404203",
"0.5587716",
"0.556849",
"0.5555637"
]
| 0.74083453 | 0 |
Function check Negative Diagonal winning [X] [X] [X] [X] function run from the point the user choose to type his discs check : first start to search on the upper right side of the selected userMove, then starts to search below left of the userMove selection In case of sequence at least 4 of the current player in a Diagonal player won | public function checkNegativeDiagonalWin($userMove){
$diagonalCounter = self::ZERO;
$gameBoards = $this->board->gameBoard;
$current_player = "[$this->currentPlayer]";
for($row = $this->lastRowInsert-1 ,$col = $userMove; $row > -1 && $col < Board::COLUMNS ; $row--, $col++ ){
if($gameBoards[$row][$col] != $current_player){
break;
}
$diagonalCounter++;
}
for($row = $this->lastRowInsert ,$col = $userMove-1; $row < Board::ROWS && $col > -1 ; $row++, $col-- ){
if($gameBoards[$row][$col] != $current_player){
break;
}
$diagonalCounter++;
}
return $diagonalCounter >= self::WIN ? true : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }",
"public static function diagonallyDismissOpponents($prevX, $prevY, $newX, $newY, $playerNumber, &$boardRows, $direction, &$removedPawnIds, &$errorMsg)\n\t{\n\t\tswitch($direction)\n\t\t{\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_UP_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_UP_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = -1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_LEFT_DOWN_DIR : \n\t\t\t\t$diffX = -1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tcase self::DIAGONALLY_DISMISS_OPPONENTS_RIGHT_DOWN_DIR : \n\t\t\t\t$diffX = 1;\n\t\t\t\t$diffY = 1;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null; \n\t\t}\n\n\t\tfor($possiblePosition = self::MIN_POSITION; $possiblePosition <= self::MAX_POSITION; $possiblePosition++)\n\t\t{\n\t\t\tif($prevX+($diffX*$possiblePosition) === $newX && $prevY+($diffY*$possiblePosition) === $newY)\n\t\t\t{\n\t\t\t\tif(($possiblePosition % 2) !== 0)\n\t\t\t\t{\n\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tif(\t$prevY+$diffY < 0 || \n\t\t\t\t\t\t$prevX+$diffX < 0 || \n\t\t\t\t\t\t$prevY+$diffY > count($boardRows)-1 || \n\t\t\t\t\t\t$prevX+$diffX > count($boardRows)-1)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t//it should not search further if previous and new positions are the same\n\t\t\t\t\tif($prevX === $newX && $prevY === $newY)\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t$posEvaluation = $playerNumber === FIRST_PLAYER ? \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > PLAYER_PAWNS_AMOUNT) : \n\t\t\t\t\t\t($boardRows[$prevY+$diffY][$prevX+$diffX] > 0 && $boardRows[$prevY+$diffY][$prevX+$diffX] <= PLAYER_PAWNS_AMOUNT);\n\n\t\t\t\t\t//checking if an opponent pawn had been spotted\n\t\t\t\t\tif($posEvaluation)\n\t\t\t\t\t{\n\t\t\t\t\t\t$removedPawnIds[] = intval($boardRows[$prevY+$diffY][$prevX+$diffX]);\n\t\t\t\t\t\t$boardRows[$prevY+$diffY][$prevX+$diffX] = 0;\n\t\t\t\t\t\t$prevX+=$diffX*2;\n\t\t\t\t\t\t$prevY+=$diffY*2;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//if the algorithm didn't reach the end that means that the chosen position is \n\t\t\t\t\t\t//illegal since newX and newY and the last opponent are too far apart\n\t\t\t\t\t\tif($prevX !== $newX && $prevY !== $newY)\n\t\t\t\t\t\t\t$errorMsg = self::ILLEGAL_POS_TEXT . $possiblePosition;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function checkWin($board) {\n $values = array();\n // horizontal\n for($r = 0; $r < 6; $r++) {\n $values[] = '';\n $i = count($values) - 1;\n for($c = 0; $c < 6; $c++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n // vertical\n for($c = 0; $c < 6; $c++) {\n $values[] = '';\n $i = count($values) - 1;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n }\n }\n\n // sub diagonal 1 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n \n // full diagonal right\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 5; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 right\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 4; $r >= 0; $r--) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 1 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 1; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // full diagonal left\n $values[] = '';\n $i = count($values) - 1;\n $c = 0;\n for($r = 0; $r < 6; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n\n // sub diagonal 2 left\n $values[] = '';\n $i = count($values) - 1;\n $c = 1;\n for($r = 0; $r < 5; $r++) {\n $values[$i] .= $board[$r][$c];\n $c++;\n }\n print_r($values);\n\n $winChaos = false;\n $winOrder = false;\n $boardFull = true;\n foreach($values as $v) {\n if(strpos($v, '11111') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '22222') !== false) {\n $winOrder = true;\n }\n if(strpos($v, '0') !== false) {\n $boardFull = false;\n }\n }\n if($winOrder == false && $boardFull == true) {\n $winChaos = true;\n }\n\n if($winChaos == false && $winOrder == false && $boardFull == false)\n return 0; // nadie ha ganado aun\n if($winOrder)\n return 1; // gana order\n if($winChaos)\n return 2; // gana chaos\n}",
"public function checkVerticalWin($userMove){\r\n $varticalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $current_player = \"[$this->currentPlayer]\";\r\n for($row = ($this->board->getRows() - 1) ; $row > -1 ; $row-- ){ \r\n if($varticalCounter == self::WIN){\r\n return true;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == $current_player){\r\n $varticalCounter++;\r\n }\r\n elseif($row < 2 && $varticalCounter < 1 ){\r\n return false;\r\n }\r\n elseif($gameBoards[$row][$userMove-1] == Board::CELL){\r\n $varticalCounter = self::ZERO;\r\n continue;\r\n }\r\n else{\r\n $varticalCounter = self::ZERO;\r\n }\r\n }\r\n return $varticalCounter >= self::WIN ? true : false;\r\n \r\n }",
"function getTurn()\n{\n $board = getArray();\n $victory = false;\n//test victoire ligne\n if ($board[0] == $board[1] && $board[0] == $board[2]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[3] == $board[4] && $board[3] == $board[5]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[4] == $board[5] && $board[4] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire colone\n if ($board[0] == $board[3] && $board[0] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[1] == $board[4] && $board[1] == $board[7]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[5] && $board[2] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n\n//test victoire diagonal\n if ($board[0] == $board[4] && $board[0] == $board[8]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n if ($board[2] == $board[4] && $board[2] == $board[6]) {\n if ($board[0] == \"X\") {\n $victory = \"X\";/*victoire X*/\n } else {\n $victory = \"O\";/*victoire O*/\n }\n }\n //test pour le prochain tour\n if ($victory = null){\n $turn = $board[9];\n if ( $turn == 'X' ){\n $board[9] = 'O';\n }else{\n $board[9] = 'X';\n }\n return $turn;\n }else{\n return $victory;\n }\n}",
"public function checkHorizontalWin($userMove){\r\n $HorizontalCounter = self::ZERO;\r\n $gameBoards = $this->board->gameBoard; \r\n $row = $this->lastRowInsert;\r\n $current_player = \"[$this->currentPlayer]\";\r\n\r\n for($col = $userMove-1; $col > -1 ; $col-- ){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break; \r\n }\r\n $HorizontalCounter++;\r\n }\r\n for($col= $userMove; $col < Board::COLUMNS ; $col++){\r\n if($gameBoards[$row][$col] != $current_player){\r\n break;\r\n }\r\n $HorizontalCounter++; \r\n }\r\n return $HorizontalCounter >= self::WIN ? true : false;\r\n \r\n }",
"public function IsKingAllowedOnSquare($x, $y){\n\t\n\t\tif ($this->IsWhiteToMove)\n\t\t\t$chesspiece = 6;\n\t\telse\n\t\t\t$chesspiece = -6;\n\t\t\n\t\tif (!$this->IsLegalChessSquare($x, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/** Actually, we don't need this piece of code, because it's not a criterion for whether \n\t\t * the king is safe on (x, y)\n\t\t//$chessposition[$x][$y]\n\t\tif ($this->IsFriendlyPiece($chesspiece, $x, $y)){ \n\t\t\treturn false;\n\t\t}\n\t\t**/\n\t\t\n\t\t/**\n\t\t * Examine the diagonals\n\t\t */\n\t $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top left diagonal\n \n //check bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining bottom left diagonal\n \n //check top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of examining top right diagonal\n \n //check bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this diagonal\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this diagonal\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 3 || $piece == 5) {\n \t\treturn false;\n \t} else \n \t\tbreak;\n }\n }//end of examining bottom right diagonal\n \n /**\n * Examine the Files and Ranks\n */\n //check forward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) \n \t\treturn false;\n \telse\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check backward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $b--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking forward file\n \n //check right-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking right-ward file\n \n //check left-ward file\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n \n if (!$this->IsLegalChessSquare($a, $b)){\n \tbreak; //there are no more squares along this file\n }\n \n if ($this->chessposition[$a][$b] == 0){ //there's nobody on this square\n \tcontinue; //move on to next iteration\n }\n \n if ($this->IsFriendlyPiece($chesspiece, $a, $b)){ //there's a friendly piece\n \tbreak; //stop examining this file\n }\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ //there's an enemy piece\n \t$enemypiece = $this->chessposition[$a][$b];\n \t$piece = abs($enemypiece);\n \tif ($piece == 4 || $piece == 5) {\n \t\treturn false;\n \t} else\n \t\tbreak;\n }\n }//end of checking left-ward file\n \n /**\n * Check for Knights\n */\n if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y+2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-1, $y-2)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x+2, $y+1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y-1)){\n \treturn false;\n } else if ($this->HasEnemyPiece($chesspiece, 2, $x-2, $y+1)){\n \treturn false;\n }\n \n\t\n\t\t/**\n\t\t * Check for Pawns\n\t\t */\n\t\tif ($chesspiece > 0){ //a white piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y+1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($chesspiece < 0){ //a black piece\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x+1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->HasEnemyPiece($chesspiece, 1, $x-1, $y-1)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * Check for the King\n\t\t */\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x+1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x-1, $y-1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif ($this->HasEnemyPiece($chesspiece, 6, $x, $y+1)){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private function findLineMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif(\t$hole )\n\t\t\t\t{\n\t\t\t\t\tif($hole->hasMarble)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('up', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i + 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i + 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i, $j);\n\t\t\t\t\t\t\t$moves[0][] = array('down', $i + 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('right', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j + 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j + 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('left', $i, $j + 3);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('down', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i - 3][$j]) &&\n\t\t\t\t\t\t\t$this->board[$i - 3][$j]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('top', $i - 3, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t$this->canMoveTo('left', $i, $j) &&\n\t\t\t\t\t\t\t!empty($this->board[$i][$j - 3]) &&\n\t\t\t\t\t\t\t$this->board[$i][$j - 3]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t$moves[3][] = array('left', $i, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i, $j - 3);\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\t\n\t\treturn $moves;\n\t}",
"public function getWinner()\r\n {\r\n// todo\r\n $p = $this->pieces;\r\n $i=0;\r\n //check the rows for winner\r\n for($i=0;$i<self::ROWS;$i++)\r\n {\r\n if(($p[$i][0] == $p[$i][1]) && ($p[$i][1] == $p[$i][2]) && $p[$i][0] != '')\r\n {\r\n if($p[$i][0] == 'O')\r\n\t\t\t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n\t\t\t\treturn 'X';\r\n\t\t\t}\r\n }\r\n }\r\n\r\n //check the columns for winner\r\n for($j=0;$j<self::ROWS;$j++)\r\n {\r\n if(($p[0][$j] == $p[1][$j]) && ($p[1][$j] == $p[2][$j]) && $p[0][$j] != '')\r\n {\r\n if($p[0][$j] == 'O')\r\n \t{\r\n\t\t\t\treturn 'O';\r\n\t\t\t}\r\n else\r\n\t\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t\t}\r\n }\r\n\r\n }\r\n\r\n //check the diagonals for winner\r\n if(($p[0][0]==$p[1][1] && $p[1][1] == $p[2][2] && $p[0][0] != '') || ($p[0][2] == $p[1][1] && $p[1][1] == $p[2][0] && $p[0][2] != ''))\r\n {\r\n if($p[1][1] == 'O')\r\n\t\t{\r\n\t\t\treturn 'O';\r\n\t\t}\r\n else\r\n\t\t{\r\n \t\treturn 'X';\r\n\r\n\t\t}\r\n }\r\n return -1; //return -1, keep playing\r\n }",
"protected function userMove() {\n echo \"Your move: \";\n $move = FALSE;\n while ($move === FALSE) {\n $move = $this->isValidMove();\n if ($move === FALSE)\n echo $this->promptMessage('invalid_move');\n }\n if (strtoupper($move) == self::QUIT_BUTTON)\n return TRUE;\n\n\n echo \"Your move is '\" . $this->_userMark . \"' at box \" . $move . PHP_EOL;\n $this->_markers[$this->_userMark][] = $move;\n $this->drawBoard($this->_markers);\n if ($this->isWon($this->_userMark) || $this->isBoardFull())\n return TRUE;\n return FALSE;\n }",
"private function findLMove()\n\t{\n\t\t$moves = array();\n\t\t\n\t\tfor($i = 3; $i >= -3; $i--)\n\t\t{\n\t\t\tfor($j = -3; $j <= 3; $j++)\n\t\t\t{\n\t\t\t\t$hole = & $this->board[$i][$j];\n\t\t\t\t\n\t\t\t\tif($hole && !$hole->hasMarble)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[0] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[0][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[0][] = array('up', $i - 2, $j + 1);\n\t\t\t\t\t\t\t$moves[0][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[1] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[1][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[1][] = array('right', $i + 1, $j - 2);\n\t\t\t\t\t\t\t$moves[1][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[2] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[2][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[2][] = array('left', $i - 1, $j + 2);\n\t\t\t\t\t\t\t$moves[2][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Down Left\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[3] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[3][] = array('up', $i - 2, $j);\n\t\t\t\t\t\t\t$moves[3][] = array('right', $i - 1, $j - 2);\n\t\t\t\t\t\t\t$moves[3][] = array('down', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Top Right\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 2]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[4] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[4][] = array('down', $i + 2, $j);\n\t\t\t\t\t\t\t$moves[4][] = array('left', $i + 1, $j + 2);\n\t\t\t\t\t\t\t$moves[4][] = array('up', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {} // Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Right Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j + 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j + 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j + 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[5] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[5][] = array('left', $i, $j + 2);\n\t\t\t\t\t\t\t$moves[5][] = array('down', $i + 2, $j + 1);\n\t\t\t\t\t\t\t$moves[5][] = array('right', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Top\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i + 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[6] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[6][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[6][] = array('down', $i + 2, $j - 1);\n\t\t\t\t\t\t\t$moves[6][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// Left Down\n\t\t\t\t\t\tif(\n\t\t\t\t\t\t\t@$this->board[$i][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i][$j - 2]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 1][$j - 1]->hasMarble &&\n\t\t\t\t\t\t\t@$this->board[$i - 2][$j - 1]->hasMarble\n\t\t\t\t\t\t)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$moves[7] = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$moves[7][] = array('right', $i, $j - 2);\n\t\t\t\t\t\t\t$moves[7][] = array('up', $i - 2, $j - 1);\n\t\t\t\t\t\t\t$moves[7][] = array('left', $i, $j);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception $e) {}// Not available\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $moves;\n\t}",
"public function checkValidMove($userMove){\r\n if(!is_numeric($userMove) ||$userMove < 1 || $userMove > Board::COLUMNS){ \r\n invalidInputMsg($this->currentPlayer);\r\n return false;\r\n }\r\n return true;;\r\n }",
"private function checkWiningDiagonal($playerUnit, $type = 'right', $returnCount = false)\n {\n $keys = ($type == 'right') ? array_keys($this->ticTacToeBoard) : array_reverse(array_keys($this->ticTacToeBoard));\n\n $diagonal = array_map(function ($row, $index) {\n return $row[$index];\n }, $this->ticTacToeBoard, $keys);\n\n $a = array_filter($diagonal, function ($val) use ($playerUnit) {\n return ($val === $playerUnit);\n });\n\n //return diagonal values\n if ($returnCount === true) {\n return $a;\n }\n return (count($a) == $this->boardSize) ? true : false;\n }",
"public function rejectIfWrongMove(Board $board, User $player, $row, $col);",
"function getMovesForMatch ()\r\n{\r\n\t//array of chess moves assuming a few things:\r\n\t/* \t- light/dark take turns \r\n\t\t- the moves are set up to take a piece and move it to another,\r\n\t\t\tso moving pawn e2 -> e4 would be stored as the first 2 elements in a multidimensional array.\r\n\t\t- there are many things that would need to be done to support algebraic chess notation, \r\n\t\t\tI didn't go into that here.\t\t\r\n\t\t\r\n\t*/\r\n\t$matchMoves = array();\r\n\t\r\n\t/*\r\n\t$matchMoves [0]['from'] = \"e2\";\r\n\t$matchMoves [0]['to'] \t= \"e4\";\r\n\t$matchMoves [1]['from'] = \"c7\";\r\n\t$matchMoves [1]['to']\t= \"c5\";\r\n\t\r\n\t$matchMoves [2]['from'] = \"g1\";\r\n\t$matchMoves\t[2]['to']\t= \"f3\";\r\n\t$matchMoves [3]['from'] = \"b8\";\r\n\t$matchMoves [3]['to']\t= \"c6\";\r\n\t\r\n\t//begin invalid off board examples\r\n\t$matchMoves [4]['from'] = \"c6\";\r\n\t$matchMoves [4]['to'] \t= \"c9\";\r\n\t\r\n\t$matchMoves [5]['from'] = \"c6\";\r\n\t$matchMoves [5]['to'] \t= \"c0\";\r\n\t\r\n\t$matchMoves [6]['from'] = \"c6\";\r\n\t$matchMoves [6]['to'] \t= \"z9\";\r\n\t*/\r\n\t//begin invalid examples for particular pieces\r\n\t\r\n\t//king =======================\r\n\t//bad move\r\n\t$matchMoves [7]['from'] = \"e8\";\r\n\t$matchMoves [7]['to'] \t= \"g7\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [8]['from'] = \"e8\";\r\n\t$matchMoves [8]['to'] \t= \"f7\";\r\n\t\r\n\t//rook =========================\r\n\t//bad move\r\n\t$matchMoves [9]['from'] = \"h8\";\r\n\t$matchMoves [9]['to'] \t= \"h5\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [10]['from'] = \"h7\";\r\n\t$matchMoves [10]['to'] \t = \"h6\";\t\r\n\t$matchMoves [11]['from'] = \"h6\";\r\n\t$matchMoves [11]['to'] \t = \"h5\";\r\n\t$matchMoves [12]['from'] = \"h5\";\r\n\t$matchMoves [12]['to'] \t = \"h4\";\r\n\t$matchMoves [13]['from'] = \"h8\";\r\n\t$matchMoves [13]['to'] \t = \"h5\";\r\n\t\r\n\t//bishop ========================\r\n\t//bad move\r\n\t$matchMoves [14]['from'] \t= \"c8\";\r\n\t$matchMoves [14]['to'] \t\t= \"b8\";\r\n\t\r\n\t//bad move because pieces are in the way\r\n\t$matchMoves [15]['from'] \t= \"c8\";\r\n\t$matchMoves [15]['to'] \t\t= \"c7\";\r\n\t\r\n\t//move pawn first\r\n\t$matchMoves [16]['from'] \t= \"b7\";\r\n\t$matchMoves [16]['to'] \t\t= \"b6\";\r\n\t$matchMoves [17]['from'] \t= \"c8\";\r\n\t$matchMoves [17]['to'] \t\t= \"a6\";\r\n\t\r\n\t//queen ==========================\r\n\t$matchMoves [18]['from'] \t= \"d8\";\r\n\t$matchMoves [18]['to'] \t\t= \"c8\";\r\n\t\r\n\t\t\r\n\t//setting up a check for between functions - rook\r\n\t$matchMoves [19]['from'] \t= \"f2\";\r\n\t$matchMoves [19]['to'] \t\t= \"f3\";\r\n\t$matchMoves [20]['from'] \t= \"f3\";\r\n\t$matchMoves [20]['to'] \t\t= \"f4\";\r\n\t$matchMoves [21]['from'] \t= \"f4\";\r\n\t$matchMoves [21]['to'] \t\t= \"f5\";\r\n\t\r\n\t$matchMoves [22]['from'] \t= \"h5\";\r\n\t$matchMoves [22]['to'] \t\t= \"e5\";\r\n\t\r\n\t//demonstrating capture move a pawn to capture\r\n\t$matchMoves [23]['from'] \t= \"f7\";\r\n\t$matchMoves [23]['to'] \t\t= \"f6\";\r\n\t$matchMoves [24]['from'] \t= \"g7\";\r\n\t$matchMoves [24]['to'] \t\t= \"g6\";\r\n\t$matchMoves [25]['from'] \t= \"f5\";\r\n\t$matchMoves [25]['to'] \t\t= \"g6\";\r\n\t\r\n\r\n\treturn ($matchMoves);\r\n}",
"public function checkWin($justReturn = false)\n {\n $actions = Action::get();\n $gameBoard = array(\n [' ', ' ', ' '],\n [' ', ' ', ' '],\n [' ', ' ', ' ']\n );\n\n foreach ($actions as $action) {\n $gameBoard[$action->row][$action->column] = $action->player;\n }\n\n\n $isX = 'X'; // Player X in gameBoard array is assigned to \"X\"\n $isO = 'O'; // Player O in gameBoard array is assigned to \"O\"\n $checkPlayer = $isX; // Tells us, which player we are checking for win\n $result = true; // Win result, after each loop must be \"true\"\n\n // Checking diagonally 0,0 1,1 2,2 game board fields\n $res = array();\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[$b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n // Checking diagonally 2,0 1,1 0,2 game board fields\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n // This loop first time checking player X, and second time player O\n $result = true; // Resetting $result to true\n if ($a == 1) {\n // loop goes 2nd time, so we are setting $checkPlayer to $isO(true), to check for player O\n $checkPlayer = $isO;\n }\n for ($b = 0; $b < 3; $b++) {\n /**\n * Because variable $result = true, on win check must be:\n * $result = true && true, to get result that there is any winner(because true && true is TRUE)\n * if there is other condition, for example:\n * $result = true && false, there is no winner(because true && false is FALSE)\n */\n $result = $result && $gameBoard[2 - $b][$b] === $checkPlayer;\n }\n\n if ($result) {\n /**\n * $result = true, that means that there is a winner.\n * Winner would be that one, which was checked last time by loop and defined by variable $checkPlayer.\n * Returning winner.\n */\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n\n\n $checkPlayer = $isX; // Resetting player that we are checking to player X.\n for ($a = 0; $a < 2; $a++) {\n if ($a == 1) $checkPlayer = $isO;\n for ($b = 0; $b < 3; $b++) {\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for rows\n $result = $result && $gameBoard[$b][$c] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n $result = true;\n for ($c = 0; $c < 3; $c++) {\n // Checking for columns\n $result = $result && $gameBoard[$c][$b] === $checkPlayer;\n }\n if ($result) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => $checkPlayer,\n ], 200);\n }\n }\n }\n\n\n /**\n * None conditinion was succes, that means there is no winner yet, so now checking if there is any free game board fields.\n */\n $foundEmpty = 0;\n foreach ($gameBoard as $row => $col) {\n foreach ($col as $player) {\n if ($player === ' ')\n $foundEmpty++;\n }\n }\n if ($foundEmpty == 0) {\n if ($justReturn)\n return true;\n\n return response()->json([\n 'winner' => ' ',\n ], 200);\n }\n\n if ($justReturn)\n return false;\n\n return response()->json([\n 'noWinner' => true\n ], 200);\n }",
"private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Test si la carte du deck peut descendre\n\t\t$move2 = $this->can_put_deck_card_down();\n\t\tif($move !== false && $move2 !== false) {\n\t\t\tarray_push($move, $move2);\n\t\t\treturn $move;\n\t\t} \n\t\tif($move !== false) return $move;\n\t\tif($move2 !== false) return $move2;\n\t\t\n\t\t// Test si une carte peut être montée suite à un déplacement spécial\n\t\t//$move = $this->can_put_a_card_up_after_move();\n\t\t//if($move !== false) return $move;\n\t\t\n\t\t// Pioche\n\t\t$move = $this->can_turn_from_deck();\n\t\tif($this->infinite_move($move)) return false;\n\t\tif($move !== false) return $move;\n\t\t\n\t\treturn false;\n\t}",
"function no_double_moves(int $spareMoves, int $movesX, int $movesO): bool\n{\n return [\n [5, 4],\n [4, 4],\n [4, 3],\n [3, 3],\n [3, 2],\n [2, 2],\n [2, 1],\n [1, 1],\n [1, 0],\n [0, 0],\n ][$spareMoves] === [$movesX, $movesO];\n}",
"function isOver()\n\t{\n\t\t\n\t\t//top row\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[0][1] && $this->board[0][1] == $this->board[0][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//middle row\n\t\tif ($this->board[1][0] && $this->board[1][0] == $this->board[1][1] && $this->board[1][1] == $this->board[1][2])\n\t\t\treturn $this->board[1][0];\n\t\t\t\n\t\t//bottom row\n\t\tif ($this->board[2][0] && $this->board[2][0] == $this->board[2][1] && $this->board[2][1] == $this->board[2][2])\n\t\t\treturn $this->board[2][0];\n\t\t\t\n\t\t//first column\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][0] && $this->board[1][0] == $this->board[2][0])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//second column\n\t\tif ($this->board[0][1] && $this->board[0][1] == $this->board[1][1] && $this->board[1][1] == $this->board[2][1])\n\t\t\treturn $this->board[0][1];\n\t\t\t\n\t\t//third column\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][2] && $this->board[1][2] == $this->board[2][2])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\t//diagonal 1\n\t\tif ($this->board[0][0] && $this->board[0][0] == $this->board[1][1] && $this->board[1][1] == $this->board[2][2])\n\t\t\treturn $this->board[0][0];\n\t\t\t\n\t\t//diagonal 2\n\t\tif ($this->board[0][2] && $this->board[0][2] == $this->board[1][1] && $this->board[1][1] == $this->board[2][0])\n\t\t\treturn $this->board[0][2];\n\t\t\t\n\t\tif ($this->totalMoves >= 9)\n\t\t\treturn \"Tie\";\n\t}",
"public function getDiagonalResultFor(string $playerUnit = 'O'): bool\n {\n return $this->winByDiagonal($playerUnit) !== false ?:\n $this->winByDiagonal(infer_opponent($playerUnit)) !== false;\n }",
"public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n $rightDiagonalSum = 0;\n $leftDiagonalSum = 0;\n\n for ($i = 0; $i <= $this->maxIndex; $i++) {\n\n if ($this->board[$i][$i] == $playerUnit) $rightDiagonalSum++;\n if ($this->board[$i][$this->maxIndex - $i] == $playerUnit) $leftDiagonalSum++;\n if ($rightDiagonalSum == $this->boardSize || $leftDiagonalSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n if ($rightDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($leftDiagonalSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInleftDiagonal($this->board);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $column = array_column($this->board, $i);\n $columnSum = 0;\n\n foreach ($column as $item) {\n if ($item == $playerUnit) $columnSum++;\n if ($columnSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInColumn($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($columnSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n $rowSum = 0;\n\n foreach ($this->board[$i] as $item) {\n if ($item == $playerUnit) $rowSum++;\n\n if ($rowSum == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRow($this->board, $i);\n if (!empty($coordinates) && empty($this->nextMove)) $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n\n if ($rowSum == $this->boardSize) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->secondMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }",
"function checkWinner($game) {\n\tglobal $message ;\n\t$winner = \"999\";\n\t$board = $game[\"board\"];\n\t$cellClicked = $game[\"clicked\"];\n\tif ($game[\"clicked\"] !== 9) {\n\t\tsettype($cellClicked, \"string\");\n\t\t$winCombo = array(\"012\",\"345\",\"678\",\"036\",\"147\",\"258\",\"840\",\"246\");\n\t\tfor( $row = 0; $row < 8; $row++ ) {\t\n\t\t\t// identify which row, column, and diag has been changed by current selection\n\t\t\t$idx = ($cellClicked < 9) \n\t\t\t\t? substr_count($winCombo[$row], $cellClicked)\n\t\t\t\t: -1;\n\t\t\t// test only the changed row, columns, and diags\n\t\t\tif ($idx == 1) { \n\t\t\t\tif ( $board[$winCombo[$row][0]] == $board[$winCombo[$row][1]] && \n\t\t\t\t\t $board[$winCombo[$row][1]] == $board[$winCombo[$row][2]] ) \t{\t\n\t\t\t\t\t\t$game[\"winningCombo\"] = $board[$winCombo[$row][0]];\n\t\t\t\t\t\t$winner = $winCombo[$row];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\t\n\t\tif ($game[\"winningCombo\"] != -1) {\n\t\t\t$message = substr($game[\"playToken\"],$game[\"winningCombo\"],1) . \" wins\";\n\t\t}\n\t\telseif (count_chars($board,3) == \"01\") {\n\t\t\t$message = \"Game over. No winner\";\n\t\t}\n\t} \n\treturn $winner;\n}",
"protected function winByDiagonal(string $playerUnit)\n {\n $d0 = '';\n $d1 = '';\n\n for ($x = 0; $x <= $this->getSize() - 1; $x++) {\n $d0 .= $this->getState()[$x][$x];\n }\n\n for ($x = 0; $x <= $this->getSize() - 1; $x++) {\n $d1 .= $this->getState()[$x][$this->getSize() - 1 - $x];\n }\n\n return $d0 === $this->getWinnerResult($playerUnit)\n ? 0\n : ($d1 === $this->getWinnerResult($playerUnit)\n ? 1\n : false);\n }",
"public static function find_move ()\n {\n // Initialize the default value functions. These apply starting values\n // to each position on the board. The starting values are then used\n // in calculating the overall value of moving in each direction.\n $my_color = Map::current('color');\n static::$_value_functions = [\n '^c.$' => config::SCORE_OTHER_BOTS,\n \"^.$my_color\\$\" => config::SCORE_OWN_COLOR,\n '^.*$' => config::SCORE_OTHER_COLOR,\n ];\n // Initialize a default value matrix.\n static::$_value_matrix = static::_generate_value_matrix();\n // Load the default available commands.\n $commands = config::VALID_MOVES;\n // Retrieve coordinates for available moves from the current map.\n // Any invalid moves will get set to null.\n $available_moves = [];\n foreach ($commands as $command) {\n $available_moves[$command] = Map::get(Map::translate($command, Map::current('x'), Map::current('y')));\n }\n // Remove invalid directions -- edges of map and any adjacent tiles\n // containing another bot (and, for now, the \"idle\" command too).\n unset($available_moves['idle']);\n $available_moves = array_filter($available_moves, function($move){\n if ( is_null($move) || substr($move, 0, 1) == 'c' ) {\n return false;\n }\n return true;\n });\n // For now, let's continue this helpful debugging output. TODO.\n print_r($available_moves);\n // Select a strategy.\n // If there is only one move (or no moves), fall back to the \"stuck\"\n // strategy. In the future this strategy might do something cool.\n if ( count($available_moves) < 2 ) {\n return static::stuck($available_moves);\n }\n // If the bot is surrounded by its own color and all moves have negative\n // values, try escaping.\n if ( count(preg_grep(\"/^.$my_color\\$/\", $available_moves)) == count($available_moves) ) {\n echo \"Yipes! Surrounded by own color...\\n\";\n $positive_scores = array_filter(static::evaluate_moves($available_moves), function($score){\n return $score > 0;\n });\n if ( count($positive_scores) == 0 ) {\n return static::escape($available_moves);\n }\n }\n // Now that urgent situations are resolved, look at nearby bots and\n // consider their behavior.\n $bots = Map::get_bots();\n $my_bot = $bots[Map::current('x') . '/' . Map::current('y')];\n foreach ($bots as $location => $bot) {\n if ( $bot->color != $my_color && Map::distance($bot->x, $bot->y, Map::current('x'), Map::current('y')) < 10 && $bot->status() != 'inactive' ) {\n echo \"Nearby active opponent: \" . $bot->name . \"\\n\";\n // Check their move history against this bot's move history;\n // if they share more than 5 moves out of the last 20...\n $my_moves = array_filter($my_bot->get_recent_moves(20));\n $their_moves = array_filter($bot->get_recent_moves(20));\n $my_overlap = array_intersect($my_moves, $their_moves);\n $their_overlap = array_intersect($their_moves, $my_moves);\n // ...then try to figure out who's following who, and if the\n // other bot is following this bot, then switch to the \"punish\"\n // strategy.\n if ( count($their_overlap) > 5 && array_sum(array_keys($my_overlap)) > array_sum(array_keys($their_overlap)) ) {\n // If this bot's matching movement indices are generally\n // higher than the other bot's, then that means they've made\n // matching moves more recently, so the other bot can be\n // assumed to be following this one.\n return static::punish($available_moves, $bot);\n }\n }\n }\n // If more than 20% of the tiles on the map are unclaimed, then select\n // a friendlier, less aggressive movement pattern.\n if ( Map::count('ux') > array_product(Map::size()) * .2 ) {\n return static::cruise($available_moves);\n }\n // Default strategy: best local move.\n return static::aggressive($available_moves);\n }",
"function iswhitechecked()\n{\n require(\"../includes/global.php\");\n\n $board = $_SESSION['board'];\n $row;\n $column;\n \n for ($i = 1; $i < 9; $i++)\n {\n for ($j = 1; $j < 9; $j++)\n {\n if ($board[$i][$j][\"piece\"] == \"king\" && $board[$i][$j][\"white\"] == true)\n {\n $row = $i;\n $column = $j;\n $i = 9;\n $j = 9;\n }\n }\n }\n \n if ($board[$row - 1][$column + 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column + 1][\"white\"] == false)\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"pawn\" && $board[$row - 1][$column - 1][\"white\"] == false)\n {\n return true;\n }\n \n \n \n if (isset($board[$row + 2][$column + 1]))\n {\n if ($board[$row + 2][$column + 1][\"piece\"] == \"knight\" && $board[$row + 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 2][$column - 1]))\n {\n if ($board[$row + 2][$column - 1][\"piece\"] == \"knight\" && $board[$row + 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column + 2]))\n {\n if ($board[$row + 1][$column + 2][\"piece\"] == \"knight\" && $board[$row + 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row + 1][$column - 2]))\n {\n if ($board[$row + 1][$column - 2][\"piece\"] == \"knight\" && $board[$row + 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column + 1]))\n {\n if ($board[$row - 2][$column + 1][\"piece\"] == \"knight\" && $board[$row - 2][$column + 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 2][$column - 1]))\n {\n if ($board[$row - 2][$column - 1][\"piece\"] == \"knight\" && $board[$row - 2][$column - 1][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column + 2]))\n {\n if ($board[$row - 1][$column + 2][\"piece\"] == \"knight\" && $board[$row - 1][$column + 2][\"white\"] == false)\n {\n return true;\n }\n }\n if (isset($board[$row - 1][$column - 2]))\n {\n if ($board[$row - 1][$column - 2][\"piece\"] == \"knight\" && $board[$row - 1][$column - 2][\"white\"] == false)\n {\n return true;\n }\n }\n \n \n \n \n \n \n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column + $i]))\n {\n break;\n }\n if (($board[$row + $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n \n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column - $i]))\n {\n break;\n }\n if (($board[$row + $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row + $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row + $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column + $i]))\n {\n break;\n }\n if (($board[$row - $i][$column + $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column + $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column - $i]))\n {\n break;\n }\n if (($board[$row - $i][$column - $i][\"piece\"] == \"bishop\" || $board[$row - $i][$column - $i][\"piece\"] == \"queen\") \n && $board[$row - $i][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row + $i][$column]))\n {\n break;\n }\n if (($board[$row + $i][$column][\"piece\"] == \"rook\" || $board[$row + $i][$column][\"piece\"] == \"queen\") \n && $board[$row + $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row + $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row - $i][$column]))\n {\n break;\n }\n if (($board[$row - $i][$column][\"piece\"] == \"rook\" || $board[$row - $i][$column][\"piece\"] == \"queen\") \n && $board[$row - $i][$column][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row - $i][$column][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column + $i]))\n {\n break;\n }\n if (($board[$row][$column + $i][\"piece\"] == \"rook\" || $board[$row][$column + $i][\"piece\"] == \"queen\") \n && $board[$row][$column + $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column + $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n for ($i = 1; $i < 8; $i++)\n {\n if (!isset($board[$row][$column - $i]))\n {\n break;\n }\n if (($board[$row][$column - $i][\"piece\"] == \"rook\" || $board[$row][$column - $i][\"piece\"] == \"queen\") \n && $board[$row][$column - $i][\"white\"] == false)\n {\n return true;\n }\n else if ($board[$row][$column - $i][\"piece\"] != \"empty\")\n {\n break;\n }\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8) \n if ($board[$row + 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column > 1)\n if ($board[$row + 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column < 8)\n if ($board[$row][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($column > 1)\n if ($board[$row][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row >1 && $column < 8)\n if ($board[$row - 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($row < 8 && $column < 8)\n if ($board[$row + 1][$column + 1][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column][\"piece\"] == \"king\")\n {\n return true;\n }\n if ($board[$row - 1][$column - 1][\"piece\"] == \"king\")\n {\n return true;\n }\n \n return false;\n \n}",
"public function GenerateLegalBishopMoves($chesspiece, $x, $y){\n\t\t//examine top right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine bottom right diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a++;\n $b--;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){ \n break; //stop examining this diagonal.\n }\n }\n\n //examine top left diagonal\n $a = $x;\n $b = $y;\n for ($i=0; $i<8; $i++){\n $a--;\n $b++;\n \n $from = array($x, $y);\n $to = array ($a, $b);\n \n if (!$this->IsLegalChessSquare($a, $b))\n \tbreak;\n \n if($this->IsFriendlyPiece($chesspiece, $a, $b))\n \tbreak;\n \t\n $this->AddChessSquare($chesspiece, $from, $to);\n \n if ($this->IsEnemyPiece($chesspiece, $a, $b)){\n break; //stop examining this diagonal.\n }\n }\n \n return true;\n\t}",
"public function checkWinning($playerUnit = 'X', $block = false)\n {\n $player = $playerUnit;\n\n if ($block) {\n if ($playerUnit == 'X') {\n $playerUnit = 'O';\n } else {\n $playerUnit = 'X';\n }\n }\n\n if ($this->checkWiningDiagonal($playerUnit, 'right') || $this->checkWiningDiagonal($playerUnit, 'left') || $this->checkWiningRowColumn($playerUnit, false) || $this->checkWiningRowColumn($playerUnit, true)) {\n $this->setMessage($playerUnit . \" wins!\");\n return true;\n }\n\n $rightDiagonal = $this->checkWiningDiagonal($playerUnit, 'right', true);\n if (count($rightDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInRightDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $leftDiagonal = $this->checkWiningDiagonal($playerUnit, 'left', true);\n if (count($leftDiagonal) == $this->maxIndex) {\n $coordinates = $this->findEmptyItemInLeftDiagonal($this->ticTacToeBoard);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitColumn = $this->checkWiningRowColumn($playerUnit, false, true);\n if ($playerUnitColumn && $playerUnitColumn[0] == true) {\n $coordinates = $this->findEmptyItemInColumn($this->ticTacToeBoard, $playerUnitColumn[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n $playerUnitRow = $this->checkWiningRowColumn($playerUnit, true, true);\n if ($playerUnitRow && $playerUnitRow[0] == true) {\n $coordinates = $this->findEmptyItemInRow($this->ticTacToeBoard,$playerUnitRow[1]);\n if (!empty($coordinates) && empty($this->nextMove)) {\n $this->nextMove = [$coordinates[1], $coordinates[0], $player];\n }\n }\n\n if (empty($this->nextMove) && !$block) {\n $this->checkWinning($playerUnit, true);\n if (empty($this->nextMove)) {\n $this->nextMove($playerUnit);\n }\n }\n\n if ($this->message == \"\") $this->setMessage($player . \" played.\");\n return false;\n }",
"public function GenerateLegalMoves($chessposition){\n\t\t$this->SetAsPosition($chessposition);\n\t\t$this->ResetLegalMovesArr();\n\t\n\t\t//loop through the entire board\n\t\t//possible candidates are (x,y)\n\t\tfor ($x=0; $x<8; $x++){\n for ($y=0; $y<8; $y++){\n $chesspiece = $this->chessposition[$x][$y];\n \n //if nothing is there\n if ($chesspiece == 0){\n continue;\n }\n \n if (($this->IsWhiteToMove && ($chesspiece < 0)) ||\n \t\t(!$this->IsWhiteToMove && ($chesspiece > 0))){\n \t\tcontinue;\n \t\t}\n \n //if chesspiece is a pawn\n if (($chesspiece == 1) || ($chesspiece == -1)){ // chesspiece = pawn\n $this->GenerateLegalPawnMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n \n //if $chesspiece is a knight\n if (($chesspiece == 2) || ($chesspiece == -2)){\n $this->GenerateLegalKnightMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }//end of examining legal moves for knight\n \n //if $chesspiece is a bishop\n if (($chesspiece == 3) || ($chesspiece == -3)){ //$chesspiece is a bishop\n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for bishop\n \n //if $chesspiece is a rook\n if (($chesspiece == 4) || ($chesspiece == -4)){\n $this->GenerateLegalRookMoves($chesspiece, $x, $y); \n \n continue; //move on to the next iteration\n }//end of generating legal moves for the rook\n \n //if $chesspiece is a queen\n if (($chesspiece == 5) || ($chesspiece == -5)){\n \n $this->GenerateLegalBishopMoves($chesspiece, $x, $y);\n $this->GenerateLegalRookMoves($chesspiece, $x, $y);\n \n continue; //move on to the next iteration\n }//end of generating legal moves for the queen\n \n //if chesspiece is a king\n if (($chesspiece == 6) || ($chesspiece == -6)){\n $this->GenerateLegalKingMoves($chesspiece, $x, $y);\n \n continue; // move on to the next iteration\n }\n }\n }\n\t}",
"function win_check($token) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo '<br />> Check function called from Game for token ' . $token . '...<br />';\r\n }\r\n\r\n $this->winning_line = []; \r\n foreach ($this->win_lines as $line_type => $lines) {\r\n foreach ($lines as $line_name => $line) {\r\n $this->winning_line[0] = $line; \r\n $check_value = 0; \r\n $win_move = 0; \r\n foreach ($line as $pos) {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo 'Checking for token ' . $token . ' in ' . $line_type . ' ' . $line_name . ' [' . implode(',', $line) . ']';\r\n }\r\n if ($this->position[$pos] != $token) {\r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n\r\n if ($this->debug) {\r\n echo ' - Position ' . $pos . '. Result: Not Found. Skipping rest of ' . $line_name . '<br />';\r\n }\r\n break;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n $win_move = $pos;\r\n }\r\n } else {\r\n if ($this->debug && debug_backtrace()[1]['function'] == 'game_check') {\r\n echo ' - Position ' . $pos . '. Result: Found.<br />';\r\n }\r\n $check_value++;\r\n }\r\n }\r\n\r\n if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n if ($check_value == ($this->grid_size - 1)) {\r\n if ($this->position[$win_move] == '-') {\r\n return $win_move;\r\n }\r\n }\r\n } else if (debug_backtrace()[1]['function'] == 'game_check') {\r\n if ($check_value == $this->grid_size) {\r\n if ($this->debug) {\r\n echo 'We have a winner!<br />';\r\n }\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n $this->winning_line = []; \r\n if (debug_backtrace()[1]['function'] == 'game_check') {\r\n return false;\r\n } else if (debug_backtrace()[1]['function'] == 'pick_move') {\r\n return -1;\r\n } else {\r\n return null;\r\n }\r\n }",
"public static function check_win($game_id)\n {\n $sum = 0;\n $matrix = (new self)->fill_matrix($game_id);\n // horisont\n for ($i = 0; $i < count($matrix); $i++) {\n $sum = (new self)->sum($matrix[$i]);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n\n // vertihal\n for ($j = 0; $j < count($matrix[0]); $j++) {\n $sum = (new self)->sum(array_column($matrix, $j));\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }\n\n // diagonal 1\n $sum = 0;\n $main_diagonal = array();\n for ($i = 0; $i < count($matrix); $i++) {\n $main_diagonal[] = $matrix[$i][$i];\n }\n\n $sum = (new self)->sum($main_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n\n // diagonal 2\n $sum = 0;\n $secondary_diagonal = array();\n for ($i = count($matrix) - 1; $i >=0; $i--) {\n $secondary_diagonal[] = $matrix[$i][count($matrix) - $i - 1];\n }\n $sum = (new self)->sum($secondary_diagonal);\n if ($sum == 3) {\n return \"user\";\n }\n if ($sum == -3) {\n return \"pc\";\n }\n }"
]
| [
"0.6600075",
"0.6290938",
"0.62222743",
"0.61987793",
"0.6095502",
"0.60868734",
"0.5933043",
"0.584326",
"0.57317954",
"0.5723613",
"0.56872284",
"0.56503785",
"0.5627409",
"0.5589535",
"0.55676717",
"0.55502504",
"0.5538387",
"0.5535532",
"0.5506976",
"0.54482555",
"0.5431541",
"0.54125214",
"0.53979534",
"0.53699183",
"0.5362783",
"0.5346643",
"0.5328598",
"0.53224474",
"0.53185534",
"0.53040487"
]
| 0.7485393 | 0 |
Player Set current player | public function setCurrentPlayer($player){
$this->currentPlayer = $player;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPlayer(Player $player);",
"public function setCurrentPlayer($player) {\n $this->game->set_current_turn($player);\n }",
"public function switchActivePlayer()\n\t{\n\t\t$activeplayer = $this -> activePlayer;\n\t\t$playerX = $this -> playerX;\n\t\t$playerO = $this -> playerO;\n\t\tif ($activeplayer == $playerX)\n\t\t\t$this -> activePlayer = $playerO;\n\t\telse\n\t\t\t$this -> activePlayer = $playerX;\n\t\t\t\n\t\t$newactive = $this -> activePlayer;\n\t\t\n\t\t$query = \"UPDATE tttgame \n\t\t\t\t SET activeplayer = '$newactive' \n\t\t\t\t WHERE playerX = '$playerX' \n\t\t\t\t AND playerO = '$playerO';\";\n\t\t$this -> queryDB($query);\n\t}",
"public function updatePlayer($player)\n\t{\n\t}",
"protected function selectPlayer(){\r\n $this->currentPlayer = rand(1,2);\r\n selectRandPlayerMsg($this->currentPlayer);\r\n }",
"private function initPlayer(): void\n {\n $name = $this->getConfig()->getPlayerName();\n $interaction = $this->getConfig()->getInteractionInterface();\n\n $this->player = PlayerFabric::createReal($this->pile, $name, $interaction);\n }",
"public function ensurePlayerActive(Player $player, $value = null);",
"public function onPlayerInteract(Player $player) : void {\n\t}",
"public function setPlayer(Player $player)\n {\n $this->player = $player;\n\n return $this;\n }",
"private function _changeActivePlayer()\n\t{\n\t\t// Get next player id, then save it to this game\n\t\t$this->read();\n\t\t$this->Player->id = $this->data['Game']['active_player'];\n\t\t$this->Player->read();\n\t\t$this->set('active_player', $this->Player->data['Player']['next_player_id']);\n\t\t$this->save();\n\t\t\n\t\t// Success\n\t\treturn true;\n\t}",
"public function player(string $player)\n {\n $this->player = $player;\n\n return $this;\n }",
"private function setMessageToPlayer()\n {\n if ($this->isUserMode()) {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng. Vill du vara med i tävlingen, spara poängen med den gröna knappen!\";\n } else {\n $this->playerMessage = 'Du fick ' . $this->points . \" poäng!\";\n }\n }",
"public function switchPlayer(){\n\t\tfor($col = 0; $col < 3; $col++){\n\t\t\tfor($row = 0; $row < 3; $row++){\n\t\t\t\tif(isset($_GET[\"cell-\".$col.\"-\".$row])){\n\t\t\t\t\tif($this->player1->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player1;\n\t\t\t\t\t}\n\t\t\t\t\tif($this->player2->getSymbol() == $_GET[\"cell-\".$col.\"-\".$row]) {\n\t\t\t\t\t\t$this->currentPlayer = $this->player2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->currentPlayer === $this->player1){\n\t\t\t$this->currentPlayer = $this->player2;\n\t\t} else {\n\t\t\t$this->currentPlayer = $this->player1;\n\t\t}\n\t}",
"public function __construct(\\App\\Player $player)\n {\n $this->player = $player;\n }",
"public function setNextPlayer($idPlayer)\n {\n if ($this->id_player6 == 0)\n {\n $this->id_player6 = $idPlayer;\n }\n else if ($this->id_player7 == 0)\n {\n $this->id_player7 = $idPlayer;\n }\n else if ($this->id_player8 == 0)\n {\n $this->id_player8 = $idPlayer;\n }\n else if ($this->id_player9 == 0)\n {\n $this->id_player9 = $idPlayer;\n }\n else if ($this->id_player10 == 0)\n {\n $this->id_player10 = $idPlayer;\n }\n else if ($this->id_player11 == 0)\n {\n $this->id_player11 = $idPlayer;\n }\n else if ($this->id_player12 == 0)\n {\n $this->id_player12 = $idPlayer;\n }\n else if ($this->id_player13 == 0)\n {\n $this->id_player13 = $idPlayer;\n }\n else if ($this->id_player14 == 0)\n {\n $this->id_player14 = $idPlayer;\n }\n else if ($this->id_player15 == 0)\n {\n $this->id_player15 = $idPlayer;\n }\n else if ($this->id_player16 == 0)\n {\n $this->id_player16 = $idPlayer;\n }\n else if ($this->id_player17 == 0)\n {\n $this->id_player17 = $idPlayer;\n }\n else if ($this->id_player18 == 0)\n {\n $this->id_player18 = $idPlayer;\n }\n else if ($this->id_player19 == 0)\n {\n $this->id_player19 = $idPlayer;\n }\n else if ($this->id_player20 == 0)\n {\n $this->id_player20 = $idPlayer;\n }\n return $this;\n }",
"public function getPlayer()\n\t{\n\t\treturn $this->player;\n\t}",
"public function getPlayer()\n {\n return $this->player;\n }",
"public function getPlayer()\n {\n return $this->player;\n }",
"public function getPlayer()\n {\n return $this->player;\n }",
"public function registerPlayer(Player $player) {\r\n\r\n if($player->isSpectator() || \r\n\r\n (!is_null($this->getMain()->getServer()->getPluginManager()->getPlugin(\"SpectatorPlus\")) &&\r\n\r\n $this->getMain()->getServer()->getPluginManager()->getPlugin(\"SpectatorPlus\")->isSpectator($player))) { // Support for spectator Plus\r\n\r\n $this->spectators[$player->getName()] = $player;\r\n\r\n $player->HideAndSeekRole = self::ROLE_SPECTATE;\r\n\r\n } elseif($this->step == self::STEP_WAIT || $this->step == self::STEP_START) {$player->hideAndSeekGame = $this;\r\n\r\n // API inside player's class (easilier to get data)\r\n\r\n $player->HideAndSeekRole = self::ROLE_WAIT;\r\n\r\n $player->playsHideAndSeek = true;\r\n\r\n $this->players[$player->getName()] = $player;\r\n\r\n $player->setGamemode(2); // Set it to adventure so player cannot break blocks.\r\n\r\n $this->sendMessage(\"§a\" . $player->getName() . \" joined (\" . count($this->players) . \"/\" . $this->getMaxPlayers() . \"). \" . (round($this->getMaxPlayers() * 0.75) - count($this->players)) . \" players left before starting\");\r\n\r\n } else {\r\n\r\n $this->spectators[$player->getName()] = $player;\r\n\r\n $player->HideAndSeekRole = self::ROLE_SPECTATE;\r\n\r\n $player->setGamemode(3);\r\n\r\n }\r\n\r\n }",
"public function giveController(Player $player) : void{\n\t\t$player->getInventory()->addItem($this->getControllerItem());\n\t}",
"public function setMediaPlayer( Streamwide_Engine_Media_Player $mediaPlayer )\n {\n $this->_mediaPlayer = $mediaPlayer;\n }",
"public function getPlayer();",
"public function setPlayerName($value)\n {\n return $this->set(self::_PLAYER_NAME, $value);\n }",
"function initPlayer($player) {\n\t\t// creates player object ...\n\t\t$player_item = new Player($player);\n\n\t\tldb_playerConnect($this, $player_item);\n\n\t\t// adds a new player to the intern player list ...\n\t\t$this->server->players->addPlayer($player_item);\n\n\t\t// display console message ...\n\t\t$this->console('<< player {1} online [{2}] {3} wins',\n\t\t\t$player_item->id,\n\t\t\t$player_item->login,\n\t\t\t$player_item->getWins());\n\t}",
"public function setName($playerName) {\n\t\tConnectionFactory::updateTableRowAbsoluteBasic(\"users\", array('name' => $playerName),\n\t\tarray('id'=>$this->id));\n\t\t$this->name = $playerName;\n\t}",
"public function player() : Player\n {\n return $this->player;\n }",
"public function registerPlayer(Player $player): void\n {\n foreach ($this->players as $key => $value) {\n if ($value->id === null) {\n // Can inject player in non-active slot.\n $this->players[$key] = $player;\n\n break;\n }\n }\n }",
"public abstract function onPlayerSelect();",
"public function setPlayersPlaying($pdo, $playerID, $opponentID) {\n $pdo->beginTransaction();\n \n try {\n $sql = \"UPDATE player SET isPlaying = 1 WHERE id = {$playerID} OR id = {$opponentID}\";\n $sth = $pdo->prepare($sql);\n \n $sth->execute();\n $currentID = $pdo->lastInsertId(); \n $pdo->commit(); \n } catch (PDOException $e) {\n die(\"<p>{$e->getMessage()}\");\n $pdo->rollBack();\n return NULL;\n }\n }"
]
| [
"0.8006255",
"0.7876374",
"0.68962395",
"0.6857048",
"0.6619847",
"0.6473134",
"0.63770133",
"0.62825596",
"0.62732565",
"0.6243762",
"0.61989444",
"0.61837643",
"0.61639684",
"0.6089696",
"0.6029448",
"0.6025325",
"0.6009613",
"0.6009613",
"0.6009613",
"0.5985696",
"0.5928059",
"0.5899848",
"0.58896065",
"0.5889113",
"0.58675927",
"0.5852861",
"0.5838359",
"0.58195025",
"0.5805915",
"0.578558"
]
| 0.87652165 | 0 |
Set Last Row inseat | public function setLastRowInsert($row){
$this->lastRowInsert = $row;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function lastRow() {\n\t}",
"private function setCurrRow()\r\n {\r\n // (1) if bNewRow, there is no selection\r\n if( $this->oComp->bNewRow ) {\r\n $this->oComp->kfuiCurrRow->SetKey(0); // this also clears the form's oDS->kfr\r\n }\r\n // (2) if there is no current row, make the first row the current row\r\n else if( !$this->oComp->kfuiCurrRow->GetKey() && @$this->raWindowRows[0] && $this->raWindowRows[0]->Key() ) {\r\n $this->oComp->kfuiCurrRow->SetKey( $this->raWindowRows[0]->Key() );\r\n // handled in Init() $this->iOffsetCurrRow = $this->iWindowOffset; // curr row is now at top of window\r\n }\r\n // (3) insert the current row if it is not in the window but likely of interest to the user\r\n else if( $this->oComp->kfuiCurrRow->GetKey() && @$_REQUEST['kluge_Added A Row Just Now Or We Really Like this One Row']) {\r\n $bFound = false;\r\n foreach( $this->raWindowRows as $kfr ) {\r\n if( $kfr->Key() == $this->oComp->kfuiCurrRow->GetKey() ) {\r\n $bFound = true;\r\n break;\r\n }\r\n }\r\n if( !$bFound ) {\r\n // scan the view\r\n // insert the current row into the window, maybe half way, and pop off the last one\r\n // fix problems with iOffsetCurrRow, offsets for scrolling down (should see the popped row)\r\n }\r\n }\r\n }",
"public function lastLine()\n {\n $this->line()->application->cursor->previousLine();\n }",
"public function moveLast()\n {\n $target = static::max($this->getPositionColumn());\n\n return $this->moveTo($target);\n }",
"public function SetLastRecord($record){$this->_lastrecord = $record;}",
"public function deleteLastRow()\n {\n array_pop($this->childNodes);\n }",
"public function lastCol() {\n\t}",
"public function setLastRoll() {\n $this->lastRoll = [];\n}",
"public function lastRow()\n {\n $query = clone $this;\n $offset = $this->limit ? $this->limit['start'] : 0;\n\n // Limit index to start in case of empty results\n $index = max($this->count() + $offset - 1, 0);\n $query->setLimit(1, $index);\n return $query;\n }",
"public function lastItem();",
"public function getLastRowInsert(){\r\n return $this->lastRowInsert;\r\n }",
"public function getEndRow(): int\n {\n return $this->end;\n }",
"public function last();",
"public function last();",
"public function last();",
"public function getLastItem() {}",
"public function getLastItem() {}",
"public function getLast();",
"public function getLast();",
"function MoveLast()\n\t{\n\t\tif ($this->EOF) return false;\n\t\treturn $this->Move($this->_numOfRows - 1);\n\t}",
"function MoveLast() {}",
"function resetRow($Old,$Current,$Row)\n{\n if($Old != $Current)\n {\n $Row = 2;\n $Zone= '';\n }\n\n return $Row;\n}",
"public function last() {\n return $this->seek($this->data['num_rows'] - 1);\n }",
"private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }",
"public function last()\n {\n return parent::last();\n }",
"public function last()\n {\n return parent::last();\n }",
"public function last()\n {\n return parent::last();\n }",
"public function last()\n {\n return parent::last();\n }",
"public function last()\n {\n return parent::last();\n }",
"public function last()\n {\n return parent::last();\n }"
]
| [
"0.7037437",
"0.6079164",
"0.58813494",
"0.57635623",
"0.57365763",
"0.57318896",
"0.57262325",
"0.5721942",
"0.5720174",
"0.56707984",
"0.56589437",
"0.56538653",
"0.56523293",
"0.56523293",
"0.56523293",
"0.55810255",
"0.55810255",
"0.54979813",
"0.54979813",
"0.54957116",
"0.54656225",
"0.544129",
"0.5432345",
"0.5410745",
"0.54005164",
"0.54005164",
"0.54005164",
"0.54005164",
"0.54005164",
"0.54005164"
]
| 0.69677466 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.