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 |
|---|---|---|---|---|---|---|
Get the cache manager instance. | public static function getCacheManager()
{
return static::$cache;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getCacheManager()\n {\n if (!$this->cacheManager) {\n $this->cacheManager = $this->getContainer()->get('fos_http_cache.cache_manager');\n }\n\n return $this->cacheManager;\n }",
"protected function cache(): CacheManager\n {\n $cache = cache();\n ... | [
"0.8094249",
"0.76013684",
"0.74770063",
"0.72327316",
"0.72218835",
"0.7214601",
"0.71625143",
"0.71580964",
"0.7146208",
"0.70696044",
"0.70076454",
"0.6980484",
"0.6976852",
"0.69767827",
"0.69588304",
"0.69588304",
"0.69588304",
"0.69519055",
"0.69373894",
"0.68777776",
"... | 0.78533554 | 1 |
Set the cache manager instance. | public static function setCacheManager($cache)
{
static::$cache = $cache;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setManager( $manager )\n {\n $this->manager = $manager;\n }",
"public function setCache() {\n \n // Set our cache to an instance of Cache\n $this->oCache = Cache::getInstance();\n \n // Return instance\n return $this;\n... | [
"0.6428454",
"0.63055575",
"0.6299985",
"0.6266025",
"0.62029254",
"0.6153924",
"0.6131992",
"0.6082044",
"0.6079378",
"0.60624725",
"0.59687716",
"0.59674877",
"0.5965505",
"0.5912485",
"0.589939",
"0.5892556",
"0.5889972",
"0.5887504",
"0.588552",
"0.58648443",
"0.58599263"... | 0.6834452 | 0 |
Unset the cache manager for models. | public static function unsetCacheManager()
{
static::$cache = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _clearCache() {\n\t\t\tCache::clear(false, '_cake_model_');\n\t\t\tClassRegistry::flush();\n\t\t}",
"public function clearCache()\n {\n flush_model_cache($this);\n }",
"public static function clearCache(){\n\t\t\n\t\t\\GO::config()->getCacheFolder(false)->delete();\t\t\n\t\t\n\t... | [
"0.6979484",
"0.67925805",
"0.67106956",
"0.6576163",
"0.6487907",
"0.64638853",
"0.63941264",
"0.63070506",
"0.6282042",
"0.6263471",
"0.62426007",
"0.6231064",
"0.61633855",
"0.6141962",
"0.613829",
"0.6118608",
"0.6101948",
"0.6080217",
"0.6071932",
"0.60490143",
"0.604901... | 0.73109895 | 0 |
Initializes the object properties from the cached data. The extra data set here becomes available as attributes set on the model after fetch. | public static function initCacheItem(&$item) { } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }",
... | [
"0.69107956",
"0.6882882",
"0.6613091",
"0.6504775",
"0.6461508",
"0.6437333",
"0.6421674",
"0.6328286",
"0.63186073",
"0.6283304",
"0.6219758",
"0.6218477",
"0.62097514",
"0.61648756",
"0.61426437",
"0.61405826",
"0.61128527",
"0.6106058",
"0.60793024",
"0.6069633",
"0.60327... | 0.0 | -1 |
Get the mutated attributes for a given instance. | public function getMutatedAttributes()
{
$class = get_class($this);
if (!isset(static::$mutatorCache[$class])) {
static::cacheMutatedAttributes($class);
}
return static::$mutatorCache[$class];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMutatedAttributes()\n {\n $class = get_class($this);\n\n if (!isset(static::$mutatorCache[$class]))\n static::cacheMutatedAttributes($class);\n\n return static::$mutatorCache[$class];\n }",
"public function getMutatedAttributes()\n {\n $mutAt = $... | [
"0.8180421",
"0.7936646",
"0.7774545",
"0.72141427",
"0.6458633",
"0.6380718",
"0.6332305",
"0.6315623",
"0.63148695",
"0.6247602",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
"0.6207506",
... | 0.81447494 | 1 |
Extract and cache all the mutated attributes of a class. | public static function cacheMutatedAttributes($class)
{
$mutatedAttributes = [];
// Here we will extract all of the mutated attributes so that we can quickly
// spin through them after we export models to their array form, which we
// need to be fast. This'll let us know the attributes that can mutate.
if (preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches)) {
foreach ($matches[1] as $match) {
$mutatedAttributes[] = lcfirst($match);
}
}
static::$mutatorCache[$class] = $mutatedAttributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function cacheMutatedAttributes($class)\n {\n $mutatedAttributes = [];\n\n // Here we will extract all of the mutated attributes so that we can quickly\n // spin through them after we export models to their array form, which we\n // need to be fast. This'll let us know ... | [
"0.79108083",
"0.76778585",
"0.7668186",
"0.7661906",
"0.74005735",
"0.69607615",
"0.6657722",
"0.6311943",
"0.6294863",
"0.6174845",
"0.6158515",
"0.6082689",
"0.60549265",
"0.60042226",
"0.5920544",
"0.58771735",
"0.5847044",
"0.57913285",
"0.5782104",
"0.5662671",
"0.56579... | 0.79209965 | 0 |
Dynamically retrieve attributes on the model. | public function __get($key)
{
return $this->getAttribute($key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getModelAttributes();",
"public function getAttributes() {}",
"public function getAttributes() {}",
"protected function _getAttributes(){\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}",
"public function getAttributes();",
"public functio... | [
"0.737541",
"0.73638135",
"0.73629034",
"0.728978",
"0.7285603",
"0.7285603",
"0.7285603",
"0.7285603",
"0.7285603",
"0.7285603",
"0.7285603",
"0.7285603",
"0.7285603",
"0.72171146",
"0.72171146",
"0.71729594",
"0.71613365",
"0.71525997",
"0.7136865",
"0.7108088",
"0.70407975... | 0.0 | -1 |
Dynamically set attributes on the model. | public function __set($key, $value)
{
$this->setAttribute($key, $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAttributes();",
"protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'nombre',\n 'estado',\n 'pais_idpais'\n ],\n 'date' => []\n ];\n }",
"protected func... | [
"0.7629739",
"0.7292454",
"0.7166651",
"0.7000142",
"0.6911653",
"0.68264914",
"0.6768282",
"0.6748999",
"0.6722249",
"0.665968",
"0.65957123",
"0.65655774",
"0.65224737",
"0.6514377",
"0.65073717",
"0.6452198",
"0.64509493",
"0.6346409",
"0.631699",
"0.62707937",
"0.62671393... | 0.0 | -1 |
Determine if the given attribute exists. | public function offsetExists($offset)
{
return isset($this->$offset);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }",
"private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}",
"private fun... | [
"0.83363783",
"0.82382506",
"0.8062594",
"0.797662",
"0.795886",
"0.7939738",
"0.79278475",
"0.7907563",
"0.78930277",
"0.78930277",
"0.7880218",
"0.7872137",
"0.78630066",
"0.78446126",
"0.78152364",
"0.7779831",
"0.77734387",
"0.7765436",
"0.7762834",
"0.7731732",
"0.768294... | 0.0 | -1 |
Get the value for a given offset. | public function offsetGet($offset)
{
return $this->$offset;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public\tfunction\tgetValue($offset)\n\t\t{\n\t\t\tif(!array_key_exists($offset, $this->_values)) {\n\t\t\t\treturn\t$this->_values[$offset];\n\t\t\t}\n\t\t}",
"public function offsetGet(mixed $offset): mixed\n {\n return Arr::get($this->value, $offset);\n }",
"public function getValue($offset = nu... | [
"0.85854644",
"0.84230113",
"0.83473283",
"0.8296362",
"0.82947904",
"0.82205033",
"0.81141675",
"0.80604595",
"0.8048024",
"0.80344164",
"0.78783303",
"0.7820231",
"0.7813389",
"0.77963674",
"0.779477",
"0.7767127",
"0.7767086",
"0.7747986",
"0.7710085",
"0.7708092",
"0.7652... | 0.75523806 | 41 |
Set the value for a given offset. | public function offsetSet($offset, $value)
{
$this->$offset = $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set($offset, $value);",
"public function set($offset, $value = null);",
"public function offsetSet($offset, $value)\n {\n $this->$offset = $value;\n }",
"public function offsetSet( $offset, $value ) {\n\t\t// ...\n\t}",
"public function offsetSet($offset, $value)\n {\n $this-... | [
"0.86257434",
"0.83691275",
"0.81148374",
"0.8103172",
"0.80643",
"0.80569595",
"0.8027558",
"0.8027558",
"0.80269706",
"0.80193007",
"0.8018883",
"0.80153614",
"0.80079514",
"0.80079514",
"0.80006105",
"0.7995831",
"0.7991908",
"0.798775",
"0.798775",
"0.798775",
"0.79810137... | 0.81316894 | 31 |
Unset the value for a given offset. | public function offsetUnset($offset)
{
unset($this->$offset);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function offsetUnset($offset)\n {\n unset($this->getValue()[$offset]);\n }",
"public function offsetUnset(mixed $offset): void\n {\n if (Arr::accessible($this->value)) {\n unset($this->value[$offset]);\n }\n }",
"public function offsetUnset($offset)\n {\n ... | [
"0.865914",
"0.85215086",
"0.82357126",
"0.8189678",
"0.8189678",
"0.81851745",
"0.8177615",
"0.8177615",
"0.8174688",
"0.8165123",
"0.8155582",
"0.8141825",
"0.8141825",
"0.81385094",
"0.81330717",
"0.81136465",
"0.8110884",
"0.80884874",
"0.8073048",
"0.806787",
"0.806787",... | 0.8040559 | 42 |
Determine if an attribute exists on the model. | public function __isset($key)
{
return isset($this->attributes[$key]) ||
(
$this->hasGetMutator($key) &&
!is_null($this->getAttribute($key))
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }",
"public function hasAttribute($attr_name)\n {\n return isset($this->attributes[$attr_name]);\n }",
"private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exi... | [
"0.79861784",
"0.78571856",
"0.7813143",
"0.7700056",
"0.76819146",
"0.7607045",
"0.7604353",
"0.7598408",
"0.75649357",
"0.7535318",
"0.7487963",
"0.7485505",
"0.74830633",
"0.74703836",
"0.74621165",
"0.7460811",
"0.743363",
"0.7426847",
"0.74267954",
"0.7424174",
"0.742159... | 0.65443265 | 78 |
Unset an attribute on the model. | public function __unset($key)
{
unset($this->attributes[$key]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __unset($attribute) {\n return $this->deleteAttribute($attribute);\n }",
"public function __unset($name)\n\t{\n\t\tif(isset($this->_attributes[$name]))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}",
"public function __unset($name) {\n\t\tif ($... | [
"0.71994036",
"0.7186004",
"0.7172486",
"0.7036468",
"0.70217484",
"0.69162786",
"0.67399037",
"0.66361064",
"0.66158473",
"0.66149557",
"0.6583601",
"0.65460634",
"0.65322083",
"0.6506163",
"0.64976794",
"0.6484506",
"0.6458264",
"0.6458026",
"0.63966703",
"0.6385877",
"0.63... | 0.69405675 | 8 |
Handle dynamic method calls into the model. | public function __call($method, $parameters)
{
try {
return parent::__call($method, $parameters);
}
catch (BadMethodCallException $ex) {
$query = $this->newQuery();
return call_user_func_array([$query, $method], $parameters);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function call()\n {\n foreach (config('lucy.crud') as $type) {\n if ($this->builder->getAttribute($type)) {\n $method = 'call'.ucfirst(strtolower($type));\n\n $this->{$method}();\n }\n }\n }",
"protected function handle() {\n\t\t\t$ar... | [
"0.6286399",
"0.62137026",
"0.6167063",
"0.6058172",
"0.6010468",
"0.6002769",
"0.5983546",
"0.59798884",
"0.5974855",
"0.5952929",
"0.5938619",
"0.58777153",
"0.58671796",
"0.58177304",
"0.5771017",
"0.5767107",
"0.57650936",
"0.5763143",
"0.5746244",
"0.57457983",
"0.573976... | 0.0 | -1 |
Handle dynamic static method calls into the method. | public static function __callStatic($method, $parameters)
{
$instance = new static;
return call_user_func_array([$instance, $method], $parameters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function __callStatic($method, $parameters);",
"public static function __callStatic($method, $arguments=null) {}",
"protected static function __callStaticHook($method, array & $arguments)\n { }",
"public static function __callStatic($method, $args){ return null; }",
"final public static ... | [
"0.6592369",
"0.6516633",
"0.64743316",
"0.6404961",
"0.6340851",
"0.6253705",
"0.6122773",
"0.6093429",
"0.60924673",
"0.60924673",
"0.60924673",
"0.6074362",
"0.6025835",
"0.6011192",
"0.60045624",
"0.5998292",
"0.59909356",
"0.598522",
"0.59669554",
"0.59428847",
"0.589320... | 0.0 | -1 |
Convert the model to its string representation. | public function __toString()
{
return $this->toJson();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toString(Eloquent $model);",
"function __toString()\r\n\t{\r\n\t\treturn ucfirst($this->model);\r\n\t}",
"public function to_string() { return $this->__toString(); }",
"public function __toString(){\n return $this->convert();\n }",
"function __toString()\n {\n return $th... | [
"0.78766185",
"0.69888157",
"0.69649905",
"0.69357395",
"0.67367023",
"0.67023927",
"0.6668791",
"0.663826",
"0.6619192",
"0.6598969",
"0.6552189",
"0.65367377",
"0.65339285",
"0.6533781",
"0.6531132",
"0.6518637",
"0.65060836",
"0.6499852",
"0.64908075",
"0.64870584",
"0.648... | 0.6412486 | 44 |
Validations and business logic | public function validation() {
$validator = new Validation();
$validator->add(
"tel",
new TelValidator(
[
"required" => true
]
)
);
$validator->add(
"post",
new PostValidator(
[
"required" => true
]
)
);
return $this->validate($validator);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function validation();",
"abstract public function validate();",
"abstract public function validate();",
"protected function _validate() {\n\t}",
"public function validation();",
"public function validate();",
"public function validate();",
"public function validate();",
"public fun... | [
"0.8325839",
"0.816064",
"0.816064",
"0.815595",
"0.8120198",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.798002",
"0.7852934",
"0.78310686",
"0.782456",
"0.7657778",
"0.7657778",
"... | 0.0 | -1 |
check in post data columns | public function getPostColumns()
{
return array(
'post' => 'post',
'prefecture' => 'prefecture',
'address1' => 'address1',
'address2' => 'address2',
'tel' => 'tel',
'fax' => 'fax',
'category' => 'category',
'healthCheck' => 'healthCheck'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateColums($POST) {\n if (isset( $POST['sName'] ) )\n return true;\n\n if ( (!isset($POST['label'])) &&\n (!isset($POST['asset_no'])) &&\n (!isset($POST['has_problems'])) &&\n (!isset($POST['comment'])) &&\n (!isset($POST['runs8021Q'])) &&\n (!isset... | [
"0.72687554",
"0.6570503",
"0.6570503",
"0.63712835",
"0.6260158",
"0.62055653",
"0.6201341",
"0.6152634",
"0.6116419",
"0.6020185",
"0.6015655",
"0.5961089",
"0.5955823",
"0.5901427",
"0.58730936",
"0.5866121",
"0.58513606",
"0.5849176",
"0.5840928",
"0.5828772",
"0.58210844... | 0.57056355 | 27 |
Returns the name of the extension. | public function getName() {
return 'main';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExtensionName() {}",
"public function getName()\n {\n return self::EXTENSION_NAME;\n }",
"abstract public function getExtensionName();",
"public function getExtensionName() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }",
"public function getN... | [
"0.91565424",
"0.8927959",
"0.8711921",
"0.84661037",
"0.83886665",
"0.8361621",
"0.83368284",
"0.82452506",
"0.8239709",
"0.8229256",
"0.81653655",
"0.81653655",
"0.80174255",
"0.79762125",
"0.79629993",
"0.788117",
"0.7860908",
"0.7790925",
"0.7765071",
"0.7755446",
"0.7723... | 0.0 | -1 |
An integer value. Value for program_number field in the MPEG Transport Stream Program Map Table (PMT). The value zero is reserved for the NIT PID entry in the PAT. | public function programNumber(int $programNumber)
{
$this->programNumber = $programNumber;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProgramID () {\n\t$preValue = $this->preGetValue(\"programID\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"programID\")->preGetData($this);\n\treturn $data;\n}",
"public function getProgramCode()\n {... | [
"0.6556063",
"0.6265387",
"0.6156509",
"0.54499173",
"0.5160234",
"0.5117792",
"0.5111381",
"0.508315",
"0.50688905",
"0.5066054",
"0.5026098",
"0.49391034",
"0.49391034",
"0.49308985",
"0.49042818",
"0.48889673",
"0.4887971",
"0.4880532",
"0.48593026",
"0.4854281",
"0.483338... | 0.5428022 | 4 |
Returns a new ConversionProcess object. | public function newInstance(RootConfig $config, LoggerInterface $logger, Fsio $fsio)
{
return new ConversionProcess(
$logger,
$fsio,
$this->newCommonMarkConverter($config)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS... | [
"0.6661424",
"0.65294755",
"0.5904691",
"0.587515",
"0.5676133",
"0.5641769",
"0.5639934",
"0.55522454",
"0.5549026",
"0.5468851",
"0.54585445",
"0.5438428",
"0.54170346",
"0.5288181",
"0.5280718",
"0.52269405",
"0.52269405",
"0.52195257",
"0.52044857",
"0.51866883",
"0.51754... | 0.6483544 | 2 |
Returns a new Converter object. | protected function newCommonMarkConverter(RootConfig $config)
{
$environment = Environment::createCommonMarkEnvironment();
foreach ($config->getCommonMarkExtensions() as $extension) {
if (! class_exists($extension)) {
throw new \RuntimeException(
sprintf('CommonMark extension class "%s" does not exists. You must use a FCQN!', $extension)
);
}
$environment->addExtension(new $extension());
}
return new Converter(
new DocParser($environment),
new HtmlRenderer($environment)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getConverter()\n {\n return new Converter(\n $this->getManager()->getTypesMapping(),\n $this->getManager()->getBundlesMapping()\n );\n }",
"protected function newConverterInstance()\n {\n if($this->__converter instanceof IBaseConverter)\n ... | [
"0.77740914",
"0.7392728",
"0.71584344",
"0.6899837",
"0.6261754",
"0.6224456",
"0.6219081",
"0.61289215",
"0.5955398",
"0.5946377",
"0.5936374",
"0.5815945",
"0.57743967",
"0.57275975",
"0.57228047",
"0.57005626",
"0.5667001",
"0.55628145",
"0.55241907",
"0.5416047",
"0.5405... | 0.47653934 | 59 |
Returns an 'error' response. | private function _returnError ($entry)
{
if ( craft()->request->isAjaxRequest() ) {
$this->returnJson(array(
'errors' => $entry->getErrors(),
));
}
else {
craft()->userSession->setError(Craft::t('Couldn’t save entry.'));
// Send the entry back to the template
$entryVariable = craft()->config->get('entryVariable', 'guestentries');
craft()->urlManager->setRouteVariables(array(
$entryVariable => $entry
));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function error(BaseResponse $response);",
"public static function sendErrorResponse($error = null){\n http_response_code(500);\n echo $error;\n die();\n }",
"protected function error()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n '... | [
"0.7358125",
"0.7270752",
"0.7248084",
"0.7242143",
"0.71371365",
"0.71275014",
"0.71046346",
"0.70637274",
"0.6966138",
"0.6936008",
"0.6904606",
"0.68734336",
"0.68625957",
"0.6858159",
"0.6851639",
"0.68138844",
"0.6718853",
"0.66543555",
"0.66509813",
"0.66401505",
"0.663... | 0.0 | -1 |
Assert that error message is visible after exporting without entity attributes data. | public function processAssert(AdminExportIndex $adminExportIndex)
{
$actualMessage = $adminExportIndex->getMessagesBlock()->getErrorMessage();
\PHPUnit\Framework\Assert::assertEquals(
self::ERROR_MESSAGE,
$actualMessage,
'Wrong error message is displayed.'
. "\nExpected: " . self::ERROR_MESSAGE
. "\nActual: " . $actualMessage
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function assertValidationDisabled()\n {\n $this->assertFalse(self::getProperty($this->intent, 'validate_inputs'), 'failed to disable validation');\n }",
"public function assertValid()\n {\n }",
"public function testHasViolation()\n {\n $this->assertFalse($this->uu... | [
"0.6224611",
"0.6062409",
"0.6024309",
"0.6002883",
"0.5990221",
"0.5971228",
"0.5851911",
"0.58296007",
"0.5828715",
"0.5828715",
"0.5791683",
"0.5763589",
"0.56965005",
"0.56837726",
"0.5681218",
"0.5676972",
"0.5671906",
"0.56293577",
"0.56121314",
"0.559088",
"0.55880904"... | 0.53069633 | 51 |
Returns a string representation of the object. | public function toString()
{
return 'Correct error message is displayed.';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toString()\n {\n return json_encode($this->obj);\n }",
"public function to_string() { return $this->__toString(); }",
"public function toString()\n {\n return $this->__toString();\n }",
"public function __toString()\n {\n notice('Object: \"'.get_class($this... | [
"0.8368788",
"0.8207118",
"0.8202881",
"0.8200635",
"0.81494355",
"0.81476235",
"0.8140076",
"0.81247735",
"0.8109041",
"0.80821025",
"0.8057032",
"0.80421513",
"0.80421513",
"0.8029052",
"0.8003964",
"0.8002423",
"0.7998356",
"0.7998356",
"0.7998356",
"0.7998356",
"0.7998356... | 0.0 | -1 |
Update Gal Image Caption | public function updateGalCaption($galImageID)
{
// Get user input
$caption = $_POST['caption'];
// Update DB
$this->db->update('galImage', array('caption' => $caption), "`galImageID` = ".$galImageID);
echo json_encode(array('error' => false));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function image_add_caption($html, $id, $caption, $title, $align, $url, $size, $alt = '')\n {\n }",
"public function actionUpdateImageCaption() \r\n {\r\n extract($_POST);\r\n $res=0;\r\n \r\n\r\n $fileMaster= FileMaster::model()->findByPk($id);\r\n ... | [
"0.6862487",
"0.65053725",
"0.62238157",
"0.61842364",
"0.60865736",
"0.6045289",
"0.59946823",
"0.59423345",
"0.57884777",
"0.57455033",
"0.57424396",
"0.57090324",
"0.5696177",
"0.5695939",
"0.5677674",
"0.564076",
"0.56226057",
"0.55413264",
"0.5514369",
"0.55143183",
"0.5... | 0.6788886 | 1 |
Returns true if a cover has been created | private function _checkCover($galID)
{
$query = "SELECT coverPath FROM gallery WHERE galID = :galID";
if($result = $this->db->select($query, array(':galID' => $galID)))
{
if($result[0]['coverPath'] == "") {
return false;
} else {
return true;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isThere() {\n\n if($this->options['overwrite'] === true) return false;\n\n // if the thumb already exists and the source hasn't been updated\n // we don't need to generate a new thumbnail\n if(file_exists($this->destination->root) && f::modified($this->destination->root) >= $this->sourc... | [
"0.64582664",
"0.63135815",
"0.6269562",
"0.6211483",
"0.61204594",
"0.6106973",
"0.6074806",
"0.6064156",
"0.5986524",
"0.59532493",
"0.59503895",
"0.5932661",
"0.58983254",
"0.58948594",
"0.5890176",
"0.5889079",
"0.5880778",
"0.5864862",
"0.58555037",
"0.58539003",
"0.5837... | 0.55374706 | 45 |
executes the request using TwitterAPIExchange | public function execute($url, $data = array(), $method = 'GET', $headers = array()) {
if (empty($url)) {
throw new Exception('Invalid url');
}
if ($method !== 'GET' && $method !== 'POST') {
throw new Exception("Method not supported");
}
if ($method == 'GET') {
$str = '';
if (!empty($data)) {
foreach($data as $k => $v) {
$str = $str . '&' . $k . '=' . $v;
}
$str = trim($str, '&');
$this->client->setGetfield($str);
$this->client->buildOauth($url, $method);
}
} else {
$this->client->buildOauth($str, $method);
if(!empty($data)) {
$this->client->setPostfields($data);
}
}
return $this->client->performRequest();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function do_api_request() {\n\t\trequire_once __DIR__ . '/../vendor/Twitter/autoload.php';\n\n\t\t$swp_api_key = 'MQGiE1PFoRKEjhR0xVGC0bT0R';\n\t\t$swp_api_secret = '2MN9AHNFIA6lYNG0lWicArt6jr8xv19iFWGRNOTRvRhKE4wYyX';\n\n\t\t$consumer_access_token = SWP_Credential_Helper::get_token('twitter');\n\t\t$consum... | [
"0.66768795",
"0.65731376",
"0.6397807",
"0.6270402",
"0.60626376",
"0.6059004",
"0.605536",
"0.600763",
"0.59945774",
"0.59656507",
"0.59415674",
"0.5912039",
"0.58229816",
"0.58083063",
"0.5781852",
"0.5778774",
"0.5770406",
"0.57647735",
"0.57619786",
"0.5757747",
"0.57051... | 0.0 | -1 |
http response code for last request | public function getResponseCode() {
return $this->client->getHttpStatusCode();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_http_response_code()\n\t{\n\t\t//最后一个收到的HTTP代码\n\t\treturn curl_getinfo($this->ch, CURLINFO_HTTP_CODE);\n\t}",
"function http_headers_get_response_code() {\n\t\treturn $this->http_response_code;\n\t}",
"public function getResponseCode();",
"public function getResponseCode();",
"function http_r... | [
"0.81262594",
"0.75935054",
"0.75740415",
"0.75740415",
"0.7570929",
"0.74551487",
"0.7380879",
"0.737842",
"0.7335493",
"0.73172444",
"0.7265346",
"0.7241535",
"0.71765614",
"0.7173066",
"0.7172273",
"0.71611243",
"0.7157645",
"0.71561307",
"0.7113337",
"0.70837396",
"0.7083... | 0.6506316 | 83 |
Display a listing of the resource. | public function index( WidgetStatRequest $request, WidgetStatServiceInterface $widgetStatService, WidgetServiceInterface $widgetService, CampaignServiceInterface $campaignService )
{
$campaign_id = $request->get('campaign_id');
if($widget_id = $request->get('widget_id')){
$stats = $widgetStatService->getWidgetStatsById($widget_id);
$stats_days = $stats->lists('created_at');
$days = array();
if($filterDays = $request->get('filterDays')){
foreach ($stats_days as $day) {
$day = Carbon::parse($day)->format('Y-m-d');
foreach($filterDays as $fd){
if($day == $fd){
array_push($days,$day);
}
}
}
return view('reports.index' , [ 'widgets' => $widgetService->getWidgetsByCampaignId($campaign_id), 'campaigns' => $campaignService->getAllCampaigns(), 'campaign_id' => $campaign_id, 'days' => $days ]);
}
foreach ($stats_days as $day) {
$day = Carbon::parse($day)->format('Y-m-d');
array_push($days,$day);
}
return view('reports.index' , [ 'widgets' => $widgetService->getWidgetsByCampaignId($campaign_id), 'campaigns' => $campaignService->getAllCampaigns(), 'campaign_id' => $campaign_id, 'days' => $days ]);
}
//$stats = $widgetStatService->getAllStats();
//dd($stats);
return view('reports.index' , [ 'widgets' => $widgetService->getWidgetsByCampaignId($campaign_id), 'campaigns' => $campaignService->getAllCampaigns(), 'campaign_id' => $campaign_id ]);
} | {
"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.7447426",
"0.73628515",
"0.73007894",
"0.7249563",
"0.7164474",
"0.7148467",
"0.71320325",
"0.7104678",
"0.7103152",
"0.7100512",
"0.7048493",
"0.6994995",
"0.69899315",
"0.6935843",
"0.6899995",
"0.68999326",
"0.6892163",
"0.6887924",
"0.6867505",
"0.6851258",
"0.6831236"... | 0.0 | -1 |
Always ` Generated from protobuf field string type = 1 [json_name = "_type"]; | public function getType()
{
return $this->type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_type(): string;",
"public function getType():string { return $this->type; }",
"function graphql_format_type_name($type_name)\n {\n }",
"abstract protected function get_typestring();",
"public function type(): string\n {\n return $this->type;\n }",
"public function t... | [
"0.6557726",
"0.65118283",
"0.64975137",
"0.6470514",
"0.6454245",
"0.6454245",
"0.6426044",
"0.6372018",
"0.63676935",
"0.6356431",
"0.6351839",
"0.6344984",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
... | 0.0 | -1 |
Always ` Generated from protobuf field string type = 1 [json_name = "_type"]; | public function setType($var)
{
GPBUtil::checkString($var, True);
$this->type = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_type(): string;",
"public function getType():string { return $this->type; }",
"function graphql_format_type_name($type_name)\n {\n }",
"abstract protected function get_typestring();",
"public function type(): string\n {\n return $this->type;\n }",
"public function t... | [
"0.6557726",
"0.65118283",
"0.64975137",
"0.6470514",
"0.6454245",
"0.6454245",
"0.6426044",
"0.6372018",
"0.63676935",
"0.6356431",
"0.6351839",
"0.6344984",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
"0.6334658",
... | 0.0 | -1 |
Generated from protobuf field repeated .grafeas.v1.Subject subject = 2; | public function getSubject()
{
return $this->subject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSubject($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Grafeas\\V1\\Subject::class);\n $this->subject = $arr;\n\n return $this;\n }",
"public function setSubject($var)\n {\n GPBUtil::checkString($var, ... | [
"0.7401237",
"0.67060596",
"0.67060596",
"0.62404615",
"0.6182576",
"0.6182576",
"0.6182576",
"0.61770827",
"0.61770827",
"0.61770827",
"0.61770827",
"0.61770827",
"0.61770827",
"0.61770827",
"0.6153662",
"0.60855913",
"0.6023436",
"0.6023339",
"0.6006469",
"0.59849185",
"0.5... | 0.59895265 | 33 |
Generated from protobuf field repeated .grafeas.v1.Subject subject = 2; | public function setSubject($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grafeas\V1\Subject::class);
$this->subject = $arr;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }",
"public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }",
"function Su... | [
"0.67051154",
"0.67051154",
"0.62397915",
"0.61822516",
"0.61822516",
"0.61822516",
"0.61764055",
"0.61764055",
"0.61764055",
"0.61764055",
"0.61764055",
"0.61764055",
"0.61764055",
"0.6152795",
"0.6084841",
"0.6022674",
"0.6022352",
"0.60057884",
"0.5988485",
"0.5988485",
"0... | 0.7399568 | 0 |
` for SlsaProvenance. Generated from protobuf field string predicate_type = 3; | public function getPredicateType()
{
return $this->predicate_type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getXsiTypeName() {\n return \"Predicate\";\n }",
"public function setPredicateType($var)\n {\n GPBUtil::checkString($var, True);\n $this->predicate_type = $var;\n\n return $this;\n }",
"public function getSlsaProvenance()\n {\n return $this->readOneof(5)... | [
"0.60628766",
"0.59220856",
"0.5573107",
"0.4837793",
"0.45543426",
"0.44325393",
"0.4421502",
"0.43902925",
"0.42896333",
"0.42843154",
"0.4241898",
"0.42232013",
"0.41924918",
"0.4179866",
"0.41772372",
"0.41759098",
"0.4161281",
"0.41504654",
"0.4114715",
"0.41031533",
"0.... | 0.59416854 | 1 |
` for SlsaProvenance. Generated from protobuf field string predicate_type = 3; | public function setPredicateType($var)
{
GPBUtil::checkString($var, True);
$this->predicate_type = $var;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getXsiTypeName() {\n return \"Predicate\";\n }",
"public function getPredicateType()\n {\n return $this->predicate_type;\n }",
"public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }",
"public function setSlsaProvenance($var)\n {\n GP... | [
"0.60628766",
"0.59416854",
"0.5573107",
"0.4837793",
"0.45543426",
"0.44325393",
"0.4421502",
"0.43902925",
"0.42896333",
"0.42843154",
"0.4241898",
"0.42232013",
"0.41924918",
"0.4179866",
"0.41772372",
"0.41759098",
"0.4161281",
"0.41504654",
"0.4114715",
"0.41031533",
"0.... | 0.59220856 | 2 |
Generated from protobuf field .grafeas.v1.InTotoProvenance provenance = 4; | public function getProvenance()
{
return $this->readOneof(4);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\InTotoProvenance::class);\n $this->writeOneof(4, $var);\n\n return $this;\n }",
"public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }",
"public function show(Provena... | [
"0.86480546",
"0.6265936",
"0.5119285",
"0.4937678",
"0.47725877",
"0.47548842",
"0.45455673",
"0.4478809",
"0.43322435",
"0.43037298",
"0.42801547",
"0.42291778",
"0.42053944",
"0.4181276",
"0.41480342",
"0.41445112",
"0.4117383",
"0.4081836",
"0.40627143",
"0.40520898",
"0.... | 0.68928325 | 1 |
Generated from protobuf field .grafeas.v1.InTotoProvenance provenance = 4; | public function setProvenance($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\InTotoProvenance::class);
$this->writeOneof(4, $var);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProvenance()\n {\n return $this->readOneof(4);\n }",
"public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }",
"public function show(Provenance $provenance)\n {\n //\n }",
"public function update(Request $request, Provenance $proven... | [
"0.6892416",
"0.62663794",
"0.5119239",
"0.4937939",
"0.4773753",
"0.47563207",
"0.45458546",
"0.44798374",
"0.43313125",
"0.43037367",
"0.42821127",
"0.4229252",
"0.42054564",
"0.41815272",
"0.41488364",
"0.4144229",
"0.41187602",
"0.40831792",
"0.40640992",
"0.40542245",
"0... | 0.8648496 | 0 |
Generated from protobuf field .grafeas.v1.SlsaProvenance slsa_provenance = 5; | public function getSlsaProvenance()
{
return $this->readOneof(5);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n $this->writeOneof(5, $var);\n\n return $this;\n }",
"public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenan... | [
"0.82513446",
"0.59556067",
"0.57351255",
"0.56474423",
"0.533182",
"0.49478623",
"0.44876257",
"0.42357317",
"0.39970246",
"0.39701355",
"0.39572632",
"0.39508253",
"0.39434958",
"0.39434958",
"0.39381585",
"0.3903843",
"0.38975328",
"0.38828385",
"0.3871688",
"0.38629025",
... | 0.8110073 | 1 |
Generated from protobuf field .grafeas.v1.SlsaProvenance slsa_provenance = 5; | public function setSlsaProvenance($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\SlsaProvenance::class);
$this->writeOneof(5, $var);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }",
"public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenanceZeroTwo::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }",
"public funct... | [
"0.8110073",
"0.59556067",
"0.57351255",
"0.56474423",
"0.533182",
"0.49478623",
"0.44876257",
"0.42357317",
"0.39970246",
"0.39701355",
"0.39572632",
"0.39508253",
"0.39434958",
"0.39434958",
"0.39381585",
"0.3903843",
"0.38975328",
"0.38828385",
"0.3871688",
"0.38629025",
"... | 0.82513446 | 0 |
Generated from protobuf field .grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6; | public function getSlsaProvenanceZeroTwo()
{
return $this->readOneof(6);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSlsaProvenanceZeroTwo($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenanceZeroTwo::class);\n $this->writeOneof(6, $var);\n\n return $this;\n }",
"public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }",
"public funct... | [
"0.885856",
"0.598365",
"0.5416365",
"0.43689844",
"0.4243492",
"0.4190934",
"0.41383106",
"0.41075718",
"0.41056344",
"0.40692857",
"0.40600303",
"0.40562642",
"0.4025134",
"0.40137738",
"0.39824584",
"0.39663893",
"0.3960904",
"0.3954369",
"0.39019033",
"0.3899117",
"0.3898... | 0.8590598 | 1 |
Generated from protobuf field .grafeas.v1.SlsaProvenanceZeroTwo slsa_provenance_zero_two = 6; | public function setSlsaProvenanceZeroTwo($var)
{
GPBUtil::checkMessage($var, \Grafeas\V1\SlsaProvenanceZeroTwo::class);
$this->writeOneof(6, $var);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSlsaProvenanceZeroTwo()\n {\n return $this->readOneof(6);\n }",
"public function getSlsaProvenance()\n {\n return $this->readOneof(5);\n }",
"public function setSlsaProvenance($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\SlsaProvenance::class);\n... | [
"0.8590371",
"0.59883463",
"0.5419901",
"0.43704906",
"0.42466873",
"0.41912127",
"0.41371742",
"0.41075215",
"0.4107362",
"0.4069287",
"0.4058884",
"0.40563935",
"0.40237805",
"0.40135035",
"0.39819425",
"0.39711174",
"0.3960179",
"0.3952438",
"0.39012656",
"0.39007732",
"0.... | 0.8856708 | 0 |
Function: reads all publications from the current pubtype list and creates an array with previous and next links for browsing through the publications. The first and the last link go the the list of the pubtype. Usage: Customize the settings below. There's a customization area below. Don't edit anything outside of this area. Put at the top of the pubtypefull.html template. This function returns an array with 2 values: Place , where you want the link to the previous pub be located Place , where you want the link to the previous pub be located Author: Thomas Smiatek | function smarty_function_pagesetter_pubBrowser($args, &$smarty)
{
//*****************************************
// Customization area
//*****************************************
// Define the text attributes for the links (size, color...)
$style = "color: black; text-decoration: none;";
// Define a symbol. It is displayed left of the previous link. You can leave it blank, if you don't need it.
$prevSymbol = "<< ";
// Define a symbol. It is displayed right of the next link. You can leave it blank, if you don't need it.
$nextSymbol = " >>";
// The previous link of the first publication links to the list of the current pub type. Define the text here.
$back2overview_left = "back to overview";
// The next link of the last publication links to the list of the current pub type. Define the text here.
$back2overview_right = "back to overview";
//*****************************************
// End of customization area
//*****************************************
$core = $smarty->get_template_vars('core');
$id = $core['id'];
if (!isset($language))
$language = pnUserGetLang();
// Get stuff that exists in core
$page = isset($args['page']) ? intval($args['page']) : intval($core['page']);
$baseURL = isset($args['baseURL']) ? $args['baseURL'] : $core['baseURL'];
//Build filter array and filter string
//this will get filter, filter1,...,filtern from the url
//note: the filter string will use filters starting from filter1
$filterStrSet = pagesetterGetFilters(array(), $dummyArgs);
if(count($filterStrSet) != 0)
{
$temp = array();
foreach( $filterStrSet as $key => $item )
{
$i = $key + 1;
$temp[] = "filter$i=" . $item;
}
$filterStr = "&" . implode("&", $temp);
} else $filterStr = "";
$baseURL .= $filterStr;
$pubList = pnModAPIFunc( 'pagesetter', 'user', 'getPubList',
array( 'tid' => $core['tid'],
'language' => $language,
'filterSet' => $filterStrSet,
'noOfItems' => -1 ) );//EM: added 'noOfItems' => -1
$pinfo = pnModAPIFunc( 'pagesetter', 'admin', 'getPubTypeInfo', array( 'tid' => $core['tid'], 'noOfItems' => 999 ) );
$perpage = $pinfo['publication']['listCount'];
$perpage = isset($args['pageSize']) ? $args['pageSize'] : $perpage;
$html = '';
$counter = 0;
$navhtml['prev'] = '<a href="index.php?module=pagesetter&tid='.$core['tid'].'" style="'.$style.'">'.$prevSymbol.$back2overview_left.'</a>';
$navhtml['next'] = '<a href="index.php?module=pagesetter&tid='.$core['tid'].'" style="'.$style.'">'.$nextSymbol.$back2overview_right.'</a>';
$foundprev = false;
$foundnext = false;
foreach ($pubList['publications'] as $pub)
{
$counter++;
if (($pub['id'] != $id) && ($foundprev == false))
{
$link = htmlspecialchars( pnModURL('pagesetter','user','viewpub',array('tid' => $core['tid'], 'pid' => $pub['pid'] )));
$navhtml['prev'] = '<a href="'.$link.'" style="'.$style.'">'.$prevSymbol.$pub['title'].'</a>';
}
if ($pub['id'] == $id)
{
$foundprev = true;
$page = ceil($counter / $perpage);
$link = htmlspecialchars( pnModURL('pagesetter','user','view',array('tid' => $core['tid'], 'page' => $page )));
$navhtml['list'] = '[ <a href="'.$link.'" style="'.$style.'">Liste</a> ]';
}
if (($pub['id'] != $id) && ($foundprev == true) && ($foundnext == false))
{
$foundnext = true;
$link = htmlspecialchars( pnModURL( 'pagesetter', 'user', 'viewpub', array( 'tid' => $core['tid'], 'pid' => $pub['pid'] )));
$navhtml['next'] = '<a href="'.$link.'" style="'.$style.'">'.$pub['title'].$nextSymbol.'</a>';
}
}
$smarty->assign('nav', $navhtml );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPagePublishableList($page = 1, $format = 0, $msv=1){\n\t\t\n\t\tglobal $db;\n\t\t//print \"gppL($page, $format, $msv)<br />\";\n\t\t$this->from = $this->getPerPage()*($this->getPage()-1);\n\t\t$this->to = $this->getPerPage()*$this->getPage();\n\t\t\n\t\tswitch($format){\n\t\t\tcase 'panel':\n\t\... | [
"0.5744485",
"0.57262945",
"0.57041144",
"0.5616822",
"0.5608698",
"0.5559315",
"0.55447",
"0.5514282",
"0.5469317",
"0.5389588",
"0.5385524",
"0.5381958",
"0.5378772",
"0.53763646",
"0.5365509",
"0.5351702",
"0.5324719",
"0.52980936",
"0.5293411",
"0.5272681",
"0.526629",
... | 0.6487439 | 0 |
Must be a valid ISO 6391 language code | public function setLanguageCode($value)
{
if (strlen($value) > 2) {
throw new InvalidLanguageCodeException('Language code must be a valid ISO 639-1 language code');
}
return $this->setParameter('languageCode', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function countryISOCode();",
"public static function is_valid_iso_country_code( $country ) {\n\t\t/**\n\t\t * List of valid iso 3166 country codes, regenerated on 1380836686\n\t\t * Code generated by a happy script at\n\t\t * https://gerrit.wikimedia.org/r/#/admin/projects/wikimedia/fundraising/t... | [
"0.6588518",
"0.62966305",
"0.6198046",
"0.61483276",
"0.6123244",
"0.60096383",
"0.5933175",
"0.5853997",
"0.5797373",
"0.5795364",
"0.5751484",
"0.57478625",
"0.5736763",
"0.5719511",
"0.56972486",
"0.56789905",
"0.5660372",
"0.56499344",
"0.56416243",
"0.56113124",
"0.5521... | 0.5202184 | 64 |
Set if the payment method should be enforced. This field can be used to send or, after a failed payment, the consumer can or can not select another payment method to still pay the payment. Valid values are: static::PAYMENT_METHOD_ENFORCE_ONCE static::PAYMENT_METHOD_ENFORCE_ALWAYS In the case of FORCE_ONCE, the indicated paymentMethod is only enforced on the first transaction. If this fails, the consumer can still choose another payment method. When FORCE_ALWAYS is chosen, the consumer can not choose another payment method | public function setEnforcePaymentMethod($value)
{
return $this->setParameter('enforcePaymentMethod', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDefaultActivePaymentMethod()\n {\n $criteria = new CDbCriteria;\n $criteria->select = 't.name, t.value';\n $criteria->condition = \"t.name LIKE 'payment_method_%' AND t.value = 1\";\n\n $data = Option::model()->findAll($criteria);\n\n $payment_method_options... | [
"0.5388515",
"0.534212",
"0.52513963",
"0.5211061",
"0.51993185",
"0.5190853",
"0.50417364",
"0.5037711",
"0.50114244",
"0.48525178",
"0.4734758",
"0.47331938",
"0.47291714",
"0.470839",
"0.47006637",
"0.46893728",
"0.46621343",
"0.46448672",
"0.46322578",
"0.46276504",
"0.46... | 0.6538562 | 0 |
The the input, rules and custom messages. The class, custom and config messages will be merged at this point. | public function __construct($input, $rules, $messages = array())
{
$this->input = $input;
$this->rules = $rules;
$this->messages = array_merge($this->messages, (array) Config::get('validator'), $messages);
$this->process();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function setupRules()\n {\n // Validator::extend('rule', 'App\\Support\\Rules\\Rule@validate');\n // Validator::replacer('rule', 'App\\Support\\Rules\\Rule@message');\n }",
"public function __construct()\n {\n $lines = require __DIR__ .DS .'messages.php';\n\n $this->m... | [
"0.5571182",
"0.5570542",
"0.53720295",
"0.5334528",
"0.53065085",
"0.5226777",
"0.52040917",
"0.51960176",
"0.51867706",
"0.5170089",
"0.51700413",
"0.5146467",
"0.5121792",
"0.50972146",
"0.5080358",
"0.5079079",
"0.5071267",
"0.50671375",
"0.5060158",
"0.50416815",
"0.5016... | 0.58393407 | 0 |
Get all errors for a specfic key. Add formatting to $wrap to have output 'wrapped' (the original message will be replaced at :message): // Example using required: $validator>get('username', 'Failed: :message'); // Yields: Failed: The username field is required | public function get($key, $wrap = ':message')
{
$result = array();
foreach (($this->has($key) ? $this->errors[$key] : array()) as $error)
{
$result[] = str_replace(':message', $error, $wrap);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($key = null)\n {\n return $key ? $this->errors[$key] : $this->errors;\n }",
"public function all($wrap = ':message')\n {\n $result = array();\n\n foreach ($this->errors as $key => $error)\n {\n $result[$key] = $this->get($key, $wrap);\n }\n\n re... | [
"0.6994177",
"0.65171075",
"0.62357885",
"0.61995965",
"0.6124119",
"0.59410465",
"0.5878711",
"0.5747908",
"0.5709658",
"0.5597807",
"0.55976063",
"0.55904186",
"0.55904186",
"0.55904186",
"0.55904186",
"0.55863374",
"0.55746555",
"0.5570421",
"0.5558939",
"0.55123585",
"0.5... | 0.79381937 | 0 |
Retrieve the first error for a given field | public function first($key, $wrap = ':message')
{
$res = $this->get($key, $wrap);
return array_shift($res);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getError($field){\n\t\treturn $this->errors[$field][0] ?? false;\n\t}",
"public function getFirstError()\n {\n return $this->errors->first();\n }",
"function get_error(string $field = null): mixed\n{\n $error = error_get_last();\n if (!$error) {\n return null;\n }\n... | [
"0.7499003",
"0.73798645",
"0.71615195",
"0.7108814",
"0.7053441",
"0.7045633",
"0.6994044",
"0.6918541",
"0.68604696",
"0.68122464",
"0.67604756",
"0.6670647",
"0.66581756",
"0.64645725",
"0.6426285",
"0.6377161",
"0.6377161",
"0.6377161",
"0.6331838",
"0.6295157",
"0.629038... | 0.0 | -1 |
Test if a specific input has failed | public function has($key)
{
return array_key_exists($key, $this->errors);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isFailure(): bool;",
"public function hasFailed();",
"public function fails();",
"public function fails();",
"function check_fail($result) {\n\tif ($result['value']['failure reason']['value']) return 'failed:'.$result['value']['failure reason']['value']; else return 'ok';\n}",
"public fun... | [
"0.68878675",
"0.67913973",
"0.66113394",
"0.66113394",
"0.6428649",
"0.64125794",
"0.6395299",
"0.63768023",
"0.634799",
"0.62923294",
"0.62866026",
"0.6254208",
"0.6252574",
"0.622374",
"0.6191365",
"0.6158087",
"0.6142088",
"0.61158746",
"0.6108378",
"0.60866684",
"0.60679... | 0.0 | -1 |
Retrieve all errors in a multi dimensional array | public function all($wrap = ':message')
{
$result = array();
foreach ($this->errors as $key => $error)
{
$result[$key] = $this->get($key, $wrap);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrors(): array;",
"public function getErrors(): array;",
"public function getErrors(): array;",
"function getErrors()\n {\n ksort($this->errors);\n $e = array();\n foreach ($this->errors as $v) foreach ($v as $e[]) {}\n return $e;\n }",
"public function... | [
"0.7795337",
"0.7795337",
"0.7795337",
"0.7729161",
"0.77105826",
"0.76871675",
"0.7679528",
"0.76375246",
"0.76167136",
"0.75923926",
"0.7546386",
"0.7545653",
"0.7525197",
"0.7512594",
"0.74988586",
"0.7491399",
"0.7491399",
"0.7491399",
"0.7491399",
"0.7459508",
"0.7439914... | 0.0 | -1 |
Pushes error 'messsages' on an array and sets the validation to failed | public function set_error($key, $type = '')
{
$text = array_key_exists($type, $this->messages) ? $this->messages[$type] : $this->messages['default'];
$value = (array_key_exists($key, $this->input) && is_array($this->input[$key]) === false) ? $this->input[$key] : null;
$this->errors[$key][] = str_replace(array(':attribute', ':value'), array($key, $value), $text);
$this->passed = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function setValidationMessages(): array;",
"function setErrors( array $errors );",
"public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->... | [
"0.7508075",
"0.70162606",
"0.6754115",
"0.6750018",
"0.6737835",
"0.66636956",
"0.66341215",
"0.6625055",
"0.66148883",
"0.66074127",
"0.6529447",
"0.649445",
"0.649445",
"0.6483229",
"0.6434119",
"0.64102674",
"0.6393927",
"0.6391266",
"0.6370894",
"0.63296163",
"0.6321584"... | 0.0 | -1 |
Is a value required $rule = array('id' => 'required'); | private function process_required($value)
{
return (bool) ($value != "" || $value === 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function required_validate() {\n if ($this->required) {\n if (array_key_exists('NOT_NULL', $this->condition)) \n {\n if ($this->value == '' || $this->value == NULL) {\n $this->errors->add_msj(NOT_NULL_PRE.$this->name.NOT_NULL_POS);\n }\n... | [
"0.694215",
"0.6938513",
"0.6925304",
"0.6925304",
"0.6925304",
"0.6925304",
"0.6925304",
"0.6925304",
"0.6925304",
"0.6925304",
"0.6887296",
"0.6842236",
"0.6825641",
"0.6783131",
"0.67827207",
"0.67827207",
"0.67819804",
"0.6707631",
"0.6673617",
"0.6623637",
"0.6557254",
... | 0.0 | -1 |
Does a value only contain alpha characters $rule = array('username' => 'alpha'); | private function process_alpha($value)
{
return ! preg_match('/[^a-zA-Z]/', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function _alphaNumeric(){\n if (self::$_ruleValue) {\n $str = trim(self::$_elementValue);\n if (!preg_match('/[a-zA-z0-9]/', $str)) {\n self:: setErrorMessage(\"Alphanumeric only\");\n self::setInvalidFlag(true);\n } else {\n ... | [
"0.7324813",
"0.7270546",
"0.7242736",
"0.7138957",
"0.71169955",
"0.71104705",
"0.7048434",
"0.7036366",
"0.7016614",
"0.70040756",
"0.69261885",
"0.69258815",
"0.68988514",
"0.687547",
"0.68582714",
"0.6853305",
"0.6846276",
"0.68265617",
"0.68182534",
"0.6793785",
"0.67635... | 0.7242046 | 3 |
Does a value only contain alphanumeric characters $rule = array('username' => 'alphanum'); | private function process_alphanum($value)
{
return ! preg_match('/[^a-zA-Z0-9]/', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function _alphaNumeric(){\n if (self::$_ruleValue) {\n $str = trim(self::$_elementValue);\n if (!preg_match('/[a-zA-z0-9]/', $str)) {\n self:: setErrorMessage(\"Alphanumeric only\");\n self::setInvalidFlag(true);\n } else {\n ... | [
"0.778703",
"0.7752259",
"0.75212014",
"0.7478658",
"0.7339149",
"0.7214964",
"0.72101265",
"0.7170849",
"0.7103691",
"0.7079534",
"0.70342964",
"0.6953465",
"0.69491094",
"0.694116",
"0.6926986",
"0.6921685",
"0.6888689",
"0.6851171",
"0.6850676",
"0.68089825",
"0.6782689",
... | 0.7481875 | 3 |
Does a value only contain alphanumeric characters and hyphen $rule = array('username' => 'alphanumhyphen'); | private function process_alphanumhyphen($value)
{
return ! preg_match('/[^a-zA-Z0-9-]/', $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function _alphaNumeric(){\n if (self::$_ruleValue) {\n $str = trim(self::$_elementValue);\n if (!preg_match('/[a-zA-z0-9]/', $str)) {\n self:: setErrorMessage(\"Alphanumeric only\");\n self::setInvalidFlag(true);\n } else {\n ... | [
"0.72674924",
"0.72103804",
"0.71864104",
"0.7124771",
"0.71141285",
"0.7093402",
"0.700634",
"0.70035607",
"0.6901776",
"0.68929225",
"0.68920124",
"0.6830163",
"0.6808117",
"0.6805563",
"0.67930293",
"0.67650265",
"0.6763107",
"0.67511755",
"0.67378145",
"0.6731889",
"0.669... | 0.742126 | 0 |
Is the value an email address | private function process_email($value)
{
return (bool) filter_var($value, FILTER_VALIDATE_EMAIL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function email($value){\n\t\treturn (bool) filter_var($value, FILTER_VALIDATE_EMAIL);\n\t}",
"function is_email($value)\r\n{\r\n\treturn preg_match('/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i', $value);\r\n}",
"public function isEmail()\n {\n return filter_var($this->_value, FILTER_VA... | [
"0.8154386",
"0.8147126",
"0.8081923",
"0.8018347",
"0.7628148",
"0.76110125",
"0.75531894",
"0.7535065",
"0.7534404",
"0.7514613",
"0.75130725",
"0.75098705",
"0.74960357",
"0.7493124",
"0.7490628",
"0.74239177",
"0.74171436",
"0.73793346",
"0.7371007",
"0.72932374",
"0.7278... | 0.7956182 | 4 |
Is the value equal to this value $rule = array('status' => 'equal:active'); | private function process_equal($value, $param = null)
{
return $value == $param;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function compare_to_rule($value, $rule)\n {\n }",
"public function getRuleStatus(): int;",
"public function _validation_valid_status($value)\n {\n\t\t return (Model_Note::status_name($value) !== 'all');\n\t}",
"function _checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id = 0)\n\t{\n\t... | [
"0.639221",
"0.5748456",
"0.56668705",
"0.55941314",
"0.5585481",
"0.55353236",
"0.5393889",
"0.53756124",
"0.5248941",
"0.52456605",
"0.5237998",
"0.5227645",
"0.5224801",
"0.52247274",
"0.520998",
"0.52081496",
"0.52030295",
"0.5184979",
"0.5184319",
"0.51591855",
"0.514970... | 0.50451165 | 35 |
Is a value numeric $rule = array('id' => 'numeric'); | private function process_numeric($value)
{
return is_numeric($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function numeric()\n {\n return $this->rule('numeric');\n }",
"function isNumeric ($value)\r\n{\r\n\treturn is_numeric ($value);\r\n}",
"public function isNumeric();",
"public function numbers_only($value)\n{\n //return preg_match('/^([0-9]+)$/', $value);\n return ctype_digit(strval... | [
"0.70908767",
"0.6886959",
"0.6846163",
"0.66850644",
"0.65457267",
"0.651632",
"0.641868",
"0.6393296",
"0.6344368",
"0.6343053",
"0.6298713",
"0.62577236",
"0.61711514",
"0.61651003",
"0.61441845",
"0.61441725",
"0.61195517",
"0.61063856",
"0.60951245",
"0.60835004",
"0.607... | 0.6374444 | 8 |
Perform a custom regex $rule = array('name' => 'regex:/^[azAZ09]+$/'); | private function process_regex($value, $param = null)
{
return (bool) preg_match($param, $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAsciiRegexp();",
"abstract function regex(): array;",
"function validaAlfa ($Cad) {\n// prueba si la entrada es una cadena alfabetica\nreturn preg_match(\"/^[a-z]+$/i\", $Cad );\n}",
"function number_car($number){\n$regexp = '/[a-ż][0-9][0-9][0-9][a-ż][a-ż]/ui';\n//$regexp = '/^[a-ż][0-9][... | [
"0.58246225",
"0.57652444",
"0.56753314",
"0.56651247",
"0.56121135",
"0.5604579",
"0.5590865",
"0.5586451",
"0.5543351",
"0.55174685",
"0.5516263",
"0.5458447",
"0.5429188",
"0.5405037",
"0.5398129",
"0.5386402",
"0.5373972",
"0.53721625",
"0.5333173",
"0.533231",
"0.5329273... | 0.0 | -1 |
Check an item exists in the database $rule = array('user' => 'exists:system.user,user_id'); | private function process_exists($value, $param = null)
{
$fields = explode(',', $param, 3);
if (count($fields) < 2 || count($fields) > 3) throw new \Exception("Exists validator: incorrect param count");
if (count($fields) == 2) {
// Use the default db connection
$conn = Config::get('database.default');
array_unshift($fields, $conn);
}
list($connection, $table, $field) = $fields;
$result = Database::connection($connection)->table($table)->where($field, '=', $value)->count();
return $result == 0 ? false : true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userIdExists($id) {\n return valueExists('users', 'id', $id);\n}",
"public function check_user()\n {\n $res = $this->CustomModel->checkUser(\n $this->input->get('index_no')\n );\n\n if (!$res) {\n echo 'not exists';\n }\n }",
"function user_id... | [
"0.6916238",
"0.6884664",
"0.6842032",
"0.68274045",
"0.68255633",
"0.6759476",
"0.6742178",
"0.66905624",
"0.6689641",
"0.6687458",
"0.65824974",
"0.6580327",
"0.6580068",
"0.65548545",
"0.65318304",
"0.64813316",
"0.6477807",
"0.64403087",
"0.6374432",
"0.6358888",
"0.63535... | 0.6263238 | 41 |
Check an item is at least a min value (inclusive) $rule = array('count' => 'min:5'); | private function process_min($value, $min) {
if (is_numeric($value) === false) {
if (is_array($value)) {
$value = count($value);
} else {
$value = strlen($value);
}
}
if ($value < $min) {
return false;
} else {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testMinval(){\n\t\t#mdx:minval\n\t\tParam::get('age')->filters()->minval(1, \"Age cannot be less than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>0])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"less than 1\", $error);\n\n\t}",
"function _isEligibleMinimumQuantity()\r\... | [
"0.6446891",
"0.6404508",
"0.628916",
"0.62634504",
"0.6232884",
"0.62027",
"0.60202944",
"0.596277",
"0.5918526",
"0.5896423",
"0.58553004",
"0.58222526",
"0.58176684",
"0.57883006",
"0.574959",
"0.5737875",
"0.5710655",
"0.56807595",
"0.5676212",
"0.5648411",
"0.5648411",
... | 0.62041444 | 5 |
Check an item is below a max value (inclusive) $rule = array('percentage' => 'max:75'); | private function process_max($value, $max) {
if (is_numeric($value) === false) {
if (is_array($value)) {
$value = count($value);
} else {
$value = strlen($value);
}
}
if ($value > $max) {
return false;
} else {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testMaxval(){\n\t\t#mdx:maxval\n\t\tParam::get('age')->filters()->maxval(150, \"Age cannot be more than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>200])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertContains(\"more than 150\", $error);\n\t}",
"function validMax($value, $max)\n ... | [
"0.6723508",
"0.65884024",
"0.64513785",
"0.63195926",
"0.62897706",
"0.62284476",
"0.6186063",
"0.6122191",
"0.61023325",
"0.6010894",
"0.59845054",
"0.5923715",
"0.58813643",
"0.58260864",
"0.5824182",
"0.58015156",
"0.5799648",
"0.5798126",
"0.5793214",
"0.57871974",
"0.57... | 0.5996792 | 10 |
Check a value falls between a min and max (inclusive) $rule = array('share' => 'between:3,4'); | private function process_between($value, $param = null) {
$fields = explode(',', $param, 2);
if (count($fields) != 2) throw new \Exception("Between validator: incorrect param count");
if ($value <= $fields[0] || $value >= $fields[1]) {
return false;
} else {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected final function _isBetweenMinAndMax($key,$value){\n\n if(($min = $this->getDefinitionValue($key,'min')) !== false && $value < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min}\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'max')) !== fa... | [
"0.69648093",
"0.6629494",
"0.65753967",
"0.65747535",
"0.6531362",
"0.64619774",
"0.64527816",
"0.64360696",
"0.6427893",
"0.64055544",
"0.6403246",
"0.6282278",
"0.62671804",
"0.62637335",
"0.62478834",
"0.6244163",
"0.6224384",
"0.6188426",
"0.6148695",
"0.61094886",
"0.61... | 0.62095875 | 17 |
Check a value is a given length (string or array) $rule = array('contacts' => 'length:5'); $rule = array('password' => 'length:8'); | private function process_length($value, $count) {
if (is_array($value)) {
if (count($value) != $count) {
return false;
} else {
return true;
}
} else {
if (strlen($value) != $count) {
return false;
} else {
return true;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function has_length($value, $options=array()) {\n //for first/last name [1,256]\n //for username [7, 256]\n if(strlen($value) > $options[0] && strlen($value) < $options[1]) {\n return 1;\n }\n return 0;\n }",
"abstract protected function validateFieldLength($fieldLength);",
"functi... | [
"0.72680736",
"0.70910126",
"0.70633745",
"0.70633745",
"0.7052609",
"0.70118636",
"0.6755176",
"0.6731889",
"0.6664935",
"0.6583602",
"0.658284",
"0.65375143",
"0.6519948",
"0.6466418",
"0.64512706",
"0.64276505",
"0.64038515",
"0.637473",
"0.6365086",
"0.6360486",
"0.630261... | 0.6708955 | 8 |
Wrapper for is_array $rule = array('ids' => array('1','2','3'); | private function process_array($value) {
return is_array($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function makeIsArrayValidator() : Closure\n {\n return function ($value) {\n if (!is_array($value)) {\n return [\n 'message' => \"{$value} is not an array\",\n 'result' => false\n ];\n } else {\n ... | [
"0.60809493",
"0.5999555",
"0.5885403",
"0.5848715",
"0.58381534",
"0.5760799",
"0.574287",
"0.5729256",
"0.57115895",
"0.5694543",
"0.563859",
"0.56356615",
"0.5593658",
"0.554811",
"0.5513434",
"0.5513434",
"0.5480104",
"0.5462608",
"0.54562473",
"0.54333705",
"0.54333705",... | 0.61283475 | 0 |
Is a value 'in' a given set of values $rule = array('id' => 'in:1,2,3'); | private function process_in($value, $param = null)
{
return in_array($value, explode(',', $param));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function in(array $values);",
"function has_inclusion_in($value,$set) {\n\t\treturn in_array($value,$set);\n\t\t}",
"function has_inclusion_in($value, $set) {\n\treturn in_array($value, $set);\n}",
"function has_inclusion_in($value, $set) {\n\treturn in_array($value, $set);\n}",
"public function in(... | [
"0.73466647",
"0.6641783",
"0.66189027",
"0.66189027",
"0.66184",
"0.658305",
"0.6574956",
"0.65687126",
"0.6516381",
"0.6437039",
"0.63461596",
"0.63260674",
"0.62862796",
"0.6252471",
"0.62310106",
"0.6228441",
"0.61634755",
"0.61172915",
"0.61148363",
"0.61049634",
"0.6091... | 0.6676657 | 1 |
Applies the validation rules to the input | private function process()
{
foreach ($this->rules as $key => $rule)
{
$exp = explode('|', $rule);
foreach ($exp as $method)
{
if (strstr($method, ':')) list($method, $param) = explode(':', $method, 2);
else $param = '';
$input = array_get($this->input, $key);
if (method_exists($this, "process_$method") === false)
{
if (!$input) continue;
if (array_key_exists($method, self::$custom))
{
if (call_user_func(self::$custom[$method], $input, $param, $this) !== true) $this->set_error($key, $method);
} else {
throw new ValidatorNotFound("No validator exists for [$method]");
}
} else {
if (($input || $method == 'required') && $this->{"process_$method"}($input, $param, $this) !== true) $this->set_error($key, $method);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validationRules( array $input );",
"public function validateRules();",
"public function validate()\n {\n foreach ( $this->rules as $key => $rules ) {\n foreach ( $rules as $type => $rule ) {\n if ( $this->hasErrors( $key ) )\n break;\n ... | [
"0.7706481",
"0.72476286",
"0.7237973",
"0.7163012",
"0.7106854",
"0.6920536",
"0.6909164",
"0.6891451",
"0.6888181",
"0.6888181",
"0.68574345",
"0.68266886",
"0.68240654",
"0.6797962",
"0.6752814",
"0.67444444",
"0.6727798",
"0.6719885",
"0.6719885",
"0.6719885",
"0.6719885"... | 0.67189133 | 29 |
Check if the validation failed | public function fails()
{
return ! $this->passed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validationHasFailed() {}",
"public function validationHasFailed(): bool;",
"function fails() {\n return !($this->startValidation());\n }",
"public function isValidationPassed();",
"public function validation()\n {\n if ($this->validationHasFailed() == true) {\n ... | [
"0.79892707",
"0.78666437",
"0.77950275",
"0.7765902",
"0.7737201",
"0.75929946",
"0.7545516",
"0.7439423",
"0.73736537",
"0.7355646",
"0.7324844",
"0.7313295",
"0.7306703",
"0.72985226",
"0.72955614",
"0.7251149",
"0.72435194",
"0.72435194",
"0.7228219",
"0.72086215",
"0.719... | 0.0 | -1 |
Check if the validation passed | public function passed()
{
return $this->passed;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isValidationPassed();",
"function passes() {\n return $this->startValidation();\n }",
"public function isValid() {}",
"public function isValid() {}",
"public function isValid() {}",
"public function isValid() {}",
"public function isValid() {}",
"public function isValid() {}... | [
"0.8801789",
"0.8215865",
"0.79134995",
"0.79134995",
"0.7913269",
"0.79122186",
"0.79122186",
"0.79122186",
"0.79122186",
"0.79122186",
"0.78895706",
"0.7806171",
"0.7806171",
"0.7806171",
"0.7806171",
"0.7806171",
"0.7806171",
"0.7806171",
"0.7806171",
"0.7794349",
"0.77876... | 0.0 | -1 |
Call the Controller constructor | public function __construct()
{
parent::__construct();
$this->load->database('ahape');
$this->load->helper('url', 'form');
$this->load->model('m_user');
$this->load->library('session');
$this->load->library('form_validation');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"protected function initializeController() {}",
"public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want... | [
"0.8059224",
"0.7987545",
"0.7944926",
"0.79420316",
"0.780782",
"0.77860343",
"0.7761986",
"0.7759328",
"0.77224964",
"0.7643974",
"0.7628149",
"0.75654286",
"0.75644344",
"0.75644344",
"0.75644344",
"0.75433105",
"0.75265795",
"0.7517518",
"0.7516316",
"0.75029874",
"0.7492... | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$users = ticketUser::all();
return view('ticketUser.index')->with('users',$users);
} | {
"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()
{
return view('ticketUser.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.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)
{
$this->validate($request,[
'tId'=>'required',
'fName'=>'required',
'lName'=>'required',
'address'=>'required',
'phoneNumber'=>'required',
'email'=>'required',
'noOfTickets'=>'required',
'cash'=>'required'
]);
$user = new ticketUser;
$user->tId = $request->input('tId');
$user->fName = $request->input('fName');
if($request->input('mName')==null){
$user->mName='';
}
else{
$user->mName = $request->input('mName');
}
$user->lName = $request->input('lName');
$user->address = $request->input('address');
$user->phoneNumber = $request->input('phoneNumber');
$user->email = $request->input('email');
$user->noOfTickets = $request->input('noOfTickets');
$user->save();
$ticketRate = 200;
$returnMoney = $request->cash - ($request->noOfTickets * $ticketRate);
$message = 'Successfuly Updated Database Return Rs. '.$returnMoney;
return redirect('ticketUser/create')->with('success',$message);
} | {
"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)
{
$user = ticketUser::find($id);
return view('ticketUser.show')->with('user',$user);
} | {
"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.8232636",
"0.81890994",
"0.68296117",
"0.64987075",
"0.649589",
"0.64692974",
"0.64633286",
"0.63640857",
"0.6307513",
"0.6281809",
"0.621944",
"0.61926234",
"0.61803305",
"0.6173143",
"0.61398774",
"0.6119022",
"0.61085826",
"0.6106046",
"0.60947937",
"0.6078597",
"0.6047... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
$user = ticketUser::find($id);
return view('ticketUser.edit')->with('user',$user);
} | {
"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.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$this->validate($request,[
'tId'=>'required',
'fName'=>'required',
'lName'=>'required',
'address'=>'required',
'phoneNumber'=>'required',
'email'=>'required',
'noOfTickets'=>'required',
'cash'=>'required'
]);
$user = ticketUser::find($id);
$user->tId = $request->input('tId');
$user->fName = $request->input('fName');
if($request->input('mName')==null){
$user->mName='';
}
else{
$user->mName = $request->input('mName');
}
$user->lName = $request->input('lName');
$user->address = $request->input('address');
$user->phoneNumber = $request->input('phoneNumber');
$user->email = $request->input('email');
$user->noOfTickets = $request->input('noOfTickets');
$user->save();
$ticketRate = 200;
$returnMoney = $request->cash - ($request->noOfTickets * $ticketRate);
$message = 'Successfuly Updated Database Return Rs. '.$returnMoney;
return redirect('ticketUser/create')->with('success',$message);
} | {
"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)
{
ticketUser::where('id',$id)->delete();
return redirect('/ticketUser')->with('success','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 |
Handle an incoming request. | public function handle($request, Closure $next)
{
if (!session()->has('usuario'))
{
session()->flash('message', 'Você precisa se autenticar para acessar essa página');
session()->flash('message-type', 'alert-warning');
return redirect()->route('home');
}
return $next($request);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function handle_request();",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest();",
"protected abstract function handleRequest();",
"abstract public function handleRequest($request);",
"abstract public function handleRequest(Request $... | [
"0.83001333",
"0.81485367",
"0.81485367",
"0.81485367",
"0.8128516",
"0.79942316",
"0.7927549",
"0.791423",
"0.79006535",
"0.7633586",
"0.7510298",
"0.74876535",
"0.74091655",
"0.7377972",
"0.7368652",
"0.7294605",
"0.7238382",
"0.72307026",
"0.7212001",
"0.718095",
"0.717224... | 0.0 | -1 |
Creates a preconfigured instance of an entity facade. | public function createInstance($plugin_id, array $configuration = [], $entity = NULL) {
$plugin_definition = $this->discovery->getDefinition($plugin_id);
$plugin_class = static::getPluginClass($plugin_id, $plugin_definition, $this->interface);
// If the plugin provides a factory method, pass the container to it.
if (is_subclass_of($plugin_class, 'Drupal\Core\Plugin\ContainerFactoryPluginInterface')) {
return $plugin_class::create(\Drupal::getContainer(), $configuration, $plugin_id, $plugin_definition, $entity);
}
// Otherwise, create the plugin directly.
return new $plugin_class($configuration, $plugin_id, $plugin_definition, $entity);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createEntity()\n {\n $this->entity = $this->container->make($this->entity());\n }",
"protected function createEntity()\n {\n return new $this->entityClass();\n }",
"abstract protected function createEntityInstance();",
"public static function create()\n {\n ... | [
"0.74809605",
"0.7070079",
"0.693194",
"0.6779854",
"0.66774094",
"0.65059674",
"0.64728147",
"0.6436203",
"0.630223",
"0.614346",
"0.6028581",
"0.5999424",
"0.58560646",
"0.58544266",
"0.5814919",
"0.58112484",
"0.57945156",
"0.56931853",
"0.5671116",
"0.566579",
"0.5659669"... | 0.0 | -1 |
tampilkan data sesuai hak akses, jika admin tampilkan semua, jika tidak tampilkan tertentu saja | public function index()
{
if ( $this->session->userdata('user')->tipe_user == "superadmin" )
{
$data['datas'] = $this->db->get($this->User->table, 100)->result();
}else
{
$data['datas'] = $this->db->where(['tipe_user !=' => 'superadmin'])->get($this->User->table, 100)->result();
}
$this->Helper->view('user/index', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function form_cari_nik_ubah_kata_sandi_kades()\n {\n\n $data['admin'] = $this->db->get_where('admin', ['id_admin' =>\n $this->session->userdata('id_admin')])->row_array();\n $data['jumlah_pesan_masuk'] = $this->m_admin->jumlah_pesan_masuk()->result();\n ... | [
"0.72243154",
"0.7163501",
"0.7140598",
"0.711764",
"0.7114377",
"0.7104306",
"0.7095891",
"0.70919675",
"0.70829564",
"0.70784324",
"0.7067763",
"0.70539343",
"0.7037229",
"0.70281017",
"0.70168734",
"0.69883883",
"0.6987628",
"0.6967386",
"0.69592667",
"0.69592154",
"0.6952... | 0.0 | -1 |
buat id baru untuk user baru dari id terakhir + 1 | public function create()
{
$data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;
$this->Helper->view('user/create', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modeling_publicusershistoriakses_createid( $tbl_publicusers_historiakses ){\n$sql = mysql_query(\"SELECT * FROM $tbl_publicusers_historiakses ORDER BY id DESC\");\n$result = mysql_fetch_object($sql);\n$id = $result->id + 1;\nreturn $id;\n}",
"function new_main_user_id() {\n global $db;\n g... | [
"0.7345678",
"0.72322524",
"0.7056364",
"0.7034461",
"0.695641",
"0.68932",
"0.6660668",
"0.6610276",
"0.6607279",
"0.6591677",
"0.65755963",
"0.65658844",
"0.65293485",
"0.6488447",
"0.64101726",
"0.6399005",
"0.63692755",
"0.6359498",
"0.6343295",
"0.63371617",
"0.63231426"... | 0.0 | -1 |
validasi semua inputan users | public function store()
{
$this->form_validation->set_rules('id', 'ID USER', 'required|trim|greater_than[0]|less_than[99]|integer|is_unique[users.id]');
$this->form_validation->set_rules('username', 'Username', 'required|trim|min_length[5]|max_length[30]|alpha_numeric|is_unique[users.username]');
$this->form_validation->set_rules('nama_lengkap', 'Nama Lengkap', 'required|min_length[5]|max_length[50]');
$this->form_validation->set_rules('password', 'Password', 'required|min_length[5]|max_length[30]');
$this->form_validation->set_rules('password_confirmation', 'Konfirmasi Password', 'required|min_length[5]|max_length[30]|matches[password]');
$this->form_validation->set_rules('tipe_user', 'Tipe User', 'required|in_list[manager,rekanan,admin]');
if ( !$this->form_validation->run() ) return $this->Helper->view('user/create');
$dataInput = $this->input->post();
unset($dataInput['password_confirmation']);
$dataInput['password'] = password_hash($this->input->post('password'), PASSWORD_BCRYPT);
$this->db->insert($this->User->table, $dataInput);
$this->session->set_flashdata('success', 'Berhasil menambah data user');
redirect('user');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validUser();",
"function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->des... | [
"0.7225207",
"0.69317764",
"0.68999225",
"0.6772607",
"0.66141236",
"0.66089237",
"0.6608094",
"0.64560276",
"0.6453151",
"0.64405507",
"0.6437364",
"0.64007616",
"0.6376669",
"0.63549536",
"0.6349365",
"0.6342118",
"0.63136595",
"0.6286658",
"0.62725496",
"0.6271175",
"0.624... | 0.0 | -1 |
decode dulu supaya bisa diconvert jadi array | public function deleteall()
{
$deleteAllInput = json_decode($this->input->post('deleteAllInput'));
// cek jika kosong kirimkan pesan error
if (! count($deleteAllInput) ) { $this->session->set_flashdata('error', "Tidak ada user yang dihapus!"); redirect('user'); }
// delete semua user yang id nya ada didalama array
$this->db->where_in("id", $deleteAllInput)->delete($this->User->table);
$this->session->set_flashdata('success', "Berhasil menghapus massal user.");
redirect('user');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function JDecode($arr){\r\n\t\tif (version_compare(PHP_VERSION,\"5.2\",\"<\"))\r\n\t\t{ \r\n\t\t\trequire_once(\"./JSON.php\"); //if php<5.2 need JSON class\r\n\t\t\t$json = new Services_JSON();//instantiate new json object\r\n\t\t\t$data=$json->decode($arr); //decode the data in json format\r\n\t\t} else {\r\... | [
"0.6557689",
"0.6557689",
"0.6557689",
"0.6557689",
"0.64336145",
"0.64336145",
"0.64336145",
"0.64336145",
"0.64336145",
"0.64336145",
"0.58297974",
"0.5809746",
"0.58042395",
"0.5705404",
"0.5705404",
"0.5705404",
"0.5705404",
"0.5705404",
"0.5693613",
"0.56423664",
"0.5637... | 0.0 | -1 |
Move Array Item (Key/Value) to bottom of Array | static function array_to_bottom($array, $key, $value_instead = false) {
if ($value_instead) {
if (($array_key = array_search($key, $array)) !== false) {
unset($array[$array_key]);
}
array_push($array,$key);
}
else {
$value = $array[$key];
unset($array[$key]);
array_push($array, $value);
}
return $array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function acadp_array_insert_after( $key, $array, $new_array ) {\n\n\tif( array_key_exists( $key, $array ) ) {\n \t$new = array();\n \tforeach( $array as $k => $value ) {\n \t\t$new[ $k ] = $value;\n \t\tif( $k === $key ) {\n\t\t\t\tforeach( $new_array as $new_key => $new_value ) {\n \t\t\t$n... | [
"0.65382046",
"0.639082",
"0.63872117",
"0.6279185",
"0.6028279",
"0.60095924",
"0.59716326",
"0.58767164",
"0.577472",
"0.57245255",
"0.57037497",
"0.56383383",
"0.5622947",
"0.55615455",
"0.5550582",
"0.5518241",
"0.54523754",
"0.5373389",
"0.53269994",
"0.5320326",
"0.5320... | 0.6967265 | 0 |
Move Array Item (Key/Value) to top of Array | static function array_to_top($array, $key, $value_instead = false) {
if ($value_instead) {
if (($array_key = array_search($key, $array)) !== false) {
unset($array[$array_key]);
}
array_unshift($array , $key);
}
else {
$value = array($key => $array[$key]);
unset($array[$key]);
$array = $value + $array;
}
return $array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unshift(array & $array, $key, $val) {\n $array = array_reverse($array, TRUE);\n $array[$key] = $val;\n $array = array_reverse($array, TRUE);\n\n return $array;\n}",
"function arrayShift($array) {\n\n unset($array[0]);\n return $array;\n}",
"public function array_put_to_position() {\n... | [
"0.64682126",
"0.6390099",
"0.63620937",
"0.6329725",
"0.62322664",
"0.61628544",
"0.61140645",
"0.60008836",
"0.5947864",
"0.58728665",
"0.58698773",
"0.5834694",
"0.5682076",
"0.5677708",
"0.56554115",
"0.5621479",
"0.5611845",
"0.55907476",
"0.5579645",
"0.5530323",
"0.552... | 0.7094842 | 0 |
Find Value in multidimensional array Will keep digging until the values isn't arrays anymore | static function in_multi_array($look_for, $array, $at_key = false, $history = false) {
if (is_array($array)) {
// Loop over array and check for value
foreach ($array AS $key => $item) {
// Set first layer of history
$history[] = $key;
// Make sure it's actually an array
if (is_array($item)) {
// If only looking in specific keys
if ( $at_key && isset($item [$at_key]) && $item [$at_key] === $look_for ) {
$result = $history;
} // Else check the whole array for the value
elseif ( in_array($look_for, $item, 1) && $at_key === false ) {
$found_key = array_search( $look_for, $item, 1 );
$history[] = $found_key;
$result = $history;
}// If still no result, look deeper
elseif (!isset($result)) {
// Let the function call itself, will return the result if possible
$result = self::in_multi_array($look_for, $item, $at_key, $history);
}
}
if (isset($result)) break;
array_pop( $history );
}
if (isset($result)) {
return $result;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function search_2d_array($array, $key, $value) {\n\t\tfor ($i = 0; $i < count($array); $i++)\n\t\t{\n\t\t\tif (isset($array[$i][$key])) {\n\t\t\t\tif ($array[$i][$key] == $value) {\n\t\t\t\t\treturn $i;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn false;\n }",
"function findSubArray($DataArray, $keyName, $Value)\... | [
"0.65598696",
"0.64539224",
"0.642019",
"0.6326771",
"0.62969977",
"0.6152916",
"0.6151372",
"0.6084739",
"0.606353",
"0.6056924",
"0.6036907",
"0.60063696",
"0.60063696",
"0.59971243",
"0.5963382",
"0.59328747",
"0.5928995",
"0.5928495",
"0.59050477",
"0.5886559",
"0.5873270... | 0.58167475 | 22 |
Hash String Hashes the string sent to it, and returns an array with both the hash & salt string in it. Config options are use_salt (bool) : Whether to use a salt string or not (`default = true`) encryption (const) : The encryption used (`default = PASSWORD_BCRYPT`) | static function hash_string($input, $config = []) {
$defaults = [
'use_salt' => true,
'encryption' => PASSWORD_BCRYPT
];
$config = array_merge($defaults, $config);
//Create random bytes
$salt_byte = random_bytes(15);
//Make the bytes into a readable string (to save to the database)
$salt_string = $config['use_salt'] ? bin2hex($salt_byte) : "";
//Put the salt-string after the password for the hashing for both creation and login
$string_hashed = password_hash($input . $salt_string, $config['encryption']);
return ['hash' => $string_hashed, 'salt' => $salt_string];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['s... | [
"0.6824701",
"0.64293176",
"0.6423593",
"0.6302542",
"0.62636876",
"0.61824",
"0.6174575",
"0.61459494",
"0.6134166",
"0.6131271",
"0.61271495",
"0.6121221",
"0.61168444",
"0.6109796",
"0.6108238",
"0.61012346",
"0.60608405",
"0.6059856",
"0.6058442",
"0.6049902",
"0.6044517"... | 0.722777 | 0 |
Actions to automatically initialize the model. | protected function init_model_actions() {
return Arr::merge(parent::init_model_actions(), array(
'popover_add',
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init()\n {\n\t\t$this->user_model = new Application_Model_Users;\n\t\t$this->request_model = new Application_Model_Requests;\n\t\t$this->material_model = new Application_Model_Materials;\n\t\t$this->course_model = new Application_Model_Courses;\n\t\t$this->comment_model = new Application_Model_C... | [
"0.81688535",
"0.774896",
"0.7699881",
"0.7617289",
"0.75674707",
"0.7528101",
"0.74634546",
"0.7417789",
"0.73810047",
"0.7367083",
"0.73665476",
"0.7353475",
"0.7345123",
"0.7280405",
"0.7219256",
"0.72102064",
"0.7206349",
"0.7193957",
"0.7189594",
"0.71637475",
"0.7161925... | 0.0 | -1 |
Sets the model name. | public function before() {
$this->_model_name = $this->request->param('model');
parent::before();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _setModelName()\n {\n $model_name = $this->_options['model_name'];\n if ($model_name) {\n $this->_model_name = $model_name;\n } else {\n $this->_model_name = null;\n }\n }",
"public function setModelName($modelName)\n {\n if (is... | [
"0.82992685",
"0.7063395",
"0.69824696",
"0.6885719",
"0.68413913",
"0.67625904",
"0.67433256",
"0.6711417",
"0.6665903",
"0.66392034",
"0.66386205",
"0.66170496",
"0.66170496",
"0.66170496",
"0.66170496",
"0.66170496",
"0.66170496",
"0.66156405",
"0.6611202",
"0.660485",
"0.... | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('articles')->truncate(); //清空数据表,删除 建表
$data=[];
for ( $i = 1 ; $i <= 33 ; $i++ ){
$data[]=[
'title'=>'标题'.$i,
'content'=>$i.'----内容按开发就开个大俺姐夫那更加客观'.$i,
'user_id'=>rand(1,3)
];
}
DB::table('articles')->insert($data);
} | {
"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.80140394",
"0.7980541",
"0.79775697",
"0.79547316",
"0.79514134",
"0.79500794",
"0.79444957",
"0.794259",
"0.79382807",
"0.7937482",
"0.7934376",
"0.7892533",
"0.7881253",
"0.78794724",
"0.7879101",
"0.7875628",
"0.787215",
"0.7870168",
"0.78515327",
"0.7850979",
"0.784195... | 0.0 | -1 |
TODO: Showing front of page registration | public function index(){
return view("partisipan.register.v_register");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register() \n\t{\n $referer = isset($_GET['referer']) ? htmlentities($_GET['referer'], ENT_QUOTES) : '';\n\t\t\n\t\t$this->View->RenderMulti(['_templates/header','user/register']);\n }",
"function register() {\n\n/* ... this form is not to be shown when logged in; if logged in just show... | [
"0.7584507",
"0.7514495",
"0.7377897",
"0.7366088",
"0.7287761",
"0.72568864",
"0.71988624",
"0.7175129",
"0.71365076",
"0.713587",
"0.71072584",
"0.7097151",
"0.7089157",
"0.7062942",
"0.70499533",
"0.70370907",
"0.7020814",
"0.70180887",
"0.6995455",
"0.69616455",
"0.695120... | 0.6439063 | 81 |
TODO: Storing value into database | public function store(Request $request){
ini_set('memory_limit', '-1');
$rules = array(
'firstname' => 'required|max:255',
'lastname' => 'required|max:255',
'email' => 'required|email|unique:users|max:255',
'phone' => 'required|numeric',
'password' => 'required|min:6|max:30',
'confirm_password' => 'required|same:password'
);
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
$message = $validator->getMessageBag()->toArray();
if(!empty($message["email"])){
return response()->json(
array(
"response" => "failed",
"errors" => $message["email"]
)
);
}else if(!empty($message["password"])){
return response()->json(
array(
"response" => "failed",
"errors" => $message["password"]
)
);
}
else if(!empty($message["phone"])){
return response()->json(
array(
"response" => "failed",
"errors" => $message["phone"]
)
);
}else if(!empty($message["confirm_password"])){
return response()->json(
array(
"response" => "failed",
"errors" => $message["confirm_password"]
)
);
}
// return Redirect::to('user/pages/register')
// ->withErrors($validator);
}
else{
$confirmation_code = str_random(30);
$fullName = ucfirst(trim($request->firstname))." ".ucfirst(trim($request->lastname));
$users = User::create([
'id' => Uuid::generate()->string,
'firstname' => ucfirst(trim($request->firstname)),
'lastname' => ucfirst(trim($request->lastname)),
'email' => trim($request->email),
'phone' => trim($request->phone),
'password' => Hash::make($request->password),
'confirmation_code' => $confirmation_code
]);
//TODO: Send Verification Email to Siswa/i
Mail::send('administrator.dashboard.pages.email_page.verify', ['confirmation_code' => $confirmation_code, 'fullName' => $fullName], function($m) {
$m->from('no-reply@loopinc.id', 'Loopinc.id');
$m->to(Input::get('email'), Input::get('firstname').' '.Input::get('lastname'))
->subject('Confirm your account');
});
//TODO: Show alert success when Siswa/o has been success to registration
return response()->json(
array(
"response" => "success"
)
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_value_db()\n\t{\n\t\treturn $this->value;\n\t}",
"protected function populate_value()\n {\n }",
"public function get_value()\n {\n }",
"public function get_value()\n {\n }",
"abstract protected function getValue();",
"public function getValue() {}",
... | [
"0.6845113",
"0.6388971",
"0.6269045",
"0.6269045",
"0.62187886",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.61215806",
"0.6121201",
"... | 0.0 | -1 |
TODO: Link page for verification email | public function confirm($id, Request $request){
if(!$id)
{
$user = User::where('confirmation_code', $id)->first();
return view("administrator.dashboard.pages.email_page.check_link.v_wrong_link");
}
$user = User::where('confirmation_code', $id)->first();
if (!$user)
{
return view("administrator.dashboard.pages.email_page.check_link.v_wrong_link");
}else{
$user->active = '1';
$user->confirmation_code = null;
$user->save();
Session::flash('message', 'Your account has been successfully verified, please log in!');
return redirect('backend/pages/signin');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verify_email()\n\t{\n\t\tlog_message('debug', 'Account/verify_email');\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['msg'] = get_session_msg($this);\n\t\tlog_message('debug', 'Account/verify_email:: [1] post='.json_encode($_POST));\n\t\t# skip this step if the user has already verified their emai... | [
"0.77511907",
"0.7717691",
"0.75077033",
"0.7412211",
"0.71125484",
"0.7008307",
"0.6939724",
"0.6900084",
"0.6862477",
"0.68117994",
"0.6811023",
"0.6769638",
"0.676641",
"0.67535245",
"0.6707911",
"0.6702164",
"0.6690018",
"0.66830254",
"0.665202",
"0.66514176",
"0.6649204"... | 0.0 | -1 |
Redirects to the requested URL with specified schema. | protected function redirectToSchema(CFilterChain $filterChain, $schema) {
$controller = $filterChain->controller;
$action = $filterChain->action;
$route = "{$controller->id}/{$action->id}";
$params = $_GET;
$controller->redirect($controller->createAbsoluteUrl($route, $params, $schema));
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function redirect(string $toUrl, int $status = 302, string $schema = 'http'): PsrResponseInterface;",
"public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext(... | [
"0.67610604",
"0.6102987",
"0.5728082",
"0.56425965",
"0.5543527",
"0.5446656",
"0.5446656",
"0.5446656",
"0.5440463",
"0.53295106",
"0.529658",
"0.5252868",
"0.52139807",
"0.519898",
"0.51872313",
"0.517975",
"0.51673764",
"0.5140585",
"0.51342213",
"0.51269835",
"0.5108659"... | 0.683372 | 0 |
Recieves an instance of the extension generator before beeing built to make changes / adjustments for the extension to handle edge cases whithout adding a million ifs into the parser code. | public function handle(ExtGenerator $gen) : void
{
$resourceDestructionFunction = $gen->findFunctionNamesMatching("/glfwDestroy.*/");
foreach($resourceDestructionFunction as $funcName) {
$this->patchResourceDestructionFunction($gen, $funcName);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function initializeExtbuilder() {\n $this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n $this->classParser = t3lib_div::makeInstance('Tx_ExtensionBuilder_Utility_ClassParser');\n\t\t$this->roundTripService = t3lib_div::makeInstance('Tx_ExtensionBuilder_Servi... | [
"0.6385709",
"0.57292295",
"0.5504658",
"0.54918504",
"0.53244096",
"0.52784276",
"0.5263746",
"0.52432895",
"0.50978214",
"0.5092834",
"0.50880367",
"0.50791556",
"0.49986157",
"0.49341345",
"0.49314094",
"0.4927959",
"0.49179727",
"0.48996198",
"0.4881467",
"0.4871375",
"0.... | 0.0 | -1 |
The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision. | public function useComparativeCourseCatalogView() {
$this->useComparativeView();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function notFoundResponse()\n {\n return Transformer::modelNotFound('Session');\n }",
"public function view_unauthorized()\n {\n return ee()->load->view('unauthorized', array(), TRUE);\n }",
"public static function GetSessionAuthorization ();",
"protected function isAuthoriz... | [
"0.5638322",
"0.5636792",
"0.54342854",
"0.5249903",
"0.51464874",
"0.51043034",
"0.5076589",
"0.5053024",
"0.50301087",
"0.50301087",
"0.50301087",
"0.50272685",
"0.5021202",
"0.5015136",
"0.5006919",
"0.4969908",
"0.49641892",
"0.4960415",
"0.4957511",
"0.4924697",
"0.49155... | 0.0 | -1 |
A complete view of the Course and CourseCatalog returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability. | public function usePlenaryCourseCatalogView() {
$this->usePlenaryView();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function courses(){\n return Catalog::where('active',1)\n ->where('for_sale', 1)\n ->where('litmos_deleted', 0)\n ->orderBy('name')\n ->lists( 'name', 'id');\n }",
"public function show(Course $cou... | [
"0.646113",
"0.6299561",
"0.62846804",
"0.62353593",
"0.6216912",
"0.62078553",
"0.61300814",
"0.6121949",
"0.6121825",
"0.61176",
"0.6061332",
"0.6040223",
"0.6013308",
"0.6009004",
"0.59991705",
"0.59434706",
"0.5942656",
"0.5932304",
"0.58917683",
"0.5889158",
"0.5861634",... | 0.6002667 | 14 |
Tests if this user can perform lookups of course/course catalog mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users. | public function canLookupCourseCatalogMappings() {
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function supportsCourseLookup() {\n \treturn $this->manager->supportsCourseLookup();\n\t}",
"public function supportsCourseCatalogLookup() {\n \treturn $this->manager->supportsCourseCatalogLookup();\n\t}",
"public function isAccessible() {\n\t\tif ($this->hasAccessRestrictions() === FALSE) {\n\t\t... | [
"0.72431564",
"0.71832025",
"0.6421889",
"0.63752073",
"0.6372867",
"0.61922044",
"0.61629236",
"0.61516887",
"0.6088547",
"0.6023293",
"0.6015788",
"0.5937918",
"0.58835906",
"0.58796704",
"0.58509636",
"0.5839969",
"0.5832234",
"0.5829884",
"0.58212954",
"0.5810474",
"0.578... | 0.7472345 | 0 |
Gets the list of Course Ids associated with a CourseCatalog. | public function getCourseIdsByCatalog(osid_id_Id $courseCatalogId) {
$ids = array();
$courses = $this->getCoursesByCatalog($courseCatalogId);
while ($courses->hasNext()) {
$ids[] = $courses->getNextCourse()->getId();
}
return new phpkit_id_ArrayIdList($ids);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCatalogIdsByCourse(osid_id_Id $courseId) {\t\t\n\t\t$parameters = array(\n\t\t\t\t':subject_code' => $this->getSubjectFromCourseId($courseId),\n\t\t\t\t':course_number' => $this->getNumberFromCourseId($courseId)\n\t\t\t);\n\t\t$statement = $this->getGetCatalogsStatement();\n\t\t$statement->exec... | [
"0.72812325",
"0.7099674",
"0.6827911",
"0.64847654",
"0.6342467",
"0.6337828",
"0.62192035",
"0.61992717",
"0.61672986",
"0.61467516",
"0.6085371",
"0.5967249",
"0.5954191",
"0.5940127",
"0.5739204",
"0.5739204",
"0.57051134",
"0.5704309",
"0.57019484",
"0.56833065",
"0.5675... | 0.7899379 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.