query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return the id of the last inserted record.
public function lastInsertId() { return $this->pdo->lastInsertId(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function last_id() {\n return $this->_connection->lastInsertId();\n }", "public function lastInsertId();", "public function lastInsertId();", "public function lastInsertId();", "public function getLastInsertId();", "public function getLastInsertId();", "public function getLastInsertId();", ...
[ "0.8800096", "0.8793759", "0.8793759", "0.8793759", "0.87822884", "0.87822884", "0.87822884", "0.8763969", "0.8735688", "0.8730565", "0.86828357", "0.86741924", "0.86563045", "0.86329615", "0.86297405", "0.862288", "0.857508", "0.8569663", "0.85602546", "0.8498436", "0.849425...
0.8363826
56
Return all records of the given table and return instances of the given class.
public function all(string $table, $columns = '*') { if (is_array($columns)) { foreach ($columns as &$column) { $column = preg_replace('/[^a-zA-Z_]*/', '', $column); } $columns = implode(',', $columns); $stmt = $this->pdo->prepare("SELECT {$columns} FROM {$table}"); } else { $stmt = $this->pdo->prepare("SELECT * FROM {$table}"); } $stmt->execute(); return $stmt->fetchAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fetchAll() {\n // Initialize fetch-all cache, if necessary\n if (!isset(self::$fetchAllRecordsPreparedStatementCache)) {\n self::$fetchAllRecordsPreparedStatementCache = array();\n }\n\n // Cache calling subclass name \n $table_name = static::getTableName();\n \n //...
[ "0.69339484", "0.674267", "0.66717446", "0.66242766", "0.6612012", "0.65876335", "0.6526707", "0.64963025", "0.6483578", "0.647809", "0.64717907", "0.6465002", "0.64388925", "0.64375657", "0.6427804", "0.6406902", "0.6375559", "0.63473886", "0.6344997", "0.6326025", "0.630351...
0.0
-1
Return the first record of the given table as an instance of the given class.
public function findWithId(string $table, $id) { $stmt = $this->pdo->prepare("SELECT * FROM {$table} WHERE id = ?"); $stmt->execute([$id]); return $stmt->fetchAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function first()\n\t{\n\t\treturn self::new_instance_records()->first();\n\t}", "public function selectFirst()\n {\n return $this->pdoConnection->query('SELECT * FROM ' . $this->table . ' LIMIT 1 ', \\PDO::FETCH_CLASS, $this->className)->fetch();\n }", "public function first()\n {...
[ "0.7174507", "0.6719947", "0.6544192", "0.65335566", "0.6489773", "0.63462794", "0.6261499", "0.6242785", "0.6187188", "0.61449975", "0.6129657", "0.6110063", "0.61063194", "0.61044705", "0.6100232", "0.6035502", "0.6009321", "0.59512377", "0.5909191", "0.5909191", "0.5909191...
0.0
-1
Perform a custom select query with user input data passed as $parameters.
public function select(string $query, array $parameters) { $stmt = $this->pdo->prepare($query); $stmt->execute($parameters); return $stmt->fetchAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function prepareSelect();", "public function select($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"SELECT \";\n\t\t$p = $this->clean($params);\n\t\t$statement = $prefix.\" \".$this->genFrom($p['cols']).\" \".$this->genTable($p['tables']).$this->genWhere($p['where']);\t\n\t\tre...
[ "0.68805516", "0.6455435", "0.6454289", "0.6419162", "0.6303152", "0.6268975", "0.6247069", "0.6247069", "0.6247069", "0.62282544", "0.6150493", "0.6144399", "0.6140313", "0.6131772", "0.6094365", "0.60730684", "0.60730684", "0.60730684", "0.60623974", "0.6011941", "0.5992475...
0.5750872
59
Perform a custom query with user input data passed as $parameters.
public function query(string $query, array $parameters = []) { $stmt = $this->pdo->prepare($query); return $stmt->execute($parameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function query($q, $params = []);", "public function doQuery($sql, $params);", "abstract public function query();", "public function runCustomQuery($query, Database_Config $databaseConfig = NULL);", "abstract public function Query( $query, $params );", "public function query(string $sql, ...
[ "0.70814127", "0.70514184", "0.6959246", "0.6915109", "0.685056", "0.6796333", "0.6735587", "0.6670455", "0.66446424", "0.66446424", "0.66446424", "0.6642994", "0.6642994", "0.6642994", "0.66143525", "0.6595483", "0.6564408", "0.65640193", "0.6546601", "0.6539666", "0.6515277...
0.0
-1
the constructor of this class
public function __construct($post_type = '', $taxs = array(), $meta_data = array(), $localize = array()){ $this->post_type = 'mjob_agreement'; parent::__construct( $this->post_type, $taxs, $meta_data, $localize); $this->meta = array( 'is_consumer_right_statement', 'is_notice_cancellation' ); $this->post_type_singular = 'Agreement'; $this->post_type_regular = 'Agreements'; $this->taxs = array( 'mjob_category' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _construct() {\n \t\n\t\t\n\t}", "final private function __construct() {\n\t\t\t}", "private function __construct()\t{}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function _construct()\n\t{\n\n\t}", "public function construct()\n\t\t{\n\t\t}", "public function __constru...
[ "0.8621917", "0.8557927", "0.85266626", "0.8508989", "0.84813875", "0.846886", "0.8468103", "0.84507173", "0.84484714", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0.84474564", "0...
0.0
-1
todo dle popisu je to spravne, ale z nejakyho duvodu to ne vzdy sedi
public static function isValidDataBoxId(string $dataBoxId) { $charCount = 7; $mapString = 'abcdefghijkmnpqrstuvwxyz23456789'; if (Strings::length($dataBoxId) !== $charCount) { throw new InputNotValid(sprintf('DataBoxId "%s" have less char. Required is %d char.', $dataBoxId, $charCount)); } $checkChar = Strings::substring($dataBoxId, -1); $checkId = Strings::substring($dataBoxId, 0, -1); $tmp = null; $splittedDataBoxId = str_split($checkId); foreach ($splittedDataBoxId as $charIndex => $char) { $int = strpos($mapString, $char); $charIndex = Strings::indexOf($mapString, $char); if (($charIndex % 2) > 0) { $int *= 2; } $restOfTheDivision = null; $value = null; if ($int > 0) { $value = round($int / 32); $restOfTheDivision = $int % 32; $int = $value + $restOfTheDivision; } $tmp += $int; } $restOfTheDivision = $tmp % 32; if ($restOfTheDivision > 0) { $restOfTheDivision = 32 - $restOfTheDivision; } if ($mapString[$restOfTheDivision] !== $checkChar) { throw new InputNotValid(sprintf('Luhn algoritmh is not valid for DataBoxId "%s"', $dataBoxId)); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AggiornaPrezzi(){\n\t}", "public function masodik()\n {\n }", "public function obtenerViajesplus();", "abstract public function getPasiekimai();", "public function valorpasaje();", "public function obtenerViajesplusAbonados();", "public function boleta()\n\t{\n\t\t//\n\t}", "pri...
[ "0.65236425", "0.6050779", "0.60170317", "0.5945462", "0.5827543", "0.57499284", "0.5735956", "0.57131404", "0.564948", "0.56271726", "0.56250745", "0.5609532", "0.5592202", "0.5572959", "0.5547439", "0.55439174", "0.5531015", "0.55304086", "0.55072117", "0.545865", "0.545256...
0.0
-1
Read data length (1 byte)
function op_pushdata1(&$stack, &$bytecode, &$return) { $size = unpack('C', substr($bytecode, 0, 1))[1]; // Push data on the stack array_push($stack, substr($bytecode, 1, $size)); // Skip the data we just pushed on stack $bytecode = substr($bytecode, $size+1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read($length);", "public function read($length);", "public function read($length);", "public function getLength()\n {\n return strlen($this->data);\n }", "public function readBytes($length) {}", "public function read($length)\n {\n }", "function getLength ()\n\t{\n\t\...
[ "0.7440475", "0.7440475", "0.7440475", "0.73347795", "0.7211564", "0.7188012", "0.6990548", "0.6979004", "0.6957159", "0.69172305", "0.69170964", "0.690911", "0.6899816", "0.68776107", "0.68767524", "0.6876467", "0.68642706", "0.6862342", "0.6862268", "0.6862268", "0.6862268"...
0.0
-1
Read data length (2 bytes)
function op_pushdata2(&$stack, &$bytecode, &$return) { $size = unpack('v', substr($bytecode, 0, 2))[1]; // Push data on the stack array_push($stack, substr($bytecode, 2, $size)); // Skip the data we just pushed on stack $bytecode = substr($bytecode, $size+2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read($length);", "public function read($length);", "public function read($length);", "public function readBytes($length) {}", "public function read($length)\n {\n }", "public function getLength()\n {\n return strlen($this->data);\n }", "function getPayloadLength();", ...
[ "0.7304598", "0.7304598", "0.7304598", "0.7094056", "0.70483017", "0.6960831", "0.6831843", "0.67855346", "0.6713402", "0.666936", "0.666093", "0.6636725", "0.662885", "0.6627719", "0.6625154", "0.66241837", "0.6623308", "0.661724", "0.661724", "0.661724", "0.6617134", "0.6...
0.0
-1
Read data length (4 bytes)
function op_pushdata4(&$stack, &$bytecode, &$return) { $size = unpack('V', substr($bytecode, 0, 4))[1]; // Push data on the stack array_push($stack, substr($bytecode, 4, $size)); // Skip the data we just pushed on stack $bytecode = substr($bytecode, $size+4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read($length);", "public function read($length);", "public function read($length);", "function getPayloadLength();", "public function getLength()\n {\n return strlen($this->data);\n }", "public function readBytes($length) {}", "public function read($length)\n {\n }", ...
[ "0.7160893", "0.7160893", "0.7160893", "0.70972085", "0.7049751", "0.6969215", "0.69129896", "0.6740731", "0.67299795", "0.6704213", "0.67034036", "0.6702364", "0.66675776", "0.66665596", "0.6660938", "0.6660504", "0.6660504", "0.6660504", "0.66230345", "0.6616208", "0.660478...
0.0
-1
We need to pop a value from the stack
function op_verify(&$stack, &$bytecode, &$return) { if (count($stack) == 0) { throw new CScriptNotValid(); } $val = array_pop($stack); // Check $return = ($val === self::OP_TRUE); // False is not poped from the stack if (!$return) { array_push($stack, $val); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop()\r\n\t{\r\n\t}", "public function popNodeFromStack() {}", "public ...
[ "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.7468564", "0.73998153", "0.739057", "0.738034", "0.72852546", "0.72711134", "0.726797", "0.7131527", "0.7105379", "0.70022684", "0.70022684", "0.6796776", "0.679...
0.0
-1
We need to pop a value from the stack
function op_ripemd160(&$stack, &$bytecode, &$return) { if (count($stack) == 0) { throw new CScriptNotValid(); } // Get value from the stack $val = array_pop($stack); // Hash value (ripemd160) if (function_exists('hash')) { $val = hash('ripemd160', $val, true); } else if (function_exists('mhash')) { $val = mhash(MHASH_RIPEMD160, $val); } else { throw new \Exception("Not implemented"); } // Push hash on stack array_push($stack, $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop()\r\n\t{\r\n\t}", "public function popNodeFromStack() {}", "public ...
[ "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.7468404", "0.73994184", "0.7389957", "0.73798776", "0.7284741", "0.7270938", "0.7267691", "0.7131278", "0.7104731", "0.7001997", "0.7001997", "0.67960066", "0.67...
0.0
-1
We need to pop a value from the stack
function op_sha1(&$stack, &$bytecode, &$return) { if (count($stack) == 0) { throw new CScriptNotValid(); } // Get value from the stack $val = array_pop($stack); // Hash value (sha1) if (function_exists('hash')) { $val = hash('sha1', $val, true); } else if (function_exists('mhash')) { $val = mhash(MHASH_SHA1, $val); } else { throw new \Exception("Not implemented"); } // Push hash on stack array_push($stack, $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop()\r\n\t{\r\n\t}", "public function popNodeFromStack() {}", "public ...
[ "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.7468404", "0.73994184", "0.7389957", "0.73798776", "0.7284741", "0.7270938", "0.7267691", "0.7131278", "0.7104731", "0.7001997", "0.7001997", "0.67960066", "0.67...
0.0
-1
We need to pop a value from the stack
function op_sha256(&$stack, &$bytecode, &$return) { if (count($stack) == 0) { throw new CScriptNotValid(); } // Get value from the stack $val = array_pop($stack); // Hash value (sha256) if (function_exists('hash')) { $val = hash('sha256', $val, true); } else if (function_exists('mhash')) { $val = mhash(MHASH_SHA256, $val); } else { throw new \Exception("Not implemented"); } // Push hash on stack array_push($stack, $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop()\r\n\t{\r\n\t}", "public function popNodeFromStack() {}", "public ...
[ "0.770251", "0.770251", "0.770251", "0.770251", "0.770251", "0.770251", "0.770251", "0.770251", "0.7468947", "0.7398456", "0.73898304", "0.7379716", "0.72852385", "0.72713125", "0.7267316", "0.7130837", "0.7104825", "0.70015806", "0.70015806", "0.6794904", "0.6792763", "0.6...
0.0
-1
We need to pop a value from the stack
function op_hash160(&$stack, &$bytecode, &$return) { if (count($stack) == 0) { throw new CScriptNotValid(); } // Get value from the stack $val = array_pop($stack); // Hash value (sha256, then ripemd160) if (function_exists('hash')) { $val = hash('ripemd160', hash('sha256', $val, true), true); } else if (function_exists('mhash')) { $val = mhash(MHASH_RIPEMD160, mhash(MHASH_SHA256, $val)); } else { throw new \Exception("Not implemented"); } // Push hash on stack array_push($stack, $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop()\r\n\t{\r\n\t}", "public function popNodeFromStack() {}", "public ...
[ "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.77021587", "0.7468564", "0.73998153", "0.739057", "0.738034", "0.72852546", "0.72711134", "0.726797", "0.7131527", "0.7105379", "0.70022684", "0.70022684", "0.6796776", "0.679...
0.0
-1
We need to pop a value from the stack
function op_hash256(&$stack, &$bytecode, &$return) { if (count($stack) == 0) { throw new CScriptNotValid(); } // Get value from the stack $val = array_pop($stack); // Hash value (sha256, then sha256) if (function_exists('hash')) { $val = hash('sha256', hash('sha256', $val, true), true); } else if (function_exists('mhash')) { $val = mhash(MHASH_SHA256, mhash(MHASH_SHA256, $val)); } else { throw new \Exception("Not implemented"); } // Push hash on stack array_push($stack, $val); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop();", "public function pop()\r\n\t{\r\n\t}", "public function popNodeFromStack() {}", "public ...
[ "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.77019155", "0.7468404", "0.73994184", "0.7389957", "0.73798776", "0.7284741", "0.7270938", "0.7267691", "0.7131278", "0.7104731", "0.7001997", "0.7001997", "0.67960066", "0.67...
0.0
-1
///////////////////////////////////////////////////// Script parsing Run a raw script with a specified stack
protected function runRawScript(&$stack, $raw_script) { $return = null; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runSubStack() {\n\t$reconId=$_POST['reconId'];\n\t$maxjump=$_POST['maxjump'];\n\t$commit=$_POST['commit'];\n\t$description=$_POST['description'];\n\n\t/* *******************\n\tPART 2: Check for conflicts, if there is an error display the form again\n\t******************** */\n\tif (!$description) createS...
[ "0.6209875", "0.5159944", "0.50516796", "0.5049321", "0.49977317", "0.49415466", "0.49384597", "0.49009112", "0.48638225", "0.48585474", "0.4837272", "0.4830505", "0.48150834", "0.48102474", "0.47752997", "0.47216263", "0.47123265", "0.46674982", "0.46604148", "0.46468744", "...
0.6518805
0
Run the specified script
public function run($input) { $stack = array(); // Load data $this->runRawScript($stack, $input->raw_data); // Run script return $this->runRawScript($stack, $this->raw_data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function script()\n {\n }", "public static function run($script)\n {\n $script = self::openTag($script);\n //\n $script = self::closeTag($script);\n //\n return $script;\n }", "protected function runScript(UpgradeScript $script)\n {\n set_error_h...
[ "0.6396461", "0.63678336", "0.6296484", "0.6067574", "0.60033673", "0.5988951", "0.59344095", "0.591913", "0.5868546", "0.58566266", "0.58457357", "0.58051", "0.57499707", "0.5749748", "0.56936795", "0.5693443", "0.5676991", "0.5608339", "0.55458915", "0.5534354", "0.5516509"...
0.52971864
69
Run the database seeds.
public function run() { $this->execute(function ($item) { $item = $item->merge([ 'is_default' => $item->get('is_default') ?: false, ]); if (User::find($item->get('user_id'))) { Address::insert($item->toArray()); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n ...
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529...
0.0
-1
Saves the entity to the database.
public function save($entity) { throw new NotImplementedException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n ...
[ "0.7910169", "0.771441", "0.771441", "0.771441", "0.76996315", "0.76428115", "0.7398375", "0.739107", "0.7290663", "0.7217688", "0.72003764", "0.7198998", "0.71093726", "0.7078092", "0.70455694", "0.7043248", "0.70213723", "0.70213723", "0.70204556", "0.69832087", "0.6949409"...
0.6823492
49
Returns the total number of entities.
public function getCount() { return $this->db->fetchColumn("SELECT COUNT(id) FROM $this->table"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function count()\n {\n return count($this->entities);\n }", "public function count()\n {\n return count($this->entities);\n }", "public function countEntities(): int;", "public function getTotal()\n\t{\n\t\t\n\t\treturn count($this->findAll());\n\t}", "public static functio...
[ "0.8469821", "0.8469821", "0.8394718", "0.7754625", "0.7671319", "0.76633185", "0.76633185", "0.76633185", "0.7645126", "0.75958246", "0.75958246", "0.7417429", "0.7408964", "0.73922515", "0.7380344", "0.7377535", "0.7373872", "0.7366266", "0.736534", "0.73604345", "0.7352632...
0.0
-1
Search in names of entities
public function search($query) { $queryBuilder = $this->db->createQueryBuilder(); $queryBuilder ->select('c.*') ->from($this->table, 'c'); $queryBuilder->where("c.`name` LIKE :query"); $queryBuilder->setParameter(':query', "%$query%"); $queryBuilder->orderBy('c.sequence', 'ASC'); return $this->queryBuilderToEntities($queryBuilder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findEntityByNameAll($q){\r\n\t\t$this->recursive = 0;\r\n\t\t$entities = $this->query(\"SELECT * \r\n\t\t\tFROM entities AS Entity \r\n\t\t\tWHERE Entity.name LIKE '%$q%' AND Entity.active = '1'\");\r\n\t\t/*\r\n\t\t$entities = $this->query(\"SELECT * \r\n\t\t\tFROM entities AS Entity \r\n\t\t\tWHE...
[ "0.72114223", "0.7179519", "0.6487015", "0.6480356", "0.6384758", "0.6278017", "0.6278017", "0.61967134", "0.6110235", "0.6025805", "0.5920057", "0.59189105", "0.59189105", "0.59189105", "0.5876035", "0.5823349", "0.5823349", "0.5822153", "0.5812715", "0.57990354", "0.573268"...
0.5547524
47
Returns an entity matching the supplied id.
public function find($id) { $data = $this->db->fetchAssoc("SELECT * FROM $this->table WHERE id = ?", [ $id ]); return $data ? $this->build($data) : FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findEntityById($id)\n {\n if (isset($this->entities[$id])) {\n return $this->entities[$id];\n }\n }", "public function find($id)\n { \n $entity = $this->_find($id);\n return $entity;\n }", "public function findEntity($id);", "private functi...
[ "0.84376955", "0.8400213", "0.8399446", "0.83531815", "0.8223296", "0.8074879", "0.79789895", "0.7923617", "0.79197025", "0.7907693", "0.7818537", "0.7818537", "0.7818537", "0.7803702", "0.7778698", "0.77648526", "0.7704424", "0.76404154", "0.76231784", "0.7613495", "0.759488...
0.0
-1
Returns a collection of entities.
public function findAll($conditions = [], $orderBy = [], $limit = NULL, $offset = 0) { $queryBuilder = $this->db->createQueryBuilder(); $queryBuilder ->select('c.*') ->from($this->table, 'c') ->setFirstResult($offset); $parameters = []; foreach ($conditions as $key => $value) { $parameters[':' . $key] = $value; $where = $queryBuilder->expr()->eq('c.' . $key, ':' . $key); $queryBuilder->andWhere($where); } $queryBuilder->setParameters($parameters); if (count($orderBy) > 0) { foreach ($orderBy as $key => $value) { $queryBuilder->orderBy('c.' . $key, $value); } } if ($limit !== NULL) { $queryBuilder->setMaxResults($limit); } return $this->queryBuilderToEntities($queryBuilder); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function entities(): Collection;", "public function getEntities()\n {\n return $this->entities;\n }", "public function all(): \\app\\domain\\interfaces\\EntityCollection {\n $collection = new \\app\\domain\\interfaces\\EntityCollection;\n \n return $collection;\n }",...
[ "0.86801857", "0.8186973", "0.81494045", "0.81318367", "0.81318367", "0.81242186", "0.80317646", "0.79952824", "0.7993389", "0.78646517", "0.77584064", "0.77419114", "0.7675455", "0.76561856", "0.76349044", "0.7605882", "0.73373246", "0.7242199", "0.72343415", "0.7185048", "0...
0.0
-1
Inserts HTML for meta box, including all existing attachments
function os_selectfile_meta_box_html() { global $post; echo '<input type="hidden" name="os_selectfile_nonce" value="'.wp_create_nonce(basename(__FILE__)).'" />'; // Use nonce for verification echo '<p id="os-selectfile-ajax">'; echo '<label for="os_selectfile_file"></label>'; echo '<select name="os_selectfile_file" id="os_selectfile_file">'; echo '<option value="">-</option>'; $val = get_post_meta($post->ID, 'os_selectfile_file', true); $q = get_posts('post_type=attachment&post_mime_type=application&posts_per_page=-1&orderby=title&order=ASC&post_parent='.$post->ID); foreach ($q as $obj) { echo '<option value="'.$obj->ID.'"'; echo $obj->ID == $val ? 'selected="selected"' : ''; echo '>'; echo $obj->post_title; //echo ' ('.str_replace("application/", "", $obj->post_mime_type).')'; echo '</option>'; } echo '</select>'; echo '</p>'; echo '<p>'; echo '<a href="media-upload.php?post_id='.$post->ID.'&TB_iframe=1" class="button button-highlighted thickbox">Upload File</a>'; echo ' <a href="#" id="os-selectfile-ajaxclick" class="button">Refresh</a>'; echo ' <span id="os-selectfile-loading" style="display:none;"><img src="images/loading.gif" alt="Loading..." style="vertical-align:middle" /></span>'; echo '</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listing_pdf_box_add_meta() {\n\tadd_meta_box( 'pdf-box', 'Listing Attachments', 'listing_pdf_box_meta', 'listing', 'normal', 'default' );\n}", "function my_attachments( $attachments ) {\n $fields = array( \n array(\n 'name' => 'caption', // unique field name\n 't...
[ "0.6577897", "0.6379991", "0.6283517", "0.62778354", "0.62731653", "0.6250863", "0.6211844", "0.62058085", "0.619171", "0.61892635", "0.6163055", "0.6161752", "0.6149466", "0.6132921", "0.60884535", "0.6076199", "0.6075508", "0.60625476", "0.6004063", "0.59992754", "0.5989507...
0.0
-1
Creates meta box on all Posts and Pages
function os_selectfile_add_meta_box() { //for general add_meta_box('os_selectfile_meta_box', 'Select File', 'os_selectfile_meta_box_html', '', 'side'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function add_meta_box() {\n add_meta_box( \"CBMTheme\", \"CBM Theme Meta Box\", \"CBMAdmin::posts_page\" );\n }", "public function add_meta_boxes()\n \t{\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('wp_plugin_template_%s_section', self::POS...
[ "0.82191217", "0.80654615", "0.80446464", "0.8042274", "0.7982741", "0.79629076", "0.7961311", "0.79566205", "0.7953053", "0.7913438", "0.7857327", "0.78455746", "0.78196794", "0.78156394", "0.77983737", "0.7756919", "0.7756676", "0.7732704", "0.7706554", "0.77033186", "0.768...
0.0
-1
Determine if the user is authorized to make this action.
public function authorize() { return $this->user()->can('manage-routes'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n if ($this->user() !== null) {\n return tru...
[ "0.8265296", "0.82451475", "0.82061696", "0.82047397", "0.82047397", "0.8201702", "0.81293136", "0.80944514", "0.8085804", "0.8074648", "0.80542374", "0.80337673", "0.80173796", "0.7980766", "0.7959179", "0.7949416", "0.7935022", "0.79347277", "0.78957665", "0.78944355", "0.7...
0.0
-1
Get the validation rules that apply to the action.
public function rules() { return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr...
[ "0.80618066", "0.8002028", "0.790071", "0.789029", "0.7878679", "0.78218657", "0.7807406", "0.7793681", "0.77879256", "0.77742267", "0.77742267", "0.77742267", "0.77742267", "0.77742267", "0.77742267", "0.77710783", "0.7744431", "0.77189857", "0.77187806", "0.7702196", "0.769...
0.0
-1
Execute the action and return a result.
public function handle() { $route = (new FetchRoute)->actingAs( $this->user() )->run([ 'encoded_id' => $this->encoded_id, 'draft' => true, ]); return $route->forceDelete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function executeAction() {\n return $this->{$this->action}();\n }", "public function execute()\n {\n $action = $this->action ?: '__index';\n $params = (array) $this->params;\n\n $response = $this->__preAction($action, $params);\n if ($response !== false) {\n ...
[ "0.8158507", "0.7919956", "0.7323433", "0.73228854", "0.73228854", "0.73228854", "0.7311486", "0.7286468", "0.7210248", "0.7123298", "0.6949441", "0.6805409", "0.67945397", "0.67396957", "0.673067", "0.6708025", "0.66695654", "0.6665719", "0.6649038", "0.66345155", "0.6608906...
0.0
-1
Returns the response from the action.
public function response($result, $request) { return $this->respondWithNoContent(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getResponseAction () {\n return $this->responseAction();\n }", "public function getActionResponse($action=null){\n\t\t if($action){\n\t\t\t if(isset($this->action_response[$action])){\n\t\t\t \treturn $this->action_response[$action];\n\t\t\t }\n\t\t\t return;\n\t\t }\n\t\t return $this->action...
[ "0.83888674", "0.7174754", "0.7150855", "0.6974776", "0.6931902", "0.6931902", "0.68952215", "0.6871222", "0.68644094", "0.6861356", "0.6861356", "0.68586594", "0.68586594", "0.685057", "0.6847018", "0.6847018", "0.68370646", "0.68359673", "0.6792551", "0.6792551", "0.6792551...
0.0
-1
Creates a new us
public function createAction() { if (!$this->request->isPost()) { return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "index" )); } // We're testing there no US with the same number for this project. $uss = Userstory::find(array("id_project = :id_project: AND number = :number:", "bind" => array( "id_project" => $this->session->get("id_proj"), "number" => $this->request->getPost("number") ) )); if($uss->count() > 0) { $this->flash->error("Ce numéro d'US est déjà utilisé, veuillez en choisir un autre."); return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "new" )); } // And we create the new Userstory. $us = new Userstory(); $us->id_project = $this->session->get('id_proj'); $us->id_sprint = null; $us->number = $this->request->getPost("number"); $us->content = $this->request->getPost("content"); $us->cost = $this->request->getPost("cost"); $us->status = "todo"; if (!$us->save()) { foreach ($us->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "new" )); } $this->flash->success("Userstory créée avec succès"); return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "index", )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $ostObj = $this->instantiateOSTSDKForV2Api();\n $usersService = $ostObj->services->users;\n $params = array();\n $response = $usersService->create($params)->wait();\n $this->isSuccessResponse($response);\n }", "public function create(){}", "public function create...
[ "0.6713635", "0.6525694", "0.6421425", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.6408233", "0.63636935", "0.6349641", "0.6314924", "0.6299753", "0.6299753", "0.6285826", "0.6285826", ...
0.0
-1
Saves a us edited
public function saveAction() { if (!$this->request->isPost()) { return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "index" )); } $id_us = $this->request->getPost("id"); $us = Userstory::findFirst(array( 'id_us = :id_us:', 'bind' => array('id_us' => $id_us) )); if (!$us) { $this->flash->error("Cette userstory n'existe pas."); return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "index" )); } $us->id_us = $id_us; $us->title = $this->request->getPost("title"); $us->content = $this->request->getPost("content"); $us->cost = $this->request->getPost("cost"); if (!$us->save()) { foreach ($us->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "edit", "params" => array($us->id_us) )); } $this->flash->success("Userstory correctement modifiée."); return $this->dispatcher->forward(array( "controller" => "userstory", "action" => "index" )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save();", "public function save();", "public function save();", "public functi...
[ "0.69948494", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.6839321", "0.68110865", "0.6793522", ...
0.65175366
36
init the required globals
public function __construct() { global $viewController, $database, $settings, $message, $tableName, $tableColumns; // get the database table names $name = array_key_exists('dbName', $_GET) ? $_GET['dbName'] : null; $tableName = $database->secureInput($name); // check if database name is empty if ($tableName == null || empty($tableName)) { $message->setError("Missing table name to edit", \ALS\Message::Error); } else { // load the required table columns $tableColumns = $database->getTableColumns($tableName); } // load the required scripts global $customScripts; $customScripts = '<script src="' . $settings->getTemplatesURL() . 'assets/js/popper.min.js"></script>' . "\n"; $customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/jquery.dataTables.min.js"></script>' . "\n"; $customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/dataTables.bootstrap4.min.js"></script>' . "\n"; $customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/dataTables.responsive.min.js"></script>' . "\n"; $customScripts .= '<script src="' . $settings->getTemplatesURL() . 'plugins/datatables/responsive.bootstrap4.min.js"></script>' . "\n"; // load the view $viewController->loadView("ad_db_editTables.html"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function initializeGlobalVariables() {}", "public static function fromGlobals() {}", "private function setup_globals() {\r\n\t\t/** Versions **********************************************************/\r\n\r\n\t\t$this->version = '0.3-alpha';\r\n\t\t$this->db_version = '1';\r\n\r\n\t\t/** Pa...
[ "0.8363796", "0.78047043", "0.76319814", "0.75502867", "0.7480796", "0.72958493", "0.7280463", "0.72623104", "0.72304994", "0.72304994", "0.72031283", "0.7196483", "0.71795076", "0.71795076", "0.7133442", "0.71278137", "0.7122769", "0.7058183", "0.70355314", "0.7014274", "0.6...
0.0
-1
Admin Edit an existing record or display form for adding a new record.
public function admin_edit($id = null) { if (!empty($id) && is_numeric($id)) { $record = $this->Coupon->find('first', array( 'conditions' => array('Coupon.id' => $id) )); if (empty($this->data)) { $this->data = $record; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit_record()\n {\n \t$id = $this->uri->segment(4);\n $table = CMS_TABLE.' as u';\n\t\t$fields = array('u.*');\n\t\t$match = array('u.cms_id' => $id);\n\t\t$result \t = $this->general_model->get_records($table,$fields,'','',$match);\n\t\t$data['editRecord...
[ "0.77151984", "0.74062943", "0.740129", "0.7256166", "0.72399557", "0.7213179", "0.72093755", "0.7188606", "0.71717924", "0.7162131", "0.7162131", "0.7125118", "0.71148413", "0.70985675", "0.7091996", "0.7063838", "0.7060254", "0.7058638", "0.7058638", "0.7053377", "0.7051325...
0.0
-1
Admin Save record (existing or new).
public function admin_save() { if ($this->Coupon->saveAll($this->data)) { $id = (empty($this->data['Coupon']['id'])) ? $this->Coupon->getInsertID() : $this->data['Coupon']['id']; $this->Session->setFlash('Record saved.', 'default', array('class' => 'success')); $this->redirect('/admin/coupons/edit/' . $id); } $this->Session->setFlash('Record could not be saved. Please check the form for errors.', 'default', array('class' => 'failure')); return $this->setAction('admin_edit'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();",...
[ "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.7501105", "0.73498344", "0.732811", "0.732811", "0...
0.6740683
69
Admin Delete a record.
public function admin_delete($id) { if ($this->Coupon->delete($id)) { $this->Session->setFlash('Record deleted.', 'default', array('class' => 'success')); $this->redirect('/admin/coupons'); } $this->Session->setFlash('Record not deleted.', 'default', array('class' => 'failure')); $this->redirect('/admin/coupons/edit/' . $id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getDeleteRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t...
[ "0.810655", "0.75969255", "0.7552575", "0.7540839", "0.7503049", "0.7494371", "0.749177", "0.7469019", "0.744173", "0.7432779", "0.7379121", "0.7379121", "0.73488516", "0.728218", "0.7281215", "0.72579277", "0.7232865", "0.7214349", "0.72120464", "0.7138606", "0.71347713", ...
0.0
-1
Inject config to uploader core.
public function inject($inject = array()) { $this->inject = $inject; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n ...
[ "0.6556836", "0.6374358", "0.6316786", "0.6282473", "0.6279587", "0.626696", "0.62310433", "0.62266403", "0.6225025", "0.6200689", "0.6198997", "0.61819494", "0.61465794", "0.6139633", "0.61144334", "0.61055017", "0.6039768", "0.6020426", "0.5970549", "0.59625906", "0.5953082...
0.0
-1
Chaining uploader to resizing.
public function resize($sizes = []) { $this->uploadInit->resize($sizes); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = ima...
[ "0.64447665", "0.6133097", "0.60556316", "0.5999829", "0.59688705", "0.59217566", "0.58979374", "0.5869364", "0.58230144", "0.58054125", "0.5804607", "0.5799716", "0.57951254", "0.57887733", "0.57887733", "0.5780943", "0.57787466", "0.57641286", "0.57621944", "0.57195693", "0...
0.57360405
19
Get only master result.
public function getMasterResult() { $results = $this->getResults(); return isset($results['original']) ? $results['original'] : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggle_master_view_query_result(): Array {\n $model = $this->current_model;\n\n $master_view = $this->master_view_query_result();\n \n // Get result from grants model if feature model list returns empty\n \n if(method_exists($this->CI->$model,'master_view') &&\n ...
[ "0.65682006", "0.6396339", "0.63761115", "0.6277591", "0.62601995", "0.6230873", "0.6190991", "0.61805916", "0.6174329", "0.6169014", "0.61662894", "0.6044402", "0.59527785", "0.58789414", "0.58752835", "0.5868419", "0.58595896", "0.5850338", "0.580162", "0.5797276", "0.57953...
0.7969295
0
Remove file from storage and db.
public function remove($attachmentId, $recursive = true) { // Prepare return. $results = array(); // No data to remove if (empty($attachmentId)) { return array(); } // Find a master. $sql = $this->getAttachmentProvider()->createModel()->whereId($attachmentId); // If recursive find related. if ($recursive == true) { $sql = $sql->orWhere(function($query) use ($attachmentId) { $query->whereMaster($attachmentId); }); } // Get attachments. $attachments = $sql->get(); if (count($attachments)) foreach ($attachments as $attachment) { // Subpath from db. $subpath = trim($attachment->path, '/'); // Inject a config, then remove a attachment related. $this->uploader->inject(array( 'subpath' => $subpath, 'onRemove' => function($result) use ($attachment, &$results) { $attachment->delete(false); Cache::forget('attachment-'.$attachment->getKey()); array_push($results, $result); } )) ->open($attachment->toArray())->remove(); } return $results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", ...
[ "0.7450772", "0.74469846", "0.7441819", "0.7323561", "0.72790444", "0.715711", "0.71543586", "0.71385515", "0.7120811", "0.71061546", "0.70888007", "0.7070013", "0.7052062", "0.70233667", "0.70158577", "0.7002905", "0.6983892", "0.6963413", "0.69581634", "0.693217", "0.693067...
0.0
-1
Resize if scale if not exists.
public function resizeFromMasterFile($masterId, $scale) { $master = $this->getAttachmentProvider()->findById($masterId); $attachment = null; if (! empty($master) and $scale) { $config = array( 'subpath' => trim($master->path, '/') ); $this->uploadInit()->inject($config)->open($master->toArray())->resize($scale); $attachment = $this->getAttachmentProvider()->findById($master->id.'_'.$scale); } return $attachment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize_scale($scale){\n\n $width = $this->get_width() * $scale / 100;\n $height = $this->get_height() * $scale / 100;\n $this->resize($width, $height);\n\n return true;\n }", "private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_...
[ "0.71044135", "0.7013781", "0.6791672", "0.6779624", "0.6640509", "0.64300925", "0.6331725", "0.62811965", "0.6259849", "0.62117106", "0.62046397", "0.62046397", "0.6204098", "0.6160525", "0.6155931", "0.60877806", "0.60513276", "0.6006957", "0.59886986", "0.5983413", "0.5970...
0.0
-1
Look up file location.
public function lookup($attachmentId) { $this->attachmentId = $attachmentId; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFoundPath() {}", "public function getFileLocation()\n {\n return $this->fileLocation;\n }", "public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$con...
[ "0.701784", "0.697948", "0.692902", "0.6897371", "0.68053204", "0.67642975", "0.6665987", "0.65930516", "0.6541964", "0.64895713", "0.64368534", "0.64029443", "0.6396638", "0.6319895", "0.62819827", "0.6268754", "0.6216853", "0.6209404", "0.61944956", "0.61857754", "0.6182206...
0.0
-1
Chaining from lookup to scale.
public function scale($scale) { $this->attachmentId = $this->attachmentId.'_'.$scale; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scale() { }", "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 sc...
[ "0.6370533", "0.5822046", "0.56585085", "0.54804677", "0.525824", "0.52413654", "0.5208612", "0.52080727", "0.5099064", "0.5088876", "0.50651646", "0.50651646", "0.5023246", "0.50086343", "0.5000667", "0.49667034", "0.48952675", "0.4893999", "0.4893999", "0.48900926", "0.4880...
0.47844583
25
Render an image path with HTML.
public function get() { $that = $this; // Using cache to reduce request. $ckey = 'attachment-'.$this->attachmentId; if (! $attachment = Cache::get($ckey)) { $attachment = $that->getAttachmentProvider()->findById($that->attachmentId); Cache::put($ckey, $attachment, 60); } // Having scale, but not generate yet! if (! is_object($attachment) and strpos($this->attachmentId, '_')) { preg_match('|(.*)_(.*)|', $this->attachmentId, $matches); $attachment = $this->resizeFromMasterFile($matches[1], $matches[2]); } if (is_object($attachment)) { $location = $attachment->getAttribute('location'); if (preg_match('/^http/', $location)) { return $location; } return $this->uploader->url($location); } $failure = array_get($this->config, 'placeholder'); return ($failure instanceof Closure) ? $failure($this->attachmentId, $this) : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderImage(){\n \n return sprintf(\n '<img src=\"%s\" title=\"%s\" alt=\"%s\">',\n $this->getField('url'),\n $this->getField('title',''),\n $this->getField('alt','')\n );\n \n }", "public function image($path, array $options = array()) {\n\t$defaults = array('alt'...
[ "0.6978498", "0.69218516", "0.67418283", "0.6529205", "0.64532566", "0.6415844", "0.64077353", "0.63982195", "0.63643473", "0.6357268", "0.63541627", "0.6284216", "0.62400454", "0.6210754", "0.6148866", "0.61467713", "0.6101545", "0.60890144", "0.6084994", "0.60308206", "0.60...
0.0
-1
To string will return path.
public function __toString() { try { return $this->get() ?: ''; } catch (Exception $e) { restore_error_handler(); trigger_error($e->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toString() {\n return url::buildPath($this->toArray());\n }", "public function __toString()\n {\n return (string)$this->_sPath;\n }", "public function toString() {\n\t\treturn $this->path();\n\t}", "public function __toString()\n {\n return $this->path;\n }", "...
[ "0.7061645", "0.6976408", "0.6937483", "0.67838067", "0.6777886", "0.6752905", "0.67480254", "0.6703624", "0.66463715", "0.66463715", "0.66424465", "0.6623441", "0.6580462", "0.6580462", "0.6580462", "0.6580462", "0.6580462", "0.6580462", "0.6580462", "0.6580462", "0.65290046...
0.0
-1
Run the database seeds.
public function run() { $classification = new \App\Models\Classification(); $classification->description = 'Camara'; $classification->save(); $classification = new \App\Models\Classification(); $classification->description = 'Portero'; $classification->save(); $classification = new \App\Models\Classification(); $classification->description = 'Cerradura'; $classification->save(); $classification = new \App\Models\Classification(); $classification->description = 'Pantalla'; $classification->save(); $classification = new \App\Models\Classification(); $classification->description = 'Luz'; $classification->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Handle the incoming request.
public function __invoke(Request $request) { $user = auth()->user(); $roles = Role::get(); return view('roles.index', compact('roles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest() {}", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "function handleRequest() ;", "abstract public function handle...
[ "0.81443435", "0.80565155", "0.8054052", "0.8054052", "0.8054052", "0.8012054", "0.76565933", "0.7453767", "0.7427182", "0.74211967", "0.73596436", "0.7341611", "0.7303668", "0.72207993", "0.71966445", "0.71955097", "0.71865135", "0.71590275", "0.7092262", "0.7065288", "0.704...
0.0
-1
Adds a blank line if the last element is not blank.
private static function space(array $lines) { if(end($lines) != '') { $lines[] = ''; } return $lines; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function emptyLine();", "public function emptyLine()\n\t{\n\t\t//return \"\\t\\t\\t\".'<td colspan=\"2\">&nbsp;</td>'.\"\\n\";\n\t}", "private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}", "public function newLine() {\n\t\t$this->_section=0;\n\t\t$this->_lineN...
[ "0.67539257", "0.64209706", "0.6342353", "0.62505233", "0.6163324", "0.59814924", "0.59573495", "0.5922869", "0.58615535", "0.57226735", "0.5545825", "0.55422246", "0.5516996", "0.53848296", "0.5292114", "0.52745247", "0.5273774", "0.5262848", "0.52592117", "0.5251377", "0.52...
0.47652394
70
Display a listing of the resource.
public function index() { try{ return InteressadoResource::collection(Interessado::paginate()); }catch(\Exception $e){ return response()->json([ 'erro' => true, 'data' => 'Erro ao consultar interessados: '.$e->getMessage() ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446377", "0.7361922", "0.72984487", "0.7248631", "0.7162871", "0.7148215", "0.7131838", "0.71028054", "0.7102395", "0.70988023", "0.7048243", "0.6993516", "0.6989079", "0.69341344", "0.69001913", "0.6899167", "0.68920904", "0.6887188", "0.68661547", "0.6849159", "0.683002...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75936973", "0.75936973", "0.7585464", "0.7576766", "0.7571166", "0.7498768", "0.7434969", "0.7432511", "0.7387868", "0.7351811", "0.7336364", "0.73113805", "0.7293885", "0.72812635", "0.7273037", "0.72410345", "0.7228987", "0.7225174", "0.718589", "0.71786976", "0.7172516"...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { try { $data = $request->all(); // dd($data); foreach ($data as $interessado ){ Interessado::create($interessado); } return response()->json([ 'erro' => false, 'data' => 'Interessados adicionados com sucesso!' ]); }catch(\Exception $e){ return response()->json([ 'erro' => true, 'data' => 'Erro ao cadastrar Interessado: '.$e->getMessage() ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { try{ $interessado = Interessado::findOrFail($id); $interessado->bolo; return response()->json([ 'erro' => false, 'data' => $interessado ]); }catch(\Exception $e){ return response()->json([ 'erro' => true, 'data' => 'Erro ao consultar interessado: '.$e->getMessage() ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665",...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { try{ $data = $request->all(); $interessado = Interessado::findOrFail($id); $interessado->update($data); return response()->json([ 'erro' => false, 'data' => $interessado ]); }catch(\Exception $e){ return response()->json([ 'erro' => true, 'data' => 'Erro ao atualizar interessado: '.$e->getMessage() ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { try{ $interessado = Interessado::findOrFail($id); $interessado->delete(); return response()->json([ 'erro' => false, 'data' => 'Interessado excluido com sucesso!' ]); }catch(\Exception $e){ return response()->json([ 'erro' => true, 'data' => 'Erro ao excluir Interessado: '.$e->getMessage() ], 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Get the form element for the element
public function getForm() { return $this->getAncestorInstanceOf('FewAgency\FluentForm\FluentForm'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getWebformElement() {\n $element = $this->getElement();\n return ($element) ? $this->elementManager->getElementInstance($element) : NULL;\n }", "protected function getElement() {\n return $this->getWebform()->getElement($this->configuration['element_key']);\n }", "public function ...
[ "0.8445001", "0.7740248", "0.7110885", "0.7031256", "0.6728191", "0.6704216", "0.66984504", "0.6690174", "0.66605794", "0.66605794", "0.6644118", "0.66006947", "0.6595454", "0.65532523", "0.65506494", "0.6543639", "0.65348387", "0.65235126", "0.65091175", "0.6484143", "0.6476...
0.6438673
24
Get the the block container element if this element is part of one.
public function getControlBlockContainer() { return $this->getAncestorInstanceOf('FewAgency\FluentForm\AbstractControlBlockContainer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnotherBlock()\n {\n $data = $this->_coreRegistry->registry('magictoolbox');\n if ($data) {\n $skip = true;\n foreach ($data['blocks'] as $name => $block) {\n if ($name == 'product.info.media.magiczoomplus') {\n $skip = fal...
[ "0.65993506", "0.6481887", "0.62601477", "0.6202864", "0.615974", "0.6153783", "0.61376804", "0.6102674", "0.599154", "0.5966898", "0.5940808", "0.5935668", "0.59266484", "0.59188133", "0.58521175", "0.5779442", "0.5757671", "0.5750264", "0.5747328", "0.57429284", "0.5734372"...
0.69294834
0
Get input values set higher up in the form structure.
protected function getValueFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->getValue($key); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInputValues();", "public function getInputValues()\n {\n return $this->input_values;\n }", "public function getFormInput()\n {\n $values = $this->getFormValues();\n\n return $values->all();\n }", "function getInputValues();", "public function getFormValue...
[ "0.7166528", "0.71647483", "0.7059991", "0.69937605", "0.68336165", "0.6744844", "0.6649693", "0.6613065", "0.6574843", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0.65634346", "0...
0.0
-1
Get labels set higher up in the form structure.
protected function getLabelFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->getLabel($key); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFormFieldLabels()\n {\n return craft()->coalescentForms->getFormFieldLabels();\n }", "public function getLabels()\n {\n return isset($this->labels) ? $this->labels : null;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public fu...
[ "0.74787265", "0.71919334", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.7182694", "0.71572393", "0.7146363", "0.7146363", ...
0.0
-1
Get error messages set higher up in the form structure.
protected function getErrorsFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->getErrors($key); } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getErrorMessages() {}", "public function getValidationErrorMessages() {}", "public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The ...
[ "0.766728", "0.7527198", "0.74471724", "0.743385", "0.74277323", "0.74069923", "0.74069923", "0.74053794", "0.7386021", "0.7316022", "0.73122793", "0.7275165", "0.7260082", "0.7252588", "0.7232897", "0.7217269", "0.71712077", "0.7170784", "0.71699893", "0.71543086", "0.714454...
0.0
-1
Get warning messages set higher up in the form structure.
protected function getWarningsFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->getWarnings($key); } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWarnings()\n {\n return $this->_getChildrenByName('warning');\n }", "public function allWarning() {\n return $this->warningMsg;\n }", "public function getWarnings()\n {\n return self::$warnings;\n }", "public function getWarningList() {\n\t\treturn array...
[ "0.7340213", "0.72617936", "0.70613706", "0.69572747", "0.69408774", "0.69408774", "0.69046336", "0.68679595", "0.6841677", "0.6841677", "0.6841677", "0.6841677", "0.6841677", "0.67735636", "0.6752713", "0.67276776", "0.67227244", "0.6722343", "0.6718121", "0.6653191", "0.664...
0.0
-1
Get success booleans set higher up in the form structure.
protected function hasSuccessFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->hasSuccess($key); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSuccess() {\n\t\tp(\"Checking success status of all\");\n\t\t// set false if error has occurred, can return false immediately\n\t\tif ( $this->success === false ) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->fields as $field) {\n\t\t\tif ( $field->getSuccess() === false) {\n\t\t\t\t$this->...
[ "0.7583577", "0.7182383", "0.6342821", "0.62320244", "0.61959094", "0.6128763", "0.6064372", "0.60322523", "0.6012358", "0.6003588", "0.60031193", "0.5997077", "0.59596586", "0.59596133", "0.59476954", "0.5946885", "0.5907511", "0.5900741", "0.5890851", "0.58753365", "0.58713...
0.0
-1
Get disabledbooleans set higher up in the form structure.
protected function isDisabledFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->isDisabled($key); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEnableFieldsToBeIgnored() ;", "public function getIsDisabled() {}", "public function getBooleanFields()\n {\n return $this->booleanFields;\n }", "function getIgnoreEnableFields() ;", "public function getDisableConditions()\n {\n $value = $this->_config->get('general/disab...
[ "0.6614957", "0.6611278", "0.64577", "0.6444632", "0.643321", "0.6414927", "0.6273574", "0.6254574", "0.6221239", "0.6210224", "0.6203815", "0.61897266", "0.61897266", "0.61897266", "0.61897266", "0.61376876", "0.61091346", "0.5932332", "0.5915527", "0.5899461", "0.5854109", ...
0.0
-1
Get readonlybooleans set higher up in the form structure.
protected function isReadonlyFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->isReadonly($key); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBooleanFields()\n {\n return $this->booleanFields;\n }", "function getReadOnly() { return $this->_readonly; }", "public function get_readonly() {\n return $this->readonly;\n }", "public function isReadonly() : bool {\n return (bool) ($this->flags & Class_::MOD...
[ "0.69539946", "0.6789906", "0.67611384", "0.6641115", "0.66196114", "0.6576605", "0.65025556", "0.6465499", "0.6464149", "0.6443993", "0.64146924", "0.6341962", "0.63217187", "0.63009435", "0.615839", "0.61463743", "0.6106181", "0.60906035", "0.60796595", "0.60535103", "0.603...
0.0
-1
Get requiredbooleans set higher up in the form structure.
protected function isRequiredFromAncestor($key) { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->isRequired($key); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBooleanFields()\n {\n return $this->booleanFields;\n }", "protected function getBooleans(){\n return array_keys( array_filter( $this->getOperatorData(),\n function($item){\n return $item['type'] === self::TYPE_BOOLEAN;\n }));\n }", "public function getBoolea...
[ "0.66736203", "0.61035544", "0.60887706", "0.5916627", "0.5845182", "0.5804804", "0.5795088", "0.57010406", "0.56568414", "0.56406957", "0.5615966", "0.56041163", "0.5585803", "0.55375504", "0.5519897", "0.5511537", "0.549661", "0.5473186", "0.54716384", "0.54529065", "0.5449...
0.0
-1
Find out if this element is placed in a horizontally aligned context.
public function isAligned() { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->isAligned(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function hasAlign() {\n\t\treturn isset($this->options['align']);\n\t}", "private function hasHeadAlign() {\n\t\treturn isset($this->options['head_align']);\n\t}", "public function isHorizontal() {\n\t\t$this->direction=\"H\";\n\t}", "public function getHorizontal() {\r\n return $this->horizon...
[ "0.6155844", "0.6120114", "0.5830942", "0.57309824", "0.57006973", "0.5585999", "0.5529587", "0.5518652", "0.5503483", "0.5436162", "0.5325055", "0.5257028", "0.52281725", "0.5196685", "0.51379114", "0.5136088", "0.51226896", "0.5119517", "0.5086906", "0.50308925", "0.4968864...
0.6797746
0
Find out if this element is placed in an inline context.
public function isInline() { if ($ancestor = $this->getControlBlockContainer()) { return $ancestor->isInline(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_inline()\r\n\t{\r\n\t\treturn $this->is_inline;\r\n\t}", "function vcex_vc_is_inline() {\n\tif ( function_exists( 'vc_is_inline' ) ) {\n\t\treturn vc_is_inline();\n\t}\n\treturn false;\n}", "public function hasInlineVector()\n {\n return ($this->hasLinkImage() && $this->LinkImage()...
[ "0.7384146", "0.70733654", "0.6968481", "0.6914325", "0.6851162", "0.67480165", "0.6497554", "0.63016534", "0.6232524", "0.57936937", "0.57405216", "0.5622722", "0.55322516", "0.5500013", "0.54707915", "0.5444395", "0.54324687", "0.5407346", "0.53898376", "0.5381279", "0.5376...
0.745781
0
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/
function __construct() { parent::__construct(); $this->load->library('session'); if($this->session->userdata('userID')=="") redirect(base_url().'home', 'refresh'); $this->load->model('Analysis_Model'); $this->load->helper('form'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome...
[ "0.7654226", "0.74120015", "0.73941106", "0.731618", "0.7225734", "0.7225734", "0.71892303", "0.71651614", "0.71515816", "0.71449816", "0.7107295", "0.7076961", "0.70735484", "0.70390433", "0.7028994", "0.7028994", "0.7028994", "0.7028994", "0.7028994", "0.6972685", "0.696650...
0.0
-1
auf blacklist: return false
function unlock($key) { if (in_array($key->getKeyId(), $this->config->blackList)) return false; // auf whitelist: return true if (in_array($key->getKeyId(), $this->config->whiteList)) return true; // accesslist pruefen! foreach ($this->config->accessList as $item) { if ($item->keyId == $key->getKeyId() && $this->isNowInWindow($item->begin, $item->end) ) { return true; } } // Bei Active Key: if ($key instanceof ActiveKey) { foreach ($key->getConfigList() as $keyConfig) { if ($keyConfig->lockId == $this->lockId && $this->isNowInWindow($keyConfig->begin, $keyConfig->end) ) { return true; } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _hardFilter()\n\t {\n\t\t$check = true;\n\n\t\t$blackxml = new SimpleXMLElement(file_get_contents(__DIR__ . \"/storage/blacklist.xml\"));\n\n\t\tforeach ($blackxml->patterns->pattern as $pattern)\n\t\t {\n\t\t\tif (isset($this->name) === true)\n\t\t\t {\n\t\t\t\tif (preg_match((string) $p...
[ "0.7139865", "0.6805139", "0.6573389", "0.65502185", "0.6545179", "0.6500885", "0.6425092", "0.63882595", "0.63882595", "0.6360267", "0.6332957", "0.6316103", "0.62741876", "0.62554574", "0.6253907", "0.6222276", "0.61966157", "0.61934495", "0.61579347", "0.6139677", "0.60964...
0.0
-1
Display a listing of the resource.
public function index() { $pages = Page::with(['parent', 'children', 'tags', 'images']) ->paginate(25); return view($this->view . 'index', compact('pages')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { $pages = Page::with('children') ->where('status', 1) ->orderBy('id')->pluck('name', 'id'); return view($this->view . 'create', compact('pages')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { try { DB::beginTransaction(); $data = $request->all(); $validator = Validator::make($data, Page::rules(), Page::messages()); if ($validator->fails()) { return back()->withInput()->withErrors($validator); } if (!empty($request->slug)) { $data['slug'] = str_slug($request->name); } if ($request->has('parent_id')) { $data['parent_id'] = $request->parent_id; $page = Page::with('parent')->create($data); } else { $data['parent_id'] = null; $page = Page::with('children')->create($data); } if ($page) { if ($request->hasFile('file')) { $this->uploadImage($request, 'uploads/page/', $page, 'file'); } if ($request->has('tags')) { $this->attachTag($page, 'App\Model\Page', $request->tags); } } DB::commit(); return redirect()->route($this->route . 'index')->with('success', 'Page added successfully.'); } catch (ModelNotFoundException $exception) { DB::rollback(); return back()->with('error', 'Your page can not add to our system right now. Plz try again later.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show(Page $page) { return view($this->view . 'show', compact('page')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit(Page $page) { if ($page === null) { return redirect()->route($this->route . 'index')->with('error', 'We can not find page with that id, please try the other'); } $pages = Page::with('children') ->where('status', 1) ->orderBy('id')->pluck('name', 'id'); return view($this->view . 'edit', compact('page', 'pages')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Page $page) { try { DB::beginTransaction(); $data = $request->all(); if ($page === null) { return redirect()->route($this->route . 'index')->with('error', 'We can not find page with that id, please try the other'); } $validator = Validator::make($data, Page::rules($page->id), Page::messages()); if ($validator->fails()) { return back()->withInput()->withErrors($validator); } if ($request->has('tags')) { Taggable::where('taggable_id', $page->id) ->where('taggable_type', 'App\Model\Page') ->delete(); $this->attachTag($page, 'App\Model\Page', $request->tags); } if ($request->hasFile('file')) { $this->uploadImage($request, 'uploads/page/', $page, 'file'); } $update = $page->update($data); if (!$update) { DB::rollBack(); return back()->with('error', 'Your page can not add to your system right now. Plz try again later.'); } DB::commit(); return redirect()->route($this->route . 'index')->with('success', 'Page added successfully.'); } catch (ModelNotFoundException $exception) { return back()->with('error', 'Your page can not add to your system right now. Plz try again later.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy(Page $page) { $delete = $page->delete(); if (!$delete) { return back()->with('error', 'Your page can not delete from your system right now. Plz try again later.'); } return redirect()->route($this->route . 'index')->with('success', 'Page deleted successfully'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Configures the options for cleaning
function setOptions($options = array()) { $default = array( "RemoveStyles" => true, "IsWord" => true, "UseTidy" => true, "TidyBefore" => false, "CleaningMethod" => array( "tags" => "whitelist", "attributes" => "blacklist" ), "OutputXHTML" => true, "FillEmptyTableCells" => true, "DropEmptyParas" => true, "Optimize" => true, "Compress" => false, "Encoding" => "UTF8" ); $new = array_merge_recursive($default, (array)$options); $this->_options = $new; $this->__setTidyConfig(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareOptions()\n {\n // apply options\n if (isset($this->_deploy['set_time_limit'])) {\n // script needs time to proces huge amount of data (important)\n set_time_limit($this->_deploy['set_time_limit']);\n }\n if (isset($this->_deploy['memo...
[ "0.67059034", "0.66845423", "0.655205", "0.65279716", "0.63488376", "0.6328982", "0.6316985", "0.62789446", "0.6235864", "0.6214473", "0.6181154", "0.6123411", "0.61230326", "0.6007186", "0.59838057", "0.5976565", "0.59759104", "0.59643817", "0.5919952", "0.59061944", "0.5868...
0.61087954
13
Sets the Tidy options based on the configuration of Options.
function __setTidyConfig() { if($this->_options["IsWord"]){ $this->_tidy_config['word-2000'] = true; $this->_tidy_config['drop-proprietary-attributes'] = true; } else { $this->_tidy_config['word-2000'] = false; } if($this->_options["OutputXHTML"]) { $this->_options["UseTidy"] = true; $this->_tidy_config['output-xhtml'] = true; } else { $this->_tidy_config['output-xhtml'] = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOptions($options = array()) \n { \n $default = array( \n \"RemoveStyles\" => true, \n \"IsWord\" => true, \n \"UseTidy\" => true, \n \"TidyBefore\" => false, \n \"CleaningMethod\" => array( \n \"tags\" => \"whitelist\", \n ...
[ "0.7753073", "0.65544134", "0.64637095", "0.62480843", "0.6239767", "0.6185608", "0.61761826", "0.604455", "0.6002066", "0.59947944", "0.59359074", "0.5933925", "0.59324235", "0.5923187", "0.59125334", "0.5909761", "0.59046334", "0.58950865", "0.58893365", "0.58893365", "0.58...
0.75497925
1
Removes attributes from html tags that match the provided pattern Example of pattern: "id|on[\w]+"
function removeBlacklistedAttributes($attribs) { $this->_html = preg_replace('/[\s]+('.$attribs.')=[\s]*("[^"]*"|\'[^\']*\')/i',"",$this->_html); $this->_html = preg_replace('/[\s]+('.$attribs.')=[\s]*[^ |^>]*/i',"",$this->_html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function removeUnallowedHTMLAttributes(string $html): string\n {\n $tidy = new tidy();\n\n $dom = new DOMDocument();\n\n // Normalizes the HTML which reduce the possibility of having an unexpected\n // exception in the DomDocument library because some bad HTML was foun...
[ "0.5939265", "0.5924926", "0.57694834", "0.5744616", "0.5660727", "0.56411314", "0.5618329", "0.5615616", "0.5602336", "0.5594623", "0.5572615", "0.55611455", "0.5544675", "0.55132604", "0.55105466", "0.5482235", "0.54742277", "0.54584867", "0.54467577", "0.5440193", "0.53907...
0.6185785
0
Uses the Tidy Configuration to run Tidy's cleanRepair method, if available.
function tidyClean() { if(!class_exists('tidy')){ if(function_exists('tidy_parse_string')){ tidy_set_encoding("{$this->_options["Encoding"]}"); foreach($this->_tidy_config as $k => $v) { tidy_setopt($k, $v); } tidy_parse_string($this->_html); tidy_clean_repair(); $this->_html = tidy_get_output(); } else { error_log("Tidy is not supported on this platform. Basic Cleaning is applied."); } } else { $tidy = new tidy; $tidy -> parseString($this->_html, $this->_tidy_config, "{$this->_options["Encoding"]}"); $tidy -> cleanRepair(); $this -> html = $tidy; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanRepair() {}", "function tidy_clean_repair(tidy $object) {}", "function __setTidyConfig() \n { \n if($this->_options[\"IsWord\"]){ \n $this->_tidy_config['word-2000'] = true; \n $this->_tidy_config['drop-proprietary-attributes'] = true; \n } \n ...
[ "0.69163716", "0.6459631", "0.5992639", "0.5587093", "0.5527182", "0.5481099", "0.54701006", "0.54606694", "0.54170126", "0.5328901", "0.51956946", "0.51528555", "0.50111246", "0.50066435", "0.48950356", "0.48489368", "0.48452532", "0.48368126", "0.48112518", "0.47943094", "0...
0.7230275
0
Cleans the provided html snippet based on the configuation options
function cleanup($html, $options = null) { if(isset($options) && is_array($options)){ $this->setOptions($options); } $this->_html = "{$html}"; if($this->_options['UseTidy'] && $this->_options['TidyBefore']){ $this->tidyClean(); } // Remove escape slashes $this->_html = stripslashes($this -> _html); if($this->_options['CleaningMethod']['tags'] == "whitelist"){ // Trim everything before body tag, leaving possible body attributes if(preg_match("/<body/i", "{$this -> _html}")){ $this -> html = stristr($this -> _html, "<body"); } // strip tags, still leaving attributes, second variable is allowed tags $this->_html = strip_tags($this->_html, $this->_tag_whitelist); } if($this->_options['RemoveStyles']){ // Remove class and style attributes $this->removeBlacklistedAttributes("class|style"); } if($this->_options['IsWord']){ $this->removeBlacklistedAttributes("lang|[ovwxp]:\w+"); } if($this->_options['CleaningMethod']['attributes'] == "blacklist"){ if(!empty ($this->_attrib_blacklist)){ $this->removeBlacklistedAttributes($this->_attrib_blacklist); } } if($this->_options['Optimize']){ $repl = 1; while($repl){ $repl = 0; foreach($this->_cleanup_tags as $tag){ // Strip empty inline tags $this -> _html = preg_replace("/<($tag)[^>]*>[\s]*([(&nbsp;)]*)[\s]*<\/($tag)>/i","\\2", $this -> _html,-1,$count); $repl += $count; // Merge inline tags $this -> _html = preg_replace("/<\/($tag)[^>]*>[\s]*([(&nbsp;)]*)[\s]*<($tag)>/i","\\2", $this -> _html,-1,$count); $repl += $count; } } // Drop empty paragraph tags if($this->_options['DropEmptyParas']){ $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\s]*[(&nbsp;)]*[\s]*<\/(p|h[1-6]{1})>/i',"\r\n", $this -> _html); } // Trim extra spaces only if tidy is not set to indent if(!$this->_tidy_config['indent']){ // Trim extra spaces between words $this -> _html = preg_replace('/([^<>])[\s]+([^<>])/i',"\\1 \\2", $this -> _html); // Trim extra spaces before tags $this -> _html = preg_replace('/[\n|\r|\r\n|][\n|\r|\r\n|]+</i',"<", $this -> _html); } } if($this->_options['DropEmptyParas'] && !$this->_options['Optimize']){ $this -> _html = preg_replace('/<(p|h[1-6]{1})([^>]*)>[\s]*[(&nbsp;)]*[\s]*<\/(p|h[1-6]{1})>/i',"\r\n", $this -> _html); } if($this->_options['FillEmptyTableCells']) { $this -> _html = preg_replace("/<td([^>]*)>[\s]*<\/td>/i", "<td\\1>&nbsp;</td>", $this -> _html); } if($this->_options['Compress']){ // Trim spaces after tags $this -> _html = preg_replace('/>[\s]+/',">", $this -> _html); // Trim spaces before end tags $this -> _html = preg_replace('/[\s]+<\//',"</", $this -> _html); // Trim spaces before tags $this -> _html = preg_replace('/[\s]+</',"<", $this -> _html); // Trim extra spaces between words $this -> _html = preg_replace('/([^<>])[\s]+([^<>])/',"\\1 \\2", $this -> _html); } if($this->_options['UseTidy'] && !$this->_options['TidyBefore']){ $this->tidyClean(); } return $this->output("{$this->_html}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function cleanHTML($content);", "protected function parseHtml() {\r\n\t\tif (is_array($this->cfg->html))\r\n\t\t\t$this->cfg->html = utils::render($this->cfg->html);\r\n\t}", "function tidyClean() \n { \n if(!class_exists('tidy')){ \n if(function_exists('tidy_parse_string')...
[ "0.65628284", "0.63438624", "0.61977494", "0.61653143", "0.6090394", "0.6088692", "0.6066914", "0.6052629", "0.6049276", "0.6041285", "0.6014014", "0.6011197", "0.59926075", "0.59078074", "0.5880054", "0.58725715", "0.58725107", "0.5853894", "0.5809442", "0.57934916", "0.5785...
0.7351366
0
Returns the fully qualified name of the class that this mapper maps.
public function mapFor() { return Forecast::class; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFullQualifiedClassname() : string\n {\n return $this->fqcn;\n \n }", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "protected function fullyQualifiedC...
[ "0.7675617", "0.7660593", "0.75880456", "0.7583924", "0.75432956", "0.7539442", "0.75309086", "0.75309086", "0.7520951", "0.7412456", "0.73640776", "0.73499453", "0.7336656", "0.73182315", "0.7286464", "0.72670597", "0.7256326", "0.72518706", "0.722197", "0.7216787", "0.72077...
0.0
-1
Load the object's metadata through the Metadata Builder object.
public function map(Fluent $builder) { $builder->integer('id')->autoIncrement()->primary(); $builder->text('city'); $builder->oneToMany(HourlyPrediction::class, 'predictions')->mappedBy('forecast')->cascadeAll(); $builder->string( 'scale'); $builder->string( 'partner'); $builder->date('date'); $builder->dateTime('createdAt'); $builder->dateTime( 'updatedAt')->nullable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadMetadata() {\n\t\t$this->pMeta = $this->em->getClassMetadata('OcProduct');\n\t\t$this->pdMeta = $this->em->getClassMetadata('OcProductDescription');\n\t}", "protected function loadMetaData() {}", "function loadClassMetadata(Mapping\\ClassMetadataInterface $metadata);", "protected functio...
[ "0.7296233", "0.67883456", "0.67231363", "0.6220508", "0.6130248", "0.6130248", "0.6130248", "0.60758543", "0.60758543", "0.601151", "0.59772253", "0.59480983", "0.5934559", "0.5933978", "0.58546364", "0.580472", "0.57982314", "0.5734579", "0.57081264", "0.5699532", "0.569175...
0.0
-1
check element 3, there's no user associated with the notloggedin collections
public function postAction(Request $request, PDO $db) { if (isset($request->url_elements[3])) { switch ($request->url_elements[3]) { case 'verifications': $userMapper = new UserMapper($db, $request); $token = filter_var($request->getParameter("token"), FILTER_SANITIZE_STRING); if (empty($token)) { throw new Exception("Verification token must be supplied", Http::BAD_REQUEST); } $success = $userMapper->verifyUser($token); if ($success) { $view = $request->getView(); $view->setHeader('Content-Length', 0); $view->setResponseCode(Http::NO_CONTENT); return; } throw new Exception("Verification failed", Http::BAD_REQUEST); default: throw new InvalidArgumentException('Unknown Subrequest', Http::NOT_FOUND); } } else { $user = []; $errors = []; $userMapper = $this->getUserMapper($db, $request); // Required Fields $user['username'] = filter_var( trim($request->getParameter("username")), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); if (empty($user['username'])) { $errors[] = "'username' is a required field"; } else { // does anyone else have this username? $existingUser = $userMapper->getUserByUsername($user['username']); if (is_array($existingUser) && array_key_exists('users', $existingUser)) { if (count($existingUser['users']) > 0) { $errors[] = "That username is already in use. Choose another"; } } } $user['full_name'] = filter_var( trim($request->getParameter("full_name")), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); if (empty($user['full_name'])) { $errors[] = "'full_name' is a required field"; } $user['email'] = filter_var( trim($request->getParameter("email")), FILTER_VALIDATE_EMAIL, FILTER_FLAG_NO_ENCODE_QUOTES ); if (empty($user['email'])) { $errors[] = "A valid entry for 'email' is required"; } else { // does anyone else have this email? $existingUser = $userMapper->getUserByEmail($user['email']); if (is_array($existingUser) && array_key_exists('users', $existingUser)) { if (count($existingUser['users']) > 0) { $errors[] = "That email is already associated with another account"; } } } $password = $request->getParameter("password"); if (empty($password)) { $errors[] = "'password' is a required field"; } else { // check it's sane $validity = $userMapper->checkPasswordValidity($password); if (true === $validity) { // OK good, go ahead $user['password'] = $password; } else { // the password wasn't acceptable, tell the user why $errors = array_merge($errors, $validity); } } // Optional Fields $user['twitter_username'] = filter_var( trim($request->getParameter("twitter_username")), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); $user['biography'] = filter_var( trim($request->getParameter("biography")), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); // How does it look? With no errors, we can proceed if ($errors) { throw new Exception(implode(". ", $errors), Http::BAD_REQUEST); } $userId = $userMapper->createUser($user); $view = $request->getView(); $view->setHeader('Location', $request->base . $request->path_info . '/' . $userId); $view->setResponseCode(Http::CREATED); // autoverify for test platforms if ( isset($this->config['features']['allow_auto_verify_users']) && $this->config['features']['allow_auto_verify_users'] ) { if ($request->getParameter("auto_verify_user") == "true") { // the test suite sends this extra field, if we got // this far then this platform supports this $userMapper->verifyThisTestUser($userId); } } // Generate a verification token and email it to the user $token = $userMapper->generateEmailVerificationTokenForUserId($userId); $recipients = [$user['email']]; $emailService = $this->getUserRegistrationEmailService($this->config, $recipients, $token); $emailService->sendEmail(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loginUserConditionDoesNotMatchSingleLoggedInUser() {}", "function user_not_loggedin() {\n global $USER;\n return ($USER->id <= 0 || isguestuser());\n}", "public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {}", "public function notAuthenticated() {\n $objUser = Ap...
[ "0.6741413", "0.63765734", "0.6325251", "0.6318579", "0.6171644", "0.6052228", "0.5989663", "0.5975919", "0.59665823", "0.59503275", "0.5901578", "0.5851601", "0.57212216", "0.5719714", "0.570461", "0.56792927", "0.5678591", "0.5677635", "0.5650076", "0.56306905", "0.5629173"...
0.0
-1
Allow a user to edit their own record
public function updateUser(Request $request, PDO $db) { if (null === ($request->getUserId())) { throw new Exception("You must be logged in to change a user account", Http::UNAUTHORIZED); } $userId = $this->getItemId($request); $userMapper = $this->getUserMapper($db, $request); if (!$userMapper->thisUserHasAdminOn($userId)) { throw new Exception("Could not update user", Http::BAD_REQUEST); } $oauthModel = $request->getOauthModel($db); $accessToken = $request->getAccessToken(); // only trusted clients can change account details if (!$oauthModel->isAccessTokenPermittedPasswordGrant($accessToken)) { throw new Exception("This client does not have permission to perform this operation", Http::FORBIDDEN); } // start building up a representation of the user $user = ["user_id" => $userId]; $errors = []; // start with passwords $password = $request->getParameter('password'); if (!empty($password)) { // they must supply their old password to be allowed to set a new one $oldPassword = $request->getParameter('old_password'); if (empty($oldPassword)) { throw new Exception( 'The field "old_password" is needed to update a user password', Http::BAD_REQUEST ); } // is the old password correct before we proceed? if (!$oauthModel->reverifyUserPassword($userId, $oldPassword)) { throw new Exception("The credentials could not be verified", Http::FORBIDDEN); } $validity = $userMapper->checkPasswordValidity($password); if (true === $validity) { // OK good, go ahead $user['password'] = $password; } else { // the password wasn't acceptable, tell the user why $errors = array_merge($errors, $validity); } } $user['full_name'] = filter_var( trim($request->getParameter("full_name")), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); if (empty($user['full_name'])) { $errors[] = "'full_name' is a required field"; } $user['email'] = filter_var( trim($request->getParameter("email")), FILTER_VALIDATE_EMAIL, FILTER_FLAG_NO_ENCODE_QUOTES ); if (empty($user['email'])) { $errors[] = "A valid entry for 'email' is required"; } else { // does anyone else have this email? $existingUser = $userMapper->getUserByEmail($user['email']); if (is_array($existingUser) && array_key_exists('users', $existingUser)) { // yes but is that our existing user being found? $oldUser = $userMapper->getUserById($userId); if ($oldUser['users'][0]['uri'] != $existingUser['users'][0]['uri']) { // the email address exists and not on this user's account $errors[] = "That email is already associated with another account"; } } } $username = $request->getParameter("username", false); if (false !== $username) { $user['username'] = filter_var( trim($username), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); // does anyone else have this username? $existingUser = $userMapper->getUserByUsername($user['username']); if (is_array($existingUser) && array_key_exists('users', $existingUser)) { // yes but is that our existing user being found? $oldUser = $userMapper->getUserById($userId); if ($oldUser['users'][0]['uri'] != $existingUser['users'][0]['uri']) { // the username exists and not on this user's account $errors[] = "That username is already associated with another account"; } } } // Optional Fields $twitterUsername = $request->getParameter("twitter_username", false); if (false !== $twitterUsername) { $user['twitter_username'] = filter_var( trim($twitterUsername), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); } $biography = $request->getParameter("biography", false); if (false !== $biography) { $user['biography'] = filter_var( trim($biography), FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES ); } if ($errors) { throw new Exception(implode(". ", $errors), Http::BAD_REQUEST); } // now update the user if (!$userMapper->editUser($user, $userId)) { throw new Exception("User not updated", Http::BAD_REQUEST); } // we're good! $view = $request->getView(); $view->setHeader('Content-Length', 0); $view->setResponseCode(Http::NO_CONTENT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function editRecord() {\n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per)...
[ "0.8144015", "0.7668761", "0.76229084", "0.7571698", "0.75554425", "0.7470559", "0.7409758", "0.7357891", "0.7357891", "0.7354206", "0.7353598", "0.73488295", "0.7344208", "0.7335994", "0.73242337", "0.73209125", "0.72854435", "0.72854435", "0.72854435", "0.72576195", "0.7257...
0.0
-1
Allow users to be set as trusted
public function setTrusted(Request $request, PDO $db) { if (null === ($request->getUserId())) { throw new Exception("You must be logged in to change a user account", Http::UNAUTHORIZED); } $userMapper = $this->getUserMapper($db, $request); if (!$userMapper->isSiteAdmin($request->getUserId())) { throw new Exception("You must be an admin to change a user's trusted state", Http::FORBIDDEN); } $userId = $this->getItemId($request); if (!is_bool($trustedStatus = $request->getParameter("trusted", null))) { throw new Exception("You must provide a trusted state", Http::BAD_REQUEST); } if (!$userMapper->setTrustedStatus($trustedStatus, $userId)) { throw new Exception("Unable to update status", Http::INTERNAL_SERVER_ERROR); } $view = $request->getView(); $view->setHeader('Content-Length', 0); $view->setResponseCode(Http::NO_CONTENT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTrustedUser(){\n if (fromLocal() === true) return true;\n return strpos(clientIp(), ALLOW_IP) === 0;\n}", "public function content_is_trusted() {\n \treturn true;\n }", "function trusted() {\n\t//-----------------------------------------------------------\n\t// Check for trusted host\n\tif(g...
[ "0.68905914", "0.6824001", "0.66266763", "0.6427507", "0.6312033", "0.6076449", "0.60483164", "0.6024739", "0.59828067", "0.59273094", "0.5910408", "0.5908191", "0.58956313", "0.58646476", "0.58488375", "0.5826323", "0.58191955", "0.5803069", "0.57992107", "0.5734636", "0.573...
0.56710774
29
Determine if the user is authorized to make this request.
public function authorize() { return True; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ // 'name' => 'required|string|min:5|max:45', 'email' => 'required|email|unique:users,email', 'mobile' => 'required|numeric|unique:users,mobile', 'image' => 'image', 'address' => 'required|string|min:3', 'password' => 'required|string|min:5', 'password2'=>'same:password', 'status' => 'string|in:Blocked,Active,Wait', 'idint'=>'required|unique:users,idint|integer' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
include "./include/stat_func_tool.php"; ////////////// get label of province tumbon mooban ///////////////////
function get_label($ccaattmm){ $lst_ampor = getListAA(substr($ccaattmm,0,2)); $lst_tumbon = getListTT(substr($ccaattmm,0,4)); $lst_mooban = getListMM(substr($ccaattmm,0,6)); $arr_aa = explode("|", $lst_ampor); $arr_tt = explode("|", $lst_tumbon); $arr_mm = explode("|", $lst_mooban); /// sel ampor for($i=0; $i<(count($arr_aa)-3) ;$i+=2){ if(substr($arr_aa[$i+2],2,2)==substr($ccaattmm,2,2)){ echo str_replace('ท้องถิ่น','',$arr_aa[$i+3])." "; } } /// sel tumbon for($i=0; $i<(count($arr_tt)-3) ;$i+=2){ if(substr($arr_tt[$i+2],4,2)==substr($ccaattmm,4,2)){ echo " ตำบล".$arr_tt[$i+3]." "; } } /// sel mooban for($i=0; $i<(count($arr_mm)-3) ;$i+=2){ if(substr($arr_mm[$i+2],6,2)==substr($ccaattmm,6,2)){ echo " หมู่".$arr_mm[$i+3]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetLabel();", "public function get_label();", "public function get_label();", "function getLabel(): string;", "function get_label($ccaattmm){\n\t\t\t$lst_ampor = getListAA(substr($ccaattmm,0,2));\n\t\t\t$lst_tumbon = getListTT(substr($ccaattmm,0,4));\n\t\t\t$lst_mooban = getListMM(substr($c...
[ "0.65225047", "0.6519477", "0.6519477", "0.64948946", "0.6446904", "0.6252001", "0.62290317", "0.62290317", "0.62290317", "0.62290317", "0.62290317", "0.62290317", "0.62290317", "0.62290317", "0.61410403", "0.61410403", "0.6139777", "0.6118511", "0.6118511", "0.6118511", "0.6...
0.6562518
0
Setup the test properties.
protected function setUp() { $this->_blockMockBuilder = $this->getBlockMockBuilder('infinitescroll/init') ->disableOriginalConstructor(); $this->_blockFullMock = $this->_blockMockBuilder->setMethods(null) ->getMock(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp()\n {\n $this->object = new Properties();\n }", "protected function setUp()\n {\n $this->object = new TestAutoGetSetProps;\n }", "protected function setUp(): void {\n $this->parser = new PropertyParser();\n }", "protected function setUp()...
[ "0.78110677", "0.75613904", "0.74574476", "0.74184036", "0.7302611", "0.728605", "0.7021227", "0.7020154", "0.7016898", "0.6964622", "0.6910357", "0.6899997", "0.68768203", "0.68570465", "0.6849253", "0.6807189", "0.679796", "0.6795303", "0.6775165", "0.67726594", "0.6752555"...
0.0
-1
Get an addressed delay message
public function getAddressedDelayMessage(UserInterface $user, DestinationInterface $destination, string $operation): string { $bacon = $this->getRandom([ "Hang in there {mention}, I'm still working on that {event}.", 'This is taking a while {mention}, but everything is fine and nothing is ruined. Especially not this {event}.', "Go get a coffee {mention}, that {event} is taking its sweet time.", 'Give it a second {mention}, your {event} is going to space for crying out loud!', 'Good things come to those who wait {mention}. You like good things, right? Your {event} is still running.', 'Did I leave a {event} in the oven {mention}?', "Rome wasn't built in a day {mention}, and neither is this {event}.", 'Cool your jamjets {mention}, your {event} will be done... eventually.', "This {event} is still red in the middle {mention}, needs a bit more time.", ]); $mention = $this->getUserReference($user); return str_replace(['{mention}', '{event}'], [$mention, $operation], $bacon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDelay(): int;", "public function getDelayTime() {}", "public function getDelay()\n {\n return $this->delay;\n }", "public function getDelay(): int\n {\n return $this->delay;\n }", "public function getDelay(): int\n {\n return $this->delay;\n }", "...
[ "0.67242295", "0.6342543", "0.6128936", "0.6110978", "0.6110978", "0.604764", "0.5802513", "0.5618736", "0.55427665", "0.5501457", "0.5499948", "0.5469847", "0.5458123", "0.5452401", "0.54503417", "0.54331344", "0.5381336", "0.5326907", "0.5259076", "0.52521944", "0.52490926"...
0.475289
89
Get an adddressed normal message
public function getAddressedMessage(UserInterface $user, DestinationInterface $destination, string $message): string { $bacon = $this->getRandom([ "{mention}: {message}.", ]); $mention = $this->getUserReference($user); return str_replace(['{mention}', '{message}'], [$mention, $message], $bacon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRawMessage()\n {\n return $this->phrase->getText();\n }", "abstract public function get_message();", "public function rawMessage(){\n $return = array(\n 'message' => '',\n 'options' => array(),\n );\n if ($this->getWillLend() && $this->isItHome()) {\n $re...
[ "0.6821266", "0.66930115", "0.6653818", "0.6559868", "0.65384877", "0.6516365", "0.6496804", "0.647781", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0.64641416", "0....
0.0
-1
Get an addressed error message
public function getAddressedError(UserInterface $user, DestinationInterface $destination, string $error): string { $bacon = $this->getRandom([ "{mention}: {error}. Sorry.", "Uh {mention}, {error}. Sorry homie.", "Sorry {mention}, {error}.", "{mention}... {error}. Woops!", "Bad news {mention}, {error}", "Yikes {mention}, {error}. C'est la vie.", "{mention} you donut, {error}.", "Damn it {mention}, {error}!", "Wow, nice work {mention}. {error}...", "Way to go {mention}, {error}.", "See what you made me do {mention}!? {error}.", "{error} {mention}. Get it together, ok?", ]); $mention = $this->getUserReference($user); return str_replace(['{mention}', '{error}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($error))], $bacon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_error_message() {\n\t\treturn $this->error_message;\n\t}", "public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }", "public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }", "public function getMessage()\n {\n return $this->...
[ "0.7943212", "0.78881043", "0.7876968", "0.78735584", "0.78591", "0.7858627", "0.769098", "0.7674132", "0.7671183", "0.7671183", "0.7671183", "0.7652574", "0.7652574", "0.76233625", "0.76000476", "0.7548441", "0.754332", "0.75359213", "0.75359213", "0.75286734", "0.7525346", ...
0.0
-1
Get an addressed confirmation message
public function getAddressedConfirm(UserInterface $user, DestinationInterface $destination, string $command): string { $bacon = $this->getRandom([ "{mention} you asked me to {command}. Ready?", ]); $mention = $this->getUserReference($user); return str_replace(['{mention}', '{command}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($command))], $bacon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocalizedConfirmMessage() {\n\t\treturn $this->_confirmMessageLocalized;\n\t}", "public function getConfirmation() { return $this->confirmation; }", "public function getConfirmationToken(): string\n {\n return $this->confirmationToken;\n }", "public function actionSendConfirmationEma...
[ "0.6675702", "0.6650465", "0.65302044", "0.6478664", "0.64228815", "0.6389416", "0.63164335", "0.62710524", "0.62657464", "0.62526095", "0.6247272", "0.6245209", "0.6219021", "0.61852574", "0.61729825", "0.6163508", "0.6163126", "0.61368823", "0.6094315", "0.60893285", "0.607...
0.56446844
51
Get an addressed acknowledge message
public function getAddressedAcknowledge(UserInterface $user, DestinationInterface $destination, string $message): string { $bacon = $this->getRandom([ "Ok {mention}, {message}.", "No problem {mention}, {message}.", "You got it {mention}, {message}.", "Sure thing {mention}, {message}.", ]); $mention = $this->getUserReference($user); return str_replace(['{mention}', '{message}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($message))], $bacon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAck()\n\t{\n\t\treturn $this->ack;\n\t}", "public function buildAck(): ?string\n\t{\n\t\tif(!is_numeric($this->iPktType)){\n\t\t\treturn null;\n\t\t}\n\t\t$sPtk = NULL;\n\t\tif($this->aTypeMap[$this->iPktType]=='Unicast'){\n\t\t\t//Set the type as Ack\n\t\t\t$sPtk = pack('C',3);\n\t\t\t//Port ...
[ "0.65506154", "0.60935456", "0.5933206", "0.5568381", "0.5542685", "0.55309165", "0.55300635", "0.55167186", "0.55120337", "0.5450928", "0.5372342", "0.5352986", "0.52318484", "0.5196054", "0.5117026", "0.5062878", "0.5058786", "0.5020445", "0.5014797", "0.50035256", "0.49852...
0.53177834
12
Get an addressed completion message
public function getAddressedComplete(UserInterface $user, DestinationInterface $destination, string $message): string { $bacon = $this->getRandom([ "Great news {mention}, {message}.", "Good news {mention}, {message}.", "You can breathe again {mention}, {message}.", "FYI {mention}, {message}.", "P.S. {mention}, {message}.", "Hey {mention}, just letting you know {message}.", ]); $mention = $this->getUserReference($user); return str_replace(['{mention}', '{message}'], [$mention, preg_replace('/^i([\' ])/', 'I$1', lcfirst($message))], $bacon); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFragmentComposeReply()\n {\n return $this->get(self::_FRAGMENT_COMPOSE_REPLY);\n }", "public function getTriggerJobReply()\n {\n return $this->get(self::_TRIGGER_JOB_REPLY);\n }", "public function getTriggerTaskReply()\n {\n return $this->get(self::_TRIGGE...
[ "0.5593971", "0.55617803", "0.5529762", "0.54996955", "0.53648376", "0.5275457", "0.5207765", "0.5196588", "0.51485234", "0.51258785", "0.50984406", "0.50970644", "0.5094707", "0.50938815", "0.5092328", "0.5079508", "0.50707316", "0.50377566", "0.4999959", "0.49890396", "0.49...
0.0
-1
Get a random response
protected function getRandom(array $responses): string { $countResponses = count($responses); $responseID = mt_rand(0, $countResponses - 1); return $responses[$responseID]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_random_response_id($connect){\n $q='RES'.rand(2000,2999);\n $id=check_response_in_DB($q,$connect); \n return $id;\n}", "public function random();", "public function getRandom() {\n\t\t$quote = $this->get('random', array('limit'=>1));\n\t\treturn $quote[0];\n\t}", "public function findR...
[ "0.6625422", "0.6340368", "0.6286194", "0.6191449", "0.6178401", "0.61579233", "0.6094504", "0.6067878", "0.6049713", "0.60324997", "0.60200506", "0.600707", "0.59981906", "0.59847075", "0.59388465", "0.5925821", "0.5925821", "0.5859056", "0.5859056", "0.5859056", "0.5859056"...
0.6278672
3
Get a user mention'
protected function getUserReference(UserInterface $user): string { return "@{$user->getName()}"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mentionDetect($match)\n{\n\tstatic $nameCache, $myCache;\n\n\tif (!empty($match['quoted'])) {\n\t\t$username = $match['quoted'];\n\t} elseif (!empty($match['unquoted'])) {\n\t\t$username = $match['unquoted'];\n\t} else {\n\t\treturn $match[0];\n\t}\n\n\t$username = html_entity_decode(mb_strtolower($userna...
[ "0.73527265", "0.7237184", "0.70045775", "0.6949537", "0.6816772", "0.65863216", "0.65647507", "0.6497825", "0.6458947", "0.6417737", "0.63917005", "0.6326686", "0.6299716", "0.6243281", "0.62321895", "0.6203905", "0.6099018", "0.59687454", "0.58519363", "0.58465546", "0.5845...
0.0
-1
Test that true does in fact equal true
public function testCurlGoodUrl() { $curl = new CurlClass(); $res = $curl->submit('http://feeds.nationalgeographic.com/ng/News/News_Main'); $this->assertTrue($res, 'test url ktory zwraca kod 200'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTrue()\n {\n $testtrue = true;\n $this->assertTrue($testtrue);\n\n\treturn false;\n }", "public function isTrue();", "public function testTrueIsTrue(){\n $foo = true;\n $this->assertTrue($foo);\n }", "public function testTrueIsTrue()\n {\n $this->ass...
[ "0.7951144", "0.7752722", "0.7670101", "0.74442613", "0.74442613", "0.7052292", "0.6819346", "0.67771477", "0.6762823", "0.6759817", "0.6748157", "0.6692686", "0.66890013", "0.66663045", "0.66407454", "0.6626448", "0.6622745", "0.66221976", "0.66015077", "0.6575891", "0.65381...
0.0
-1