Adds an object to this repository.

@param object $object The object to add
@return void
@throws IllegalObjectTypeException
@api
969904
public function add($object)
    {
        if (!is_object($object) || !($object instanceof $this->entityClassName)) {
            $type = (is_object($object) ? get_class($object) : gettype($object));
            throw new IllegalObjectTypeException('The value given to add() was ' . $type . ' , however the ' . get_class($this) . ' can only store ' . $this->entityClassName . ' instances.', 1298403438);
        }
        $this->persistenceManager->add($object);
    }
785186
public function add($objects) {
        if (is_array($objects)) {
            foreach ($objects as $object) {
                $this->BuildAddDbConfig($object);
            }
        } else {
            $this->BuildAddDbConfig($objects);
        }
        return $this->BindParametersAndExecute(null);
    }
780810
static function addInstance($object){
		$name = str_replace(DS,'.',get_class($object));
		self::$instance[$name] = $object;
	}
827250
public function addReference($name, $object)
    {
        $ref = $this->references[$name] ?? null;
        if ($ref === $object) {
            return;
        }
        if ($ref !== null && !$ref instanceof UnknownElement) {
            $this->log("Overriding previous definition of reference to $name", Project::MSG_VERBOSE);
        }
        $refName = method_exists($object, 'toString') ? $object->toString() : get_class($object);
        $refName = method_exists($object, '__toString') ? (string) $object : $refName;
        $this->log("Adding reference: $name -> " . $refName, Project::MSG_DEBUG);
        $this->references[$name] = $object;
    }
1172285
public function add(ObjectInterface ...$objects)
    {
        foreach ($objects as $object)
        {
            if ($object instanceof RoleInterface)
            {
                $this->addRole((string)$object);
            }
            else if ($object instanceof ResourceInterface)
            {
                $this->addResource((string)$object);
            }
            else if ($object instanceof PermissionInterface)
            {
                $this->addPermission((string)$object);
            }
            else {
                throw new \Exception(
                    sprintf(
                        "%s must implement one of RoleInterface, '.
                        'ResourceInterface and PermissionInterface",
                        $object
                    )
                );
            }   
        }
    }
138718
public function add(Database\Model $object)
    {
        if ($this->items === null) {
            if ( ! $this->fillItems()) {
                return false;
            }
        }
        $this->addToDb($object);
        $this->addItem($object);

        return true;
    }
1351738
public function setObjects(array $objects)
    {
        foreach ($objects as $object) {
            $this->checkType(ObjectDataInterface::class, $object);
        }

        $this->objects = $objects;
    }
526826
protected function addToQueue($object, $relations)
	{
		if( ! array_key_exists($object->type, self::$loadQueue) )
		{
			self::$loadQueue[$object->type] = [];
		}
		$relationsKey = base64_encode(json_encode($relations));
		if( ! array_key_exists($relationsKey, self::$loadQueue[$object->type]) )
		{
			self::$loadQueue[$object->type][$relationsKey] = [ 'type' => $object->type, 'ids' => [], 'relations' => $relations ];
		}
		self::$loadQueue[$object->type][$relationsKey]['ids'][] = $object->id;

	}
741441
protected function registerDirty(PersistentObject $object) {
    $key = $object->getOID()->__toString();
    // if it was a new or deleted object, we return immediatly
    if (isset($this->newObjects[$key]) || isset($this->deletedObjects[$key])) {
      return $object;
    }
    if (self::$isDebugEnabled) {
      self::$logger->debug("Register dirty object: ".$key);
    }
    $this->dirtyObjects[$key] = $object;
    return $object;
  }
914864
public function add(ElementInterface $object, $weight = 0)
    {
        parent::add($object, $weight);
        $this->_addInput($object);
    }
881682
public function push($object): self
    {
        $this->internalDataListUpdate();
        array_push($this->internalDataListData, $object);
        return $this;
    }
451447
protected function imports ($object)
	{
		// the new object to import
		$newImport 			= new $object();
		// the name of the new object (class name)
		$importName			= get_class($newImport);
		// the new functions to import
		$importFunctions 	= get_class_methods($newImport);
		
		// add the object to the registry
		array_push($this->imported, array($importName, $newImport));
		
		// add the methods to the registry
		foreach ($importFunctions as $key => $functionName)
		{
			$this->importedFunctions[$functionName] = &$newImport;
		}
	}
705010
public function addDocument($document) {
		if(is_array($document)) {
			$this->addDocumentArray($document);
		} elseif ($document instanceof Document) {
			$this->addDocumentObject($document);
		}
	}
733607
public function add($object, $defaults = [])
    {
        if (!is_array($defaults)) {
            $defaults = ['name' => $defaults];
        }

        $defaults['join'] = $this;

        return $this->owner->add($object, $defaults);
    }
1198671
public function registerInstance($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('registerInstance(): Cannot pass primitive types, can only register an object instance; use registerVariable() instead');
        }

        $reflectionObject = new \ReflectionObject($object);
        $className = $reflectionObject->getName();

        // Register strong link in $instance
        $this->instances[$className] = $object;

        // Recursively determine and register weak links
        $determineParent = function (\ReflectionClass $class) use ($className, &$determineParent) {
            $parentClass = $class->getParentClass();

            if (!empty($parentClass)) {
                $this->weakLinks[$parentClass->getName()] = $className;
                $determineParent($parentClass);
            }
        };

        $determineParent($reflectionObject);
    }
1286404
public static function createFromObject($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('Object was expected.');
        }

        $className = get_class($object);

        return new self($className);
    }
716818
public function postUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $blockManager = $this->blockManager;

        $block = $blockManager->get($object);
        $block->postUpdate($object);

        $service = $blockManager->get($object);

        $this->cacheManager->invalidate($service->getCacheKeys($object));
    }