_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q10100
Picture.resize
train
public function resize($width, $height = NULL, $resizeMode = NULL) { if(!$height) { $height = $width; } $this->effect[] = new Resize($width, $height, $resizeMode); }
php
{ "resource": "" }
q10101
Picture.setProgressive
train
public function setProgressive($progressive = TRUE) { if(is_bool($progressive)) { $this->progressive = $progressive; } else { trigger_error('Picture progressive mode must be boolean', E_USER_WARNING); } }
php
{ "resource": "" }
q10102
Picture.save
train
public function save($file = NULL) { if(is_null($file) && $this->storage) { $this->storage->save($this); } elseif(!is_null($file)) { $this->savePicture($file); } else { trigger_error('Image file to save is not define...
php
{ "resource": "" }
q10103
Picture.output
train
public function output() { $imageFile = $this->storage->getPath($this); if(file_exists($imageFile)) { header('Content-Type: image'); header('Content-Length: ' . filesize($imageFile)); readfile($imageFile); exit; } }
php
{ "resource": "" }
q10104
Picture.getUrl
train
public function getUrl() { if($this->storage) { $this->save(); return $this->storage->getUrl($this); } return NULL; }
php
{ "resource": "" }
q10105
Picture.getDimensions
train
public function getDimensions() { $imageDimension = getimagesize($this->image); $width = $imageDimension[0]; $height = $imageDimension[1]; foreach($this->effect as $effect) { if($effect instanceof PictureEffect) { $modified = $effect...
php
{ "resource": "" }
q10106
Transformation.perspective
train
public function perspective($dx1, $dy1, $dx2, $dy2, $dx3, $dy3, $dx4, $dy4, $sx1 = null, $sy1 = null, $sx2 = null, $sy2 = null, $sx3 = null, $sy3 = null, $sx4 = null, $sy4 = null) { if (!is_null($sx1) || !is_null($sy1) || !is_null($sx2) || !is_null($sy2) || !is_null($sx3) || !is_null($sy3) || !is_null($sx4)...
php
{ "resource": "" }
q10107
Transformation.border
train
public function border($top, $right = null, $bottom = null, $left = null) { return $this->addItem('border', implode(',', func_get_args())); }
php
{ "resource": "" }
q10108
Transformation.round
train
public function round($topLeft, $topRight = null, $bottomRight = null, $bottomLeft = null) { return $this->addItem('ro', implode(',', func_get_args())); }
php
{ "resource": "" }
q10109
Transformation.jpegoptim
train
public function jpegoptim($quality = null) { return $quality === null ? $this->addItem('q', 'jpegoptim') : $this->addItem('q', 'jpegoptim', $quality); }
php
{ "resource": "" }
q10110
Transformation.addItem
train
private function addItem() { $args = func_get_args(); if (in_array($args[0], self::$appendableTransformations)) { $i = $this->findLastTransformation($args[0]); if ($i !== false) { $this->items[$i]['rendered'] .= ','.implode(':', array_slice($args, 1)); ...
php
{ "resource": "" }
q10111
Transformation.render
train
private function render() { $transformation = implode('_', array_column($this->items, 'rendered')); $transformation = preg_replace('#(_?/_?)+#isu', '/', $transformation); $transformation = trim($transformation, '/_'); return $transformation; }
php
{ "resource": "" }
q10112
Socket.stopHeartbeat
train
private function stopHeartbeat() { if ($this->hTimer !== null) { $this->hTimer->cancel(); $this->hTimer = null; } }
php
{ "resource": "" }
q10113
Socket.clearConnectionPool
train
private function clearConnectionPool() { $deleted = $this->connectionPool->removeInvalid(); foreach ($deleted as $deletedid) { $this->emit('disconnect', [ $deletedid ]); } }
php
{ "resource": "" }
q10114
Socket.startTimeRegister
train
private function startTimeRegister() { if ($this->rTimer === null && $this->flags['enableHeartbeat'] === true && $this->flags['enableTimeRegister'] === true) { $proxy = $this; $this->rTimer = $this->loop->addPeriodicTimer(($this->options['timeRegisterInterval']/1000), functio...
php
{ "resource": "" }
q10115
Socket.stopTimeRegister
train
private function stopTimeRegister() { if ($this->rTimer !== null) { $this->rTimer->cancel(); $this->rTimer = null; $this->connectionPool->resetNow(); } }
php
{ "resource": "" }
q10116
Enum.read
train
public function read(AbstractStream $stream) { $key = parent::read($stream); $values = $this->getValues(); if (array_key_exists($key, $values)) { $value = $values[$key]; } else { $value = $this->getDefault(); } if ($value === null) { ...
php
{ "resource": "" }
q10117
Shareable.all
train
public function all() { $defaultButtons = Config::get('shareable::default_buttons', array()); $buttons = array(); $output = ''; foreach ($defaultButtons as $button) { $buttons[] = call_user_func(array($this, $button)); } return $this->view->make('shareab...
php
{ "resource": "" }
q10118
StrictPasswordBehavior.buildValidator
train
public function buildValidator(Event $event, Validator $validator, string $name): void { $this->validationStrictPassword($validator); }
php
{ "resource": "" }
q10119
StrictPasswordBehavior.validationStrictPassword
train
public function validationStrictPassword(Validator $validator): Validator { $validator ->add('password', [ 'minLength' => [ 'rule' => ['minLength', $this->getConfig('minPasswordLength')], 'last' => true, 'message' => __d...
php
{ "resource": "" }
q10120
StrictPasswordBehavior.checkForUserName
train
public function checkForUserName(string $value, array $context): bool { // return true if config is not set if (empty($this->getConfig('noUserName'))) { return true; } // Get Config $firstNameField = $this->getConfig('userNameFields.firstname'); $lastNameF...
php
{ "resource": "" }
q10121
StrictPasswordBehavior.checkLastPasswords
train
public function checkLastPasswords(string $value, array $context): bool { // return true if config is not set if (empty($this->getConfig('oldPasswordCount'))) { return true; } // ignore on new user if (empty($context['data']['id'])) { return true; ...
php
{ "resource": "" }
q10122
StrictPasswordBehavior.beforeSave
train
public function beforeSave(Event $event, EntityInterface $entity): bool { if (empty($this->getConfig('oldPasswordCount')) || !is_numeric($this->getConfig('oldPasswordCount'))) { return true; } if (!is_array($entity->last_passwords)) { $entity->last_passwords = []; ...
php
{ "resource": "" }
q10123
RemoteProcessFactory.spawnProcess
train
protected static function spawnProcess(string $cmd, array $spec, ?array & $pipes, ?string $dir = null, ?array $env = null, bool $bypassShell = false) { return @\proc_open($cmd, $spec, $pipes, $dir, $env, $bypassShell ? [ 'bypass_shell' => true ] : []); }
php
{ "resource": "" }
q10124
UserController.store
train
public function store(StoreUserRequest $request, Repository $config) { $this->dispatch(new RegisterUser($request->get('name'), $request->get('email'), $request->get('password'))); return redirect($config->get('authentication.registration.redirectUri')); }
php
{ "resource": "" }
q10125
DatatablesEnabledControllerTrait.listAction
train
public function listAction(Request $request) { $manager = $this->getEntityManager(); $total_count = $manager->getTotalCount($request); $filtered_count = $manager->getFilteredCount($request); $entities = $manager->getEntities($request); return array_merge( $thi...
php
{ "resource": "" }
q10126
DatatablesEnabledControllerTrait.getFilter
train
protected function getFilter(Request $request) { if ($filter_type = $this->getEntityManager()->getFilterType($request)) { return $this->createForm($filter_type); } }
php
{ "resource": "" }
q10127
TypeAwareTrait.getTypeDescription
train
public static function getTypeDescription(?string $type): ?string { $descriptions = self::typeDescriptions(); if (isset($descriptions[$type])) { return $descriptions[$type]; } return $type; }
php
{ "resource": "" }
q10128
IterableResultHydrator.hydrate
train
public function hydrate($objectClass, array $data, $indexOfBy = false) { $this->objectClass = $objectClass; if (0 == count($data)) { yield $this->createObjectToHydrate($this->objectClass); } elseif (! is_array(current($data))) { yield $this->hydrateItem($this->obje...
php
{ "resource": "" }
q10129
Busy.done
train
public function done() { if ($this->watcher) { if ($this->watcher->count > 0) { $this->watcher->count--; } $this->watcher = null; } }
php
{ "resource": "" }
q10130
DoctrineSectionManager.restoreFromHistory
train
public function restoreFromHistory(SectionInterface $sectionFromHistory): SectionInterface { /** @var SectionInterface $activeSection */ $activeSection = $this->readByHandle($sectionFromHistory->getHandle()); // 1 /** @var SectionInterface $newSectionHistory */ $newSectionHistory = ...
php
{ "resource": "" }
q10131
DoctrineSectionManager.updateByConfig
train
public function updateByConfig( SectionConfig $sectionConfig, SectionInterface $section, bool $history = false ): SectionInterface { if ($history) { /** @var SectionInterface $sectionHistory */ $sectionHistory = $this->copySectionDataToSectionHistoryEntity($s...
php
{ "resource": "" }
q10132
Coanda.loadModules
train
public function loadModules() { $core_modules = [ 'CoandaCMS\Coanda\Pages\PagesModuleProvider', 'CoandaCMS\Coanda\Media\MediaModuleProvider', 'CoandaCMS\Coanda\Users\UsersModuleProvider', 'CoandaCMS\Coanda\Layout\LayoutModuleProvider', 'CoandaCMS\Coanda\Urls\UrlModuleProvider', 'CoandaCMS\Coanda\Hi...
php
{ "resource": "" }
q10133
Coanda.filters
train
public function filters() { Route::filter('admin_auth', function() { if (!App::make('coanda')->isLoggedIn()) { Session::put('pre_auth_path', Request::path()); Session::put('pre_auth_query_string', Request::getQueryString()); return Redirect::to('/' . Config::get('coanda::coanda.admin...
php
{ "resource": "" }
q10134
Coanda.routes
train
public function routes() { Route::group(array('prefix' => $this->config->get('coanda::coanda.admin_path')), function() { // All module admin routes should be wrapper in the auth filter Route::group(array('before' => 'admin_auth'), function() { foreach ($this->modules as $module) { $module->ad...
php
{ "resource": "" }
q10135
Coanda.bindings
train
public function bindings($app) { $app->bind('CoandaCMS\Coanda\Urls\Repositories\UrlRepositoryInterface', 'CoandaCMS\Coanda\Urls\Repositories\Eloquent\EloquentUrlRepository'); $search_provider = $this->config->get('coanda::coanda.search_provider'); if (class_exists($search_provider)) { $app->bind('CoandaCM...
php
{ "resource": "" }
q10136
Lexer.updateOptions
train
public function updateOptions() { if ($onLex = $this->getOption('on_lex')) { $this->attach(LexerEvent::LEX, $onLex); } if ($onLex = $this->getOption('on_lex_end')) { $this->attach(LexerEvent::END_LEX, $onLex); } if ($onToken = $this->getOption('on_to...
php
{ "resource": "" }
q10137
Lexer.prependScanner
train
public function prependScanner($name, $scanner) { $this->filterScanner($scanner); $scanners = [ $name => $scanner, ]; foreach ($this->getScanners() as $scannerName => $classNameOrInstance) { if ($scannerName !== $name) { $scanners[$scannerNam...
php
{ "resource": "" }
q10138
Lexer.addScanner
train
public function addScanner($name, $scanner) { $this->filterScanner($scanner); return $this->setOption(['scanners', $name], $scanner); }
php
{ "resource": "" }
q10139
Lexer.lex
train
public function lex($input, $path = null) { $stateClassName = $this->getOption('lexer_state_class_name'); $lexEvent = new LexEvent($input, $path, $stateClassName, [ 'encoding' => $this->getOption('encoding'), 'indent_style' => $this->getOption('ind...
php
{ "resource": "" }
q10140
Message.addQuestion
train
public function addQuestion(string $host, int $type, int $class = self::CLASS_IN): void { $this->questions[] = [ 'host' => $host, 'type' => $type, 'class' => $class ]; }
php
{ "resource": "" }
q10141
Message.addAnswer
train
public function addAnswer(string $host, int $type, int $class, string $data, int $ttl): void { $this->answers[] = [ 'host' => $host, 'type' => $type, 'class' => $class, 'data' => $data, 'ttl' => $ttl ]; }
php
{ "resource": "" }
q10142
Message.encodeHeader
train
protected function encodeHeader(): string { return \pack('n*', ...[ $this->id, $this->getFlags(), \count($this->questions), \count($this->answers), $this->authorityCount, $this->additionalCount ]); }
php
{ "resource": "" }
q10143
Message.encodeLabel
train
protected function encodeLabel(string $label): string { $encoded = ''; foreach (\explode('.', $label) as $part) { $encoded .= \chr(\strlen($part)) . $part; } return $encoded . "\x00"; }
php
{ "resource": "" }
q10144
Message.encodeQuestion
train
protected function encodeQuestion(array $question): string { $encoded = $this->encodeLabel($question['host']); $encoded .= \pack('nn', $question['type'], $question['class']); return $encoded; }
php
{ "resource": "" }
q10145
Message.encodeAnswer
train
protected function encodeAnswer(array $answer): string { $encoded = $this->encodeLabel($answer['host']); switch ($answer['type']) { case self::TYPE_A: case self::TYPE_AAAA: $data = \inet_pton($answer['data']); break; case s...
php
{ "resource": "" }
q10146
ShoppingCart.emptycart
train
public function emptycart() { ShoppingCartFactory::create()->delete(); $form = $this->CartForm(); $form->sessionMessage(_t( "ShoppingCart.EmptiedCart", "Shopping cart emptied" )); return $this->redirectBack(); }
php
{ "resource": "" }
q10147
ShoppingCart.checkout
train
public function checkout() { if (!class_exists($this->config()->checkout_class)) { return $this->httpError(404); } $checkout = Injector::inst() ->get($this->config()->checkout_class); $checkout->setEstimate($this->dataRecord); $this->extend("onBefore...
php
{ "resource": "" }
q10148
DateService.getFormat
train
public function getFormat(string $dateLength): string { // Oops, unknown length of date if (false === (new DateLength())->isCorrectType($dateLength)) { throw UnknownDateLengthException::createException($dateLength); } $format = ''; switch ($dateLength) { ...
php
{ "resource": "" }
q10149
DateService.formatDate
train
public function formatDate(\DateTimeInterface $dateTime, string $dateLength): string { $format = $this->getFormat($dateLength); return $dateTime->format($format); }
php
{ "resource": "" }
q10150
Success.success
train
public function success(int $statusCode, string $message, $data = null): JsonResponse { $this->setStatusCode($statusCode); $this->setMessage($message); $this->setData($data); $content['message'] = $this->getMessage(); if (null !== $this->getCode()) { $conte...
php
{ "resource": "" }
q10151
HierarchyBuilder.explodeChildren
train
private function explodeChildren($id, array $childrenMap) { if (! isset($childrenMap[$id])) { return []; } // Indexing items by their value $indexed = []; foreach ($childrenMap[$id] as $childName) { $indexed[$childName] = $childName; } ...
php
{ "resource": "" }
q10152
Hydrator.doHydrate
train
protected function doHydrate(array $data, $object) { $previousHydrationContext = $this->currentHydrationContext; $this->currentHydrationContext = new CurrentHydrationContext($data, $object); foreach ($this->metadata->getMappedFieldNames() as $mappedFieldName) { $defaultValue = $...
php
{ "resource": "" }
q10153
Hydrator.getCurrentConfigVariableByName
train
public function getCurrentConfigVariableByName($variableKey) { if (! isset($this->currentConfigVariables[$variableKey])) { throw new ObjectMappingException( sprintf( 'The current config variables do not contains key "%s". Availables keys are "[%s]".', ...
php
{ "resource": "" }
q10154
PineAnnotationsServiceProvider.registerReader
train
protected function registerReader() { // Give a Cached Reader when our // reader class needs // a ReaderContract. $this->app->when(AnnotationsReader::class) ->needs(Reader::class) ->give(function () { return $this->createAndRe...
php
{ "resource": "" }
q10155
PineAnnotationsServiceProvider.addAnnotationsToRegistry
train
protected function addAnnotationsToRegistry() { // Creates annotation Reader. $reader = $this->app->make(AnnotationsReader::class); // Register files autoload. $reader->addFilesToRegistry(config('pine-annotations.autoload_files')); // Register namespaces autoload. $...
php
{ "resource": "" }
q10156
Compare.isDimensionsEqual
train
public function isDimensionsEqual() { if($this->image1->getImageWidth() !== $this->image2->getImageWidth() || $this->image1->getImageHeight() !== $this->image2->getImageHeight()) { return FALSE; } return TRUE; }
php
{ "resource": "" }
q10157
Compare.isEqual
train
public function isEqual() { // CHECK IMAGES DIMENSIONS if(!$this->isDimensionsEqual()) { return FALSE; } $compare = $this->image1->compareImages($this->image2, Imagick::METRIC_MEANSQUAREERROR); // IMAGE IS EXACTLY THE SAME if($compare === TRUE) ...
php
{ "resource": "" }
q10158
Paymill.createModel
train
public function createModel($class, $id) { $this->model = new $class(); if ($id) { $this->model->setId($id); } return $this; }
php
{ "resource": "" }
q10159
UserController.index
train
public function index(Request $request, UserRepository $users) { return view('authentication::user.index') ->with('users', $users->query($request->get('q'))); }
php
{ "resource": "" }
q10160
InstallDirectoryCommand.getAllYamls
train
private static function getAllYamls(string $directory): \Generator { /** @var \SplFileInfo $file */ foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($directory)) as $file) { if ($file->isFile() && $file->getExtension() === 'yml') { $fileName = $file...
php
{ "resource": "" }
q10161
ExpressionContext.addVariable
train
public function addVariable($key, $value) { if (is_null($key) || ! is_string($key)) { throw new RuntimeException(sprintf('The key where to save your variable in the expression context is invalid. Got "%s".', $key)); } $this->variables[$key] = $value; }
php
{ "resource": "" }
q10162
Server.serverResponse
train
public function serverResponse() { if(!empty($_GET['imageQuery'])) { $picture = $this->loadPicture($_GET['imageQuery']); $savePath = $this->getPath($picture); $picture->save($savePath); if($savePath !== $this->getPath($picture)) { ...
php
{ "resource": "" }
q10163
Server.requestWithoutWaiting
train
function requestWithoutWaiting($url, array $params = array()) { $post = array(); foreach($params as $index => $val) { $post[] = $index . '=' . urlencode($val); } $post = implode('&', $post); $request = parse_url($url); // SUPPORT FOR RELATIVE G...
php
{ "resource": "" }
q10164
DataSet.setValue
train
public function setValue($name, $value) { $child = & $this->data; foreach ($this->currentPath as $part) { if (isset($child[$part])) { $child = & $child[$part]; } else { $child[$part] = []; $child = & $child[$part]; ...
php
{ "resource": "" }
q10165
DataSet.getValue
train
public function getValue($name) { $child = & $this->data; foreach ($this->currentPath as $part) { if (isset($child[$part])) { $child = & $child[$part]; } else { return null; } } return isset($child[$name]) ? $child...
php
{ "resource": "" }
q10166
DataSet.getValueByPath
train
public function getValueByPath($path) { if (is_string($path)) { $path = $this->parsePath($path); } $child = $this->data; foreach ($path as $part) { if (isset($child[$part])) { $child = $child[$part]; } else { retur...
php
{ "resource": "" }
q10167
DataSet.setValueByPath
train
public function setValueByPath($path, $value) { if (is_string($path)) { $path = $this->parsePath($path); } $endPart = array_pop($path); $child = & $this->data; foreach ($path as $part) { if (isset($child[$part])) { $child = & $child[$...
php
{ "resource": "" }
q10168
DataSet.parsePath
train
public function parsePath($path) { $parts = explode('/', trim($path, '/')); $pathArray = []; if ($parts[0] == '.') { $pathArray = $this->currentPath; array_shift($parts); } foreach ($parts as $part) { if ($part == '..') { ...
php
{ "resource": "" }
q10169
DataSet.resolvePath
train
public function resolvePath($value) { do { $value = $this->getValueByPath($value); } while (self::isPath($value)); return $value; }
php
{ "resource": "" }
q10170
SourceFactory.create
train
public function create(WP_Post $attachment, Size $size): Source { if (!wp_attachment_is_image($attachment)) { throw new InvalidArgumentException('Attachment must be an image.'); } $imageSource = (array)wp_get_attachment_image_src( $attachment->ID, [$size-...
php
{ "resource": "" }
q10171
Guzzle5ApiClient._doRequest
train
protected function _doRequest($method, $uri, $options) { // For Guzzle5 we cannot have any options that are not pre-defined, // so instead we put it in the config array if (isset($options[self::OPT_VIDEO_MANAGER_ID])) { $options['config'][self::OPT_VIDEO_MANAGER_ID] = $options[se...
php
{ "resource": "" }
q10172
AlgoliaComponent.createManager
train
private function createManager() { $config = $this->generateConfig(); $algoliaManager = $this->algoliaFactory->make($config); $algoliaManager->setEnv($this->env); return $algoliaManager; }
php
{ "resource": "" }
q10173
AlgoliaComponent.generateConfig
train
private function generateConfig() { return new AlgoliaConfig( $this->applicationId, $this->apiKey, $this->hostsArray, $this->options ); }
php
{ "resource": "" }
q10174
URIHelper.hasExtension
train
public static function hasExtension(string $uri, string $extension): bool { $extension = '.' . ltrim($extension, '.'); $uriLength = mb_strlen($uri); $extensionLength = mb_strlen($extension); if ($extensionLength > $uriLength) { return false; } ...
php
{ "resource": "" }
q10175
URIHelper.containsExtension
train
public static function containsExtension(string $uri): string { $pathParts = explode('/', $uri); $filename = array_pop($pathParts); $filenameParts = explode('.', $filename); if (count($filenameParts) > 1) { return array_pop($filenameParts); } re...
php
{ "resource": "" }
q10176
RoutePermissionRepository.extractPermissionFrom
train
private function extractPermissionFrom(Route $route) { $parameters = $route->getAction(); if (isset($parameters['permission'])) { return $parameters['permission']; } return null; }
php
{ "resource": "" }
q10177
RouteAnnotationListener.getUrlFromRoute
train
protected function getUrlFromRoute($name, Route $route) { $option = $route->getOption('sitemap'); if ($option === null) { return null; } if (is_string($option)) { $decoded = json_decode($option, true); if (!json_last_error() && is_array($d...
php
{ "resource": "" }
q10178
PHPEngine.getRenderCallback
train
public function getRenderCallback(string $uri, array $context = []): callable { if (! is_readable($uri)) { throw new FailedToLoadView( sprintf( _('The View URI "%1$s" is not accessible or readable.'), $uri ) ); ...
php
{ "resource": "" }
q10179
Text_Password.createMultiple
train
public static function createMultiple( $number, $length = 10, $type = 'pronounceable', $chars = '' ) { $passwords = array(); while ($number > 0) { while (true) { $password = self::create($length, $type, $chars); if (!in_arr...
php
{ "resource": "" }
q10180
Text_Password.createMultipleFromLogin
train
public static function createMultipleFromLogin($login, $type, $key = 0) { $passwords = array(); $number = count($login); $save = $number; while ($number > 0) { while (true) { $password = self::createFromLogin($login[$save - $number], $type, $key);...
php
{ "resource": "" }
q10181
Text_Password._shuffle
train
protected static function _shuffle($login) { $tmp = array(); for ($i = 0; $i < strlen($login); $i++) { $tmp[] = $login[$i]; } shuffle($tmp); return implode($tmp, ''); }
php
{ "resource": "" }
q10182
Text_Password._rand
train
protected static function _rand($min, $max) { if (version_compare(PHP_VERSION, '7.0.0', 'ge')) { $value = random_int($min, $max); } else { $value = mt_rand($min, $max); } return $value; }
php
{ "resource": "" }
q10183
Errors.badRequest
train
public function badRequest($message = 'Bad Request', $errors = null): void { $this->setStatusCode(400); $this->setMessage($message); $this->setErrors($errors); throw new ApiException($this); }
php
{ "resource": "" }
q10184
TWBTreeView.finalize
train
public function finalize() { \Ease\TWB\Part::twBootstrapize(); $this->includeJavascript('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.js'); $this->includeCss('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.css'...
php
{ "resource": "" }
q10185
DcxApiClient.stream
train
public function stream($url, array $query, callable $eventListener) { try { $response = $this->guzzleClient->request ( 'GET', $this->fullUrl($url), $this->getRequestOptions ( [ ...
php
{ "resource": "" }
q10186
Service.sendRequest
train
protected function sendRequest($requiredParams, $params, $callback) { $response = $this->client->send($requiredParams, array_merge($params, [ 'module' => static::getModule(), 'controller' => static::getController(), 'version' => $this->version, ]), function ($resp...
php
{ "resource": "" }
q10187
FileLoader.mergeEnvironments
train
public function mergeEnvironments(array $lines, string $file): array { if ($this->files->exists($file)) { $lines = \array_replace_recursive($lines, $this->files->getRequire($file)); } return $lines; }
php
{ "resource": "" }
q10188
FeatureType.getValue
train
public static function getValue($slug, $featureId, $locale = 'en_US') { return self::getValues([$slug], [$featureId], $locale)[$slug][$featureId]; }
php
{ "resource": "" }
q10189
Guzzle6ApiClient._doRequest
train
protected function _doRequest($method, $uri, $options) { return $this->httpClient->request($method, $uri, $options); }
php
{ "resource": "" }
q10190
DoctrineIterator.loadPage
train
protected function loadPage($page) { $this->pageStart = $page * $this->pageSize; $this->pageData = $this->query->setFirstResult($this->pageStart)->setMaxResults($this->pageSize)->getResult(); }
php
{ "resource": "" }
q10191
FeatureType.initFeatureFeatureTypes
train
public function initFeatureFeatureTypes($overrideExisting = true) { if (null !== $this->collFeatureFeatureTypes && !$overrideExisting) { return; } $this->collFeatureFeatureTypes = new ObjectCollection(); $this->collFeatureFeatureTypes->setModel('\FeatureType\Model\Feature...
php
{ "resource": "" }
q10192
FeatureType.getFeatureFeatureTypes
train
public function getFeatureFeatureTypes($criteria = null, ConnectionInterface $con = null) { $partial = $this->collFeatureFeatureTypesPartial && !$this->isNew(); if (null === $this->collFeatureFeatureTypes || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collFea...
php
{ "resource": "" }
q10193
FeatureType.countFeatureFeatureTypes
train
public function countFeatureFeatureTypes(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collFeatureFeatureTypesPartial && !$this->isNew(); if (null === $this->collFeatureFeatureTypes || null !== $criteria || $partial) { if ($this->isNew...
php
{ "resource": "" }
q10194
FeatureType.addFeatureFeatureType
train
public function addFeatureFeatureType(ChildFeatureFeatureType $l) { if ($this->collFeatureFeatureTypes === null) { $this->initFeatureFeatureTypes(); $this->collFeatureFeatureTypesPartial = true; } if (!in_array($l, $this->collFeatureFeatureTypes->getArrayCopy(), true...
php
{ "resource": "" }
q10195
FeatureType.getFeatureFeatureTypesJoinFeature
train
public function getFeatureFeatureTypesJoinFeature($criteria = null, $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildFeatureFeatureTypeQuery::create(null, $criteria); $query->joinWith('Feature', $joinBehavior); return $this->getFeatureFeatureTypes($query, $con); }
php
{ "resource": "" }
q10196
FeatureType.initFeatureTypeI18ns
train
public function initFeatureTypeI18ns($overrideExisting = true) { if (null !== $this->collFeatureTypeI18ns && !$overrideExisting) { return; } $this->collFeatureTypeI18ns = new ObjectCollection(); $this->collFeatureTypeI18ns->setModel('\FeatureType\Model\FeatureTypeI18n'); ...
php
{ "resource": "" }
q10197
FeatureType.getFeatureTypeI18ns
train
public function getFeatureTypeI18ns($criteria = null, ConnectionInterface $con = null) { $partial = $this->collFeatureTypeI18nsPartial && !$this->isNew(); if (null === $this->collFeatureTypeI18ns || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collFeatureTypeI...
php
{ "resource": "" }
q10198
FeatureType.countFeatureTypeI18ns
train
public function countFeatureTypeI18ns(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collFeatureTypeI18nsPartial && !$this->isNew(); if (null === $this->collFeatureTypeI18ns || null !== $criteria || $partial) { if ($this->isNew() && nul...
php
{ "resource": "" }
q10199
FeatureType.addFeatureTypeI18n
train
public function addFeatureTypeI18n(ChildFeatureTypeI18n $l) { if ($l && $locale = $l->getLocale()) { $this->setLocale($locale); $this->currentTranslations[$locale] = $l; } if ($this->collFeatureTypeI18ns === null) { $this->initFeatureTypeI18ns(); ...
php
{ "resource": "" }