Adding an image at a specific index in our array of SitemapUrls

@param int $key
@param $location
@param string $caption
@param string $geolocation
@param string $title
@param string $license
765502
public function addImage( $key, $location, $caption = '', $geolocation = '', $title = '', $license = '' )
    {
        /**
         * @var \Lti\Sitemap\SitemapUrl $node
         */
        $node = $this->get( $key );
        if ( ! is_null( $node )) {
            $node->addImage( new SitemapImage( $location, $caption, $geolocation, $title, $license ) );
            $this->hasImages = true;
        }
    }
1259911
public function addImage($loc, $geoLocation = null, $caption = null, $title = null, $license = null)
    {
        if (empty($loc)) {
            return $this;
        }

        $image = [
            'loc' => $loc,
            'geoLocation' => $geoLocation,
            'caption' => $caption,
            'title' => $title,
            'license' => $license,
        ];
        $this->images[] = $image;

        return $this;
    }
368369
public function location(string $location, bool $permanent = false)
    {
        $header = new Location($location);

        if ($permanent) {
            $header->setPermanent($permanent);
        }

        $this->addHeader($header);
    }
346737
public function setLocation(string $location)
    {
        $dir = Directory::make($location, Directory::MAKE_DIRECTORY_EXISTS_OPEN);

        $old = $this->getPath();
        $new = $dir->getPath();

        if(rename($old, $new)) {
            $this->_location = $dir->getPath();
        }
    }
1210338
public function addElement($title, $description, $image = '')
    {
        $element = new Element($title, $description, $image);
        $this->add($element);

        return $element;
    }
1136331
public function indexLocation(Location $location)
    {
        $document = $this->mapper->mapLocation($location);

        $this->gateway->index($document);
    }
247722
public function setAll($title, $description, $image = null)
    {
        $this->setTitle($title);
        $this->setDescription($description);
        if (!is_null($image)) {
            $this->setImage($image);
        }
    }
246022
private function addTrashContainerField(FormInterface $form, Location $location = null): void
    {
        if (null === $location) {
            return;
        }

        $isContainer = new IsContainer();
        $hasChildren = new HasChildren($this->locationService);

        if (!$isContainer->and($hasChildren)->isSatisfiedBy($location)) {
            return;
        }

        $locationChildren = $this->locationService->loadLocationChildren($location);

        $translatorParameters = [
            '%children_count%' => $locationChildren->totalCount,
            '%content_name%' => $location->getContent()->getName(),
        ];

        $form->add('trashContainer', ChoiceType::class, [
            'expanded' => true,
            'multiple' => true,
            'choices' => [
                /** @Desc("%children_count% content items under location %content_name%") */
                $this->translator->trans('location_trash_form.trash_container', $translatorParameters, 'forms') => self::TRASH_WITH_CHILDREN,
            ],
        ]);
    }
1330371
public static function createLocated(
        Coordinate $coordinate,
        string $queryText,
        int $page = self::DEFAULT_PAGE,
        int $size = self::DEFAULT_SIZE
    ) {
        $query = self::create(
            $queryText,
            $page,
            $size
        );

        $query->coordinate = $coordinate;

        return $query;
    }
523955
public static function redirectTo(string $location, array $queryParameters = null): void
    {
        if (isset($queryParameters)) {
            header("Location: $location" . "?" . http_build_query($queryParameters));
        } else {
            header("Location: $location");
        }
        exit();
    }
941449
public function viewParentExtraInfoAction(Location $location)
    {
        $repository = $this->getRepository();
        $parentLocation = $repository->getLocationService()->loadLocation($location->parentLocationId);

        // TODO once the keyword service is available replace part this subrequest by a full symfony one

        return $this->render(
            'eZDemoBundle:parts/blog:extra_info.html.twig',
            array('location' => $parentLocation)
        );
    }
1018194
public function locationCopied($locationId, $newLocationId, $newParentId)
    {
        $newParentAliasId = $this->getRealAliasId($newLocationId);
        $oldParentAliasId = $this->getRealAliasId($locationId);

        $actionMap = $this->getCopiedLocationsMap($locationId, $newLocationId);

        $this->copySubtree(
            $actionMap,
            $oldParentAliasId,
            $newParentAliasId
        );
    }
1324019
public function addLocation($location, $data = null)
  {
    if(InUseLocation::isValid($location))
    {
      $this->locations[] = [$location, $data];
    }
    return $this;
  }
742088
public function addImage($title, $description, $path, $width, $coordinate){
        $objDrawing = new PHPExcel_Worksheet_Drawing();
        $objDrawing->setName($title);
        $objDrawing->setDescription($description);
        $objDrawing->setPath($path);
        $objDrawing->setHeight($width);
        $objDrawing->setCoordinates($coordinate);
        $objDrawing->setWorksheet($this->engine->getActiveSheet());
    }
550028
protected function addParameter($name, $location, $required, $description = null)
    {
        $name = trim($name);

        if (strpos($name, ',') !== false) {
            foreach (explode(',', $name) as $subname) {
                $this->addParameter($subname, $location, $required, $description);
            }

            return;
        }

        $this->parameters[$name] = Parameter::build($location, $required, $description);
    }
428710
public function renderPlaceholder($context, $key = 0, $label = false, $htmlTag = 'div', $data = null)
    {
        if (isset($context['environment'])) {
            $this->blockEnvironment = $context['environment'];
        }

        $content = '';

        if ($this->blockEnvironment instanceof Environment) {
            if (isset($context['block'])) {
                /* @var BlockInterface $container */
                $container = $context['block'];
                if ($container instanceof CompositeBlock) {
                    $blocks = $this->blockEnvironment->getBlockChildren($container);
                } else {
                    throw new \Exception('Tried to render placeholder in a block which is not a CompositeBlock');
                }
            } else {
                $blocks = $this->blockEnvironment->getRootBlocks();
            }

            foreach ($blocks as $block) {
                if ($block->getPosition() === (int) $key || ((int) $key === 0 && $block->getPosition() === 0)) {
                    $content .= $this->renderBlock($block);
                }
            }

            if ($this->blockEnvironment->getBlockMode() === 'manage') {
                $data['class'] = 'pm-placeholder '.$data['class'];
            }

            $content = $this->container->get('templating')->render('OpiferContentBundle:Block/Layout:placeholder.html.twig', [
                'content' => $content,
                'tag' => $htmlTag,
                'data' => $data,
                'key' => $key,
                'id' => (isset($container)) ? $container->getId() : 0,
                'manage_type' => 'placeholder'
            ]);
        }

        return $content;
    }
760722
public function addTag($location, $lastModified = null, $changeFrequency = null, $priority = null)
    {
        $tag = $location instanceof Tag ? $location : new Tag($location, $lastModified, $changeFrequency, $priority);

        $this->tags[] = $tag;

        return $tag;
    }