Sets has many relation

@param mixed $id
@param \JSONSimpleStorage $object
@param mixed[] $foreignIds
511386
public function hasMany($id, \JSONSimpleStorage $object, array $foreignIds) {
        // set has one on foreign data
        foreach ($foreignIds as $foreignId) {
            $object->hasOne($foreignId, $this, $id);
        }
    }
249481
public function setForeignKeys(array $foreignKeys)
    {
        $this->foreignKeys = array();

        foreach ($foreignKeys as $foreignKey) {
            $this->addForeignKey($foreignKey);
        }
    }
557154
public function setIdObjectsAlertList(array $idObjectsAlertList)
    {
        $this->idObjectsAlertList = $idObjectsAlertList;
        self::logInfo($this->translate("Objects subject to an alert") . " : \r\n");
        self::logInfo(print_r($idObjectsAlertList, true));
    }
791148
protected function restoreObjectRelations(IObject $object, array $relatedValues)
    {
        foreach ($relatedValues as $propertyName => $value) {
            $property = $object->getProperty($propertyName);
            $property->setInitialValue(null);
            $property->setValue($value);
        }
    }
604181
public function setIdentifierValue(object $document, $id) : void
    {
        $id = $this->getPHPIdentifierValue($id);
        $this->reflFields[$this->identifier]->setValue($document, $id);
    }
245840
public function setIds(array $ids): void
    {
        if (empty($ids)) {
            throw new \InvalidArgumentException('At least one ID must be specified');
        }

        foreach ($ids as $id) {
            if (!\is_int($id)) {
                throw new \InvalidArgumentException('All IDs must be integers');
            }
        }

        $this->ids = $ids;
    }
723744
public function offsetSet($id, $value)
    {
        if (is_array($value)) {
            $param1 = isset($value[0]) ? $value[0] : '';
            $param2 = isset($value[1]) ? $value[1] : '';
            $this->set($id, $param1, $param2);
        } else {
            $this->set($id, $value);
        }
    }
1356265
public function setTypeId( $id )
	{
		$id = (int) $id;
		if ( $id === $this->getTypeId() ) { return; }

		$this->_values['typeid'] = (int) $id;
		$this->setModified();
	}
1183149
public function getAllWhichHasOne($foreignId, JSONSimpleStorage $object, $cascade = false) {
        // default value
        $result = [];
        
        // check if foreign object has relations with current one
        if (isset($object->many[$foreignId][$this->class])) {
            // iterate through all related data
            foreach ($object->many[$foreignId][$this->class] as $id) {
                if (null !== ($item = $this->getById($id, $cascade))) {
                    $result[$id] = $item;
                }
            }
        }
        return $result;
    }
1346772
public function setRelatedId( $id )
	{
		if ( $id === $this->getRelatedId() ) { return; }
		$id = (int) $id;
		$this->_values['relatedid'] = $id;
		$this->setModified();
	}
1070852
final protected function setForeignKey(array $rows, string $foreignKey, $value)
    {
        foreach ($rows as $row) {
            $row->setColumn($foreignKey, $value);
        }
    }
345266
public function set($object, $id = null)
    {
        if (is_array($object)) {
            return $this->setAll($object);
        }

        $this->objects[$object] = $id;
    }
929520
public function setId($id)
    {
        if (is_null($this->id) && ! is_null($id) && ($model = $this->getRepository()->find($id))) {
            $this->id = $id;

            parent::setModel($model);
            $this->getButtons()->setModel($model);
            $this->setModelClass(get_class($model));
        }
    }
911862
public function addRelationshipObject($key, RelationshipObject $relationshipObject, array $options=[]) {
		if ($relationshipObject->hasResource($this)) {
			throw new DuplicateException('can not add relation to self');
		}
		
		if ($this->relationships === null) {
			$this->setRelationshipsObject(new RelationshipsObject());
		}
		
		$this->validator->claimUsedFields([$key], Validator::OBJECT_CONTAINER_RELATIONSHIPS, $options);
		
		$this->relationships->addRelationshipObject($key, $relationshipObject);
	}
892707
public static function set(array &$object, $keys, $value)
    {
        $keys = explode('.', $keys);
        $depth = count($keys);
        $key = array_shift($keys);

        if (1 === $depth) {
            $object[$key] = $value;
        } else {
            if (!isset($object[$key])) {
                $object[$key] = [];
            } elseif (!is_array($object[$key])) {
                throw new \Exception('Cannot set property because it already exists as a non \stdClass');
            }

            static::set($object[$key], implode('.', $keys), $value);
        }
    }
1080589
public function setRelation($relation, $relationColumn = null)
    {
        $this->relation = $relation;
        $this->relationColumn = $relationColumn;

        return $this;
    }
1078266
public void addObjectId( Object object, ObjectIdSerializer<?> id ) {
        if ( null == mapObjectId ) {
            if ( useEqualityForObjectId ) {
                mapObjectId = new HashMap<Object, ObjectIdSerializer<?>>();
            } else {
                mapObjectId = new IdentityHashMap<Object, ObjectIdSerializer<?>>();
            }
        }
        mapObjectId.put( object, id );
    }