Add adoptee to the collector.
@param string $for Class name of the adopting entity
@param string $adoptee Class name of the adopted entity
@param string $discriminator Name for the discriminator column
@return $this
435565
public function addAdoptee($for, $adoptee, $discriminator)
    {
        if (!isset($this->entities[$for]) || !is_array($this->entities[$for])) {
            $this->entities[$for] = [];
        }
        $this->entities[$for][$discriminator] = $adoptee;
        return $this;
    }
362966
public function findAssociationsByRootAssociations($associationsFilter = null)
    {
        $arrayWithChilds = $this->associationsApiService->findAssociationsByRootAssociations($associationsFilter);

        $associations = new Associations();

        foreach ($arrayWithChilds as $xmlQuery) {
            $mapper = new \RGU\Dvoconnector\Mapper\Associations($xmlQuery);
            $mapper->mapToAbstractEntity($associations);
        }

        return $this->completeEntity($associations);
    }
770808
protected function applySimpleCondition(ISelectBuilder $selectBuilder)
    {
        $selectBuilder->expr($this->fieldColumn, $this->operator, $this->placeholder);
        $selectBuilder->bindValue($this->placeholder, $this->expression, $this->field->getDataType());

        return $this;
    }
283266
public function findAssociationsByAssociation($association, $associationsFilter = null)
    {
        $xmlQuery = $this->associationsApiService->getChildAssociationsFromAssociation($association->getID(), $associationsFilter);

        $associations = new Associations();

        $mapper = new \RGU\Dvoconnector\Mapper\Associations($xmlQuery);
        $mapper->mapToAbstractEntity($associations);

        return $this->completeEntity($associations);
    }
1204224
private function acceptBranch($sbas_id, \DOMElement $node)
    {
        if (strlen($oldid = $node->getAttribute("id")) > 1) {
            $node->setAttribute("id", $newid = ("C" . substr($oldid, 1)));
        }
        for ($n = $node->firstChild; $n; $n = $n->nextSibling) {
            if ($n->nodeType == XML_ELEMENT_NODE) {
                $this->acceptBranch($sbas_id, $n);
            }
        }
    }
1193935
public static function getAddonByIdentifier(string $identifier)
    {
        foreach (self::getAddons() as $addon) {
            if ($addon->getIdentifier() == $identifier) {
                return $addon;
            }
        }
        
        return null;
    }
616134
public function addSelection($sSelector, $sOptionSelector)
    {
        $sOptionSelector = str_replace('label=', '', $sOptionSelector);
        $this->getElementLazy($sSelector)->selectOption($sOptionSelector, true);
    }
1007822
private function attachDiscriminatorColumn(
        array $classAnnotations,
        ReflectionClass $reflectionClass,
        Mapping\ClassMetadata $metadata
    ) : void {
        $discriminatorColumn = new Mapping\DiscriminatorColumnMetadata();

        $discriminatorColumn->setTableName($metadata->getTableName());
        $discriminatorColumn->setColumnName('dtype');
        $discriminatorColumn->setType(Type::getType('string'));
        $discriminatorColumn->setLength(255);

        // Evaluate DiscriminatorColumn annotation
        if (isset($classAnnotations[Annotation\DiscriminatorColumn::class])) {
            /** @var Annotation\DiscriminatorColumn $discriminatorColumnAnnotation */
            $discriminatorColumnAnnotation = $classAnnotations[Annotation\DiscriminatorColumn::class];
            $typeName                      = ! empty($discriminatorColumnAnnotation->type)
                ? $discriminatorColumnAnnotation->type
                : 'string';

            $discriminatorColumn->setType(Type::getType($typeName));
            $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name);

            if (! empty($discriminatorColumnAnnotation->columnDefinition)) {
                $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition);
            }

            if (! empty($discriminatorColumnAnnotation->length)) {
                $discriminatorColumn->setLength($discriminatorColumnAnnotation->length);
            }
        }

        $metadata->setDiscriminatorColumn($discriminatorColumn);

        // Evaluate DiscriminatorMap annotation
        if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) {
            $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class];
            $discriminatorMap           = $discriminatorMapAnnotation->value;

            $metadata->setDiscriminatorMap($discriminatorMap);
        }
    }
103175
public function createDiscriminatorSelection() {
		$idQueryItems = array(new QueryColumn($this->getIdColumnName(), $this->registerEntityModel($this->entityModel)));
		$entityModels = array($this->entityModel);
		
		foreach ($this->entityModel->getAllSubEntityModels() as $subEntityModel) {
			$idQueryItems[] = new QueryColumn($this->getIdColumnName(), $this->registerEntityModel($subEntityModel));
			$entityModels[] = $subEntityModel;
		}
		
		return new JoinedDiscriminatorSelection($idQueryItems, $entityModels);
	}
556318
public function addSeeder(AbstractPopulator $seeder)
    {
        $seeder->setPopulator($this);
        $seeder->setDatabase($this->database);
        $seeder->setFaker($this->faker);
        $this->seeders[] = $seeder;
    }
90135
protected function deleteJoinTableRecords($identifier)
    {
        foreach ($this->class->getDeclaredPropertiesIterator() as $association) {
            if (! ($association instanceof ManyToManyAssociationMetadata)) {
                continue;
            }

            // @Todo this only covers scenarios with no inheritance or of the same level. Is there something
            // like self-referential relationship between different levels of an inheritance hierarchy? I hope not!
            $selfReferential   = $association->getTargetEntity() === $association->getSourceEntity();
            $owningAssociation = $association;
            $otherColumns      = [];
            $otherKeys         = [];
            $keys              = [];

            if (! $owningAssociation->isOwningSide()) {
                $class             = $this->em->getClassMetadata($association->getTargetEntity());
                $owningAssociation = $class->getProperty($association->getMappedBy());
            }

            $joinTable     = $owningAssociation->getJoinTable();
            $joinTableName = $joinTable->getQuotedQualifiedName($this->platform);
            $joinColumns   = $association->isOwningSide()
                ? $joinTable->getJoinColumns()
                : $joinTable->getInverseJoinColumns();

            if ($selfReferential) {
                $otherColumns = ! $association->isOwningSide()
                    ? $joinTable->getJoinColumns()
                    : $joinTable->getInverseJoinColumns();
            }

            $isOnDeleteCascade = false;

            foreach ($joinColumns as $joinColumn) {
                $keys[] = $this->platform->quoteIdentifier($joinColumn->getColumnName());

                if ($joinColumn->isOnDeleteCascade()) {
                    $isOnDeleteCascade = true;
                }
            }

            foreach ($otherColumns as $joinColumn) {
                $otherKeys[] = $this->platform->quoteIdentifier($joinColumn->getColumnName());

                if ($joinColumn->isOnDeleteCascade()) {
                    $isOnDeleteCascade = true;
                }
            }

            if ($isOnDeleteCascade) {
                continue;
            }

            $this->conn->delete($joinTableName, array_combine($keys, $identifier));

            if ($selfReferential) {
                $this->conn->delete($joinTableName, array_combine($otherKeys, $identifier));
            }
        }
    }
753341
public function addDiscriminator(string $class, string $key, string $discriminatorClass): void
    {
        if (!isset($this->discriminators[$class])) {
            $this->discriminators[$class] = [];
        }

        if (!isset($this->discriminators[$class][$key])) {
            $this->discriminators[$class][$key] = $discriminatorClass;
        }
    }
1349483
public function addStep(StepDescriptor $descriptor)
    {
        $id = $descriptor->getId();
        if (null !== $this->getStep($id)) {
            $errMsg = sprintf('Шаг с id %s уже существует', $id);
            throw new InvalidArgumentException($errMsg);
        }

        $this->getSteps()->attach($descriptor);
        return $this;
    }
1337363
public function add($candidate)
    {
        $hash = $this->objectHash($candidate);

        if (isset($this->candidateIds[$hash])) {
            return $this;
        }

        $function = $this->shouldCallReversed() ? 'array_unshift' : 'array_push';

        $function($this->candidates, $this->checkAndReturn($candidate));

        $this->candidateIds[$hash] = true;

        return $this;
    }
213494
protected function addConvertor(AbstractConvertor $convertor)
	{
		foreach ($convertor->getRegexpGroups() as $name => $group)
		{
			$this->matchGroup[$name] = $group;
			$this->groups[$group][]  = '(?&' . $name . ')';
		}

		foreach ($convertor->getRegexps() as $name => $regexp)
		{
			$regexp = $this->insertCaptureNames($name, $regexp);
			$regexp = str_replace(' ', '\\s*', $regexp);
			$regexp = '(?<' . $name . '>' . $regexp . ')';

			$this->callbacks[$name] = [$convertor, 'convert' . $name];
			$this->regexps[$name]   = $regexp;
		}
	}
48966
public function addIdentifier($identifier)
    {
        if (!isset($this->identifiers[$identifier])) {
            $this->identifiers[$identifier] = $identifier;
        }

        return $this;
    }
1153226
public function addExchangeRateProvider(ExchangeRateProvider $provider) : self
    {
        $hash = spl_object_hash($provider);
        $this->providers[$hash] = $provider;

        return $this;
    }