query stringlengths 11 3.13k | ru_query stringlengths 9 3.91k | document stringlengths 18 71k | metadata dict | negatives listlengths 0 100 | negative_scores listlengths 0 100 | document_score stringlengths 5 10 | document_rank stringclasses 2 values |
|---|---|---|---|---|---|---|---|
Returns the directory name corresponding to the object type. For pages the directory name is "pages", for layouts "layouts", etc. | Возвращает имя директории, соответствующее типу объекта. Для страниц это имя директории "pages", для шаблонов "layouts" и т.д. | public function getObjectTypeDirName()
{
return $this->dirName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function dirName()\n {\n return str_plural(strtolower($this->itemClass()));\n }",
"private function _getTypeDirectory( $type )\n\t\t{\n\t\t\t$config = Config::getInstance();\n\t\t\t$directory = null;\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'installed':\n\t\t\t\tcase 'uninstalled':\n\t\t\t\t\... | [
"0.69865394",
"0.67635524",
"0.6652575",
"0.6649803",
"0.66300887",
"0.6527499",
"0.6215122",
"0.61566806",
"0.61389947",
"0.6063629",
"0.6054397",
"0.6043413",
"0.60420436",
"0.6017169",
"0.60124964",
"0.6008611",
"0.59829533",
"0.59541494",
"0.59476876",
"0.593549",
"0.5918... | 0.8279505 | 0 |
Returns the maximum directory nesting allowed by this template. | Возвращает максимальную глубину вложенности директорий, разрешенную этим шаблоном. | public function getMaxNesting()
{
return $this->maxNesting;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function maxDepth()\n {\n if ($this->maxDepth === null) {\n return static::DEFAULT_MAX_DEPTH;\n }\n\n return $this->maxDepth;\n }",
"public static function getMaximumPathLength() {}",
"public function getDepth(): int\n {\n return count(explode('/', $this->... | [
"0.6367185",
"0.6237618",
"0.6235076",
"0.6183445",
"0.6144252",
"0.612431",
"0.60825133",
"0.59626013",
"0.59626013",
"0.5907675",
"0.5822726",
"0.5790901",
"0.57689506",
"0.57647324",
"0.5746729",
"0.572063",
"0.56975687",
"0.56738526",
"0.56526834",
"0.5572018",
"0.5532492... | 0.7226511 | 0 |
Returns true if the object was loaded from the cache. | Возвращает true, если объект был загружен из кэша. | public function isLoadedFromCache()
{
return $this->loadedFromCache;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n... | [
"0.8096812",
"0.7640676",
"0.7482657",
"0.74748504",
"0.74692136",
"0.74615556",
"0.74591196",
"0.7450629",
"0.7428408",
"0.74026287",
"0.7331308",
"0.7271206",
"0.72503763",
"0.72425246",
"0.7219823",
"0.71931124",
"0.7180526",
"0.71777904",
"0.71598095",
"0.7149306",
"0.714... | 0.8554659 | 0 |
Get the fillable attributes of a given array. | Получите заполняемые атрибуты заданного массива. | protected function fillableFromArray(array $attributes)
{
$defaults = ['fileName'];
if (count($this->fillable) > 0) {
return array_intersect_key(
$attributes,
array_flip(array_merge($defaults, $this->fillable))
);
}
return $attributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function fillableFromArray(array $attributes)\n {\n if (count($this->fillable) > 0 && !static::$unguarded)\n return array_intersect_key($attributes, array_flip($this->fillable));\n\n return $attributes;\n }",
"protected function fillableFromArray(array $attributes)\n {... | [
"0.7485169",
"0.7431268",
"0.65387875",
"0.6369011",
"0.6369011",
"0.61958706",
"0.61957335",
"0.61303127",
"0.61303127",
"0.61303127",
"0.61303127",
"0.61298674",
"0.6035263",
"0.60131687",
"0.59887",
"0.5970922",
"0.5961864",
"0.59574443",
"0.59520197",
"0.59307975",
"0.592... | 0.7535031 | 0 |
Convert the model's attributes to an array. | Преобразуйте атрибуты модели в массив. | public function attributesToArray()
{
$attributes = $this->attributes;
$mutatedAttributes = $this->getMutatedAttributes();
// We want to spin through all the mutated attributes for this model and call
// the mutator for the attribute. We cache off every mutated attributes so
// we don't have to constantly check on attributes that actually change.
foreach ($mutatedAttributes as $key) {
if (!array_key_exists($key, $attributes)) {
continue;
}
$attributes[$key] = $this->mutateAttributeForArray(
$key, $attributes[$key]
);
}
// Here we will grab all of the appended, calculated attributes to this model
// as these attributes are not really in the attributes array, but are run
// when we need to array or JSON the model for convenience to the coder.
foreach ($this->getArrayableAppends() as $key) {
$attributes[$key] = $this->mutateAttributeForArray($key, null);
}
return $attributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function attributesToArray()\n {\n $attributes = $this->getArrayableAttributes();\n\n return $attributes;\n }",
"public function toArray()\n {\n return $this->attributesToArray();\n }",
"public function toArray()\n {\n return $this->attributesToArray();\n }"... | [
"0.80428535",
"0.7896457",
"0.7896457",
"0.78604525",
"0.7803931",
"0.77749693",
"0.77749693",
"0.77749693",
"0.77749693",
"0.7734881",
"0.77163154",
"0.77087635",
"0.7693619",
"0.7691863",
"0.763805",
"0.7616516",
"0.7616516",
"0.7614991",
"0.7529832",
"0.7518526",
"0.746092... | 0.80184025 | 1 |
Determine if a get mutator exists for an attribute. | Определите, существует ли для атрибута мутатор get. | public function hasGetMutator($key)
{
return $this->methodExists('get'.Str::studly($key).'Attribute');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . Str::studly($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . studly_case($key) . 'Attribute');\n }",
"public function hasGetMutator($key)\n {\n ... | [
"0.7768784",
"0.77530867",
"0.7690894",
"0.7690894",
"0.7635883",
"0.75039136",
"0.72599494",
"0.711803",
"0.65001476",
"0.64817536",
"0.6368092",
"0.63547635",
"0.6345683",
"0.6345683",
"0.6326818",
"0.62785614",
"0.6278046",
"0.62641793",
"0.6239149",
"0.62237495",
"0.61550... | 0.7816478 | 0 |
Determine if a set mutator exists for an attribute. | Определите, существует ли для атрибута мутатор множества. | public function hasSetMutator($key)
{
return $this->methodExists('set'.Str::studly($key).'Attribute');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . Str::studly($key) . 'Attribute');\n }",
"public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . studly_case($key) . 'Attribute');\n }",
"public function hasSetMutator($key)\n {\n ... | [
"0.7262567",
"0.72312343",
"0.7197799",
"0.7197799",
"0.6677842",
"0.664554",
"0.6518645",
"0.65154284",
"0.64689076",
"0.64689076",
"0.64452624",
"0.62474126",
"0.6231419",
"0.62125957",
"0.6177204",
"0.6177204",
"0.61649835",
"0.6161747",
"0.6148717",
"0.61353886",
"0.61332... | 0.7232248 | 1 |
Sync the original attributes with the current. | Синхронизируйте оригинальные атрибуты с текущими. | public function syncOriginal()
{
$this->original = $this->attributes;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final public function sync() {\n\t\t$this->original = $this->attributes;\n\n\t\treturn true;\n\t}",
"public function syncOriginal()\n {\n $this->original = $this->toArray();\n\n return $this;\n }",
"public function syncOriginal(): Model\n {\n $this->original = $this->getAttributes... | [
"0.74845415",
"0.680344",
"0.6802746",
"0.6786014",
"0.63640785",
"0.63399667",
"0.63048583",
"0.60904676",
"0.6056318",
"0.6033761",
"0.590117",
"0.5896081",
"0.589403",
"0.5851019",
"0.58411443",
"0.5820354",
"0.5798619",
"0.5727194",
"0.57045454",
"0.5635495",
"0.56159526"... | 0.74856496 | 0 |
Determine if the new and old values for a given key are numerically equivalent. | Определите, численно эквивалентны ли новые и старые значения для заданного ключа. | protected function originalIsNumericallyEquivalent($key)
{
$current = $this->attributes[$key];
$original = $this->original[$key];
return is_numeric($current) && is_numeric($original) && strcmp((string) $current, (string) $original) === 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function originalIsNumericallyEquivalent($key)\n {\n $current = $this->attributes[$key];\n $original = $this->original[$key];\n\n // Date comparison.\n if (in_array($key, $this->getDates())) {\n $current = $current instanceof Timestamp ? $this->asDateTime($curren... | [
"0.7722886",
"0.60779005",
"0.545446",
"0.53319126",
"0.5328782",
"0.5290431",
"0.51420885",
"0.51365614",
"0.5067573",
"0.5048477",
"0.49768052",
"0.49618724",
"0.49539602",
"0.49462232",
"0.49450853",
"0.49256834",
"0.49012312",
"0.48968127",
"0.48750275",
"0.48686787",
"0.... | 0.72838795 | 1 |
Get the current datasource name for the model. | Получить текущее имя источника данных для модели. | public function getDatasourceName()
{
return $this->datasource;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getDataSourceName() {\r\n // Example: Use a local SQLite3 database\r\n return 'sqlite:' . dirname(__FILE__) . '/counter.sqlite3';\r\n \r\n // Example use mySQL\r\n // return 'mysql:host=localhost;port=3306;dbname=demo';\r\n }",
"public static function getDataSourceKey()\n ... | [
"0.7160904",
"0.7128389",
"0.7120785",
"0.6970749",
"0.6970749",
"0.686984",
"0.6869673",
"0.6817336",
"0.67749864",
"0.6697576",
"0.65902865",
"0.64754593",
"0.64501506",
"0.644604",
"0.639903",
"0.63811195",
"0.6365092",
"0.63477874",
"0.634556",
"0.63448626",
"0.6340736",
... | 0.8409692 | 0 |
Resolve a datasource instance. | Разрешить экземпляр источника данных. | public static function resolveDatasource($datasource = null)
{
return static::$resolver->datasource($datasource);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getDatasourceResolver()\n {\n return static::$resolver;\n }",
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public static function getConnectionResolver();",
"public static function getDataSource()\n {\n ... | [
"0.6254908",
"0.5897958",
"0.5827101",
"0.5559807",
"0.55424845",
"0.55424845",
"0.551143",
"0.54690635",
"0.54495233",
"0.5303409",
"0.53020084",
"0.53020084",
"0.52671164",
"0.5264699",
"0.5243511",
"0.52429086",
"0.52256596",
"0.52160084",
"0.520504",
"0.509803",
"0.508639... | 0.73382974 | 0 |
Get the datasource resolver instance. | Получите экземпляр резолвера источника данных. | public static function getDatasourceResolver()
{
return static::$resolver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public static function getConnectionResolver()\n {\n return static::$resolver;\n }",
"public function getConnectionResolver()\n {\n return $this->resolver;\n }",
"public static functio... | [
"0.74746126",
"0.74746126",
"0.73314303",
"0.7196785",
"0.6959201",
"0.6614767",
"0.6291765",
"0.61531407",
"0.61505747",
"0.6123957",
"0.61236215",
"0.6103618",
"0.6086765",
"0.6069854",
"0.6024955",
"0.6020866",
"0.6020866",
"0.5958177",
"0.5931751",
"0.5924971",
"0.5905664... | 0.8466631 | 0 |
Set the datasource resolver instance. | Установите экземпляр резолвера источника данных. | public static function setDatasourceResolver(Resolver $resolver)
{
static::$resolver = $resolver;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function setConnectionResolver(Resolver $resolver);",
"public function set_resolver(Resolver $resolver);",
"public static function setConnectionResolver(Resolver $resolver)\n {\n static::$resolver = $resolver;\n }",
"public static function getDatasourceResolver()\n {\n re... | [
"0.70538473",
"0.6986677",
"0.6957359",
"0.6792438",
"0.6722543",
"0.66289234",
"0.66157186",
"0.6512312",
"0.6101639",
"0.5945581",
"0.59298414",
"0.59298414",
"0.589466",
"0.58686596",
"0.58485174",
"0.581797",
"0.57792646",
"0.5719786",
"0.5640163",
"0.5609125",
"0.5604885... | 0.7941913 | 0 |
Unset the datasource resolver for models. | Сбросить разрешатель источника данных для моделей. | public static function unsetDatasourceResolver()
{
static::$resolver = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function unsetDalResolver()\n {\n static::$_resolver = null;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"public static function unsetConnectionResolver()\n {\n static::$resolver = null;\n }",
"public static functi... | [
"0.6991766",
"0.67543536",
"0.67543536",
"0.65499735",
"0.60841894",
"0.5916611",
"0.5754598",
"0.5667877",
"0.5643645",
"0.56382513",
"0.5610049",
"0.5541841",
"0.5490016",
"0.5461307",
"0.5368551",
"0.53546363",
"0.53523505",
"0.5347345",
"0.53370273",
"0.53142",
"0.5304529... | 0.7958001 | 0 |
Get the event dispatcher instance. | Получить экземпляр диспетчера событий. | public static function getEventDispatcher()
{
return static::$dispatcher;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getEventDispatcherService()\n {\n if (isset($this->shared['event_dispatcher'])) return $this->shared['event_dispatcher'];\n\n $class = $this->getParameter('event_dispatcher.class');\n $instance = new $class($this);\n $this->shared['event_dispatcher'] = $instance;\n... | [
"0.81160486",
"0.80278236",
"0.79869395",
"0.7969047",
"0.7869225",
"0.785308",
"0.7763506",
"0.77522147",
"0.75496876",
"0.75269914",
"0.7480979",
"0.7477476",
"0.7353422",
"0.72507995",
"0.71986276",
"0.71884865",
"0.71487474",
"0.70782775",
"0.70391905",
"0.70391905",
"0.7... | 0.80964833 | 1 |
Unset the event dispatcher for models. | Сбросить диспетчер событий для моделей. | public static function unsetEventDispatcher()
{
static::$dispatcher = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function unsetEventDispatcher()\n {\n $this->events = null;\n }",
"public function unsetDispatcher(): void\n {\n $this->dispatcher = null;\n }",
"public function reset() {\n $this->_events->reset();\n }",
"public function unsetEventTypes(): void\n {\n $thi... | [
"0.7311602",
"0.67983913",
"0.63313633",
"0.62176996",
"0.6075609",
"0.6002631",
"0.58648247",
"0.57652485",
"0.57640064",
"0.57521355",
"0.57027155",
"0.5669808",
"0.5664629",
"0.5622729",
"0.5581341",
"0.55378693",
"0.55290747",
"0.5523264",
"0.552272",
"0.5500164",
"0.5478... | 0.71739745 | 1 |
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 |
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 |
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 |
Generated from protobuf field repeated .grafeas.v1.Subject subject = 2; | Сгенерировано из поля protobuf 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 |
Generated from protobuf field .grafeas.v1.InTotoProvenance provenance = 4; | Сгенерировано из поля protobuf .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; | Сгенерировано из поля protobuf .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; | Сгенерировано из поля protobuf .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; | Сгенерировано из поля protobuf .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; | Сгенерировано из поля protobuf .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 |
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 | Получить все ошибки для конкретного ключа. Добавить форматирование к $wrap, чтобы вывод был 'обернут' (исходное сообщение будет заменено на :message): // Пример использования required: $validator>get('username', 'Failed: :message'); // Результат: 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 |
Does a value only contain alphanumeric characters and hyphen $rule = array('username' => 'alphanumhyphen'); | Содержит ли значение только алфавитно-цифровые символы и дефис $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 |
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 |
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`) | Хэш строка хэширует строку, отправленную ей, и возвращает массив, содержащий оба хэша и строку с солью. Параметры настройки: use_salt (bool): Использовать ли строку с солью (`default = true`) encryption (const): Используемый метод шифрования (`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 |
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. | Проверяет, может ли текущий пользователь выполнять поиск сопоставлений курса/каталога курсов. Возвращение значения true не гарантирует успешной авторизации. Возвращение значения false означает, что в текущей сессии известно, что методы поиска приведут к ошибке PERMISSION_DENIED. Это предназначено как подсказка приложениям, которые могут решить не предлагать операции поиска неавторизованным пользователям. | 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 |
Gets the list of Courses associated with a CourseCatalog. | Получает список курсов, связанных с каталогом курсов. | public function getCoursesByCatalog(osid_id_Id $courseCatalogId) {
$lookupSession = $this->manager->getCourseLookupSessionForCatalog($courseCatalogId);
$lookupSession->useIsolatedView();
if ($this->usesPlenaryView())
$lookupSession->usePlenaryCourseView();
else
$lookupSession->useComparativeCourseView();
return $lookupSession->getCourses();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetCourses()\n\t\t{\n $course_students = CourseStudent::GetAll(['student_id' => $this->GetAttribute(static::$primary_key)]);\n $courses = array();\n\n foreach ($course_students as $course_student) {\n $courses[] = Course::GetFromPrimaryKey($course_stu... | [
"0.71496224",
"0.7125692",
"0.70384246",
"0.69054234",
"0.68716055",
"0.6822623",
"0.67812306",
"0.6755467",
"0.66981727",
"0.6686777",
"0.66485065",
"0.6596202",
"0.65363705",
"0.6517668",
"0.650607",
"0.64620215",
"0.6339792",
"0.6298999",
"0.6254616",
"0.6078578",
"0.60613... | 0.7477056 | 0 |
Gets the list of Course Ids corresponding to a list of CourseCatalog objects. | Получает список идентификаторов курсов, соответствующих списку объектов CourseCatalog. | public function getCourseIdsByCatalogs(osid_id_IdList $courseCatalogIdList) {
$idList = new phpkit_CombinedList('osid_id_IdList');
while ($courseCatalogIdList->hasNext()) {
try {
$idList->addList($this->getCourseIdsByCatalog($courseCatalogIdList->getNextId()));
} catch (osid_NotFoundException $e) {
if ($this->usesPlenaryView())
throw $e;
}
}
return $idList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCourseIdsByCatalog(osid_id_Id $courseCatalogId) {\n \t$ids = array();\n \t$courses = $this->getCoursesByCatalog($courseCatalogId);\n \twhile ($courses->hasNext()) {\n \t\t$ids[] = $courses->getNextCourse()->getId();\n \t}\n \treturn new phpkit_id_ArrayIdList($ids);\n }",
"... | [
"0.76753193",
"0.71126395",
"0.6887197",
"0.6728595",
"0.6565588",
"0.6200786",
"0.6114252",
"0.611215",
"0.6048621",
"0.60457027",
"0.6044892",
"0.59037507",
"0.5902864",
"0.5879822",
"0.5832614",
"0.5832614",
"0.5800741",
"0.57538456",
"0.5745121",
"0.5712706",
"0.57010573"... | 0.7867208 | 0 |
Gets the list of Courses corresponding to a list of CourseCatalog objects. | Получает список курсов, соответствующих списку объектов CourseCatalog. | public function getCoursesByCatalogs(osid_id_IdList $courseCatalogIdList) {
$courseList = new phpkit_CombinedList('osid_course_CourseList');
while ($courseCatalogIdList->hasNext()) {
try {
$courseList->addList($this->getCoursesByCatalog($courseCatalogIdList->getNextId()));
} catch (osid_NotFoundException $e) {
if ($this->usesPlenaryView())
throw $e;
}
}
return $courseList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetCourses()\n\t\t{\n $course_students = CourseStudent::GetAll(['student_id' => $this->GetAttribute(static::$primary_key)]);\n $courses = array();\n\n foreach ($course_students as $course_student) {\n $courses[] = Course::GetFromPrimaryKey($course_stu... | [
"0.73062104",
"0.71245277",
"0.7057654",
"0.70350176",
"0.6980809",
"0.6867817",
"0.67235196",
"0.6720836",
"0.662141",
"0.65670955",
"0.65172315",
"0.64136034",
"0.6380824",
"0.6318145",
"0.63082445",
"0.6265644",
"0.6240504",
"0.62089175",
"0.613569",
"0.610299",
"0.6020837... | 0.7464477 | 0 |
Gets the CourseCatalog Ids mapped to a Course. | Получает идентификаторы CourseCatalog, сопоставленные с курсом. | public function getCatalogIdsByCourse(osid_id_Id $courseId) {
$parameters = array(
':subject_code' => $this->getSubjectFromCourseId($courseId),
':course_number' => $this->getNumberFromCourseId($courseId)
);
$statement = $this->getGetCatalogsStatement();
$statement->execute($parameters);
$ids = array();
while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
$ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog/');
}
$statement->closeCursor();
return new phpkit_id_ArrayIdList($ids);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCourseIdsByCatalog(osid_id_Id $courseCatalogId) {\n \t$ids = array();\n \t$courses = $this->getCoursesByCatalog($courseCatalogId);\n \twhile ($courses->hasNext()) {\n \t\t$ids[] = $courses->getNextCourse()->getId();\n \t}\n \treturn new phpkit_id_ArrayIdList($ids);\n }",
"... | [
"0.76474375",
"0.68942463",
"0.6645033",
"0.6436734",
"0.6417131",
"0.62609273",
"0.6161324",
"0.61395127",
"0.6127694",
"0.6127694",
"0.60481673",
"0.6031365",
"0.60047334",
"0.58725065",
"0.5861905",
"0.5826808",
"0.5821608",
"0.5818245",
"0.58150244",
"0.57863843",
"0.5781... | 0.7548647 | 1 |
Answer the statement for fetching catalogs | Ответьте на заявление о получении каталогов | private function getGetCatalogsStatement () {
if (!isset(self::$getCatalogsByCourse_stmt)) {
self::$getCatalogsByCourse_stmt = $this->manager->getDB()->prepare(
"SELECT
course_catalog.catalog_id,
catalog_title
FROM
SCBCRSE
LEFT JOIN course_catalog_college ON SCBCRSE_COLL_CODE = coll_code
LEFT JOIN course_catalog ON course_catalog_college.catalog_id = course_catalog.catalog_id
WHERE
SCBCRSE_SUBJ_CODE = :subject_code
AND SCBCRSE_CRSE_NUMB = :course_number
AND SCBCRSE_CSTA_CODE NOT IN (
'C', 'I', 'P', 'T', 'X'
)
GROUP BY SCBCRSE_SUBJ_CODE , SCBCRSE_CRSE_NUMB, catalog_id
");
}
return self::$getCatalogsByCourse_stmt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function fetchCatalogs()\n {\n $Sql = \"SELECT * FROM `db_catalogs`\";\n Parent::query($Sql);\n\n $catalogs = Parent::fetchAll();\n if (empty($catalogs)) {\n return array(\n 'status' => false,\n 'd... | [
"0.68669045",
"0.6088272",
"0.5808634",
"0.5698634",
"0.56830096",
"0.56573486",
"0.55278283",
"0.5515977",
"0.5488257",
"0.54359615",
"0.5419701",
"0.5405967",
"0.5371099",
"0.53543603",
"0.53422266",
"0.5339128",
"0.53056455",
"0.52927727",
"0.5285707",
"0.52774066",
"0.524... | 0.75474966 | 0 |
Saves the Target Grade into the database. It either updates or inserts. | Сохраняет целевую оценку в базе данных. Обновляет или вставляет в зависимости от ситуации. | public function save()
{
if($this->id != -1)
{
$this->update_target_grade();
}
else
{
$this->insert_target_grade();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function insert_target_grade()\r\n {\r\n global $DB;\r\n $params = $this->get_params();\r\n $this->id = $DB->insert_record('block_bcgt_target_grades', $params);\r\n }",
"public function save_grade() {\r\n\r\n\t\t\t//new method\r\n\t\t\t$sql = \"UPDATE grades SET student_id = ?,... | [
"0.76819974",
"0.73544496",
"0.66014427",
"0.64346683",
"0.6227649",
"0.59803945",
"0.59065485",
"0.58583045",
"0.58172953",
"0.5750802",
"0.5672258",
"0.5603101",
"0.55894566",
"0.55830395",
"0.5562536",
"0.5552673",
"0.54855484",
"0.5479278",
"0.54779685",
"0.5452694",
"0.5... | 0.82555264 | 0 |
Deletes the target grade using the target grade id passed in (from the database.) | Удаляет целевую оценку с использованием идентификатора целевой оценки, переданного (из базы данных). | public static function delete_target_grade($targetGradeID)
{
global $DB;
$DB->delete_records('block_bcgt_target_grades', array('id'=>$targetGradeID));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete_grade() {\r\n\t\t\t$sql = \"DELETE FROM grades WHERE id = $this->id;\";\r\n\t\t\tDatabase::$db->query($sql);\r\n\t\t}",
"function sqlDeleteGrade()\n\t{\n\t\t$sql = \"\n\t\tDELETE FROM tbl_grade\n\t\tWHERE grade_id = :grade_id\n\t\t\";\n\n\t\treturn $sql;\n\t}",
"function sb_assignment_de... | [
"0.7750345",
"0.62856454",
"0.62751067",
"0.6247999",
"0.62387985",
"0.6219215",
"0.6123618",
"0.6043811",
"0.6039449",
"0.60063916",
"0.59998786",
"0.5998948",
"0.59953314",
"0.5958848",
"0.59498954",
"0.5947142",
"0.5945185",
"0.5928793",
"0.5928475",
"0.59033436",
"0.58987... | 0.78142464 | 0 |
Inserts the target grade into the database. | Вставляет целевую оценку в базу данных. | private function insert_target_grade()
{
global $DB;
$params = $this->get_params();
$this->id = $DB->insert_record('block_bcgt_target_grades', $params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save()\r\n {\r\n if($this->id != -1)\r\n {\r\n $this->update_target_grade();\r\n }\r\n else\r\n {\r\n $this->insert_target_grade();\r\n }\r\n }",
"public function test_insert_grade_record() {\n global $DB, $USER;\n\n ... | [
"0.72508174",
"0.6786291",
"0.6740325",
"0.6493337",
"0.64287007",
"0.6354729",
"0.6333785",
"0.6196301",
"0.612433",
"0.6093761",
"0.60206985",
"0.59183985",
"0.5916492",
"0.58917445",
"0.58423537",
"0.56940925",
"0.56732213",
"0.5664993",
"0.5616756",
"0.5606822",
"0.560106... | 0.8400825 | 0 |
Update the sitename placeholder in .ddev/config.yaml with the directory name | Обновите плейсхолдер sitename в .ddev/config.yaml именем директории | protected static function updateDDevName(): void
{
$base = self::getBasepath();
$directories = explode('/', $base);
$directoryName = array_pop($directories);
$ddevConfigPath = $base . '/.ddev/config.yaml';
if (file_exists($ddevConfigPath)) {
$ddevConfig = file_get_contents($ddevConfigPath);
$ddevConfig = str_replace('{sitename}', $directoryName, $ddevConfig);
file_put_contents($ddevConfigPath, $ddevConfig);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateConfigApp() : void\n {\n $this->domainName = Str::title(Str::lower(Str::studly($this->domainName)));\n $configAppFilePath = config_path(\"app.php\");\n $oldValue = \"/*NewDomainsServiceProvider*/\";\n $newValue = \"App\\\\\".config(\"domain.pat... | [
"0.56040007",
"0.53270847",
"0.5232809",
"0.5228946",
"0.5197544",
"0.50947136",
"0.506499",
"0.50548595",
"0.5019438",
"0.49987584",
"0.49904034",
"0.49785993",
"0.4973142",
"0.4967103",
"0.49667454",
"0.4963577",
"0.49460825",
"0.49360842",
"0.4933854",
"0.4931945",
"0.4928... | 0.80105674 | 0 |
Copies the .env.example to .env if it doesn't exist | Копирует .env.example в .env, если он не существует | protected static function copyEnv(): void
{
$base = self::getBasepath();
$envPath = $base . '/.env';
$examplePath = $base . '/.env.example';
if (file_exists($examplePath) && !file_exists($envPath)) {
copy($examplePath, $envPath);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createEnvFile()\n {\n if (! file_exists('.env')) {\n copy('.env.example', '.env');\n $this->line('.env file successfully created');\n }\n }",
"public static function copyEnv()\n {\n // Get VCAP_APPLICATION\n $vcapsApplication = json_de... | [
"0.7551238",
"0.6644462",
"0.6558725",
"0.6294258",
"0.61804384",
"0.61367",
"0.61296517",
"0.60745007",
"0.6059287",
"0.60549015",
"0.6017924",
"0.59529054",
"0.59469897",
"0.59280616",
"0.5917926",
"0.58679223",
"0.5857066",
"0.5803609",
"0.57858473",
"0.5783957",
"0.576681... | 0.8148647 | 0 |
Removes README.md from the project. | Удаляет README.md из проекта. | protected static function removeReadme(): void
{
$basePath = self::getBasepath();
if (file_exists($basePath . '/README.md')) {
unlink($basePath . '/README.md');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function removeReadme()\n {\n $basePath = self::getBasepath();\n\n if (file_exists($basePath . '/README.md')) {\n unlink($basePath . '/README.md');\n }\n }",
"protected function createReadme() :void\n {\n $path = app_path('readme.md');\n\n S... | [
"0.79977196",
"0.67315334",
"0.61825985",
"0.5848066",
"0.5719331",
"0.56311715",
"0.54835165",
"0.5389537",
"0.53789705",
"0.5251935",
"0.5251701",
"0.5218745",
"0.51502585",
"0.506788",
"0.50622153",
"0.50605273",
"0.5029634",
"0.500807",
"0.5003002",
"0.4989636",
"0.498699... | 0.79444027 | 1 |
Returns table locks information in the current database | Возвращает информацию о блокировках таблиц в текущей базе данных | function getLocks() {
global $conf;
if (!$conf['show_system'])
$where = "AND pn.nspname NOT LIKE 'pg\\\\_%'";
else
$where = "AND nspname !~ '^pg_t(emp_[0-9]+|oast)$'";
$sql = "SELECT pn.nspname, pc.relname AS tablename, pl.transaction, pl.pid, pl.mode, pl.granted
FROM pg_catalog.pg_locks pl, pg_catalog.pg_class pc, pg_catalog.pg_namespace pn
WHERE pl.relation = pc.oid AND pc.relnamespace=pn.oid {$where}
ORDER BY nspname,tablename";
return $this->selectSet($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLocks();",
"protected function getLockTablesQuery()\n {\n $newDbName = $this->newDbName;\n $oldDbName = $this->oldDbName;\n\n $tablesLocks = array_map(function ($table) use ($newDbName, $oldDbName) {\n return [\"{$newDbName}.{$table} WRITE\", \"{$oldDbName}.{$table}... | [
"0.7128183",
"0.6891073",
"0.6674592",
"0.63838595",
"0.63678104",
"0.62678874",
"0.6111381",
"0.6071616",
"0.60571986",
"0.60114866",
"0.60066295",
"0.59425944",
"0.58664453",
"0.5799368",
"0.577263",
"0.57592314",
"0.57064563",
"0.5694649",
"0.5665413",
"0.5633671",
"0.5626... | 0.794663 | 0 |
Returns the current database encoding | Возвращает текущую кодировку базы данных | function getDatabaseEncoding() {
$sql = "SELECT getdatabaseencoding() AS encoding";
return $this->selectField($sql, 'encoding');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEncoding() {\n\t\treturn $this->fetchRow('PRAGMA encoding');\n\t}",
"public function getEncoding()\n {\n return $this->fetchRow('PRAGMA encoding');\n }",
"function getEncoding() {\n\t\treturn mysql_client_encoding($this->connection);\n\t}",
"public function encoding()\n {\n ... | [
"0.82511604",
"0.81630945",
"0.79951113",
"0.79760355",
"0.787582",
"0.772699",
"0.7725211",
"0.7709512",
"0.7694289",
"0.76809746",
"0.7680298",
"0.7680298",
"0.7680298",
"0.7680298",
"0.7650099",
"0.76317376",
"0.76317376",
"0.76009744",
"0.76009744",
"0.75444674",
"0.75089... | 0.88552 | 0 |
Returns the current default_with_oids setting | Возвращает текущее значение настройки default_with_oids | function getDefaultWithOid() {
// 8.0 is the first release to have this setting
// Prior releases don't have this setting... oids always activated
return 'on';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDefaultWithOid() {\n\n\t\t$sql = \"SHOW default_with_oids\";\n\n\t\treturn $this->selectField($sql, 'default_with_oids');\n\t}",
"protected function get_default() {\n\t\treturn array( 'ownerID' => 0 );\n\t}",
"function get_defaultsetting() {\n return $this->defaultsetting;\n }",
"public... | [
"0.8139143",
"0.65943444",
"0.6342786",
"0.62780774",
"0.61722475",
"0.6169658",
"0.60390615",
"0.6026518",
"0.60127527",
"0.5982875",
"0.5978619",
"0.5910437",
"0.5862489",
"0.5839659",
"0.5837869",
"0.5837418",
"0.58335173",
"0.58161354",
"0.57959735",
"0.57930255",
"0.5787... | 0.76608455 | 1 |
Constraint functions Returns a list of all constraints on a table, including constraint name, definition, related col and referenced namespace, table and col if needed | Функции ограничений Возвращает список всех ограничений на таблице, включая имя ограничения, определение, связанную колонку и отсылаемое пространство имен, таблицу и колонку, если это необходимо | function getConstraintsWithFields($table) {
$c_schema = $this->_schema;
$this->clean($c_schema);
$this->clean($table);
// get the max number of col used in a constraint for the table
$sql = "SELECT DISTINCT
max(SUBSTRING(array_dims(c.conkey) FROM '^\\\\[.*:(.*)\\\\]$')) as nb
FROM pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_class AS r ON (c.conrelid=r.oid)
JOIN pg_catalog.pg_namespace AS ns ON (r.relnamespace=ns.oid)
WHERE
r.relname = '{$table}' AND ns.nspname='{$c_schema}'";
$rs = $this->selectSet($sql);
if ($rs->EOF) $max_col = 0;
else $max_col = $rs->fields['nb'];
$sql = '
SELECT
c.oid AS conid, c.contype, c.conname, pg_catalog.pg_get_constraintdef(c.oid, true) AS consrc,
ns1.nspname as p_schema, r1.relname as p_table, ns2.nspname as f_schema,
r2.relname as f_table, f1.attname as p_field, f1.attnum AS p_attnum, f2.attname as f_field,
f2.attnum AS f_attnum, pg_catalog.obj_description(c.oid, \'pg_constraint\') AS constcomment,
c.conrelid, c.confrelid
FROM
pg_catalog.pg_constraint AS c
JOIN pg_catalog.pg_class AS r1 ON (c.conrelid=r1.oid)
JOIN pg_catalog.pg_attribute AS f1 ON (f1.attrelid=r1.oid AND (f1.attnum=c.conkey[1]';
for ($i = 2; $i <= $rs->fields['nb']; $i++) {
$sql.= " OR f1.attnum=c.conkey[$i]";
}
$sql.= '))
JOIN pg_catalog.pg_namespace AS ns1 ON r1.relnamespace=ns1.oid
LEFT JOIN (
pg_catalog.pg_class AS r2 JOIN pg_catalog.pg_namespace AS ns2 ON (r2.relnamespace=ns2.oid)
) ON (c.confrelid=r2.oid)
LEFT JOIN pg_catalog.pg_attribute AS f2 ON
(f2.attrelid=r2.oid AND ((c.confkey[1]=f2.attnum AND c.conkey[1]=f1.attnum)';
for ($i = 2; $i <= $rs->fields['nb']; $i++)
$sql.= " OR (c.confkey[$i]=f2.attnum AND c.conkey[$i]=f1.attnum)";
$sql .= sprintf("))
WHERE
r1.relname = '%s' AND ns1.nspname='%s'
ORDER BY 1", $table, $c_schema);
return $this->selectSet($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getConstraints($tableName) {\n $constraints = DbManager::query(\"select TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME,\n REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE\n where table_name = '$tableName'\");\n return $... | [
"0.746639",
"0.693201",
"0.6890931",
"0.6868531",
"0.6831753",
"0.6791077",
"0.6779372",
"0.6769578",
"0.6655093",
"0.6639738",
"0.6578574",
"0.6568467",
"0.65648335",
"0.655904",
"0.65273464",
"0.6445459",
"0.635602",
"0.6333815",
"0.63224715",
"0.6318673",
"0.6258683",
"0... | 0.71316516 | 1 |
Sequence functions Returns all sequences in the current database | Функции последовательностей Возвращает все последовательности в текущей базе данных | function getSequences($all = false) {
$c_schema = $this->_schema;
$this->clean($c_schema);
if ($all) {
// Exclude pg_catalog and information_schema tables
$sql = "SELECT n.nspname, c.relname AS seqname, u.usename AS seqowner
FROM pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_namespace n
WHERE c.relowner=u.usesysid AND c.relnamespace=n.oid
AND c.relkind = 'S'
AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast')
ORDER BY nspname, seqname";
} else {
$sql = "SELECT c.relname AS seqname, u.usename AS seqowner, pg_catalog.obj_description(c.oid, 'pg_class') AS seqcomment
FROM pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_namespace n
WHERE c.relowner=u.usesysid AND c.relnamespace=n.oid
AND c.relkind = 'S' AND n.nspname='{$c_schema}' ORDER BY seqname";
}
return $this->selectSet( $sql );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_sequences()\n\t{\n\t\treturn $this->driver_query('sequence_list');\n\t}",
"public function getSequences()\n {\n $main_actions = [\n 'sequence' => \\adminer\\lang('Create sequence'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n ];\n\n ... | [
"0.8136024",
"0.7423928",
"0.7077528",
"0.64897966",
"0.6129248",
"0.60549",
"0.59157425",
"0.58499014",
"0.5774951",
"0.57231396",
"0.57211506",
"0.56081337",
"0.55795294",
"0.5522043",
"0.5512508",
"0.5490074",
"0.54655147",
"0.5461807",
"0.5416555",
"0.54039043",
"0.533166... | 0.7641541 | 1 |
This will return entity id based on email address. | Это вернет идентификатор сущности на основе адреса электронной почты. | public function getEntityIdByEmail($email)
{
$read = Mage::getSingleton('core/resource')->getConnection('core_read');
$readresult = $read->query(
'SELECT entity_id,role_id,role_code FROM `customer_entity` ce LEFT JOIN axaltacore_user_role aur ON ce.entity_id = aur.user_id LEFT JOIN axaltacore_role ar ON aur.role_id = ar.axaltacore_role_id
where ce.email = "'.$email.'" and ar.role_code="la_key_user"'
);
while ($row = $readresult->fetch()) {
$entityId = $row['entity_id'];
}
return $entityId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEmailId() {\n\t\treturn $this->getData('emailId');\n\t}",
"protected function userIDEmail ($email)\n {\n \n $user = Model_users::find('all', array\n (\n 'where' => array\n (\n array('email'=>$email),\n )\n ));\n if(!empty($user))\n ... | [
"0.73483413",
"0.7223782",
"0.72197527",
"0.7193137",
"0.716111",
"0.71277434",
"0.70311105",
"0.6999079",
"0.685598",
"0.68531823",
"0.6843078",
"0.68231684",
"0.68041915",
"0.6756805",
"0.67410135",
"0.67270297",
"0.67166895",
"0.67041534",
"0.66755015",
"0.66755015",
"0.66... | 0.81247777 | 0 |
Readiness check and Create Backup steps. | Проверка готовности и шаг «Создать резервную копию». | protected function readinessCheckAndBackup(
AssertSuccessfulReadinessCheck $assertReadiness,
BackupOptions $backupOptions
) {
$this->readinessCheck($assertReadiness);
$this->setupWizard->getReadiness()->clickNext();
$this->backup($backupOptions);
$this->setupWizard->getCreateBackup()->clickNext();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n// dd('backup.create');\n $exitCode = Artisan::call('backup:run', ['--only-db'=>true]);\n return redirect()->route('backup.index');\n }",
"protected function initial()\n {\n $adapter = new Local('/', LOCK_SH, Local::SKIP_LINKS);\n $local =... | [
"0.6220813",
"0.6220601",
"0.6089825",
"0.6017322",
"0.5974011",
"0.59259033",
"0.58765393",
"0.5808511",
"0.575421",
"0.5747473",
"0.56747955",
"0.56574196",
"0.56556",
"0.5649466",
"0.5625648",
"0.5590939",
"0.55859196",
"0.5580922",
"0.5556306",
"0.5543951",
"0.55151266",
... | 0.7063489 | 0 |
/ City: + tolower if ALL CAPS + Capitalize first letter of each word + Double apostrophes | Город: + tolower, если ВСЕ ЗАГЛАВНЫЕ БУКВЫ + Заглавная буква первого слова + Двойные кавычки | function fixCity($str = "") {
if ( preg_match("/[A-Z]{3}/", $str) ) {
$str = strtolower($str);
}
$str = ucwords($str);
$str = str_replace("'", "''", $str);
return($str);
//fixCity
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function accronym($string) {\n $out = '';\n foreach (explode(' ', $string) as $value) {\n if ($value) {\n $out .= strtoupper($value[0]);\n }\n }\n return $out;\n}",
"function makeTitleCase($input_title)\n {\n $input_array_of_words = explode(\" \", strtolower... | [
"0.6969585",
"0.6899945",
"0.6711611",
"0.65355843",
"0.65331244",
"0.65323824",
"0.6488122",
"0.6426783",
"0.6404989",
"0.6376354",
"0.63423026",
"0.63273424",
"0.63271356",
"0.62753755",
"0.6269467",
"0.62544614",
"0.62507164",
"0.62440306",
"0.6243878",
"0.6205333",
"0.619... | 0.74844426 | 0 |
Returns if the dialog retrieved a valid result. If a valid result has already been received, this method returns true, otherwise false. | Возвращает true, если диалог получил корректный результат. Если корректный результат уже был получен, этот метод возвращает true, иначе false. | public function hasValidResult()
{
return ( $this->result !== null );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkResult() {\n\t\treturn ($this->_query_result !== false);\n\t}",
"protected function _isResultValid()\n {\n if (!$this->getRequest()->getParam('result') ||\n !in_array($this->getRequest()->getParam('result'), $this->_validResults)) {\n $this->_logger->error(__(... | [
"0.7610003",
"0.7455422",
"0.726771",
"0.7231844",
"0.7221336",
"0.7185457",
"0.69031245",
"0.68116444",
"0.68116444",
"0.68116444",
"0.66841316",
"0.66414577",
"0.65968955",
"0.65859735",
"0.6569663",
"0.6548598",
"0.6537232",
"0.6536151",
"0.65261424",
"0.64882785",
"0.6442... | 0.7776744 | 0 |
Get the site setting schema, conforming to JSON Schema. | Получите схему настроек сайта, соответствующую JSON Schema. | public function get_item_schema() {
$options = $this->get_registered_options();
$schema = array(
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'settings',
'type' => 'object',
'properties' => array(),
);
foreach ( $options as $option_name => $option ) {
$schema['properties'][ $option_name ] = $option['schema'];
}
return $this->add_additional_fields_schema( $schema );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function get_settings_schema() {\n\n $_schema = json_decode( wp_remote_retrieve_body( wp_remote_get( WPP_API_URL_STANDARDS . '/schema' ) ), true );\n\n return isset( $_schema['data'] ) ? $_schema['data'] : array();\n\n }",
"public function getSettings() {\n $file = SETTING... | [
"0.7996044",
"0.6677421",
"0.6593927",
"0.6385942",
"0.6174305",
"0.6144686",
"0.6039883",
"0.6017932",
"0.59656686",
"0.59631807",
"0.5948019",
"0.5907641",
"0.58914",
"0.58914",
"0.58914",
"0.58914",
"0.58914",
"0.58914",
"0.5885717",
"0.5882725",
"0.5876973",
"0.58548236... | 0.7493372 | 1 |
Halaman List para User | Список пользователей | public function list_user()
{
check_access_level_superuser();
$data = [
'list_user' => $this->user_m->get_cabang(),
'list_cabang' => $this->data_m->get('tb_cabang')
];
$this->template->load('template2', 'user/list_user', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}",
"public function userList() {\n /** @var User[] ... | [
"0.7710576",
"0.76590395",
"0.7579087",
"0.7573508",
"0.75307435",
"0.75220776",
"0.7499849",
"0.74958277",
"0.7457248",
"0.74262947",
"0.7386747",
"0.729269",
"0.7289015",
"0.72821397",
"0.72498786",
"0.7218278",
"0.71950054",
"0.7181125",
"0.7177128",
"0.71610385",
"0.71588... | 0.7906442 | 0 |
Loads Model represented by $modName and $ctrlName | Загружает модель, представленную $modName и $ctrlName | public function loadModel($modName, $ctrlName = '')
{
if (!class_exists($modName.'Model')) {
if (!$ctrlName) $ctrlName = $this->ctrlName;
$filename = $this->app->getModelClassFileName($modName, $ctrlName);
if (!file_exists($filename)) zf::halt("No such model found \"$modName\"! at $filename");
require_once $filename;
}
$class = ucfirst($modName).'Model';
$mod = new $class($ctrlName, $modName, $this);
$this->models[$modName] = $mod;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function model($modName = null, $ctrlName = '')\n\t{\n\t\tif (!$modName) $modName = $this->ctrlName;\n if (!$ctrlName) $ctrlName = $this->ctrlName;\n\t\tif (isset($this->models[$modName])) return $this->models[$modName];\n\t\t\n\t\t$this->loadModel($modName, $ctrlName);\n\t\treturn $this->model($mo... | [
"0.7934687",
"0.7782699",
"0.7741777",
"0.6975137",
"0.6923596",
"0.6880434",
"0.68387866",
"0.68174314",
"0.6717329",
"0.6551923",
"0.6425403",
"0.63943905",
"0.63550526",
"0.6327506",
"0.6289112",
"0.6261731",
"0.6251583",
"0.6205615",
"0.6176086",
"0.6131433",
"0.6118449",... | 0.8280711 | 0 |
Returns loaded Model object represented by $modName and $ctrlName | Возвращает загруженный объект Model, представленный $modName и $ctrlName | public function model($modName = null, $ctrlName = '')
{
if (!$modName) $modName = $this->ctrlName;
if (!$ctrlName) $ctrlName = $this->ctrlName;
if (isset($this->models[$modName])) return $this->models[$modName];
$this->loadModel($modName, $ctrlName);
return $this->model($modName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function model($modName = '', $ctrlName = '')\n {\n return parent::model($modName, $ctrlName);\n }",
"public function loadModel($modName, $ctrlName = '')\n\t{\n\t\tif (!class_exists($modName.'Model')) {\n\t\t\tif (!$ctrlName) $ctrlName = $this->ctrlName;\n\t\t\t$filename = $this->app->getMode... | [
"0.8005318",
"0.7772888",
"0.75677365",
"0.6486984",
"0.64635754",
"0.6358232",
"0.63388497",
"0.63196945",
"0.6294006",
"0.62820995",
"0.62815875",
"0.6276671",
"0.62104774",
"0.6201406",
"0.6194457",
"0.61726457",
"0.61702365",
"0.61461574",
"0.6140707",
"0.6138701",
"0.611... | 0.83249307 | 0 |
Returns form represented by $formName | Возвращает форму, представленную $formName | protected function form($formName)
{
if (isset($this->forms[$formName])) return $this->forms[$formName];
zf::halt("No such form \"{$formName}\" loaded");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getForm($name)\n {\n return $this->getFormBuilder()->createBuilder($name);\n }",
"public function getForm($formName)\n {\n if (!isset($this->form[$formName])) {\n $message = sprintf(\n 'Requested form \"%s\" not part of this build. Available forms:... | [
"0.76612115",
"0.73769957",
"0.7250387",
"0.7189241",
"0.71573496",
"0.7138883",
"0.7075898",
"0.7067946",
"0.70426977",
"0.7030337",
"0.70275545",
"0.7017357",
"0.7017357",
"0.69855624",
"0.69801784",
"0.69801784",
"0.69255316",
"0.6913544",
"0.6912028",
"0.69070464",
"0.687... | 0.8119895 | 0 |
Not found action method for controller | Действие метода не найдено для контроллера | protected function actionNotFound()
{
zf::halt("You can't call this function \"actionNotFound\" directly. You must redefine it in your controller.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionnotfound()\n {\n $this->render('notfound');\n }",
"public function actionNotfound()\n {\n $this->actionSlug = 'notfound';\n $this->actionParams = [];\n $this->breadcrumbs=[];\n $this->beforeAction();\n $this->breadcrumbs[] = ['title' => 404... | [
"0.8356943",
"0.8273121",
"0.8070214",
"0.8017735",
"0.7941634",
"0.784426",
"0.7821098",
"0.7747471",
"0.7669802",
"0.7664562",
"0.7656013",
"0.7636298",
"0.7623391",
"0.75673753",
"0.75317514",
"0.75268656",
"0.7502693",
"0.7497364",
"0.74813926",
"0.7467583",
"0.74636656",... | 0.83453125 | 1 |
Many to many relationship with genre model. | Много к много отношение с моделью жанра. | public function genres()
{
return $this->belongsToMany('App\Genre', 'genre_artist');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function genres()\n {\n return $this->belongsToMany('App\\Genre');\n }",
"public function genres()\n {\n return $this->belongsToMany(Genre::class, 'genre__movies', 'movie_id', 'id');\n }",
"public function genres()\n {\n return $this->belongsToMany('App\\Models\\Genre... | [
"0.82063353",
"0.78325015",
"0.77752",
"0.7754915",
"0.7650356",
"0.7539934",
"0.71598816",
"0.71355844",
"0.6953636",
"0.6885664",
"0.6842402",
"0.66718584",
"0.657852",
"0.6541937",
"0.6354747",
"0.62195873",
"0.62049276",
"0.6166439",
"0.61296797",
"0.61159146",
"0.6080682... | 0.79764205 | 1 |
Replaces all valid imports with the result of the $contentReplaceFunction. The function receives the cleaned path as argument (without the quotes and the function must not add quotes). | Заменяет все допустимые импорты результатом функции $contentReplaceFunction. Функция получает очищенный путь в качестве аргумента (без кавычек, и функция не должна добавлять кавычки). | public function replaceValidImports (string $fileContent, callable $contentReplaceFunction) : string
{
return \preg_replace_callback(
'~url\\(\\s*(?<path>.*?)\\s*\\)~i',
function (array $matches) use ($contentReplaceFunction)
{
return $this->ensureValidImportAndReplace($matches, $contentReplaceFunction);
},
$fileContent
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function ensureValidImportAndReplace (array $matches, callable $contentReplaceFunction) : string\n {\n $path = $matches[\"path\"];\n $openingQuote = \\substr($matches[\"path\"], 0, 1);\n $closingQuote = \\substr($matches[\"path\"], -1);\n $usedQuotes = \"\";\n\n // che... | [
"0.7026493",
"0.688952",
"0.59473085",
"0.59461015",
"0.59340507",
"0.5927119",
"0.5904901",
"0.572699",
"0.56774545",
"0.55368406",
"0.54570633",
"0.5386634",
"0.52854264",
"0.52719516",
"0.52693266",
"0.52442926",
"0.523602",
"0.5209371",
"0.5193935",
"0.5193661",
"0.515291... | 0.7020751 | 1 |
changes $current_path used for fixing relative paths | изменения $current_path, используемые для исправления относительных путей | private function setCurrentPath(){
$dirs = explode('/', $this->pages[0]);
// if last character is a / then just use it
if(empty($dirs[count($dirs)-1]) || is_null($dirs[count($dirs)-1])){
$this->current_path = $this->pages[0];
// if end of path was a filename, remove it and add a /
} else {
array_pop($dirs);
$this->current_path = implode('/', $dirs).'/';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function changePath()\n {\n chdir(base_path());\n }",
"abstract public function getCurrentPath();",
"function current_path()\n {\n\treturn str_replace(base_url(), '', current_url());\n }",
"protected function setInitialRelativePath() {}",
"private function relativePathFix($path){\n\t... | [
"0.7021977",
"0.6928795",
"0.6675617",
"0.6667217",
"0.66215587",
"0.65949434",
"0.6530308",
"0.63362676",
"0.6181536",
"0.610016",
"0.60529083",
"0.6050394",
"0.60440636",
"0.60261613",
"0.59632707",
"0.59627086",
"0.5916782",
"0.5903339",
"0.5897093",
"0.5879897",
"0.587657... | 0.77386767 | 0 |
look through all files found in crawl for CSS files and parse them for images | просмотрите все файлы, найденные в crawl, для файлов CSS и извлеките из них изображения | private function parseCSS(){
// collect all unique values from the arrays in $links
$css_links = array();
foreach ($this->links as $key => $paths) {
foreach ($paths as $key => $value) {
$css_links[] = $value;
}
}
$css_links = array_unique($css_links);
sort($css_links);
// loop through all values look for files
foreach ($css_links as $value) {
if(count(explode('.', $value)) > 1){
$temp = explode('.', $value);
$qry = false;
// if a file is found, see if it has a querystring
foreach ($temp as $key => $css) {
if(count(explode('?', $css)) > 1){
$temp[$key] = explode('?', $css);
$qry = $key;
}
}
// if it has a query string, remove it
if($qry){
$type = $temp[$qry][0];
// otherwise, just grab the extension
} else {
$type = count($temp);
$type = $temp[$type-1];
}
// check if the file extension is css
if($type === 'css'){
// ensure path to file exists
$path = 'http://'.$this->url.$value;
if(@file_get_contents($path)){
// add file to $visited
$this->visited[] = $value;
// set current path for relativePathFiX()
$dir = explode('/', $value);
array_pop($dir);
$this->current_path = implode('/', $dir).'/';
// open the file to start parsing
$file = file_get_contents($path);
$imgs = array();
// find all occurrences of the url() method used to include images
preg_match_all("%.*url\('*(.*)[^\?]*\).*\)*%", $file, $matches);
// loop through occurrences
foreach ($matches[1] as $key => $img) {
// check if a query string is attached to the image (used to prevent caching)
if(count(explode('?', $img)) > 1){
// if there is, remove it and fix the path
$temp = explode('?', $img);
$imgs[] = $this->relativePathFix($temp[0]);
} else {
// if there isn't a query string, make sure to remove the closing bracket
$temp = explode(')', $img);
$imgs[] = $this->relativePathFix($temp[0]);
}
}
// if images were found, add them to $links
if(count($imgs) > 0){
$this->links[$value] = $imgs;
}
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findCssFiles();",
"private function getImageIntoCss(): void\n {\n preg_match_all(self::REGEX_IMAGE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $sImgPath = PH7_PATH_ROOT . $this->sBaseUrl . $aH... | [
"0.7313089",
"0.682833",
"0.67335427",
"0.6691646",
"0.6673036",
"0.6495293",
"0.6486712",
"0.6344852",
"0.6308274",
"0.6184599",
"0.6152373",
"0.6046938",
"0.60176307",
"0.5997407",
"0.59607375",
"0.5951366",
"0.5904705",
"0.58877546",
"0.5876533",
"0.58764654",
"0.5857931",... | 0.80734646 | 0 |
Create the structure for the displayed month | Создайте структуру для отображаемого месяца | function mkMonth ($month) {
$head = "<div class='fullwidth'>";
$head .= "<div class='month'>";
$head .= date("F", mktime(0,0,0,$month));
$head .= "</div>";
$head .= "<div id='jresult'>";
$head .= "</div>";
$head .= "<div id='week'>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Sunday";
$head .= "</td>";
$head .= "</table>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Monday";
$head .= "</td>";
$head .= "</table>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Tuesday";
$head .= "</td>";
$head .= "</table>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Wednesday";
$head .= "</td>";
$head .= "</table>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Thursday";
$head .= "</td>";
$head .= "</table>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Friday";
$head .= "</td>";
$head .= "</table>";
$head .= "<table class='days'>";
$head .= "<td>";
$head .= "Saturday";
$head .= "</td>";
$head .= "</table>";
$head .= "</div>";
echo $head;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function monthCreator($from,$to){\n\n$month='';\nforeach (h_many_M($from,$to) as $i) {\n\n$d = DateTime::createFromFormat('!m', $i);\n$m = $d->format('F').' '.$i;\n\n $month.=' \n<th class=\"planning_head_month\" colspan=\"28\">'.$m.'</th>\n ';\n}\necho $month;\n}",
"public function get_month_permastruct()\... | [
"0.73935616",
"0.7041853",
"0.67926854",
"0.66831195",
"0.66279286",
"0.6617421",
"0.6536828",
"0.6473009",
"0.6435724",
"0.6414517",
"0.64120907",
"0.6408968",
"0.6383224",
"0.63521445",
"0.6348271",
"0.63159007",
"0.631117",
"0.6222103",
"0.62045795",
"0.61959517",
"0.61901... | 0.72050965 | 1 |
Logout() Closes session and returns to login screen | Logout() завершает сессию и возвращает на экран входа | public static function Logout()
{
Session::CloseSession();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function logOut()\n {\n self::startSession();\n session_destroy();\n }",
"public function logout()\n { \n Session_activity::delete();\n \n Session_activity::delete_session();\n \n $conf = $GLOBALS['CONF'];\n $ossim_li... | [
"0.8442549",
"0.8360225",
"0.83082336",
"0.8288833",
"0.82682294",
"0.8265262",
"0.82278305",
"0.82249373",
"0.821423",
"0.8210084",
"0.82098794",
"0.8203934",
"0.82014424",
"0.8174821",
"0.81561655",
"0.8118859",
"0.81179655",
"0.80941784",
"0.8085273",
"0.8083066",
"0.80751... | 0.8388605 | 1 |
Delete an individual survey submission | Удалить отдельную отправку опроса | public function delete_survey_submission($id)
{
if ( isset($id) )
{
$this->db->delete('vwm_surveys_submissions', array('id' => $id));
}
elseif ( isset($survey_id) )
{
$this->db->delete('vwm_surveys_submissions', array('survey_id' => $id));
}
return $this->db->affected_rows() > 0 ? TRUE : FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }",
... | [
"0.704928",
"0.6927132",
"0.6782566",
"0.67519563",
"0.6743712",
"0.67242193",
"0.6659275",
"0.6654835",
"0.65483344",
"0.6547482",
"0.6538272",
"0.6526627",
"0.6492822",
"0.64676714",
"0.64564884",
"0.6453267",
"0.6381312",
"0.63810337",
"0.6379219",
"0.6363803",
"0.63554263... | 0.7071134 | 0 |
On first call creates as data_record record used to link data object with its content. On subsequent calls returns the previously created record. | При первом вызове создает запись data_record, используемую для связи объекта данных с его содержимым. При последующих вызовах возвращает ранее созданную запись. | protected function get_data_record($data) {
if ($this->_data_record) {
return $this->_data_record;
}
global $USER, $DB;
$this->_data_record = new object();
$this->_data_record->id = null;
$this->_data_record->userid = $USER->id;
$this->_data_record->groupid = 0;
$this->_data_record->dataid = $data->id;
$this->_data_record->timecreated = $time = time();
$this->_data_record->timemodified = $time;
$this->_data_record->approved = true;
$this->_data_record->id = $DB->insert_record('data_records', $this->_data_record);
return $this->_data_record->id ? $this->_data_record : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addRecord()\n {\n $rec = new Record($this, true);\n $rec->markForInsert();\n $this->records[] = $rec;\n return $rec;\n }",
"public function create($data)\n {\n try {\n $record = $this->model->create($data);\n } catch (\\Exception $e) {... | [
"0.6830509",
"0.66752625",
"0.65268564",
"0.63946795",
"0.6298123",
"0.6273325",
"0.61721206",
"0.6119108",
"0.6106025",
"0.6050434",
"0.6050434",
"0.6048353",
"0.6044807",
"0.59401137",
"0.59214187",
"0.58682567",
"0.5797092",
"0.5792165",
"0.57628447",
"0.57008016",
"0.5700... | 0.7404586 | 0 |
Fetch first child of $el with class name equals to $name and returns all li in an array. | Получает первого ребенка $el с именем класса, равным $name, и возвращает все li в массиве. | protected function read_list($el, $name) {
$result = array();
$list = $el->getElementsByTagName('div');
foreach ($list as $div) {
if (strtolower($div->getAttribute('class')) == $name) {
$lis = $el->getElementsByTagName('li');
foreach ($lis as $li) {
$result[] = trim(html_entity_decode($this->get_innerhtml($li)));
}
}
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function read($el, $name, $default = '') {\r\n $list = $el->getElementsByTagName('div');\r\n foreach ($list as $div) {\r\n if (strtolower($div->getAttribute('class')) == $name) {\r\n $result = $this->get_innerhtml($div);\r\n $result = str_ireplace('<... | [
"0.61263555",
"0.56702036",
"0.5652199",
"0.5628246",
"0.55545205",
"0.54151684",
"0.5303527",
"0.52979654",
"0.52324617",
"0.5228412",
"0.5225914",
"0.51862645",
"0.5164076",
"0.5162426",
"0.5157026",
"0.5079374",
"0.5076307",
"0.50721323",
"0.5065997",
"0.501336",
"0.499664... | 0.7723638 | 0 |
Fetch first child of $el with class name equals to $name and returns its inner html. Returns $default if no child is found. | Получает первого дочернего элемента $el с именем класса, равным $name, и возвращает его внутренний HTML. Возвращает $default, если элемент не найден. | protected function read($el, $name, $default = '') {
$list = $el->getElementsByTagName('div');
foreach ($list as $div) {
if (strtolower($div->getAttribute('class')) == $name) {
$result = $this->get_innerhtml($div);
$result = str_ireplace('<p>', '', $result);
$result = str_ireplace('</p>', '', $result);
return $result;
}
}
return $default;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFirstChildByName($name) {\n foreach($this->__childs as $child) {\n if ($child->getName() == $name) {\n return $child;\n }\n }\n return null; \n }",
"public function get($name) {\n\t\tif( isset($... | [
"0.6228843",
"0.57680947",
"0.566378",
"0.56176656",
"0.55473787",
"0.54208755",
"0.54067624",
"0.5387862",
"0.532956",
"0.5317605",
"0.5308805",
"0.52735484",
"0.52621186",
"0.5230969",
"0.5207049",
"0.5177255",
"0.5170779",
"0.5135536",
"0.5127617",
"0.51206994",
"0.5076852... | 0.76925004 | 0 |
/ Update user vendor | / Обновление поставщика пользователя | public function updateVendor() {
try {
if (!($this->vendor instanceof Base_Model_ObtorLib_App_Core_Catalog_Entity_Vendor)) {
throw new Base_Model_ObtorLib_App_Core_Catalog_Exception(" Vendor Entity not initialized");
} else {
$objVendor = new Base_Model_ObtorLib_App_Core_Catalog_Dao_Vendor();
$objVendor->vendor = $this->vendor;
return $objVendor->updateVendor();
}
} catch (Exception $ex) {
throw new Base_Model_ObtorLib_App_Core_Catalog_Exception($ex);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update($vendor);",
"public function update_vendor($id, $data)\n\t{\n\t\t// Unset, if neccessary\n\t\tif ($data['api_id'] == '0')\n\t\t\t$data['api_id'] = NULL;\n\t\t\n\t\tif (empty($data['orderemail']))\n\t\t\t$data['orderemail'] = NULL;\n\t\t\t\n\t\tif (empty($data['ordername']))\n\t\t\t$data['o... | [
"0.77089745",
"0.678249",
"0.6584451",
"0.6425409",
"0.6245101",
"0.62318724",
"0.62134546",
"0.6159758",
"0.6158834",
"0.6122324",
"0.6108975",
"0.60946953",
"0.602808",
"0.59663606",
"0.59483075",
"0.59092873",
"0.59023994",
"0.58952296",
"0.5860157",
"0.5858423",
"0.584987... | 0.713382 | 1 |
Display a listing of the Uploads. | Показать список загрузок. | public function index()
{
$module = Module::get('Uploads');
if(Module::hasAccess($module->id)) {
return View('la.uploads.index', [
'show_actions' => $this->show_action,
'listing_cols' => $this->listing_cols,
'module' => $module
]);
} else {
return redirect(config('laraadmin.adminRoute')."/");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index() {\n $this->data['title'] = \"Uploads\";\n $viewContent = $this->load->view('uploads/index', $this->data, true);\n renderWithLayout(array('content' => $viewContent), 'admin');\n }",
"public function index()\n {\n $uploads=Auth::guard('team')->user()->uploa... | [
"0.69382066",
"0.6876522",
"0.6749682",
"0.6725907",
"0.6721007",
"0.6666607",
"0.6666607",
"0.6640795",
"0.66351545",
"0.66273767",
"0.6605901",
"0.65982366",
"0.6577865",
"0.65707296",
"0.6520642",
"0.65011615",
"0.64765644",
"0.63927686",
"0.6379982",
"0.63731706",
"0.6365... | 0.71702826 | 1 |
Update Uploads Public Visibility | Обновить публичную видимость загрузок | public function update_public()
{
if(Module::hasAccess("Uploads", "edit")) {
$file_id = Input::get('file_id');
$public = Input::get('public');
if(isset($public)) {
$public = true;
} else {
$public = false;
}
$upload = Upload::find($file_id);
if(isset($upload->id)) {
if($upload->user_id == Auth::user()->id || Entrust::hasRole('SUPER_ADMIN')) {
// Update Caption
$upload->public = $public;
$upload->save();
return response()->json([
'status' => "success"
]);
} else {
return response()->json([
'status' => "failure",
'message' => "Unauthorized Access 1"
]);
}
} else {
return response()->json([
'status' => "failure",
'message' => "Upload not found"
]);
}
} else {
return response()->json([
'status' => "failure",
'message' => "Unauthorized Access"
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_public()\n {\n\t\tif(Module::hasAccess(\"Uploads\", \"edit\")) {\n\t\t\t$file_id = Input::get('file_id');\n\t\t\t$public = Input::get('public');\n\t\t\t\n\t\t\t\n\t\t\t$upload = Upload::find($file_id);\n\t\t\tif(isset($upload->id)) {\n\t\t\t\tif($upload->user_id == Auth::user()->id || Ent... | [
"0.7433434",
"0.697364",
"0.6724741",
"0.6699069",
"0.6688663",
"0.6155418",
"0.6049058",
"0.6047401",
"0.60376936",
"0.5982526",
"0.57420754",
"0.5724763",
"0.57083505",
"0.56794137",
"0.56685036",
"0.56627905",
"0.56376064",
"0.5635653",
"0.56148225",
"0.56059617",
"0.55955... | 0.7411745 | 1 |
Test that the sanitized css matches a known good version | Тестирование того, чтобы очищенный css соответствовал известной хорошей версии | public function test_css_was_sanitized() {
$unsanitized_css = file_get_contents( __DIR__ . '/unsanitized.css' );
$known_good_sanitized_css = file_get_contents( __DIR__ . '/sanitized.css' );
$maybe_sanitized_css = sanitize_unsafe_css( $unsanitized_css );
$this->assertEquals( $maybe_sanitized_css, $known_good_sanitized_css );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function safecss_filter_attr($css, $deprecated = '')\n {\n }",
"function cleanStyleInformation($string) {\r\n\t\t$string = str_replace(' ', ' ', $string);\r\n\t\t$string = str_replace('"', \"'\", $string);\r\n\t\t$string = ReTidy::decode_for_DOM_character_entities($string);\r\n\t\t/* // 2011-11-2... | [
"0.62958",
"0.61226946",
"0.6118173",
"0.6066739",
"0.6029883",
"0.5999646",
"0.5948778",
"0.59352994",
"0.5889052",
"0.57163066",
"0.55703104",
"0.5520725",
"0.55170554",
"0.54799986",
"0.54263294",
"0.53980327",
"0.53788733",
"0.5351177",
"0.53320503",
"0.5310577",
"0.52976... | 0.8243286 | 0 |
Returns whether this plugin is running on a test system or the production system. | Возвращает true, если этот плагин запущен на тестовой системе или в производственной системе. | public function is_test_environment() {
if(empty($this->production_site_url))
return true;
else
return get_site_url() === $this->production_site_url ? false : true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isTest() : bool\n\t{\n\t\treturn $this->productionTest;\n\t}",
"public function isProd() {\n\t\tif ($this->checkEnv(array('prod', 'product', 'production'))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static function isDev() {\n // Acquia.\n if (defined('AH_SITE_ENVIRON... | [
"0.77510166",
"0.76399803",
"0.7498758",
"0.7489189",
"0.73803633",
"0.7375103",
"0.7369261",
"0.73560923",
"0.73511416",
"0.728489",
"0.7228609",
"0.71942675",
"0.7176972",
"0.7143329",
"0.71116257",
"0.7090879",
"0.70895076",
"0.7072677",
"0.7005752",
"0.70015776",
"0.69697... | 0.76479644 | 1 |
Modify the css if we are in a test environment to make the website look ugly to avoid confusion. To be added to the 'wp_head' and 'admin_head' action. | Измените css, если мы находимся в тестовой среде, чтобы сайт выглядел не красиво и избежать путаницы. Должен быть добавлен в действие 'wp_head' и 'admin_head'. | public function modify_css_if_in_test_environment() {
if($this->is_test_environment())
echo '<style>div#wpadminbar {background-color: #49cf44;}</style>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function attach_custom_css_filter() {\n\tif ( ! is_admin() && ! is_feed() && ! is_robots() && ! is_trackback() ) {\n\t\tglobal $publishthis;\n\n\t\tif( is_singular() ) echo $publishthis->utils->display_css();\n\t}\n}",
"private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n... | [
"0.64123803",
"0.6364427",
"0.634668",
"0.6344194",
"0.6244267",
"0.62112933",
"0.6184165",
"0.617153",
"0.6154084",
"0.61347914",
"0.6115918",
"0.61113024",
"0.6109064",
"0.6083221",
"0.6071445",
"0.60558105",
"0.6034255",
"0.60268146",
"0.6019083",
"0.6017077",
"0.5979238",... | 0.826032 | 0 |
Returns a filename that is unique in the given directory. This fuction is based on wp_unique_filename() from but it treats .tar.gz as a single extension. | Возвращает имя файла, которое является уникальным в заданной директории. Эта функция основана на wp_unique_filename(), но рассматривает .tar.gz как один расширение. | public function unique_filename_callback( $dir, $filename, $ext ) {
$ext = mb_strtolower($ext);
if($ext === '.gz' && mb_substr($filename, -7) === '.tar.gz' ) $ext = '.tar.gz';
$number = '';
while ( file_exists( $dir . "/$filename" ) ) {
$new_number = (int) $number + 1;
if ( '' === "$number$ext" ) {
$filename = "$filename-" . $new_number;
} else {
$filename = str_replace( array( "-$number$ext", "$number$ext" ), "-" . $new_number . $ext, $filename );
}
$number = $new_number;
}
return $filename;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generate_unique_file_name($dir, $filename)\n{\n if (!$filename)\n return;\n \n $extension = pathinfo($filename, PATHINFO_EXTENSION);\n\n $new_filename = '';\n for (;;)\n {\n $new_filename = get_random_string(8, 8) . '.' . $extension;\n if (!file_exists($dir . '/' . ... | [
"0.77655303",
"0.767303",
"0.7602459",
"0.75815725",
"0.74350446",
"0.74350446",
"0.74350446",
"0.74350446",
"0.74350446",
"0.74350446",
"0.73986477",
"0.7397706",
"0.7242553",
"0.72255135",
"0.71434987",
"0.70677674",
"0.7001081",
"0.6945939",
"0.6924418",
"0.6850468",
"0.68... | 0.7734731 | 1 |
Get the path of a feature image of a post Returns the path of the feature image, insired by | Получить путь изображения-обложки поста. Возвращает путь изображения-обложки, вдохновленный | public function get_feature_image_path( $post_id ) {
$thumb_id = get_post_thumbnail_id($post_id);
if(empty($thumb_id))
return '';
$image= wp_get_attachment_image_src($thumb_id, 'full');
if(empty($image))
return '';
$upload_dir = wp_upload_dir();
$base_dir = $upload_dir['basedir'];
$base_url = $upload_dir['baseurl'];
$imagepath= str_replace($base_url, $base_dir, $image[0]);
if (file_exists( $imagepath))
return $imagepath;
else
return '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnail($post_id))\n\t{\n\t\t$image5 = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'full' );\n\t\treturn $image5[0];\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}",
"function get_feature_image_url($post_id)\n{\n\tif(has_post_thumbnai... | [
"0.6573878",
"0.6573878",
"0.6296172",
"0.6168056",
"0.6103291",
"0.60804135",
"0.6034792",
"0.6013491",
"0.58720905",
"0.5870317",
"0.58182037",
"0.5749974",
"0.5736883",
"0.5706038",
"0.5667666",
"0.56430054",
"0.5625451",
"0.5622882",
"0.56065935",
"0.56058884",
"0.5603174... | 0.75880456 | 0 |
Loads the name of an user given its email | Загружает имя пользователя по его электронной почте | public function findNameByEmail($email){
$stmt = $this->db->prepare("SELECT * FROM users WHERE email=?");
$stmt->execute(array($email));
$user = $stmt->fetch(PDO::FETCH_ASSOC);
if($user != null) {
return new User(
$user["email"],
$user["completeName"]);
}
else {
return NULL;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadUserByEmail($email)\n { \n $user = $this->_em->getRepository('Entity\\User\\User')->findOneBy(array('email' => $email));\n\n if($user != null)\n return $user;\n\n throw new UsernameNotFoundException(\"Compte introuvable\");\n }",
"function getUserNam... | [
"0.7470118",
"0.7409108",
"0.7289771",
"0.70845586",
"0.6977614",
"0.69411457",
"0.6923764",
"0.689882",
"0.6886406",
"0.68858427",
"0.68018734",
"0.67706674",
"0.6748977",
"0.6733427",
"0.6714101",
"0.6670983",
"0.66457134",
"0.66178656",
"0.65951985",
"0.65804493",
"0.65501... | 0.7462196 | 1 |
Saves a User into the database | Сохраняет пользователя в базе данных | public function save($user) {
$stmt = $this->db->prepare("INSERT INTO users values (?,?,?)");
$stmt->execute(array($user->getEmail(), $user->getCompleteName(), $user->getPasswd()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->C... | [
"0.79587907",
"0.77736866",
"0.7708109",
"0.7707836",
"0.7703543",
"0.76558113",
"0.76016927",
"0.7571912",
"0.75581414",
"0.7402825",
"0.7399722",
"0.739042",
"0.73269767",
"0.7292358",
"0.7276313",
"0.7225437",
"0.721875",
"0.7218055",
"0.7195012",
"0.71814644",
"0.71694463... | 0.7893134 | 1 |
Send reminder messages to the list of appointments that have been passed to us | Отправлять напоминания сообщениям в список встреч, которые были переданы нам | function sendReminders($appointmentList)
{
// get appointment details and email address
JLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php');
$appointmentModel = new SalonBookModelAppointments();
foreach ($appointmentList as $appointment)
{
$mailingInfo = $appointmentModel->detailsForMail($appointment['id']);
// clear any old recipients
$this->email = NULL;
$this->setSuccessMessage($mailingInfo);
// $this->mailer->addBCC("cronwatch@pelau.com");
$this->sendMail();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$a... | [
"0.8026194",
"0.7020604",
"0.67048925",
"0.66590756",
"0.6545574",
"0.64621097",
"0.6336447",
"0.6316557",
"0.6287346",
"0.6232709",
"0.620149",
"0.6109475",
"0.60863554",
"0.60080373",
"0.5963936",
"0.59571224",
"0.5953585",
"0.5945126",
"0.5907907",
"0.59026027",
"0.5885300... | 0.7875032 | 1 |
Updates the specified agent version. Note that this method does not allow you to update the state of the agent the given version points to. It allows you to update only mutable properties of the version resource. | Обновляет указанную версию агента. Примечание: данный метод не позволяет обновлять состояние агента, на который указывает заданная версия. Он позволяет обновлять только изменяемые свойства ресурса версии. | public function UpdateVersion(\Google\Cloud\Dialogflow\V2\UpdateVersionRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/google.cloud.dialogflow.v2.Versions/UpdateVersion',
$argument,
['\Google\Cloud\Dialogflow\V2\Version', 'decode'],
$metadata, $options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUpdateVersion($val)\n {\n $this->_propDict[\"updateVersion\"] = $val;\n return $this;\n }",
"public function setAgentVersion($agentVersion)\n {\n $this->_data['ai.internal.agentVersion'] = $agentVersion;\n }",
"public function updateVersion($version)\n {\n... | [
"0.58730173",
"0.58695847",
"0.58048266",
"0.5606574",
"0.55426466",
"0.54943204",
"0.54700434",
"0.54400736",
"0.54400736",
"0.54400736",
"0.54358196",
"0.5432168",
"0.5421149",
"0.5421149",
"0.54122525",
"0.5388079",
"0.53782827",
"0.53386074",
"0.5330476",
"0.5304612",
"0.... | 0.7078659 | 0 |
Copy existing Annotation Urls from old to new product, since they are usually not included in the catalog update. | Скопируйте существующие URL-адреса аннотаций из старого продукта в новый, так как они обычно не включаются в обновление каталога. | private static function copyAnnotationUrls($existing_product, $new_product) {
foreach(["AntCbildUrl","AntAbildUrl","AntRueckUrl"] as $ant) {
if(isset($existing_product->$ant) && !property_exists($new_product,$ant)) {
$new_product->$ant = $existing_product->$ant;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function mapMagentoAttributes(ProductInterface $newProduct)\n {\n try {\n $originalProduct = $this->baseMagentoProductRepository->get($newProduct->getSku());\n $newProduct->setMediaGalleryEntries($originalProduct->getMediaGalleryEntries());\n } catch (NoSuchEntityExce... | [
"0.5510585",
"0.5038295",
"0.497977",
"0.49260625",
"0.49137515",
"0.48702252",
"0.48362923",
"0.48355854",
"0.48096398",
"0.4760752",
"0.47297874",
"0.4719762",
"0.4659986",
"0.46197754",
"0.45372865",
"0.45190895",
"0.45028773",
"0.44517055",
"0.44405726",
"0.4438688",
"0.4... | 0.76536757 | 0 |
Converts ISBN10 to ISBN13 string. Taken from | Преобразует ISBN10 в строку ISBN13. Источник: | private function isbn10to13($isbn10){
$isbnclean = preg_replace("/([^d])/", "",substr($isbn10,0,-1));
if (strlen($isbnclean) != 9) {
return $isbn10;
}
$isbn="978".$isbnclean;
$check=0;
for ($i=0;$i<12;$i++) {
$check+=(($i%2)*2+1)*$isbn[$i];
}
$check=(10-($check%10))%10;
return "978".substr($isbn10,0,-1).$check;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function convert10to13($isbn10)\n {\n $isbn13 = '978' . substr($isbn10, 0, 9);\n $sum = 0;\n for ($i = 0; $i < 12; $i ++) {\n if ($i % 2 == 0) {\n $sum += $isbn13{$i};\n } else {\n $sum += 3 * $isbn13{$i};\n }\n }\... | [
"0.7752301",
"0.69664115",
"0.683384",
"0.65942186",
"0.63080627",
"0.6307712",
"0.61868817",
"0.61771363",
"0.61431986",
"0.5945208",
"0.5832819",
"0.5708205",
"0.5654722",
"0.5618333",
"0.5520768",
"0.5519655",
"0.5519655",
"0.55044407",
"0.531368",
"0.5266902",
"0.5264451"... | 0.8058322 | 0 |
Retrieve Blurb Text from ONIX data | Извлечение текста Блурба из данных ONIX | public function getBlurb() {
// check if there is text available in the onix message
// and return as Blurb if it exists
$records = $this->product->get('OtherText');
foreach ($records as $record) {
if($record->getType() == 18) {
return $record->getValue();
}
}
return false;
/* Original SQL statement from spMacSelectProductsFairnopoly.sql:
> update macSelectProducts
> set Blurb =
> cast((
> select top 1 OtherText from refProductOtherText
> where macSelectProducts.ProductReference = refProductOtherText.ProductReference
> and refProductOtherText.TextTypeCode = '18')
> as varchar(4000))
*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_featureblurb() {\n\t\tglobal $product;\n\t\tif ( is_front_page() ) {\n\t\t\t$content = get_post_meta( $product->id, 'featureblurb', true );\n\t\t\tif ( $content ) {\n\t\t\t\techo( '<div class=\"featureblurb\">' . html_entity_decode( $content ) . '</div>' );\n\t\t\t}\n\t\t}\n\t}",
"public function ge... | [
"0.6004652",
"0.59671986",
"0.5666079",
"0.5549008",
"0.5529162",
"0.54114276",
"0.54049116",
"0.53617334",
"0.53467906",
"0.5331171",
"0.5294811",
"0.5259774",
"0.5241196",
"0.520316",
"0.5161109",
"0.5139849",
"0.5134706",
"0.51287276",
"0.5109651",
"0.5109651",
"0.5109651"... | 0.7552279 | 0 |
Threads belong to many viewers (Users) through ViewedThread. | Потоки принадлежат многим просматривающим (Пользователям) через ViewedThread. | public function viewedBy()
{
return $this->belongsToMany(
'App\Models\User',
'viewed_threads',
'thread_id',
'user_id'
)
->using('App\Models\ViewedThread')
->withPivot('timestamp');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function views()\n {\n return $this->hasMany('App\\Models\\ViewedThread');\n }",
"public function favoriteThreads($userid, $threads);",
"public function threads()\n {\n return $this->hasMany(thread::class);\n }",
"public function threads()\n {\n return $this->hasMan... | [
"0.64863783",
"0.6115233",
"0.58442837",
"0.5840202",
"0.5840202",
"0.5837736",
"0.58362126",
"0.573146",
"0.57066077",
"0.57065344",
"0.56756526",
"0.56379545",
"0.5579365",
"0.55518365",
"0.54680085",
"0.5441456",
"0.5403752",
"0.53617686",
"0.53530246",
"0.5348783",
"0.527... | 0.7057228 | 0 |
Function to save chat messages and relay to recepient | Функция для сохранения сообщений чата и передачи получателю | public function action_chat() {
$recepient = $this->request->param('id');
$sender = $this->_current_user;
$avatar = ($sender->personnel_info->personnel_avatar) ? $sender->personnel_info->personnel_avatar : 'default.png';
//STEP1: Save the chat message;
$message = ORM::factory('Message');
$message->values($this->request->post());
$message->sender = $sender;
$message->recepient = $recepient;
$message->time = time();
try {
$message->save();
//STEP2: Send Chat Notification to Recepient
$date = gmdate('m/d/Y H:i:s', $message->time) . " UTC";
$payload = array(
'msg_id' => $message->message_id,
'msg' => $message->message,
'time' => $date,
'id' => $sender->id,
'username' => $sender->username,
'avatar' => 'assets/avatars/' . $avatar,
"local_time" => Date::local_time("now", "m/d/Y H:i:s", "UTC")
);
$this->_push('appchat', $payload, array(
'id' => $recepient,
'pushUid'=> Kohana::$config->load("pusher.pushUid")
));
$this->_set_msg('Successful sent message', 'success', $payload);
} catch(ORM_Validation_Exception $e) {
$this->_set_msg('Someone slept on the job', 'error', TRUE);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $res... | [
"0.6664889",
"0.6569174",
"0.65105015",
"0.64977884",
"0.6429702",
"0.6415614",
"0.6414149",
"0.62557876",
"0.6244839",
"0.62010616",
"0.6194378",
"0.6177268",
"0.61681765",
"0.6135774",
"0.6078879",
"0.60549617",
"0.6047958",
"0.6035952",
"0.60296375",
"0.60248077",
"0.60204... | 0.7232398 | 0 |
Function to retrieve offline messages from a particular user | Функция для получения офлайн-сообщений от определенного пользователя | public function action_offline_messages() {
$sender = $this->request->param('id');
$offline_messages = ORM::factory('Message')->get_offline_messages($this->_current_user->id, $sender);
$this->_set_msg('Offline Messages Retrieved', 'success', $offline_messages);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function messages_by_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByUserID($uid, $skip, $limit);\n\t\t\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages... | [
"0.6780795",
"0.674822",
"0.6740253",
"0.67117596",
"0.65558434",
"0.65558434",
"0.651822",
"0.6502502",
"0.6500644",
"0.6482182",
"0.6426987",
"0.6404993",
"0.63747907",
"0.6374496",
"0.63287437",
"0.63178515",
"0.62996584",
"0.6279364",
"0.62371874",
"0.62257695",
"0.621837... | 0.77622706 | 0 |
Function to retrieve the entire conversation with a single user | Функция для получения всего диалога с одним пользователем | public function action_get_conversation() {
$sender = ORM::factory('User', $this->request->param("id"));
$conversations =array();// ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);
$post = $this->request->post();
$to = "";
$from = "";
if($post) {
$from = date('Y-m-d',strtotime($post['from']));
$to = date('Y-m-d',strtotime($post['to']));
if($to == '1969-12-31') {
$to = date('Y-m-d',strtotime('2030-01-01'));
}
if($from == '1969-12-31') {
$from = date('Y-m-d',strtotime('2030-01-01'));
}
$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender, $from, $to);
}else {
$conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);
}
$this->_template->set("conversation_info", $sender);
$this->_template->set("filters", array("from"=>$from,"to"=>$to,"results"=>$this->_count_all_messages_in_conversation($conversations)));
$this->_template->set("conversations", $conversations);
$this->_set_content('conversation');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getConversation($id, $fromUser=false){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE conv_id=:id ORDER BY date');\n\t\t$statement->execute(array(':id'=>$id));\n\t\treturn $statement->fetchAll(PDO::FETCH_ASSOC);\n\t}",
"public function getConversationWith (int $use... | [
"0.7440169",
"0.69513035",
"0.681697",
"0.65520465",
"0.6527377",
"0.65152216",
"0.6510654",
"0.6480371",
"0.64448404",
"0.642741",
"0.6410428",
"0.6403281",
"0.6367946",
"0.63518864",
"0.62390363",
"0.6126855",
"0.6103688",
"0.6100901",
"0.6088312",
"0.60726404",
"0.60698473... | 0.71423113 | 1 |
Gets the content types searched in a typespecific search. | Получает типы контентов, которые ищутся в поиске по типу. | public function getSearchContentTypes()
{
return array('quote');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSearchContentTypes()\n {\n return array('conversation_message', 'conversation');\n }",
"function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variab... | [
"0.73325866",
"0.69764763",
"0.66080374",
"0.65561604",
"0.65206754",
"0.64649403",
"0.639141",
"0.639141",
"0.639141",
"0.639141",
"0.6279278",
"0.6266108",
"0.6264383",
"0.625179",
"0.6250367",
"0.62446696",
"0.62359303",
"0.61834264",
"0.61506534",
"0.61179155",
"0.6115676... | 0.72188073 | 1 |
Get typespecific constraints from input. | Получить типоспецифические ограничения из входных данных. | public function getTypeConstraintsFromInput(XenForo_Input $input)
{
return array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConstraintTypes() {}",
"public function getTypeConstraintsFromInput(XenForo_Input $input)\n {\n if (!($this->enabled)) return array();\n $constraints = array();\n\n $replyCount = $input->filterSingle('reply_count', XenForo_Input::UINT);\n if ($replyCount)\n ... | [
"0.67598665",
"0.6378992",
"0.61512977",
"0.61164725",
"0.5882489",
"0.577702",
"0.57595295",
"0.5725472",
"0.5725472",
"0.5702714",
"0.5702714",
"0.5693041",
"0.5693041",
"0.5656768",
"0.5656637",
"0.5656637",
"0.56557584",
"0.5632766",
"0.5628496",
"0.562461",
"0.56117433",... | 0.7038645 | 0 |
Returns true if the value resolves to true. | Возвращает true, если значение решается в true. | public function isTrue()
{
return !!$this->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isTrue()\n {\n return $this->value === true;\n }",
"public function isTrue();",
"function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}",
"function bool ($value)\r\n{\r\n\tif ($value === true || $value === ... | [
"0.83746284",
"0.7327865",
"0.7255598",
"0.7237692",
"0.7135793",
"0.7099107",
"0.7009759",
"0.69991183",
"0.6963154",
"0.69327813",
"0.689397",
"0.68891025",
"0.6885377",
"0.6842323",
"0.68270355",
"0.6826442",
"0.68248254",
"0.68046576",
"0.67733765",
"0.67328924",
"0.67099... | 0.76715714 | 1 |
Returns true if the value resolves to false. | Возвращает true, если значение оценивается как false. | public function isFalse()
{
return !$this->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_false(mixed $value): bool\n\t{\n\t\treturn $value === false;\n\t}",
"public function isFalse();",
"public static function false(): self\n {\n return self::fromValue(Value::false());\n }",
"public function isFalse() {\n return $this->is(new Identical(false));\n }",
"protected fu... | [
"0.7759415",
"0.7726061",
"0.74473184",
"0.7393785",
"0.73572373",
"0.7334865",
"0.7206088",
"0.7168344",
"0.67863894",
"0.67777485",
"0.67279816",
"0.6600152",
"0.64929044",
"0.64041144",
"0.6379429",
"0.636509",
"0.6354426",
"0.6321541",
"0.6304143",
"0.6290906",
"0.6277464... | 0.80876946 | 0 |
Extract filepaths from finder results | Извлечь пути к файлам из результатов поиска | private function getFinderResult()
{
$results = array();
foreach ($this->finder as $result) {
$results[] = $result->getRealPath();
}
return $results;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findFiles();",
"public function find () {\n\t\t$results = array();\n\n\t\t// Iterate all paths in target\n\t\tforeach ($this->target->get_resolved_paths() as $path) {\n\t\t\t\n\t\t\t// Iterate all files in paths\n\t\t\t$files = directory_contents($path);\n\t\t\tforeach ($files as $file) {\n\t\t\t... | [
"0.6785689",
"0.6522868",
"0.63721865",
"0.61564285",
"0.61357844",
"0.6121081",
"0.6059127",
"0.5994545",
"0.5969169",
"0.5963418",
"0.595956",
"0.59460074",
"0.59460074",
"0.59460074",
"0.5936259",
"0.5908881",
"0.5865822",
"0.5853286",
"0.5838035",
"0.5817389",
"0.581305",... | 0.7564424 | 0 |
Return whether we're testing Varien_Object, where bug in unsetOldData() is fixed | Вернуть, тестируем ли мы Varien_Object, где исправлен баг в unsetOldData() | protected static function _isFixedBugWithOldDataNullKey()
{
if (!defined('TESTS_MAGENTO_PATH')) {
return true; // php_mage extension has non-buggy functionality
}
$reflectionMethod = new ReflectionMethod('Varien_Object', 'unsetOldData');
$sourceClass = file($reflectionMethod->getFileName());
$sourceMethod = array_slice($sourceClass, $reflectionMethod->getStartLine(),
$reflectionMethod->getEndLine() - $reflectionMethod->getStartLine());
$source = implode("\n", $sourceMethod);
return strpos($source, '$this->_oldFieldsMap') !== false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function changelog_validate_object () {\n\t\t# set valid objects\n\t\t$objects = array(\n\t\t\t\t\t\t\"ip_addr\",\n\t\t\t\t\t\t\"subnet\",\n\t\t\t\t\t\t\"section\"\n\t\t\t\t\t\t);\n\t\t# check\n\t\treturn in_array($this->object_type, $objects) ? true : false;\n\t}",
"protected function isUnchanged() {}",... | [
"0.6035578",
"0.595178",
"0.59030485",
"0.5902927",
"0.5800507",
"0.5791812",
"0.57532674",
"0.57275575",
"0.5698497",
"0.5694829",
"0.56756383",
"0.56614673",
"0.5654564",
"0.56535953",
"0.5642814",
"0.5601161",
"0.55899113",
"0.55794257",
"0.55789065",
"0.55774814",
"0.5559... | 0.72413844 | 0 |
DOES NOT SANITIZE: esc_attr for tests without loading WordPress | НЕ ПРОИЗВОДИТ ОЧИСТКУ: esc_attr для тестов без загрузки WordPress | function esc_attr($value) {
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function esc_attr( $text ) {\r\n\t$safe_text = wp_check_invalid_utf8( $text );\r\n\t$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\r\n\t/**\r\n\t * Filters a string cleaned and escaped for output in an HTML attribute.\r\n\t *\r\n\t * Text passed to esc_attr() is stripped of invalid or special characters\... | [
"0.7714346",
"0.7655529",
"0.7497903",
"0.7321529",
"0.7312101",
"0.69006974",
"0.6862679",
"0.6846908",
"0.6838206",
"0.67843723",
"0.67037374",
"0.66565704",
"0.6595387",
"0.6562398",
"0.6528609",
"0.6511456",
"0.6489237",
"0.64501077",
"0.64376867",
"0.6415322",
"0.6405743... | 0.77115417 | 1 |
Provides data for testTemplatePreprocessUpdateReport(). | Предоставляет данные для testTemplatePreprocessUpdateReport(). | public function providerTemplatePreprocessUpdateReport() {
return [
'$variables with data not set' => [
[],
],
'$variables with data as an interger' => [
['data' => 4],
],
'$variables with data as a string' => [
['data' => 'I am a string'],
],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function templateData()\n {\n return $this->templateData;\n }",
"public function templateData() {\n return array();\n }",
"protected function getTemplateData() {\r\n return $this->templateData;\r\n }",
"protected function preprocessData() {}",
"function prepareTemplateVars... | [
"0.5940317",
"0.5926782",
"0.5818001",
"0.57136965",
"0.56867206",
"0.5643051",
"0.56323236",
"0.56283516",
"0.55528146",
"0.55338997",
"0.54815525",
"0.5401672",
"0.54012936",
"0.5378693",
"0.537162",
"0.53187644",
"0.53041244",
"0.5270606",
"0.52558017",
"0.52430856",
"0.52... | 0.77148503 | 0 |
Practice from notes on Models: Retrieve all the books in descending order according to published date | Практика из заметок по моделям: Получить все книги в порядке убывания по дате публикации | public function getEx12() {
$books = \App\Book::orderBy('published','desc')->get();
$this->printBooks($books);
# Underlying SQL: select * from `books` order by `published` desc
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function latest_books()\n {\n //thiet lap rieng\n $this->paginate = array(\n 'fields' => array('id', 'title', 'slug', 'image', 'sale_price'),\n 'order' => array('created' => 'desc'),\n 'limit' => 8,\n 'contain'=> arra... | [
"0.664487",
"0.66268075",
"0.63996667",
"0.6333038",
"0.63007253",
"0.62964976",
"0.6257233",
"0.6132179",
"0.6080486",
"0.5959239",
"0.5945087",
"0.5939681",
"0.59193873",
"0.58530307",
"0.5847881",
"0.5840894",
"0.57964605",
"0.5785783",
"0.5782388",
"0.57759106",
"0.577208... | 0.72998583 | 0 |
Practice from notes on Models: Retrieve all the books published after 1950 | Практика из заметок по моделям: Получить все книги, опубликованные после 1950 года | public function getEx10() {
$books = \App\Book::where('published','>',1950)->get();
$this->printBooks($books);
# Underlying SQL: select * from `books` where `published` > '1950'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEx12() {\n $books = \\App\\Book::orderBy('published','desc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `published` desc\n\t}",
"function bm_get_books($all=false) {\n\n $now = time();\n $books = array();\n $data = @getXML(BMB... | [
"0.72562957",
"0.69154596",
"0.65214384",
"0.6507692",
"0.6353704",
"0.63432425",
"0.6179446",
"0.61784595",
"0.61729115",
"0.6163359",
"0.61611396",
"0.6026118",
"0.5979315",
"0.5978755",
"0.5978443",
"0.59604555",
"0.5953469",
"0.5950752",
"0.5942591",
"0.59336406",
"0.5920... | 0.79408365 | 0 |
A node is displayable through __toString() Displays all its children | Узел отображается через __toString() и отображает всех своих потомков | final public function __toString()
{
$ret = $this->getContent();
foreach ($this as $node) {
$ret .= PHP_EOL . (string)$node;
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ToString()\n {\n if ( $this->Level == 0 )\n {\n // This is the root node, only walk through children\n $out = \"\";\n foreach($this->ChildNodes as $node)\n $out .= $node->ToString();\n }\n else\n {\n // Print node depending of it's type\n $indent = str_repea... | [
"0.70736414",
"0.6942445",
"0.68213433",
"0.677516",
"0.67311156",
"0.6724975",
"0.6720872",
"0.67094123",
"0.6638178",
"0.6607054",
"0.65930605",
"0.65775317",
"0.65398896",
"0.65095794",
"0.64452183",
"0.6443773",
"0.6377824",
"0.63743883",
"0.62876564",
"0.62808686",
"0.62... | 0.7287501 | 0 |
Creates a query builder which get the term neighbors in hierarchy for this term (same parent). | Создает построитель запроса, который получает соседей термина в иерархии для этого термина (тот же родитель). | public function neighbors()
{
$parent = $this->parent;
$exclude = $this->term_id;
$query = static::where('term_id', '!=', $exclude);
return $parent ? $query->where('parent', $parent) : $query->whereNull('parent');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNodeTreeQueryBuilder()\n {\n $qb = $this->repository\n ->createQueryBuilder('c')\n ->select('c, p')\n ->leftJoin('c.parent', 'p')\n ->orderBy('c.lft');\n\n return $qb;\n }",
"public function get_neighbors()\n\t{\n\t\t// get parent... | [
"0.5459179",
"0.5322152",
"0.5216854",
"0.520977",
"0.5110506",
"0.510095",
"0.50065535",
"0.49941385",
"0.49413258",
"0.49358067",
"0.48979303",
"0.48816496",
"0.4859124",
"0.48404846",
"0.4839154",
"0.48387024",
"0.48383516",
"0.48220128",
"0.4820134",
"0.48043463",
"0.4797... | 0.7360482 | 0 |
/ / WP methods / Get the taxonomy labels. | // WP методы / Получение меток таксономий. | public function getLabelsAttribute()
{
return (get_taxonomy($this->name))->labels;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function acf_get_taxonomy_labels($taxonomies = array())\n{\n}",
"public function getTaxonomyTerms();",
"public function getTaxonomy()\n {\n return ucwords(\\Present::unslug($this->taxonomy));\n }",
"public function taxonomy();",
"function kulam_get_custom_taxonomy_labels( $name, $singular ) {\... | [
"0.82675576",
"0.7565901",
"0.6956691",
"0.68305755",
"0.67615193",
"0.6740723",
"0.67178845",
"0.67178845",
"0.67178845",
"0.6679489",
"0.6631996",
"0.6617115",
"0.65822595",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.6554932",
"0.655493... | 0.7698398 | 1 |