_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 83 13k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q249900 | MarketplaceWebService_Client.convertGetFeedSubmissionCount | validation | private function convertGetFeedSubmissionCount($request)
{
$parameters = array();
$parameters['Action'] = 'GetFeedSubmissionCount';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
... | php | {
"resource": ""
} |
q249901 | MarketplaceWebService_Client.convertGetReportList | validation | private function convertGetReportList($request)
{
$parameters = array();
$parameters['Action'] = 'GetReportList';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
$paramete... | php | {
"resource": ""
} |
q249902 | MarketplaceWebService_Client.convertGetFeedSubmissionResult | validation | private function convertGetFeedSubmissionResult($request)
{
$parameters = array();
$parameters['Action'] = 'GetFeedSubmissionResult';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
... | php | {
"resource": ""
} |
q249903 | MarketplaceWebService_Client.convertGetFeedSubmissionList | validation | private function convertGetFeedSubmissionList($request)
{
$parameters = array();
$parameters['Action'] = 'GetFeedSubmissionList';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
... | php | {
"resource": ""
} |
q249904 | MarketplaceWebService_Client.convertGetReportRequestList | validation | private function convertGetReportRequestList($request)
{
$parameters = array();
$parameters['Action'] = 'GetReportRequestList';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
... | php | {
"resource": ""
} |
q249905 | MarketplaceWebService_Client.convertManageReportSchedule | validation | private function convertManageReportSchedule($request)
{
$parameters = array();
$parameters['Action'] = 'ManageReportSchedule';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
... | php | {
"resource": ""
} |
q249906 | MarketplaceWebService_Client.convertGetReportRequestCount | validation | private function convertGetReportRequestCount($request)
{
$parameters = array();
$parameters['Action'] = 'GetReportRequestCount';
if ($request->isSetMarketplace()) {
$parameters['Marketplace'] = $request->getMarketplace();
}
if ($request->isSetMerchant()) {
... | php | {
"resource": ""
} |
q249907 | FBAInboundServiceMWS_Model_InvalidASINList.setInvalidASIN | validation | public function setInvalidASIN($value)
{
if (!$this->_isNumericArray($value)) {
$value = array($value);
}
$this->_fields['InvalidASIN']['FieldValue'] = $value;
return $this;
} | php | {
"resource": ""
} |
q249908 | MarketplaceWebServiceProducts_Model_MessageList.setMessage | validation | public function setMessage($value)
{
if (!$this->_isNumericArray($value)) {
$value = array($value);
}
$this->_fields['Message']['FieldValue'] = $value;
return $this;
} | php | {
"resource": ""
} |
q249909 | MarketplaceWebServiceProducts_Model_GetProductCategoriesForASINResult.setSelf | validation | public function setSelf($value)
{
if (!$this->_isNumericArray($value)) {
$value = array($value);
}
$this->_fields['Self']['FieldValue'] = $value;
return $this;
} | php | {
"resource": ""
} |
q249910 | CleanAssetsCommand.computeFileSystemDifferences | validation | protected function computeFileSystemDifferences()
{
$entityPathByFilesystems = [];
foreach ($this->resourceManager->getResourceConfigurations() as $resourceConfiguration) {
$className = $resourceConfiguration->getEntity();
$entityManager = $this->doctrine->getManagerForClass(... | php | {
"resource": ""
} |
q249911 | Bag.fromRecursive | validation | public static function fromRecursive($collection)
{
$arr = Arr::from($collection);
foreach ($arr as $key => $value) {
if ($value instanceof stdClass || \is_iterable($value)) {
$value = static::fromRecursive($value);
}
$arr[$key] = $value;
... | php | {
"resource": ""
} |
q249912 | Bag.combine | validation | public static function combine($keys, $values)
{
$keys = Arr::from($keys);
$values = Arr::from($values);
if (count($keys) !== count($values)) {
throw new InvalidArgumentException('The size of keys and values needs to be the same.');
}
if (count($keys) === 0) {
... | php | {
"resource": ""
} |
q249913 | Bag.iterateFromIndex | validation | private function iterateFromIndex($fromIndex)
{
Assert::integer($fromIndex);
$count = count($this->items);
if ($count === 0) {
return;
}
$last = $count - 2;
$index = $fromIndex < 0 ? max($last + $fromIndex, -1) : min($fromIndex - 1, $last);
$k... | php | {
"resource": ""
} |
q249914 | Bag.iterateReverseFromIndex | validation | private function iterateReverseFromIndex($fromIndex)
{
Assert::nullOrInteger($fromIndex);
$index = count($this->items);
if ($index === 0) {
return;
}
if ($fromIndex !== null) {
$index = $fromIndex < 0 ? max($index + $fromIndex, 1) : min($fromIndex +... | php | {
"resource": ""
} |
q249915 | Bag.mapKeys | validation | public function mapKeys(callable $callback)
{
$items = [];
foreach ($this->items as $key => $value) {
$items[$callback($key, $value)] = $value;
}
return $this->createFrom($items);
} | php | {
"resource": ""
} |
q249916 | Bag.merge | validation | public function merge($list)
{
return $this->createFrom(array_merge($this->items, Arr::from($list)));
} | php | {
"resource": ""
} |
q249917 | Bag.flip | validation | public function flip()
{
if (!$this->items) {
return $this->createFrom([]);
}
try {
return $this->createFrom(Thrower::call('array_flip', $this->items));
} catch (ErrorException $e) {
throw new LogicException('Only string and integer values can be f... | php | {
"resource": ""
} |
q249918 | Bag.unique | validation | public function unique()
{
$items = [];
foreach ($this->items as $item) {
if (array_search($item, $items, true) === false) {
$items[] = $item;
}
}
return $this->createFrom($items);
} | php | {
"resource": ""
} |
q249919 | Bag.chunk | validation | public function chunk($size, $preserveKeys = false)
{
$create = function ($items) {
return $this->createFrom($items);
};
return $this->createFrom(array_map($create, array_chunk($this->items, $size, $preserveKeys)));
} | php | {
"resource": ""
} |
q249920 | Bag.sort | validation | public function sort($order = SORT_ASC, $flags = SORT_REGULAR, $preserveKeys = false)
{
$this->validateSortArgs($order, $flags);
$items = $this->items;
if (!$preserveKeys) {
if ($order === SORT_ASC) {
sort($items, $flags);
} elseif ($order === SORT_D... | php | {
"resource": ""
} |
q249921 | Bag.sortKeys | validation | public function sortKeys($order = SORT_ASC, $flags = SORT_REGULAR)
{
$this->validateSortArgs($order, $flags);
$items = $this->items;
if ($order === SORT_ASC) {
ksort($items, $flags);
} else {
krsort($items, $flags);
}
return $this->createFro... | php | {
"resource": ""
} |
q249922 | Bag.set | validation | public function set($key, $value)
{
Deprecated::method(1.1, MutableBag::class);
$this->items[$key] = $value;
} | php | {
"resource": ""
} |
q249923 | Bag.setPath | validation | public function setPath($path, $value)
{
Deprecated::method(1.1, MutableBag::class);
Arr::set($this->items, $path, $value);
} | php | {
"resource": ""
} |
q249924 | Arr.from | validation | public static function from($iterable)
{
if (is_array($iterable)) {
return $iterable;
}
// Don't mean to play favorites, but want to optimize where we can.
if ($iterable instanceof ImmutableBag) {
return $iterable->toArray();
}
if ($iterable in... | php | {
"resource": ""
} |
q249925 | Arr.fromRecursive | validation | public static function fromRecursive($iterable)
{
$arr = static::from($iterable);
foreach ($arr as $key => $value) {
if ($value instanceof \stdClass || \is_iterable($value)) {
$value = static::fromRecursive($value);
}
$arr[$key] = $value;
... | php | {
"resource": ""
} |
q249926 | Arr.set | validation | public static function set(&$data, $path, $value)
{
Assert::isArrayAccessible($data);
Assert::stringNotEmpty($path);
$queue = explode('/', $path);
// Optimization for simple sets.
if (count($queue) === 1) {
if ($path === '[]') {
$data[] = $value;
... | php | {
"resource": ""
} |
q249927 | Arr.remove | validation | public static function remove(&$data, $path, $default = null)
{
if (!static::$unsetMarker) {
static::$unsetMarker = new \stdClass();
}
// Call get() with special default value so we can know if the key exists without calling has()
$value = static::get($data, $path, stati... | php | {
"resource": ""
} |
q249928 | Arr.replaceRecursive | validation | public static function replaceRecursive($iterable1, $iterable2)
{
Assert::allIsIterable([$iterable1, $iterable2]);
if ($iterable1 instanceof Traversable) {
$iterable1 = iterator_to_array($iterable1);
}
if ($iterable2 instanceof Traversable) {
$iterable2 = ite... | php | {
"resource": ""
} |
q249929 | Arr.canReturnArraysByReference | validation | private static function canReturnArraysByReference(ArrayAccess $obj, $key, &$value, &$ex)
{
static $supportedClasses = [
// Add our classes by default to help with performance since we can
Bag::class => true, // but deprecated
MutableBag::class ... | php | {
"resource": ""
} |
q249930 | Arr.doFlatten | validation | private static function doFlatten($iterable, $depth, callable $predicate, array $result = [])
{
foreach ($iterable as $item) {
if ($depth >= 1 && $predicate($item)) {
$result = static::doFlatten($item, $depth - 1, $predicate, $result);
} else {
$result... | php | {
"resource": ""
} |
q249931 | Circle.validateElementValues | validation | protected function validateElementValues() {
// Iterate over all fields
foreach ( self::$mandatoryFields as $field ) {
// If the field does not exist then exit with exception
if ( array_key_exists($field, $this->attributes) ) {
$value = (int) $this->attributes[$field];
... | php | {
"resource": ""
} |
q249932 | ScriptHandler.symlinkJQueryFileUpload | validation | public static function symlinkJQueryFileUpload(Event $event)
{
$IO = $event->getIO();
$composer = $event->getComposer();
$cmanager = new ComposerPathFinder($composer);
$ds = DIRECTORY_SEPARATOR;
$options = [
'targetSuffix' => self::getTargetSuffix('jquery-file-upl... | php | {
"resource": ""
} |
q249933 | ScriptHandler.checkSymlink | validation | public static function checkSymlink($symlinkTarget, $symlinkName, $forceSymlink = false)
{
if ($forceSymlink && file_exists($symlinkName) && !is_link($symlinkName)) {
if ('link' !== filetype($symlinkName)) {
throw new \UnexpectedValueException("{$symlinkName} exists and is not a ... | php | {
"resource": ""
} |
q249934 | ScriptHandler.createSymlink | validation | public static function createSymlink($symlinkTarget, $symlinkName)
{
if (false === @symlink($symlinkTarget, $symlinkName)) {
throw new \UnexpectedValueException("An error occurred while creating symlink '{$symlinkName}'");
}
if (false === $target = readlink($symlinkName)) {
... | php | {
"resource": ""
} |
q249935 | BinarySizeUtility.parse | validation | public static function parse($size, $fallbackUnits = null)
{
preg_match('/^(\d+)[.,]?(\d*)\s*(\w*)$/', $size, $matches);
if (empty($matches[1]) || (empty($matches[3]) && null === $fallbackUnits)) {
throw new \UnexpectedValueException("Unable to parse : '{$size}'");
}
$oSi... | php | {
"resource": ""
} |
q249936 | BinarySizeUtility.format | validation | public static function format($size, $decimals = 2, $decPoint = '.', $thousandsSep = '', $unitSep = '')
{
$output = $unit = null;
foreach (self::getBinarySizes() as $unit => $divider) {
$output = $size / $divider;
if ($output < 1000) {
break;
}
... | php | {
"resource": ""
} |
q249937 | ConfigureCommand.handle | validation | public function handle()
{
$config = $this->option('config');
if (!$config) {
throw new Exception('Config option is required.');
}
$configPath = realpath($config);
if (!file_exists($configPath)) {
throw new Exception('Configuration file not found.')... | php | {
"resource": ""
} |
q249938 | Element.validateMandatoryAttribs | validation | protected function validateMandatoryAttribs() {
// Iterate over all fields
foreach ( static::$mandatoryFields as $field ) {
// If the field does not exist then exit with exception
if ( !array_key_exists($field, $this->attributes) ) {
throw new \SVGCreator\SVGException("The field " . $fiel... | php | {
"resource": ""
} |
q249939 | Element.attr | validation | public function attr($attrKey, $attrValue = null) {
if ( !is_null($attrValue) ) {
if ( !is_array($this->attributes) ) {
$this->attributes = array();
}
$this->attributes[$attrKey] = $attrValue;
return $this;
} else {
if ( array_key_exists($attrKey, $this->attributes) ) {
return $this-... | php | {
"resource": ""
} |
q249940 | Element.factoryElement | validation | private function factoryElement($type) {
switch ( $type ) {
case \SVGCreator\Element::CIRCLE:
return new \SVGCreator\Elements\Circle();
break;
case \SVGCreator\Element::DEFS:
return new \SVGCreator\Elements\Defs();
break;
case \SVGCreator\Element::GROUP:
return new \SVGCreator\El... | php | {
"resource": ""
} |
q249941 | Element.append | validation | public function append($element) {
if ( true === $element instanceof \SVGCreator\Element ) {
$this->childElements[] = $element;
return $element;
} else {
$elementCreated = $this->factoryElement($element);
$this->childElements[] = $elementCreated;
return $elementCreated;
}
} | php | {
"resource": ""
} |
q249942 | Element.getString | validation | public function getString() {
// Validate the element first of all!
$this->validateElement();
// Start writing the tag
$elementStringData = '';
$elementStringData = '<' . static::TYPE;
foreach ( $this->attributes as $key => $data ) {
$elementStringData .= ' ' . $key . '="' . $data . '"';
}
... | php | {
"resource": ""
} |
q249943 | Element.saveElementAsFile | validation | public function saveElementAsFile($fileName) {
// Get the element string
$this->getString();
if ( false === file_put_contents($fileName, $this->elementString) ) {
return false;
} else {
return $fileName;
}
} | php | {
"resource": ""
} |
q249944 | CmsThemeServiceProvider.registerViewComposers | validation | protected function registerViewComposers()
{
$core = $this->getCore();
view()->composer($core->config('views.menu'), MenuComposer::class);
view()->composer($core->config('views.top'), TopComposer::class);
return $this;
} | php | {
"resource": ""
} |
q249945 | TranslatableScope.apply | validation | public function apply(EloquentBuilder $builder, Eloquent $model)
{
$this->table = $model->getTable();
$this->locale = $model->getLocale();
$this->i18nTable = $model->getI18nTable();
$this->fallback = $model->getFallbackLocale();
if(!starts_with($this->table, 'laravel_reserve... | php | {
"resource": ""
} |
q249946 | TranslatableScope.extend | validation | public function extend(EloquentBuilder $builder)
{
$builder->macro('onlyTranslated', function (EloquentBuilder $builder, $locale = null) {
$builder->getModel()->setOnlyTranslated(true);
if($locale) {
$builder->getModel()->setLocale($locale);
}
... | php | {
"resource": ""
} |
q249947 | FolderDropdownField.setLastFolderID | validation | public function setLastFolderID($folderID)
{
$request = Controller::curr()->getRequest();
$session = $request->getSession();
$session->set(get_class() . '.FolderID', $folderID);
} | php | {
"resource": ""
} |
q249948 | FolderDropdownField.getLastFolderID | validation | public function getLastFolderID()
{
$request = Controller::curr()->getRequest();
$session = $request->getSession();
return $session->get(self::class . '.FolderID');
} | php | {
"resource": ""
} |
q249949 | QueryBuilder.select | validation | public function select($columns = ['*'])
{
parent::select($columns);
$this->columns = $this->qualifyColumns($this->columns);
return $this;
} | php | {
"resource": ""
} |
q249950 | QueryBuilder.qualifyColumns | validation | protected function qualifyColumns($columns)
{
foreach($columns as &$column) {
if(!in_array($column, $this->model->translatableAttributes())) {
continue;
}
$primary = $this->qualifyTranslationColumn($column);
$fallback = $this->qualifyTranslati... | php | {
"resource": ""
} |
q249951 | QueryBuilder.where | validation | public function where($column, $operator = null, $value = null, $boolean = 'and')
{
// If the column is an array, we will assume it is an array of key-value pairs
// and can add them each as a where clause. We will maintain the boolean we
// received when the method was called and pass it in... | php | {
"resource": ""
} |
q249952 | QueryBuilder.whereOriginal | validation | public function whereOriginal($column, $operator = null, $value = null, $boolean = 'and')
{
return parent::where($column, $operator, $value, $boolean);
} | php | {
"resource": ""
} |
q249953 | QueryBuilder.whereTranslated | validation | public function whereTranslated($column, $operator = null, $value = null, $boolean = 'and')
{
// Here we will make some assumptions about the operator. If only 2 values are
// passed to the method, we will assume that the operator is an equals sign
// and keep going. Otherwise, we'll require... | php | {
"resource": ""
} |
q249954 | QueryBuilder.orWhereTranslated | validation | public function orWhereTranslated($column, $operator = null, $value = null)
{
return $this->whereTranslated($column, $operator, $value, 'or');
} | php | {
"resource": ""
} |
q249955 | QueryBuilder.whereSubQuery | validation | public function whereSubQuery($column, $query, $boolean = 'and')
{
list($type, $operator) = ['Sub', 'in'];
$this->wheres[] = compact('type', 'column', 'operator', 'query', 'boolean');
$this->addBinding($query->getBindings(), 'where');
return $this;
} | php | {
"resource": ""
} |
q249956 | ApiBase.getAccessToken | validation | public function getAccessToken(): ApiAccessToken
{
try {
$accessToken = $this->tokenStorage->getAccessToken();
} catch (UnableToAcquireAccessToken $e) {
$accessToken = null;
}
if ($accessToken && $accessToken->isExpired()) {
$this->tokenStorage->u... | php | {
"resource": ""
} |
q249957 | Translatable.createInLocale | validation | public static function createInLocale($locale, array $attributes = [], $translations = [])
{
$model = (new static($attributes))->setLocale($locale);
if ($model->save() && is_array($translations)) {
$model->saveTranslations($translations);
}
return $model;
} | php | {
"resource": ""
} |
q249958 | Translatable.forceCreate | validation | public static function forceCreate(array $attributes, $translations = [])
{
$model = new static;
return static::unguarded(function () use ($model, $attributes, $translations){
return $model->create($attributes, $translations);
});
} | php | {
"resource": ""
} |
q249959 | Translatable.forceCreateInLocale | validation | public static function forceCreateInLocale($locale, array $attributes, $translations = [])
{
$model = new static;
return static::unguarded(function () use ($locale, $model, $attributes, $translations){
return $model->createInLocale($locale, $attributes, $translations);
});
} | php | {
"resource": ""
} |
q249960 | Translatable.fresh | validation | public function fresh($with = [])
{
if (!$this->exists) {
return;
}
$query = static::newQueryWithoutScopes()
->with(is_string($with) ? func_get_args() : $with)
->where($this->getKeyName(), $this->getKey());
(new TranslatableScope())->apply($query... | php | {
"resource": ""
} |
q249961 | Translatable.initTranslatableAttributes | validation | protected function initTranslatableAttributes()
{
if (property_exists($this, 'translatable')) {
$attributes = $this->translatable;
}else {
$attributes = $this->getTranslatableAttributesFromSchema();
}
static::$i18nAttributes[$this->getTable()] = $attributes;
... | php | {
"resource": ""
} |
q249962 | Translatable.getTranslatableAttributesFromSchema | validation | protected function getTranslatableAttributesFromSchema()
{
if ((!$con = $this->getConnection()) || (!$builder = $con->getSchemaBuilder())) {
return [];
}
if ($columns = TranslatableConfig::cacheGet($this->getI18nTable())) {
return $columns;
}
$column... | php | {
"resource": ""
} |
q249963 | Translatable.translate | validation | public function translate($locale)
{
$found = $this->translations->where($this->getLocaleKey(), $locale)->first();
if (!$found && $this->shouldFallback($locale)) {
return $this->translate($this->getFallbackLocale());
}
return $found;
} | php | {
"resource": ""
} |
q249964 | Translatable.translateOrNew | validation | public function translateOrNew($locale)
{
if (is_null($instance = $this->translate($locale))) {
return $this->newModelInstance();
}
return $instance;
} | php | {
"resource": ""
} |
q249965 | Translatable.translations | validation | public function translations()
{
$localKey = $this->getKeyName();
$foreignKey = $this->getForeignKey();
$instance = $this->translationModel();
return new HasMany($instance->newQuery(), $this, $instance->getTable() . '.' . $foreignKey, $localKey);
} | php | {
"resource": ""
} |
q249966 | Translatable.translationModel | validation | public function translationModel()
{
$translation = new TranslationModel();
$translation->setConnection($this->getI18nConnection());
$translation->setTable($this->getI18nTable());
$translation->setKeyName($this->getForeignKey());
$translation->setLocaleKey($this->getLocaleKey... | php | {
"resource": ""
} |
q249967 | Translatable.shouldFallback | validation | public function shouldFallback($locale = null)
{
if (!$this->getWithFallback() || !$this->getFallbackLocale()) {
return false;
}
$locale = $locale ?: $this->getLocale();
return $locale != $this->getFallbackLocale();
} | php | {
"resource": ""
} |
q249968 | Translatable.getDirty | validation | public function getDirty()
{
$dirty = parent::getDirty();
if (!$this->localeChanged) {
return $dirty;
}
foreach ($this->translatableAttributes() as $key) {
if (isset($this->attributes[$key])) {
$dirty[$key] = $this->attributes[$key];
... | php | {
"resource": ""
} |
q249969 | SelectUploadField.changeFolder | validation | public function changeFolder(HTTPRequest $request)
{
// CSRF check
$token = $this->getForm()->getSecurityToken();
if (!$token->checkRequest($request)) {
return $this->httpError(400);
}
$folderID = $request->postVar('FolderID');
if ($folderID) {
... | php | {
"resource": ""
} |
q249970 | SelectUploadField.updateFolderName | validation | protected function updateFolderName(HTTPRequest $request)
{
// check if allowed to select folder
if (!$this->getCanSelectFolder()) {
return;
}
// Get path from upload
$folderID = $request->requestVar("{$this->Name}/folder");
$path = $this->folderPathFromI... | php | {
"resource": ""
} |
q249971 | SelectUploadField.getCanSelectFolder | validation | public function getCanSelectFolder()
{
if (!$this->isActive()) {
return false;
}
if ($this->template && in_array($this->template, self::config()->disable_for_templates)) {
return false;
}
// Check config
$can = $this->canSelectFolder;
r... | php | {
"resource": ""
} |
q249972 | Server.whitelist | validation | public function whitelist(string $address): WhitelistResponse
{
try {
$response = $this->callHydroApi(
'post',
'whitelist',
[
'timeout' => 60,
'json' => [
'address' => $address
... | php | {
"resource": ""
} |
q249973 | Server.challenge | validation | public function challenge(string $hydroAddressId): ChallengeResponse
{
try {
$response = $this->callHydroApi(
'post',
'challenge',
[
'json' => [
'hydro_address_id' => $hydroAddressId
]... | php | {
"resource": ""
} |
q249974 | Builder.update | validation | public function update(array $values)
{
$updated = 0;
$modelKey = $this->getModel()->getKey();
$modelKeyName = $this->model->getKeyName();
$values = $this->addUpdatedAtColumn($values);
list($values, $i18nValues) = $this->filterValues($values);
$ids = $modelKey ? [$... | php | {
"resource": ""
} |
q249975 | Builder.increment | validation | public function increment($column, $amount = 1, array $extra = [])
{
$extra = $this->addUpdatedAtColumn($extra);
return $this->noTranslationsQuery()->increment($column, $amount, $extra);
} | php | {
"resource": ""
} |
q249976 | Builder.decrement | validation | public function decrement($column, $amount = 1, array $extra = [])
{
$extra = $this->addUpdatedAtColumn($extra);
return $this->noTranslationsQuery()->decrement($column, $amount, $extra);
} | php | {
"resource": ""
} |
q249977 | Builder.insert | validation | public function insert(array $values)
{
list($values, $i18nValues) = $this->filterValues($values);
if($this->query->insert($values)) {
return $this->insertI18n($i18nValues, $values[$this->model->getKeyName()]);
}
} | php | {
"resource": ""
} |
q249978 | Builder.insertGetId | validation | public function insertGetId(array $values, $sequence = null)
{
list($values, $i18nValues) = $this->filterValues($values);
if($id = $this->query->insertGetId($values, $sequence)) {
if($this->insertI18n($i18nValues, $id)) {
return $id;
}
}
retu... | php | {
"resource": ""
} |
q249979 | Builder.filterValues | validation | protected function filterValues(array $values)
{
$attributes = $this->model->translatableAttributes();
$translatable = [];
foreach($attributes as $key) {
if(array_key_exists($key, $values)) {
$translatable[$key] = $values[$key];
unset($values[$k... | php | {
"resource": ""
} |
q249980 | Builder.updateBase | validation | private function updateBase(array $values, array $ids)
{
$query = $this->model->newQuery()
->whereIn($this->model->getKeyName(), $ids)
->getQuery();
return $query->update($values);
} | php | {
"resource": ""
} |
q249981 | Builder.i18nQuery | validation | public function i18nQuery()
{
$query = $this->getModel()->newQueryWithoutScopes()->getQuery();
$query->from($this->model->getI18nTable());
return $query;
} | php | {
"resource": ""
} |
q249982 | Builder.i18nDeleteQuery | validation | protected function i18nDeleteQuery($withGlobalScopes = true)
{
$subQuery = $withGlobalScopes ? $this->toBase() : $this->getQuery();
$subQuery->select($this->model->getQualifiedKeyName());
return $this->i18nQuery()->whereIn(
$this->model->getForeignKey(), $subQuery->pluck($this->... | php | {
"resource": ""
} |
q249983 | TranslationModel.setKeysForSaveQuery | validation | protected function setKeysForSaveQuery(EloquentBuilder $query)
{
$query->where($this->getKeyName(), '=', $this->getKeyForSaveQuery());
$query->where($this->localeKey, '=', $this->{$this->localeKey});
return $query;
} | php | {
"resource": ""
} |
q249984 | Listener.start | validation | public function start()
{
$this->eventDispatcher->addListener(
'key:stop:listening',
function () {
$this->isListening = false;
}
);
$this->resetListener()
->overrideReadlineHandler()
->runLoop()
->restor... | php | {
"resource": ""
} |
q249985 | Listener.runLoop | validation | protected function runLoop()
{
while ($this->isListening) {
$this->stream->select();
// special key sequence has started
if (true === $this->charSequenceEnabled && null !== $this->escapePressedAt) {
if ($this->escapeKeyHasExpired()) {
... | php | {
"resource": ""
} |
q249986 | Listener.resetListener | validation | protected function resetListener()
{
$this->currentKey = null;
$this->escapePressedAt = null;
$this->charSequenceEnabled = false;
$this->isListening = true;
return $this;
} | php | {
"resource": ""
} |
q249987 | Detector.getListenerInstance | validation | public function getListenerInstance(EventDispatcher $eventDispatcher = null, StreamableInterface $stream = null)
{
//instantiate the key matcher object
$reflection = new \ReflectionClass('\\Iber\\Phkey\\Environment\\' . $this->getEnvironment() . '\\Matcher');
$matcher = $reflection->newInsta... | php | {
"resource": ""
} |
q249988 | Stream.select | validation | public function select()
{
$read = [$this->stream];
$write = null;
$except = null;
// if the process gets a system signal before the timeout is ran
// a warning is thrown therefore we need to suppress the warning
$this->selected = @stream_select(
$read,
... | php | {
"resource": ""
} |
q249989 | ObjectDefinition.addMethodCall | validation | public function addMethodCall($methodName, array $arguments = array())
{
$this->actions[] = $methodCall = new MethodCall($methodName, $arguments);
return $methodCall;
} | php | {
"resource": ""
} |
q249990 | ServiceProviderLoader.loadFromRegistry | validation | public function loadFromRegistry(Registry $registry)
{
foreach ($registry as $key => $serviceProvider) {
$this->loadServiceProviderFactories($serviceProvider, $key);
}
foreach ($registry as $key => $serviceProvider) {
$this->loadServiceProviderExtensions($serviceProvi... | php | {
"resource": ""
} |
q249991 | ValueUtils.dumpValue | validation | public static function dumpValue($value, $containerVariable, array $usedVariables): InlineEntryInterface
{
if (is_array($value)) {
return self::dumpArray($value, $containerVariable, $usedVariables);
} elseif ($value instanceof ReferenceInterface) {
return self::dumpReference(... | php | {
"resource": ""
} |
q249992 | Parser.addCurrentMessage | validation | private function addCurrentMessage()
{
if ($this->currentMessage->hasTranslation()) {
$this->messages[] = $this->currentMessage;
$this->currentMessage = new Message();
}
} | php | {
"resource": ""
} |
q249993 | Compiler.addDefinition | validation | public function addDefinition($identifier, DefinitionInterface $definition)
{
$this->definitions[$identifier] = $definition;
unset($this->dumpableDefinitions[$identifier]);
} | php | {
"resource": ""
} |
q249994 | Compiler.register | validation | public function register(DefinitionProviderInterface $definitionProvider)
{
foreach ($definitionProvider->getDefinitions() as $identifier => $definition) {
$this->addDefinition($identifier, $definition);
}
} | php | {
"resource": ""
} |
q249995 | Master.start | validation | public function start($block = true, $interval = 100)
{
$loop = $this->loop;
$this->pool = new ParallelPool(function () use ($loop) {
$loop->run();
}, $this->count);
$this->pool->start();
$this->pool->keep($block, $interval);
} | php | {
"resource": ""
} |
q249996 | TrackerFactory.buildTracker | validation | public function buildTracker($numItems = Tracker::UNKNOWN, array $extraSubscribers = [])
{
$tracker = new Tracker($numItems);
foreach (array_merge($this->defaultSubscribers, $extraSubscribers) as $listener) {
$tracker->getDispatcher()->addSubscriber($listener);
}
return... | php | {
"resource": ""
} |
q249997 | Tracker.build | validation | public static function build(array $subscribers = [], $totalItems = self::UNKNOWN)
{
// New object
$that = new static($totalItems);
// Register subscribers
foreach ($subscribers as $subscriber) {
$that->addSubscriber($subscriber);
}
// Return it
... | php | {
"resource": ""
} |
q249998 | Tracker.run | validation | public function run(\Traversable $items, callable $itemCallback)
{
$this->start();
foreach ($items as $item) {
call_user_func($itemCallback, $this, $item);
}
return $this->finish();
} | php | {
"resource": ""
} |
q249999 | Tracker.tick | validation | public function tick($status = Tick::SUCCESS, $msg = null, array $extraInfo = [], $incrementBy = 1)
{
if ( ! $this->isRunning()) {
$this->start();
}
$tick = new Tick($this, $status, $msg, $extraInfo, $incrementBy);
// Increment the counter
if (array_key_exists($t... | php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.