_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
33
8k
language
stringclasses
1 value
meta_information
dict
q10400
WaitingListRegistrationForm.doRegister
train
public function doRegister($data, WaitingListRegistrationForm $form) { $form->saveInto($registration = WaitingListRegistration::create()); $registration->EventID = $this->getController()->ID;
php
{ "resource": "" }
q10401
Database.getInfo
train
public function getInfo(string $key = null) { if ($this->info == null) { $resource = $this->linker->getLink()->getAgent()->getResource(); $resourceType = $resource->getType(); $serverVersion = $clientVersion = null; if ($resourceType == Resource::TYPE_MYSQL_LINK) { $object = $resource->getObject(); foreach (get_class_vars(get_class($object)) as $var => $_) { $this->info[$var] = $object->{$var}; } $serverVersion = preg_replace('~\s*([^ ]+).*~', '\1', $object->server_info); $clientVersion = preg_replace('~(?:[a-z]+\s+)?([^ ]+).*~i', '\1', $object->client_info);
php
{ "resource": "" }
q10402
LayoutRow.updateSize
train
protected function updateSize() { $sizeY = abs($this->startY); $sizeX = 0; foreach ($this->elements as $idx => $element) { $sizeY += $element->getHeight() + $this->margin; if (abs($element->getX()) + $element->getWidth() > $sizeX) {
php
{ "resource": "" }
q10403
LayoutRow.setPosition
train
public function setPosition($x, $y) { $this->posX = $x;
php
{ "resource": "" }
q10404
AccountManager.getAccounts
train
public function getAccounts() { //Is Group: Further accounts can be made under Groups, but entries can be made against non-Groups $accounts = array(); $this->Account->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($Account) use (&$accounts) {
php
{ "resource": "" }
q10405
AccountManager.getGroupsAccounts
train
public function getGroupsAccounts() { //Is Group: Further accounts can be made under Groups, but entries can be made against non-Groups $accounts = array(); $this->Account->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($Account) use (&$accounts) { if($Account->is_group)
php
{ "resource": "" }
q10406
AccountManager.getAccountsTypes
train
public function getAccountsTypes() { //Is Group: Further accounts can be made under Groups, but entries can be made against non-Groups $accountTypes = array(); $this->AccountType->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($AccountType) use (&$accountTypes)
php
{ "resource": "" }
q10407
Node.accept
train
public function accept(VisitorInterface $visitor): void { $visitor->visitBefore($this); foreach ($this->getChildren() as $node) {
php
{ "resource": "" }
q10408
Node.getChild
train
public function getChild(string $name): Node { foreach ($this->children as $node) {
php
{ "resource": "" }
q10409
Node.hasChild
train
public function hasChild(string $name): bool { foreach ($this->children as $node) { if (strcasecmp($node->getName(), $name) == 0) {
php
{ "resource": "" }
q10410
Node.getChildren
train
public function getChildren(string $name = ''): array { $nodes = []; foreach ($this->children as $node) { if (!$name ||
php
{ "resource": "" }
q10411
SettingManager.getCountryAccountsChartsTypes
train
public function getCountryAccountsChartsTypes() { $accountsChartsTypes = array(); $this->AccountChartType->accountsChartsTypesByCountry($this->AuthenticationManager->getCurrentUserOrganizationCountry())->each(function($AccountChartType) use(&$accountsChartsTypes) { $name = $this->Lang->has($AccountChartType->lang_key) ? $this->Lang->get($AccountChartType->lang_key) :
php
{ "resource": "" }
q10412
SettingManager.getSystemCurrencies
train
public function getSystemCurrencies() { $currencies = array(); $this->Currency->all()->each(function($Currency) use (&$currencies) { array_push($currencies, array('label'=> $Currency->name . '
php
{ "resource": "" }
q10413
SettingManager.getSettingJournals
train
public function getSettingJournals() { return $this->JournalManager->getJournalsByApp(array('appId' => 'acct-initial-acounting-setup', 'page' => 1, 'journalizedId' =>
php
{ "resource": "" }
q10414
Model.initModelProperties
train
private static function initModelProperties() { $currentModel = static::class; if (isset(self::$modelProperties[$currentModel])) { return; } $properties = [ 'connection' => ConnectionFactory::build(static::$connection), 'dateFields' => static::$dates ?: [], 'fields' => static::$fields ?: [], 'primaryKeys' => (array) static::$primaryKey, 'table' => static::$table, 'timestamps' => (bool) static::$timestamps, ];
php
{ "resource": "" }
q10415
Model.exists
train
public function exists() : bool { $query = static::createQuery(); $pks = static::getPrimaryKeys(); $pkValues = $this->getPrimaryKeyValues(); if (count($pks) != count($pkValues)) { return false; } $filterFunction = function (WhereClause $whereClause) use (&$pkValues, $query) { foreach ($pkValues as $field => $value) {
php
{ "resource": "" }
q10416
Model.insert
train
public function insert() : Result { $result = self::getConnection()->insert($this); /* * In a successful insert operation, assign the new id to * current model. */ if ($result->count()) {
php
{ "resource": "" }
q10417
MelisModuleManager.sanitize
train
public static function sanitize($input, $skip = [], $textOnly = false, $removeFunctions = true) { if (!is_array($input)) { if (true === $removeFunctions) { $input = preg_replace('/[a-zA-Z][a-zA-Z0-9_]+(\()+([a-zA-Z0-9_\-$,\s\"]?)+(\))(\;?)/', '', $input); } $invalidValues = ['exec', '\\', '&amp;', '&#', '0x', '<script>', '</script>', '">', "'>"]; $allowableTags = '<p><br><img><label><input><textarea><div><span><a><strong><i><u>'; $input = str_replace($invalidValues, '', $input); $input = preg_replace('/%[a-zA-Z0-9]{2}/', '', $input); $input = strip_tags(trim($input), $allowableTags); if ($textOnly) { $input = str_replace(['<', '>', "'", '"'], '', $input); } return $input; } else { $array = []; foreach ($input as $key => $item) {
php
{ "resource": "" }
q10418
XmlDualList.setDataSource
train
public function setDataSource($listLeft, $listRight = null)
php
{ "resource": "" }
q10419
XmlDualList.createDefaultButtons
train
public function createDefaultButtons() { $this->setButtonOneLeft(new DualListButton("&#60;--", DualListButtonType::Button)); $this->setButtonAllLeft(new DualListButton("&#60;&#60;&#60;", DualListButtonType::Button)); $this->setButtonOneRight(new
php
{ "resource": "" }
q10420
XmlDualList.Parse
train
public static function Parse($context, $duallistaname) { $val = $context->get($duallistaname); if ($val != "") {
php
{ "resource": "" }
q10421
XmlDualList.buildListItens
train
private function buildListItens($list, $arr) { foreach ($arr as $key=>$value) { $item = XmlUtil::CreateChild($list, "item", "");
php
{ "resource": "" }
q10422
XmlDualList.makeButton
train
private function makeButton($button, $name, $duallist, $from, $to, $all) { $newbutton = XmlUtil::CreateChild($duallist, "button", ""); XmlUtil::AddAttribute($newbutton, "name", $name); if ($button->type == DualListButtonType::Image ) { XmlUtil::AddAttribute($newbutton, "type", "image"); XmlUtil::AddAttribute($newbutton, "src", $button->href); XmlUtil::AddAttribute($newbutton, "value", $button->text); }else {
php
{ "resource": "" }
q10423
Collection.delete
train
function delete($key) { $this->data[$key] = null;
php
{ "resource": "" }
q10424
Collection.chunk
train
function chunk(int $numitems, bool $preserve_keys = false) {
php
{ "resource": "" }
q10425
Collection.diff
train
function diff($arr) { if($arr instanceof self) { $arr = $arr->all(); }
php
{ "resource": "" }
q10426
Collection.diffKeys
train
function diffKeys($arr) { if($arr instanceof self) { $arr = $arr->all(); }
php
{ "resource": "" }
q10427
Collection.each
train
function each(callable $closure) { foreach($this->data as $key => $val) { $feed = $closure($val, $key); if($feed === false)
php
{ "resource": "" }
q10428
Collection.filter
train
function filter(callable $closure) { $new = array(); foreach($this->data as $key => $val) { $feed = (bool) $closure($val, $key); if($feed) {
php
{ "resource": "" }
q10429
Collection.first
train
function first(callable $closure = null) { if($closure === null) { if(empty($this->data)) { return null; } $keys = \array_keys($this->data); return ($this->data[$keys[0]] ?? null); }
php
{ "resource": "" }
q10430
Collection.flatten
train
function flatten(int $depth = 0) { $data = $this->flattenDo($this->data, $depth);
php
{ "resource": "" }
q10431
Collection.groupBy
train
function groupBy($column) { if($column === null || $column === '') { return $this; } $new = array(); foreach($this->data as $key => $val) { if(\is_callable($column)) {
php
{ "resource": "" }
q10432
Collection.implode
train
function implode($col, string $glue = ', ') { $data = ''; foreach($this->data as $key => $val) { if(\is_array($val)) { if(!isset($val[$col])) { throw new \BadMethodCallException('Specified key "'.$col.'" does not exist on array'); } $data .= $glue.$val[$col]; } elseif(\is_object($val)) { if(!isset($val->$col)) {
php
{ "resource": "" }
q10433
Collection.indexOf
train
function indexOf($value) { $i = 0; foreach($this->data as $val) { if($val === $value) { return $i;
php
{ "resource": "" }
q10434
Collection.intersect
train
function intersect($arr) { if($arr instanceof self) { $arr
php
{ "resource": "" }
q10435
Collection.last
train
function last(callable $closure = null) { if($closure === null) { if(empty($this->data)) { return null; } $keys = \array_keys($this->data); return $this->data[$keys[(\count($keys) - 1)]]; }
php
{ "resource": "" }
q10436
Collection.map
train
function map(callable $closure) { $keys = \array_keys($this->data);
php
{ "resource": "" }
q10437
Collection.max
train
function max($key = null) { if($key !== null) { $data = \array_column($this->data, $key); } else {
php
{ "resource": "" }
q10438
Collection.min
train
function min($key = null) { if($key !== null) { $data = \array_column($this->data, $key); } else {
php
{ "resource": "" }
q10439
Collection.merge
train
function merge(\CharlotteDunois\Collect\Collection $collection) {
php
{ "resource": "" }
q10440
Collection.nth
train
function nth(int $nth, int $offset = 0) { if($nth <= 0) { throw new \InvalidArgumentException('nth must be a non-zero positive integer'); } $new = array();
php
{ "resource": "" }
q10441
Collection.only
train
function only(array $keys) { $new = array(); foreach($this->data as $key => $val) {
php
{ "resource": "" }
q10442
Collection.partition
train
function partition(callable $closure) { $collection1 = new self(); $collection2 = new self(); foreach($this->data as $key => $val) { if($closure($val, $key)) { $collection1->set($key, $val);
php
{ "resource": "" }
q10443
Collection.pluck
train
function pluck($key, $index = null) { $data = array(); $i = 0; foreach($this->data as $v) { $k = ($index ? (\is_array($v) ? (\array_key_exists($index, $v) ? $v[$index] : $i) : (\is_object($v) ?
php
{ "resource": "" }
q10444
Collection.random
train
function random(int $num = 1) { $rand = \array_rand($this->data, $num); if(!\is_array($rand)) { $rand = array($rand); } $col = new self();
php
{ "resource": "" }
q10445
Collection.reduce
train
function reduce(callable $closure, $carry = null) { foreach($this->data as $val) { $carry = $closure($carry,
php
{ "resource": "" }
q10446
Collection.search
train
function search($needle, bool $strict = true) {
php
{ "resource": "" }
q10447
Collection.slice
train
function slice(int $offset, int $limit = null, bool $preserve_keys = false) { $data = $this->data;
php
{ "resource": "" }
q10448
Collection.some
train
function some(callable $closure) { foreach($this->data as $key => $val) { if($closure($val, $key)) {
php
{ "resource": "" }
q10449
Collection.sort
train
function sort(bool $descending = false, int $options = \SORT_REGULAR) { $data = $this->data; if($descending) { \arsort($data, $options); } else {
php
{ "resource": "" }
q10450
Collection.sortKey
train
function sortKey(bool $descending = false, int $options = \SORT_REGULAR) { $data = $this->data; if($descending) { \krsort($data, $options); } else {
php
{ "resource": "" }
q10451
Collection.sortCustom
train
function sortCustom(callable $closure) { $data = $this->data; \uasort($data,
php
{ "resource": "" }
q10452
Collection.sortCustomKey
train
function sortCustomKey(callable $closure) { $data = $this->data; \uksort($data,
php
{ "resource": "" }
q10453
Collection.unique
train
function unique($key, $options = \SORT_REGULAR) { if($key === null) { return (new self(\array_unique($this->data, $options))); } $exists = array(); return $this->filter(function ($item) use ($key, &$exists) { if(\is_array($item)) { if(!isset($item[$key])) { throw new \BadMethodCallException('Specified key "'.$key.'" does not exist on array');
php
{ "resource": "" }
q10454
File.resolveClass
train
public function resolveClass(FoundClass $found) { Logger::trace("Resolving class %s", $found->name); if ($found->name[0] === '\\') { return new Classname($found->name); } $classParts = explode('\\', $found->name); if (count($classParts) >= 2) { $b = array_shift($classParts); $baseClass = $this->originalUse->get($b); if ($baseClass) { return new Classname($baseClass . '\\' . implode('\\', $classParts)); } } if ($c = $this->originalUse->get($found->name))
php
{ "resource": "" }
q10455
File.shortenClasses
train
public function shortenClasses($classesToFix, Configuration $config) { $cumulativeOffset = 0; /** @var FoundClass $c */ foreach ($classesToFix as $c) { $replacement = []; if (in_array($c->name, $this->ignoredClassNames)) { if ($c->name == $this->originalClassname) { $replacement = [[T_STATIC, "static", 2]]; } else { continue; } } if (!$replacement) { $resolvedClass =
php
{ "resource": "" }
q10456
File.getSrc
train
public function getSrc() { $content = ""; foreach ($this->tokens as $token) { $content .= is_string($token)
php
{ "resource": "" }
q10457
File.save
train
public function save($directory) { $parts = explode('_', $this->getClass()); array_unshift($parts, $directory);
php
{ "resource": "" }
q10458
File.saveToFile
train
private static function saveToFile($path, $contents) { $directory = pathinfo($path, PATHINFO_DIRNAME); if (!file_exists($directory)) {
php
{ "resource": "" }
q10459
HookReciever.saveLastProcessedVersion
train
public function saveLastProcessedVersion($version) { $this->lastProcessedVersion = $version; $this->myCreateColumn = null; $this->deleteFromSQL(['serverurl' => constant('FLEXIBEE_URL')]); if (is_null($this->insertToSQL(['serverurl' => constant('FLEXIBEE_URL'),
php
{ "resource": "" }
q10460
SyncPlugin.putFile
train
private function putFile(MountManager $mountManager, string $from, string $to, array $config): bool { $this->logger->debug("Copying file $from to $to"); list($prefixFrom, $from) = $mountManager->getPrefixAndPath($from); $buffer = $mountManager->getFilesystem($prefixFrom)->readStream($from); if ($buffer === false) { return false;
php
{ "resource": "" }
q10461
IdGenerator.generateSessionId
train
public static function generateSessionId($length = 40) { if ($length < 1) { throw new \InvalidArgumentException('Length should be >= 1'); } $chars = '0123456789abcdefghijklmnopqrstuvwxyz'; $numChars = 36; $bytes = random_bytes($length); $pos = 0;
php
{ "resource": "" }
q10462
PlayerFactory.createPlayer
train
public function createPlayer(PlayerInfo $playerInfo, PlayerDetailedInfo $playerDetailedInfo) { $class = $this->class; $player = new $class();
php
{ "resource": "" }
q10463
TwoDimensionalPoint.getRenderData
train
public function getRenderData( $useLabel = false ) { if ( ( $this->jsWriter->getType( $this->series->getTitle() ) instanceof \Altamira\Type\Flot\Donut ) ) { $value = array( 1, $this['y'] ); } else {
php
{ "resource": "" }
q10464
DlstatsHelper.checkIP
train
public function checkIP($UserIP = false) { // Check if IP present if ($UserIP === false) { $tempIP = $this->dlstatsGetUserIP(); if ($tempIP !== false) { $this->IP = $tempIP; } else { return false; // No IP, no search. } } else { $this->IP = $UserIP; } // IPv4 or IPv6 ? switch ($this->checkIPVersion($this->IP)) { case "IPv4": if ($this->checkIPv4($this->IP) === true) { $this->IP_Filter = true;
php
{ "resource": "" }
q10465
DlstatsHelper.checkIPVersion
train
protected function checkIPVersion($UserIP = false) { // Test for IPv4 if (ip2long($UserIP) !== false) { $this->IP_Version = "IPv4"; return $this->IP_Version; } // Test for IPv6 if (substr_count($UserIP, ":") < 2) { $this->IP_Version = false; return false; } // ::1 or 2001::0db8 if (substr_count($UserIP, "::") > 1) { $this->IP_Version = false; return false; // one allowed } $groups = explode(':', $UserIP); $num_groups = count($groups); if (($num_groups > 8) || ($num_groups < 3)) { $this->IP_Version = false; return false; } $empty_groups = 0; foreach ($groups as $group) { $group = trim($group); if (! empty($group) && ! (is_numeric($group) && ($group == 0))) {
php
{ "resource": "" }
q10466
DlstatsHelper.checkIPv6
train
protected function checkIPv6($UserIP = false) { // Check if IP present if ($UserIP === false) { return false; // No IP, no search. } // search for user bot IP-filter definitions in localconfig.php if (isset($GLOBALS['DLSTATS']['BOT_IPV6']))
php
{ "resource": "" }
q10467
DlstatsHelper.checkIPv4
train
protected function checkIPv4($UserIP = false) { // Check if IP present if ($UserIP === false) { return false; // No IP, no search. } // search for user bot IP-filter definitions in localconfig.php if (isset($GLOBALS['DLSTATS']['BOT_IPV4']))
php
{ "resource": "" }
q10468
DlstatsHelper.dlstatsAnonymizeDomain
train
protected function dlstatsAnonymizeDomain() { if ($this->IP_Version === false || $this->IP === '0.0.0.0') { return ''; } if (isset($GLOBALS['TL_CONFIG']['privacyAnonymizeIp']) && (bool) $GLOBALS['TL_CONFIG']['privacyAnonymizeIp'] === false) { // Anonymize is disabled $domain = gethostbyaddr($this->IP); return ($domain == $this->IP) ? '' : $domain; } // Anonymize is enabled $domain = gethostbyaddr($this->IP); if ($domain !=
php
{ "resource": "" }
q10469
TextListConfig.add
train
public function add($element) { $currentValue = $this->getRawValue(); if (!in_array($element, $currentValue)) { $currentValue[] = $element;
php
{ "resource": "" }
q10470
TextListConfig.remove
train
public function remove($element) { $currentValue = $this->getRawValue(); if (($key = array_search($element,
php
{ "resource": "" }
q10471
JqPlot.useCursor
train
public function useCursor() { $this->files = array_merge_recursive( array( 'jqplot.cursor.js' ), $this->files ); $this->setNestedOptVal( $this->options, 'cursor', 'show', true );
php
{ "resource": "" }
q10472
JqPlot.setAxisOptions
train
public function setAxisOptions($axis, $name, $value) { if(strtolower($axis) === 'x' || strtolower($axis) === 'y') { $axis = strtolower($axis) . 'axis'; if ( in_array( $name, array( 'min', 'max', 'numberTicks', 'tickInterval', 'numberTicks' ) ) ) { $this->setNestedOptVal( $this->options, 'axes', $axis, $name, $value );
php
{ "resource": "" }
q10473
JqPlot.setType
train
public function setType( $type, $options = array(), $series = 'default' ) { parent::setType( $type, $options, $series ); if ( $series == 'default' ) { $rendererOptions = $this->types['default']->getRendererOptions(); if ( $renderer = $this->types['default']->getRenderer() ) { $this->options['seriesDefaults']['renderer']
php
{ "resource": "" }
q10474
JqPlot.getOptionsJS
train
protected function getOptionsJS() { $opts = $this->options; foreach ( $opts['seriesStorage'] as $label => $options ) { $options['label'] = $label; $opts['series'][] = $options; }
php
{ "resource": "" }
q10475
JqPlot.setSeriesLabelSetting
train
public function setSeriesLabelSetting( $series, $name, $value ) { if ( ( $name === 'location' && in_array( $value, array( 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' ) ) )
php
{ "resource": "" }
q10476
TitleRenderer.preRender
train
public static function preRender( \Altamira\Chart $chart, array $styleOptions = array() ) { if ( $chart->titleHidden() ) { return ''; } $tagType = isset( $styleOptions['titleTag'] ) ? $styleOptions['titleTag'] : 'h3'; $title = $chart->getTitle();
php
{ "resource": "" }
q10477
AdminGroups.getUserGroups
train
public function getUserGroups() { $groups = []; foreach ($this->adminGroupConfiguration->getGroups() as $groupName) { $groups[] = $this->getUserGroup("$groupName");
php
{ "resource": "" }
q10478
AdminGroups.getLoginUserGroups
train
public function getLoginUserGroups($login) { $groupName = $this->adminGroupConfiguration->getLoginGroupName($login); if (empty($groupName)) {
php
{ "resource": "" }
q10479
AdminGroups.hasPermission
train
public function hasPermission($recipient, $permission) { if ($recipient instanceof Group) { $check = true; foreach ($recipient->getLogins() as $login) {
php
{ "resource": "" }
q10480
AdminGroups.hasGroupPermission
train
public function hasGroupPermission($groupName, $permission) { if (strpos($groupName, 'admin:') === 0) { $groupName = str_replace("admin:", '', $groupName); } $logins = $this->adminGroupConfiguration->getGroupLogins($groupName); if (!empty($logins)) {
php
{ "resource": "" }
q10481
EmbedViewHelper.render
train
public function render($uri, $maxWidth = 0, $maxHeight = 0, $objectName = null) { $consumer = new Consumer(); $this->prepareRequestParameters($maxWidth, $maxHeight, $consumer); $resourceObject = $consumer->consume($uri); if ($resourceObject !== null) { if ($objectName !== null) { if ($this->templateVariableContainer->exists($objectName)) { throw new Exception('Object name for EmbedViewHelper given as: ' . htmlentities($objectName) . '. This variable name is already in use, choose another.', 1359969229); }
php
{ "resource": "" }
q10482
ActiveRecord.removeAll
train
public final function removeAll($whereParams): int { $whereParams = [$whereParams]; if ($whereParams[0] === null || $whereParams[0] === '') { throw new InvalidValueException('You need to pass a parameter for delete action!'); } $return = $this->db->getLink()->getAgent()
php
{ "resource": "" }
q10483
ThriftyFileSession.end
train
public function end() { if ($this->isStarted()) { if (is_callable($this->getCleanupCallback())) { call_user_func($this->getCleanupCallback());
php
{ "resource": "" }
q10484
ThriftyFileSession.setCleanupCallback
train
public function setCleanupCallback($callback) { if (!is_null($callback) && !is_callable($callback) ) {
php
{ "resource": "" }
q10485
ThriftyFileSession.setCookieLifetime
train
public function setCookieLifetime($ttl) { if (!is_null($ttl) && !is_numeric($ttl) ) {
php
{ "resource": "" }
q10486
ID.fixSforceId
train
public static function fixSforceId($shortId) { $shortId = (string)$shortId; if (strlen($shortId) !== 15) { return new self($shortId); } $suffix = ''; for ($i = 0; $i < 3; $i++) { $flags = 0; for ($j = 0; $j < 5; $j++) { $c =
php
{ "resource": "" }
q10487
Entity.getRoot
train
public function getRoot() { $tmp_parent = $this->getParent(); $root = $tmp_parent; while ($tmp_parent) { $root = $tmp_parent;
php
{ "resource": "" }
q10488
Entity.setValue
train
public function setValue($attribute_name, $attribute_value) { $value_holder = $this->getValueHolderFor($attribute_name);
php
{ "resource": "" }
q10489
Entity.setValues
train
public function setValues(array $values) { foreach ($this->type->getAttributes()->getKeys() as $attribute_name) { if (array_key_exists($attribute_name, $values)) {
php
{ "resource": "" }
q10490
Entity.toArray
train
public function toArray() { $attribute_values = [ self::OBJECT_TYPE => $this->getType()->getPrefix() ]; foreach ($this->value_holder_map as $attribute_name => $value_holder) { $attribute_value = $value_holder->getValue(); if (is_object($attribute_value) && is_callable([ $attribute_value, 'toArray' ])) {
php
{ "resource": "" }
q10491
Entity.isEqualTo
train
public function isEqualTo(EntityInterface $entity) { if ($entity->getType() !== $this->getType()) { return false; } if ($this->getType()->getAttributes()->getSize() !== $this->value_holder_map->getSize()) { return false; } foreach ($this->getType()->getAttributes()->getKeys() as
php
{ "resource": "" }
q10492
Entity.addEntityChangedListener
train
public function addEntityChangedListener(EntityChangedListenerInterface $listener)
php
{ "resource": "" }
q10493
Entity.removeEntityChangedListener
train
public function removeEntityChangedListener(EntityChangedListenerInterface $listener) { if ($this->listeners->hasItem($listener)) {
php
{ "resource": "" }
q10494
Entity.onValueChanged
train
public function onValueChanged(ValueChangedEvent $event) { // @todo Possible optimization: only track events for EmbedRoot entities, // what will save some memory when dealing with
php
{ "resource": "" }
q10495
Entity.collateChildren
train
public function collateChildren(Closure $criteria, $recursive = true) { $entity_map = new EntityMap; $nested_attribute_types = [ EmbeddedEntityListAttribute::CLASS, EntityReferenceListAttribute::CLASS ]; foreach ($this->getType()->getAttributes([], $nested_attribute_types) as $attribute) { foreach ($this->getValue($attribute->getName()) as $child_entity) {
php
{ "resource": "" }
q10496
WindowHelpFactory.getChatCommands
train
protected function getChatCommands(ManialinkInterface $manialink) { $login = $manialink->getUserGroup()->getLogins()[0]; return array_map( function ($command) { /** @var AbstractChatCommand $command */ return [ 'command' => $command->getCommand(), 'description' => $command->getDescription(), 'help' => $command->getHelp(), 'aliases' => $command->getAliases(), ];
php
{ "resource": "" }
q10497
WindowHelpFactory.callbackCallCommand
train
public function callbackCallCommand(ManialinkInterface $manialink, $login, $params, $arguments) {
php
{ "resource": "" }
q10498
WindowHelpFactory.callbackDescription
train
public function callbackDescription(ManialinkInterface $manialink, $login, $params, $arguments) { $chatCommands = $this->chatCommands->getChatCommands();
php
{ "resource": "" }
q10499
ErrorObject.addError
train
public function addError(string $msg, string ...$args): void {
php
{ "resource": "" }