sentence1
stringlengths
52
3.87M
sentence2
stringlengths
1
47.2k
label
stringclasses
1 value
private static function comment_block($text, $char = ' ') { $text = wordwrap($text, self::MAX_LINE_LEN - 3); return self::prepend_each_line($text, "#$char "); }
Prepare a text as a comment -- wraps the lines and prepends # and a special character to each line. @param string $text the comment text @param string $char character to denote a special PO comment, like :, default is a space @return string The modified string
entailment
public static function export_entry(EntryTranslations &$entry) { if (null === $entry->singular || '' === $entry->singular) { return false; } $po = array(); if (!empty($entry->translator_comments)) { $po[] = self::comment_block($entry->translator_comments); ...
Builds a string from the entry for inclusion in PO file. @static @param EntryTranslations &$entry the entry to convert to po string @return false|string PO-style formatted string for the entry or false if the entry is empty
entailment
public static function match_begin_and_end_newlines($translation, $original) { if ('' === $translation) { return $translation; } $original_begin = "\n" === substr($original, 0, 1); $original_end = "\n" === substr($original, -1); $translation_begin = "\n" === subs...
@param $translation @param $original @return string
entailment
public function import_from_file($filename) { $f = fopen($filename, 'r'); if (!$f) { return false; } $lineno = 0; $res = false; while (true) { $res = $this->read_entry($f, $lineno); if (!$res) { break; } ...
@param string $filename @return bool
entailment
public function read_entry($f, $lineno = 0) { $entry = new EntryTranslations(); // where were we in the last step // can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural $context = ''; $msgstr_index = 0; while (true) { $lineno++; ...
@param resource $f @param int $lineno @return null|false|array
entailment
public static function read_line($f, $action = 'read') { static $last_line = ''; static $use_last_line = false; if ('clear' == $action) { $last_line = ''; return true; } if ('put-back' == $action) { $use_last_line = true; retu...
@param resource $f @param string $action @return bool
entailment
public static function trim_quotes($s) { if (substr($s, 0, 1) == '"') { $s = substr($s, 1); } if (substr($s, -1, 1) == '"') { $s = substr($s, 0, -1); } return $s; }
@param string $s @return string
entailment
public function loginAndRegisterVia($provider) { $this->authenticationService = $this->authenticationServiceFactory->getInstance($provider); $isUserLoggedIn = $this->accountService->checkUser(); // active sw login session if ($isUserLoggedIn) { return $isUserLoggedIn; ...
the overall method for the SSO workflow login + register @param $provider string the authsource string (e.g.: linkedin, ...) @return bool
entailment
protected function tryLoginCustomer($customer = null) { $result = false; if ($customer !== null) { $checkUser = $this->accountService->loginUser($customer); if (empty($checkUser['sErrorMessages'])) { $result = true; } } else { ...
@param Customer $customer @return bool true if the customer is successfully logged in, false if not
entailment
public function setCheckbox(): ColumnInterface { return $this->setKey('checkbox') ->setValue('<input type="checkbox" class="js_adminSelectAll">') ->setSort(false) ->setScreening(true) ->setHandler(function ($data) { if ($data && $data->id) { ...
template for checkbox @return $this
entailment
public function getValues(\Illuminate\Database\Eloquent\Model $instance = null) { if ($instance) { $this->setInstance($instance); } if ($this->isHandler()) { return $this->getHandler(); } if ($this->instance) { return $this->getValueColumn...
@param \Illuminate\Database\Eloquent\Model|null $instance @return mixed|null
entailment
public function getValueColumn($instance, string $name) { if (!$instance) { return null; } $parts = explode('.', $name); $part = array_shift($parts); if ($instance instanceof \Illuminate\Database\Eloquent\Collection) { $instance = $instance->pluck($pa...
@param mixed $instance @param string $name @return mixed
entailment
public function setInstance(\Illuminate\Database\Eloquent\Model $instance): ColumnInterface { $this->instance = $instance; return $this; }
Необходимо устанавливать только в момент когда приходит инстанс модели! @param \Illuminate\Database\Eloquent\Model $instance @return ColumnInterface
entailment
public function setKeyAction(): ColumnInterface { $this->key = self::ACTION_NAME; $this->setValue(''); $this->setSort(false); $this->setScreening(true); return $this; }
Method for a single column with actions @return ColumnInterface
entailment
public function setFilter( string $field, $data, string $mode = null, array $selected = [], string $class = '', string $style = '', string $placeholder = '', string $url = '' ): ColumnInterface { $mode = $mode ? $mode : self::FILTER_TYPE_SELECT...
@param string $field @param string|array $data @param string|null $mode @param array $selected @param string $class @param string $style @param string $placeholder @param string $url @return ColumnInterface
entailment
public function setFilterFormat(string $format = 'DD MMM YY'): ColumnInterface { $this->filter[self::FILTER_KEY_FORMAT] = $format; return $this; }
@param string $width @return ColumnInterface
entailment
public function setFilterWidth(string $width = '180px'): ColumnInterface { $this->filter[self::FILTER_KEY_WIDTH] = $width; return $this; }
@param string $width @return ColumnInterface
entailment
public function setFilterSelect( string $field, array $array, string $class = '', string $style = '', string $placeholder = '' ): ColumnInterface { return $this->setFilter($field, $array, self::FILTER_TYPE_SELECT, [], $class, $style, $placeholder); }
@param string $field @param array $array @param string $class @param string $style @param string $placeholder @return ColumnInterface
entailment
public function setFilterSelectAjax( string $field, array $array, array $selected, string $url, string $class = '', string $style = '', string $placeholder = '' ): ColumnInterface { return $this->setFilter($field, $array, self::FILTER_TYPE_SELECT_AJAX,...
@param string $field @param array $array @param string $url @param string $class @param string $style @param string $placeholder @return ColumnInterface
entailment
public function setFilterSelectNotAjax( string $field, array $array, array $selected = [], string $url = '', string $class = '', string $style = '', string $placeholder = '' ): ColumnInterface { return $this->setFilter($field, $array, self::FILTER_TYPE...
@param string $field @param array $array @param string $url @param string $class @param string $style @param string $placeholder @return ColumnInterface
entailment
public function setFilterString( string $field, string $string = '', string $class = '', string $style = '', string $placeholder = '' ): ColumnInterface { return $this->setFilter($field, $string, self::FILTER_TYPE_STRING, [], $class, $style, $placeholder); }
@param string $field @param string $string @param string $class @param string $style @param string $placeholder @return ColumnInterface
entailment
public function setFilterDate( string $field, string $string = '', bool $active = true, string $format = null, string $class = '', string $style = '', string $placeholder = '' ): ColumnInterface { $this->setDateActive($active); if ($format) { ...
@param string $field @param string $string @param bool $active @param string|null $format @param string $class @param string $style @param string $placeholder @return ColumnInterface
entailment
public function setFilterDateRange( string $field, string $string = '', bool $active = true, string $format = null, string $class = '', string $style = '', string $placeholder = '' ): ColumnInterface { $this->setDateActive($active); if ($format...
@param string $field @param string $string @param bool $active @param string|null $format @param string $class @param string $style @param string $placeholder @return ColumnInterface
entailment
public function setActions(Callable $action, string $value = null): ColumnInterface { $this->setKeyAction(); $this->actions = $action; if ($value !== null) { $this->setValue($value); } return $this; }
@param callable $action @param string|null $value @return ColumnInterface
entailment
public function setClassForString(Callable $handler): ColumnInterface { $this->key = self::ACTION_STRING_TR; $this->setHandler($handler); return $this; }
@param callable $handler @return ColumnInterface
entailment
public function gettext_select_plural_form($count) { if (!isset($this->_gettext_select_plural_form) || is_null($this->_gettext_select_plural_form)) { list($nplurals, $expression) = $this->nplurals_and_expression_from_header($this->get_header('Plural-Forms')); $this->_nplu...
The gettext implementation of select_plural_form. It lives in this class, because there are more than one descendand, which will use it and they can't share it effectively. @param int $count Items count @return mixed
entailment
public function nplurals_and_expression_from_header($header) { if (preg_match('/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches)) { $nplurals = (int) $matches[1]; $expression = trim($matches[2]); return array($nplurals, $expression); } else...
@param $header @return array
entailment
public function make_plural_form_function($nplurals, $expression) { try { $handler = new PluralForms(rtrim($expression, ';')); return array($handler, 'get'); } catch (\Exception $e) { // Fall back to default plural-form function. return $this->make_pl...
Makes a function, which will return the right translation index, according to the plural forms header. @param int $nplurals @param string $expression @return callable The right translation index
entailment
public function parenthesize_plural_exression($expression) { $expression .= ';'; $res = ''; $depth = 0; for ($i = 0; $i < strlen($expression); ++$i) { $char = $expression[$i]; switch ($char) { case '?': $res .= ' ? ('; ...
Adds parentheses to the inner parts of ternary operators in plural expressions, because PHP evaluates ternary operators from left to right. @param string $expression the expression without parentheses @return string the expression with parentheses added
entailment
public function make_headers($translation) { $headers = array(); // sometimes \ns are used instead of real new lines $translation = str_replace('\n', "\n", $translation); $lines = explode("\n", $translation); foreach ($lines as $line) { $parts = explode(':', $line...
@param string $translation @return array
entailment
public function aroundExecute( CategoryView $subject, \Closure $proceed ) { if (!$subject->getRequest()->isAjax()) { return $proceed(); } try { // Remove query parameters added for AJAX requests $this->cleanRequestUri(); $this-...
Category view action @param CategoryView $subject @param \Closure $proceed @return void|\Magento\Framework\View\Result\Page|\Magento\Framework\Controller\Result\Json
entailment
public static function forType($type, KeyValueStore $store, $code = 0, Exception $cause = null) { return new static(sprintf( 'Values of type %s are not supported by %s.', $type, get_class($store) ), $code, $cause); }
Creates a new exception for the given value type. @param string $type The name of the unsupported type. @param KeyValueStore $store The store that does not support the type. @param int $code The exception code. @param Exception|null $cause The exception that caused this exception. @return static...
entailment
public static function forValue($value, KeyValueStore $store, $code = 0, Exception $cause = null) { return new static(sprintf( 'Values of type %s are not supported by %s.', gettype($value), get_class($store) ), $code, $cause); }
Creates a new exception for the given value. @param string $value The unsupported value. @param KeyValueStore $store The store that does not support the type. @param int $code The exception code. @param Exception|null $cause The exception that caused this exception. @return static The new excepti...
entailment
public function getEnabledProviders() { $result = []; foreach (Port1HybridAuth::PROVIDERS as $provider) { if ((Boolean)$this->config->getByNamespace('Port1HybridAuth', strtolower($provider) . '_enabled')) { $label = $this->snippetManager->getNamespace('frontend/account/l...
Returns all enabled providers @return array
entailment
public function validate(Address $address) { $this->validationContext = $this->validator->startContext(); $this->validateField('firstname', $address->getFirstname(), [new NotBlank()]); $this->validateField('lastname', $address->getLastname(), [new NotBlank()]); if ($this->validatio...
@param Address $address @throws ValidationException
entailment
public function setType(string $type = self::TYPE_HIDDEN): InputInterface { $this->type = $type; return $this; }
@param string $type @return InputInterface
entailment
public function setInputHidden( string $name = '', string $value = '', string $id = '', string $class = '', array $options = [] ): InputInterface { $this->setType(self::TYPE_HIDDEN) ->setName($name) ->setValue($value) ->setId($id) ...
@param string $name @param string $value @param string $id @param string $class @param array $options @return InputInterface
entailment
public function setQuery(\Illuminate\Database\Eloquent\Builder &$query): PaginationInterface { $this->_query = $query; return $this; }
@param \Illuminate\Database\Eloquent\Builder $query @return PaginationInterface
entailment
public function get(int $page, int $limit = 10): \Illuminate\Pagination\LengthAwarePaginator { if (!$this->_columns && !$this->_query) { return null; } $countTotal = $this->_query->count(); $this->_query->skip(($limit * $page) - $limit); $this->_query->limit($limi...
Returns a collection in view of pagination @param int $page @param int $limit @return LengthAwarePaginator
entailment
public function getSimple(int $page, int $limit = 10, bool $isClount = false): \Illuminate\Contracts\Pagination\Paginator { if (!$this->_columns && !$this->_query) { return null; } if ($isClount) { $countTotal = $this->_query->count(); } $this->_query-...
Returns a collection in view of pagination @param int $page @param int $limit @return \Illuminate\Contracts\Pagination\Paginator
entailment
public function render(string $view = null, array $data = [], string $formAction = ''): string { if (!$this->_data) { return ''; } return $this->_data->setPath($formAction)->appends($data)->render($view)->toHtml(); }
@param string|null $view @param array $data @param string $formAction @return string
entailment
public function getItemForPagination( string $status = '', string $text = '', string $url = '', string $rel = '', string $page = '' ): array { return [ 'status' => $status, 'text' => $text, 'url' => $url, 'rel' =...
@param string $status @param string $text @param string $url @param string $rel @param string $page @return array
entailment
public function set($key, $value) { $this->store->set($key, $value); $this->cache->save($key, $value, $this->ttl); }
{@inheritdoc}
entailment
public function get($key, $default = null) { if ($this->cache->contains($key)) { return $this->cache->fetch($key); } try { $value = $this->store->getOrFail($key); } catch (NoSuchKeyException $e) { return $default; } $this->cache->...
{@inheritdoc}
entailment
public function getOrFail($key) { if ($this->cache->contains($key)) { return $this->cache->fetch($key); } $value = $this->store->getOrFail($key); $this->cache->save($key, $value, $this->ttl); return $value; }
{@inheritdoc}
entailment
public function getMultiple(array $keys, $default = null) { $values = array(); // Read cached values from the cache foreach ($keys as $i => $key) { if ($this->cache->contains($key)) { $values[$key] = $this->cache->fetch($key); unset($keys[$i]); ...
{@inheritdoc}
entailment
public function getMultipleOrFail(array $keys) { $values = array(); // Read cached values from the cache foreach ($keys as $i => $key) { if ($this->cache->contains($key)) { $values[$key] = $this->cache->fetch($key); unset($keys[$i]); }...
{@inheritdoc}
entailment
public function remove($key) { $this->store->remove($key); $this->cache->delete($key); }
{@inheritdoc}
entailment
public function exists($key) { if ($this->cache->contains($key)) { return true; } return $this->store->exists($key); }
{@inheritdoc}
entailment
public function clear() { $this->store->clear(); if ($this->cache instanceof ClearableCache) { $this->cache->deleteAll(); } else { $this->cache->flushAll(); } }
{@inheritdoc}
entailment
protected function getRepository() { if ($this->repository === null) { $this->repository = $this->container->get('models')->getRepository(Customer::class); } return $this->repository; }
Helper function to get access on the static declared repository @return \Shopware\Models\Customer\Repository @throws \Exception
entailment
public static function value($object, $attribute, $defaultValue = null) { if (is_scalar($attribute)) { foreach (explode(self::$pathDivider, $attribute) as $name) { if (isset($object->$name)) { $object = $object->$name; } elseif (isset($object[$...
Evaluates the value of the specified attribute for the given object or array. The attribute name can be given in a path syntax. For example, if the attribute is "author.firstName", this method will return the value of "$object->author->firstName" or "$array['author']['firstName']". A default value (passed as the last p...
entailment
public static function join($array, $divider = ',', $prefix = null, $postfix = null) { if (is_array($divider)) { list($divider, $prefix, $postfix) = $divider; } array_walk($array, function (&$value) use ($divider, $prefix, $postfix) { if (is_array($value)) { ...
Return string containing a string representation of all the items, with the $divider string between each element. <code> $str=A::join([1,2,3],',','["','"]'); // $str='["1"],["2"],["3"]' $str=A::join(['a'=>[1,2,3]],','); // array flatten $str='1,2,3' $str=A::join([$user1,$user2,$user3],','); // for objects joined id att...
entailment
public function register() { $this->commands([ Commands\DeployCommand::class, Commands\ListCommand::class, Commands\RollbackCommand::class, Commands\SyncCommand::class, ]); }
Register the service provider. @return void
entailment
private function addIdentityFieldsToUser() { /** @var CrudService $service */ $service = $this->container->get('shopware_attribute.crud_service'); foreach (self::PROVIDERS as $provider) { $service->update('s_user_attributes', strtolower($provider) . '_identity', 'string', [ ...
Adds the identity attribute to the customer model. @return void @throws \Exception
entailment
private function activateAmazonProvider() { if (ComposerLocator::isInstalled('hybridauth/hybridauth')) { $hybridauthRootPath = ComposerLocator::getPath('hybridauth/hybridauth'); $hybridauthAmazonPath = rtrim($hybridauthRootPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR ...
Activate Amazon provider (copy sources from additional-providers into Hybrid) @return void @throws \Exception
entailment
public function getMultiple(array $keys, $default = null) { KeyUtil::validateMultiple($keys); // Normalize indices of the array $keys = array_values($keys); $values = array(); try { $serializedValues = $this->clientGetMultiple($keys); } catch (Exception ...
{@inheritdoc}
entailment
public function getMultipleOrFail(array $keys) { KeyUtil::validateMultiple($keys); // Normalize indices of the array $keys = array_values($keys); $values = array(); $notFoundKeys = array(); try { $serializedValues = $this->clientGetMultiple($keys); ...
{@inheritdoc}
entailment
public function get($key, $default = null) { KeyUtil::validate($key); try { $serialized = $this->clientGet($key); } catch (Exception $e) { throw ReadException::forException($e); } if ($this->clientNotFoundValue() === $serialized) { return...
{@inheritdoc}
entailment
public function getOrFail($key) { KeyUtil::validate($key); try { $serialized = $this->clientGet($key); } catch (Exception $e) { throw ReadException::forException($e); } if ($this->clientNotFoundValue() === $serialized) { throw NoSuchKeyEx...
{@inheritdoc}
entailment
public function set($key, $value) { KeyUtil::validate($key); $serialized = Serializer::serialize($value); try { $this->clientSet($key, $serialized); } catch (Exception $e) { throw WriteException::forException($e); } }
{@inheritdoc}
entailment
public function remove($key) { KeyUtil::validate($key); try { return (bool) $this->clientRemove($key); } catch (Exception $e) { throw WriteException::forException($e); } }
{@inheritdoc}
entailment
public function exists($key) { KeyUtil::validate($key); try { return $this->clientExists($key); } catch (Exception $e) { throw ReadException::forException($e); } }
{@inheritdoc}
entailment
public function start() { // Get server list. $connection = new Connection($this->optServer); $servers = $connection->servers(); $rollback = null; // When in rollback mode, get the commit. if ($this->mode == self::MODE_ROLLBACK) { $rollback = array('comm...
Starts the Maneuver
entailment
public function push($deploy) { // Compare local revision to the remote one, to // build files to upload and delete. $message = $deploy->compare(); print $message; print "\n+ --------------- + --------------- +"; $dirty = false; $filesToUpload = $deploy->get...
Handles the upload and delete processes @param \Fadion\Maneuver\Deploy $deploy @return bool
entailment
protected function cleanRequestUri() { $requestUri = $this->request->getRequestUri(); $requestUriQuery = parse_url($requestUri, PHP_URL_QUERY); parse_str($requestUriQuery, $requestParams); if (is_array($requestParams) && count($requestParams) > 0) { foreach ($this->ajaxQ...
Remove query parameters added to the request URI for AJAX requests @return void
entailment
protected function removeAjaxQueryParams() { /** @var \Zend\Stdlib\Parameters */ $query = $this->request->getQuery(); if (count($query) > 0) { foreach ($this->ajaxQueryParams as $queryParam) { $query->set($queryParam, null); } } }
Remove query parameters added for AJAX requests @return void
entailment
protected function jsonResponse($data) { /** @var \Magento\Framework\Controller\Result\Json $resultJson */ $resultJson = $this->resultJsonFactory->create(); $resultJson->setHeader('Content-type', 'application/json', true); $resultJson->setData($data); return $resultJson; ...
Build a JSON response @param array $data Response data @return \Magento\Framework\Controller\Result\Json
entailment
protected function getCurrentPageUrl($pager) { if ($pager->isFirstPage()) { $pageUrl = $pager->getPageUrl(null); } else { $pageUrl = $pager->getPageUrl($pager->getCurrentPage()); } return $this->removeTags->filter($pageUrl); }
Retrieve current page URL @param \Magento\Theme\Block\Html\Pager $pager @return string
entailment
public function set($key, $value) { KeyUtil::validate($key); $serialized = Serializer::serialize($value); try { $this->client->bucket($this->bucketName)->newBinary($key, $serialized)->store(); } catch (Exception $e) { throw WriteException::forException($e); ...
{@inheritdoc}
entailment
public function get($key, $default = null) { KeyUtil::validate($key); try { $object = $this->client->bucket($this->bucketName)->getBinary($key); $exists = $object->exists(); } catch (Exception $e) { throw ReadException::forException($e); } ...
{@inheritdoc}
entailment
public function getOrFail($key) { KeyUtil::validate($key); try { $object = $this->client->bucket($this->bucketName)->getBinary($key); $exists = $object->exists(); } catch (Exception $e) { throw ReadException::forException($e); } if (!$exi...
{@inheritdoc}
entailment
public function getMultiple(array $keys, $default = null) { KeyUtil::validateMultiple($keys); $values = array(); try { $bucket = $this->client->bucket($this->bucketName); foreach ($keys as $key) { $object = $bucket->getBinary($key); ...
{@inheritdoc}
entailment
public function getMultipleOrFail(array $keys) { KeyUtil::validateMultiple($keys); $values = array(); $notFoundKeys = array(); try { $bucket = $this->client->bucket($this->bucketName); foreach ($keys as $key) { $values[$key] = $bucket->getBi...
{@inheritdoc}
entailment
public function remove($key) { KeyUtil::validate($key); try { $object = $this->client->bucket($this->bucketName)->get($key); if (!$object->exists()) { return false; } $object->delete(); } catch (Exception $e) { th...
{@inheritdoc}
entailment
public function exists($key) { KeyUtil::validate($key); try { return $this->client->bucket($this->bucketName)->get($key)->exists(); } catch (Exception $e) { throw ReadException::forException($e); } }
{@inheritdoc}
entailment
public function clear() { try { $bucket = $this->client->bucket($this->bucketName); foreach ($bucket->getKeys() as $key) { $bucket->get($key)->delete(); } } catch (Exception $e) { throw WriteException::forException($e); } }
{@inheritdoc}
entailment
public function keys() { try { return $this->client->bucket($this->bucketName)->getKeys(); } catch (Exception $e) { throw ReadException::forException($e); } }
{@inheritdoc}
entailment
public function set($key, $value) { KeyUtil::validate($key); if (is_float($value) && $value > self::MAX_FLOAT) { throw new UnsupportedValueException('The JSON file store cannot handle floats larger than 1.0E+14.'); } $data = $this->load(); $data[$key] = $this->s...
{@inheritdoc}
entailment
public function get($key, $default = null) { KeyUtil::validate($key); $data = $this->load(); if (!array_key_exists($key, $data)) { return $default; } return $this->unserializeValue($data[$key]); }
{@inheritdoc}
entailment
public function getOrFail($key) { KeyUtil::validate($key); $data = $this->load(); if (!array_key_exists($key, $data)) { throw NoSuchKeyException::forKey($key); } return $this->unserializeValue($data[$key]); }
{@inheritdoc}
entailment
public function getMultiple(array $keys, $default = null) { $values = array(); $data = $this->load(); foreach ($keys as $key) { KeyUtil::validate($key); if (array_key_exists($key, $data)) { $value = $this->unserializeValue($data[$key]); }...
{@inheritdoc}
entailment
public function getMultipleOrFail(array $keys) { $values = array(); $data = $this->load(); foreach ($keys as $key) { KeyUtil::validate($key); if (!array_key_exists($key, $data)) { throw NoSuchKeyException::forKey($key); } $va...
{@inheritdoc}
entailment
public function remove($key) { KeyUtil::validate($key); $data = $this->load(); if (!array_key_exists($key, $data)) { return false; } unset($data[$key]); $this->save($data); return true; }
{@inheritdoc}
entailment
public function exists($key) { KeyUtil::validate($key); $data = $this->load(); return array_key_exists($key, $data); }
{@inheritdoc}
entailment
public function sort($flags = SORT_REGULAR) { $data = $this->load(); ksort($data, $flags); $this->save($data); }
{@inheritdoc}
entailment
public function checked(bool $bool, string $checked = '&check;', string $unchecked = '-'): string { return $bool ? $checked : $unchecked; }
@param bool $bool @param string $checked @param string $unchecked @return string
entailment
public function image(string $link, string $title = null, string $view = null): string { $view = $view ?: 'column.linkImage'; return GridView::view($view, [ 'link' => $link, 'title' => $title, ])->render(); }
@param string $link @param string|null $title @param string|null $view @return string @throws \Throwable
entailment
public function listToString( $data, string $title = null, string $titleAddition = null, string $class = null, string $delimiter = null, string $delimiterAddition = null, string $view = null ): string { $view = $view ?: 'column.listToString'; ...
@param $data @param string|null $title @param string|null $titleAddition @param string|null $class @param string|null $delimiter @param string|null $delimiterAddition @param string|null $view @return string @throws \Throwable
entailment
public function filterButton( string $name, string $id, string $class = null, string $icon = null, string $title = null, string $originTitle = null, string $view = null ): string { $icon = $icon ? $icon : 'fa fa-filter'; $class = $class ? $clas...
@param string $name @param string|null $id @param string|null $class @param string|null $icon @param string|null $title @param string|null $originTitle @param string|null $view @return string @throws \Throwable
entailment
public function editable(array $options = [], string $view = null): string { $view = $view ?: 'column.editableClick'; $initJsEvent = isset($options['initJsEvent']) ? $options['initJsEvent'] : 'ready change'; $initJsClass = isset($options['initJsClass']) ? $options['initJsClass'] : 'js_editab...
Editable ceil button * =========================================== * string - $initJsEvent - Init js event * string - $initJsClass - Init js class * bool - $escape - * string - $class - * string - $text - * string|array|int - $na...
entailment
public static function validateMultiple($keys) { foreach ($keys as $key) { if (!is_string($key) && !is_int($key)) { throw InvalidKeyException::forKey($key); } } }
Validates that multiple keys are valid. @param array $keys The tested keys. @throws InvalidKeyException If a key is invalid.
entailment
public function loginAction() { $provider = $this->Request()->getParam('provider'); if ($provider) { /** @var \Port1HybridAuth\Service\SingleSignOnService $singleSignOnService */ $singleSignOnService = $this->container->get('port1_hybrid_auth.single_sign_on_service'); ...
action login @throws \Exception
entailment
public function registerCustomerByUser($user) { /** @var ShopContextInterface $context */ $context = $this->context->getShopContext(); $shop = $context->getShop(); $customer = new Customer(); $customer->setAttribute([strtolower($user->getType()) . 'Identity' => $user->getI...
@param User $user @return Customer
entailment
public function connectUserWithExistingCustomer($user, $customer) { $result = false; if ($user->getEmail() === $customer->getEmail()) { \call_user_func( [$customer->getAttribute(), 'set' . ucfirst($user->getType()) . 'Identity'], $user->getId() ...
Connects a user with an existing customer @param User $user @param Customer $customer @return Customer|false Customer if connecting was successful, false if not (e.g. email adresses are not equal)
entailment
protected function udapteCustomerAttributes($customer) { try { $this->validator->validate($customer); $this->modelManager->persist($customer->getAttribute()); $this->modelManager->flush($customer->getAttribute()); $this->modelManager->refresh($customer->getAt...
@param Customer $customer @return Customer|false
entailment
protected function command($command, $repoPath = null) { if (!$repoPath) { $repoPath = $this->repo; } $command = 'git --git-dir="'.$repoPath.'/.git" --work-tree="'.$repoPath.'" '.$command; exec(escapeshellcmd($command), $output, $returnStatus); if ($returnStatu...
Runs a Git command. @param string $command @param null|string $repoPath @throws Exception if command fails @return array
entailment
protected function subModules() { $repo = $this->repo; $output = $this->command('submodule status'); if ($output) { foreach ($output as $line) { $line = explode(' ', trim($line)); $this->submodules[] = array( 'revision' => $lin...
Checks submodules
entailment
protected function checkSubSubmodules($repo, $name) { $output = $this->command('submodule foreach git submodule status'); if ($output) { foreach ($output as $line) { $line = explode(' ', trim($line)); if (trim($line[0]) == 'Entering') continue; ...
Checks submodules of submodules @param string $repo @param string $name
entailment
final public static function getEverythingFromArgs(\Enlight_Event_EventArgs $args, $element = null) { /** * @var \Enlight_Controller_Action $controller */ $controller = $args->get('subject'); /** * @var \Enlight_Controller_Request_Request $request */ ...
Returns an array in the form of var association: list($controller, $request, $view) = self::getEverythingFromArgs($args); @param \Enlight_Event_EventArgs $args @param null $element @return array|mixed|null
entailment