EmberSerializers::associationsMerege()

@param mixed $name
@param mixed $association
@return void
166285
private function associationsMerege($name,$association) {
		$name= Inflector::tableize($name);
		if (!isset($this->models[$name])){
			$this->models[$name] = array();
		}
		if(!isset($association[0])) {
			$association = array($association);
		}
		
		
		foreach($association as $key => $rec) {
			
			if($rec['id'] !== null && !Hash::contains($this->models[$name], $rec) ) {
				$this->models[$name][] =  $rec;
			}
		}
	}
1246339
public function addOneToMany($name, $targetEntity, $mappedBy)
    {
        $builder = $this->createOneToMany($name, $targetEntity);
        $builder->mappedBy($mappedBy);

        return $builder->build();
    }
782401
public function setAssociationContext(XMLElement &$wrapper)
    {
        $association_context = $this->getAssociationContext();

        if (!empty($association_context)) {
            $wrapper->setAttributeArray(array(
                'data-parent-section-id' => $association_context['parent_section_id'],
                'data-parent-section-field-id' => $association_context['parent_section_field_id'],
                'data-child-section-id' => $association_context['child_section_id'],
                'data-child-section-field-id' => $association_context['child_section_field_id'],
                'data-interface' => $association_context['interface'],
                'data-editor' => $association_context['editor']
            ));
        }
    }
870094
function storeAssociation($server_url, $association)
    {
        // create memcached keys for association itself
        // and list of associations for this server
        $associationKey = $this->associationKey($server_url,
            $association->handle);
        $serverKey = $this->associationServerKey($server_url);

        // get list of associations
        $serverAssociations = $this->connection->get($serverKey);

        // if no such list, initialize it with empty array
        if (!$serverAssociations) {
            $serverAssociations = array();
        }
        // and store given association key in it
        $serverAssociations[$association->issued] = $associationKey;

        // save associations' keys list
        $this->connection->set(
            $serverKey,
            $serverAssociations,
            $this->compress
        );
        // save association itself
        $this->connection->set(
            $associationKey,
            $association,
            $this->compress,
            $association->issued + $association->lifetime);
    }
665407
private function updateAssociationWithMergedEntity($entity, array $association, $previousManagedCopy, $managedCopy)
    {
        $assocField = $association['fieldName'];
        $prevClass  = $this->em->getClassMetadata(get_class($previousManagedCopy));

        if ($association['type'] & ClassMetadata::TO_ONE) {
            $prevClass->reflFields[$assocField]->setValue($previousManagedCopy, $managedCopy);

            return;
        }

        $value   = $prevClass->reflFields[$assocField]->getValue($previousManagedCopy);
        $value[] = $managedCopy;

        if ($association['type'] == ClassMetadata::ONE_TO_MANY) {
            $class = $this->em->getClassMetadata(get_class($entity));

            $class->reflFields[$association['mappedBy']]->setValue($managedCopy, $previousManagedCopy);
        }
    }
189830
public function setAssociation($name, $value, $raw = false)
    {
        if ($raw) {
            $this->loadedAssociations[$name] = $value;
        } else {
            return (new Setter())->set($this, $name, $value);
        }
    }
891282
private function getParentJoin(Association $association): array
    {
        $table = $association->getTarget();

        $result = [];
        foreach (Utils::getTableAssignationFields($table) as $field) {
            $result[$table->aliasField($field) . ' IN'] = $this->user['id'];
        }

        return $result;
    }
265951
public void setAssociations(java.util.Collection<InstanceAssociation> associations) {
        if (associations == null) {
            this.associations = null;
            return;
        }

        this.associations = new com.amazonaws.internal.SdkInternalList<InstanceAssociation>(associations);
    }
361191
public function validateAssociations()
    {
        foreach ($this->associationMappings as $mapping) {
            if ( ! ClassLoader::classExists($mapping['targetEntity']) ) {
                throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']);
            }
        }
    }
279742
public function associate($entity)
    {
        $this->parent->setEntityAttribute($this->foreignKey, $entity->getEntityAttribute($this->otherKey));
    }
851543
public function validateAssociations() : void
    {
        array_map(
            function (Property $property) {
                if (! ($property instanceof AssociationMetadata)) {
                    return;
                }

                $targetEntity = $property->getTargetEntity();

                if (! class_exists($targetEntity)) {
                    throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName());
                }
            },
            $this->declaredProperties
        );
    }
597519
protected function determineAssociationsByName($name)
    {
        $associationsFilter = new AssociationsFilter();
        $associationsFilter->setName($name);

        $associations = $this->associationRepository->findAssociationsByRootAssociations($associationsFilter);

        return $associations;
    }
735790
protected function updateBelongsToManyRelation($eloquentModel, $name, $action)
    {
        $eloquentCollection = $eloquentModel->getRelation($name);

        if (! $eloquentCollection instanceof \Illuminate\Database\Eloquent\Collection) {
            throw new Exception("Many-to-many relation '".$name."' is not a valid collection");
        }

        // get related keys
        $keys = [];

        foreach($eloquentCollection as $item) {
            $keys[] = $item->getKey();
        }

        // attach/sync/detach keys
        if ($action == 'insert') {
            $eloquentModel->{$name}()->attach($keys);
        }
        if ($action == 'update') {
            $eloquentModel->{$name}()->sync($keys);
        }
        if ($action == 'delete') {
            $eloquentModel->{$name}()->detach($keys);
        }
    }
295759
public function visitAssociation($className, $association = null)
    {
        if (null === $association) {
            return $this->visitSingleSidedAssociation($className);
        }

        return $this->visitDoubleSidedAssociation($className, $association);
    }
1277276
private function getAssociationFromServer($associationKey)
    {
        $association = $this->redis->get($associationKey);
        return $association ? unserialize($association) : null;
    }
519130
public function add_associations($unused = null) {

        if ($unused !== null) {
            debugging('Illegal argument used in blog_entry->add_associations()', DEBUG_DEVELOPER);
        }

        $this->remove_associations();

        if (!empty($this->courseassoc)) {
            $this->add_association($this->courseassoc);
        }

        if (!empty($this->modassoc)) {
            $this->add_association($this->modassoc);
        }
    }
1132207
public function setAssociationMapping($associationMapping)
    {
        if (!\is_array($associationMapping)) {
            throw new \InvalidArgumentException('The association mapping must be an array');
        }

        $this->associationMapping = $associationMapping;

        if (isset($associationMapping['type'])) {
            $this->type = $this->type ?: $associationMapping['type'];
            $this->mappingType = $this->mappingType ?: $associationMapping['type'];
        } else {
            throw new \InvalidArgumentException('Unknown association mapping type');
        }
        $this->fieldName = $associationMapping['fieldName'];
    }