Add Item.

@param View|string  $object New object to add
@param string|array $region (or array for full set of defaults)

@return View
326320
public function add($object, $region = null)
    {
        $item = parent::add($object, $region);
        $item->addClass('item');

        return $item;
    }
80111
protected function loadAssociationObjectsToObject(array $item, $object)
    {
        foreach ($this->objectMetadata->getAssociationMappings() as $associationMapping) {

            $value = null;
            if (isset($item[$associationMapping['fieldName']]) && !is_object($item[$associationMapping['fieldName']])) {
                $value = $this->objectManager->getReference($associationMapping['targetEntity'], $item[$associationMapping['fieldName']]);
            }

            if (null === $value) {
                continue;
            }

            $setter = 'set' . ucfirst($associationMapping['fieldName']);
            $this->setValue($object, $value, $setter);
        }
    }
780810
static function addInstance($object){
		$name = str_replace(DS,'.',get_class($object));
		self::$instance[$name] = $object;
	}
910700
public function add($oObject)
    {
        if ($oObject->getId()) {
            $this->_aArray[$oObject->getId()] = $oObject;
        } else {
            $this->_aArray[] = $oObject;
        }
    }
13021
public function addContextRelationToObject($object, $context_name = 'default')
    {
        $context = $this->findContext($context_name);

        $object->setContext($context);

        return $object;
    }
1122486
public function addItem($obj, $key = null)
    {
        if ($key == null) {
            $this->items[] = $obj;
        } else {
            if (array_key_exists($key, $this->getItems())) {
                throw new KeyHasUseException("Key $key already in use.");
            } else {
                $this->items[$key] = $obj;
            }
        }

        return $this;
    }
259647
public function loadFromArrayForGroups($object)
    {
        parent::loadFromArray($object);

        if (!empty($object->items)) {
            foreach($object->items AS &$item) {
                $Group = new Group();
                $Group->loadFromArray($item);

                $item = $Group;
            }
        }
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
                    )
                );
            }   
        }
    }
497334
public function add_regions($regions, $custom = true) {
        foreach ($regions as $region) {
            $this->add_region($region, $custom);
        }
    }
585757
public function add(ElementInterface $object, $weight = 0)
    {
        if (!$this->elements->isEmpty() && $weight == 0) {
            $weight = $this->elements->last()->weight() + 10;
        }


        $this->elements->insert($object, $weight);
        return $this;
    }
50230
public function add($title, $item = [])
    {
        $list = self::$data;

        $_item = [
            'id' => $title,
            'parent' => false,
            'url' => '#',
            'title' => $title,
            'icon' => '',
            'area' => $this->area(),
            'active' => false,
            'weight' => 10,
            'children' => []
        ];

        $item = array_merge($_item, $item);

        $url = Router::url($item['url']);
        $actives = $this->config('active');

        if ($url === Router::url("/" . $this->Controller->request->url)) {
            $item['active'] = true;
        }

        $this->area = $item['area'];

        $data = self::$data;
        if (array_key_exists($this->area, $data)) {
            $menu = $data[$this->area];
        } else {
            $menu = [];
        }
        if ($item['parent']) {
            if (array_key_exists($item['parent'], $menu)) {
                $menu[$item['parent']]['children'][$item['id']] = $item;
            }
        } else {
            $menu[$item['id']] = $item;
        }
        $menu = Hash::sort($menu, '{s}.weight', 'asc');
        $data[$this->area] = $menu;
        self::$data = $data;
    }
728151
private function array_insert(mixed $object, string $key, int $position) : void
    {
        if (0 == count($this->members)) {
            // The array is empty so just add the item
            $this->members[$key] = $object;
        } elseif ($position == count($this->members)) {
            // The item goes at the end of the array
            $this->members[$key] = $object;
        } else {
            $this->members = array_slice($this->members, 0, $position,
                    true) + array($key => $object) + array_slice($this->members, $position, null, true);
        }
    }
1179561
public function setContext($object, $locale, array $context)
    {
        if (array_key_exists('template', $context)) {
            $object->setStructureType($context['template']);
        }

        return $object;
    }
1143395
public function setRegion( string $region ): self
	{
		$this->setSetting(self::SET_REGION, $this->regions->getRegionName($region));
		$this->setSetting(self::SET_PLATFORM, $this->platforms->getPlatformName($region));
		return $this;
	}
979337
public function add($object)
	{
		if (is_a($object, 'Closure')) {
			return $this->closures[] = $object;
		}

		$this->validateObject($object);

		$data = $object->getSitemapData();
		$this->addRaw($data);
	}
862255
public function add($seed, $region = null)
    {
        if (!$this->layout) {
            throw new Exception(['If you use $app->add() you should first call $app->setLayout()']);
        }

        return $this->layout->add($seed, $region);
    }
415824
private function addCollectionToRoot(&$root, &$object, $fullPropertyPath)
    {
        // First determine if the $object is a resource or a
        // collection of resources
        $isResource = false;
        if (is_array($object)) {
            $copy = $object;
            $values = array_values($copy);
            $firstPropertyOrResource = array_shift($values);

            if (Utility::isPrimitive($firstPropertyOrResource)) {
                $isResource = true;
            }
        } elseif ($object instanceof EloquentModel) {
            $isResource = true;
        }

        $newCollection = $isResource ? [$object] : $object;

        // Does existing collections use arrays or Collections
        $copy = $root;
        $values = array_values($copy);
        $existingRootCollection = array_shift($values);

        $newCollection = $existingRootCollection instanceof Collection ?
                                new Collection($newCollection) : $newCollection;

        if (!array_key_exists($fullPropertyPath, $root)) {
            $root[$fullPropertyPath] = $newCollection;
        } else {
            $this->mergeRootCollection($root[$fullPropertyPath], $newCollection);
        }
    }