Convert parameters to LocationCreateStruct and stores it on the ContentObject.

@param Location|LocationObject|int $parentLocation

@throws InvalidDataStructureException
761975
public function addParentLocation($parentLocation)
    {
        $locationObject = $this->convertToLocationObject($parentLocation);

        if (!isset($locationObject->data['parent_location_id']) || (int) $locationObject->data['parent_location_id'] < 1) {
            throw new InvalidDataStructureException('Parent location id must be an integer of 2 or above.');
        }

        if (!isset($locationObject->data['content_id'])) {
            if ($this->getProperty('id')) {
                $locationObject->data['content_id'] = $this->getProperty('id');
            }
        }

        $this->properties['parent_locations'][$locationObject->data['parent_location_id']] = $locationObject;
    }
212172
public function setLocation($location)
    {
        if (! is_int($location)) {
            throw new \InvalidArgumentException(
                'Argument 1 must be an int value. Valued passed is of type ' . gettype($location));
        }
        
        $this->location = $location;
    }
575106
private function buildLocationQuery(Query $query, Location $parentLocation): LocationQuery
    {
        $locationQuery = new LocationQuery();

        $criteria = [
            new Criterion\Subtree($parentLocation->pathString),
            new Criterion\Visibility(Criterion\Visibility::VISIBLE),
            new Criterion\LogicalNot(new Criterion\LocationId($parentLocation->id)),
            $this->getMainLocationFilterCriteria($query),
            $this->getQueryTypeFilterCriteria($query, $parentLocation),
            $this->getContentTypeFilterCriteria($query),
            $this->getSectionFilterCriteria($query),
            $this->getObjectStateFilterCriteria($query),
        ];

        $criteria = array_filter(
            $criteria,
            static function ($criterion): bool {
                return $criterion instanceof Criterion;
            }
        );

        $locationQuery->filter = new Criterion\LogicalAnd($criteria);
        $locationQuery->sortClauses = $this->getSortClauses($query, $parentLocation);

        return $locationQuery;
    }
214315
private function createLocationRemoveForm(Location $location, array $contentLocations): FormInterface
    {
        return $this->formFactory->removeLocation(
            new ContentLocationRemoveData($location->getContentInfo(), $this->getLocationChoices($contentLocations))
        );
    }
117258
private function createLocationAddForm(Location $location): FormInterface
    {
        return $this->formFactory->addLocation(
            new ContentLocationAddData($location->getContentInfo())
        );
    }
528176
private function createLoadContentInfoQueryBuilder(bool $joinMainLocation = true): DoctrineQueryBuilder
    {
        $queryBuilder = $this->connection->createQueryBuilder();
        $expr = $queryBuilder->expr();

        $joinCondition = $expr->eq('c.id', 't.contentobject_id');
        if ($joinMainLocation) {
            // wrap join condition with AND operator and join by a Main Location
            $joinCondition = $expr->andX(
                $joinCondition,
                $expr->eq('t.node_id', 't.main_node_id')
            );
        }

        $queryBuilder
            ->select('c.*', 't.main_node_id AS ezcontentobject_tree_main_node_id')
            ->from('ezcontentobject', 'c')
            ->leftJoin(
                'c',
                'ezcontentobject_tree',
                't',
                $joinCondition
            );

        return $queryBuilder;
    }
376844
public function setParent(\Tx_Oelib_Visibility_Node $parentNode)
    {
        if ($this->parentNode !== null) {
            throw new \InvalidArgumentException('This node already has a parent node.', 1331488668);
        }

        $this->parentNode = $parentNode;
    }
73451
public function updatePathIdentificationString($locationId, $parentLocationId, $text)
    {
        $parentData = $this->getBasicNodeData($parentLocationId);

        $newPathIdentificationString = empty($parentData['path_identification_string']) ?
            $text :
            $parentData['path_identification_string'] . '/' . $text;

        /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */
        $query = $this->handler->createUpdateQuery();
        $query->update(
            'ezcontentobject_tree'
        )->set(
            $this->handler->quoteColumn('path_identification_string'),
            $query->bindValue($newPathIdentificationString, null, \PDO::PARAM_STR)
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('node_id'),
                $query->bindValue($locationId, null, \PDO::PARAM_INT)
            )
        );
        $query->prepare()->execute();
    }
300494
public function createNodeAssignment(CreateStruct $createStruct, $parentNodeId, $type = self::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP)
    {
        try {
            return $this->innerGateway->createNodeAssignment($createStruct, $parentNodeId, $type);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
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)
        );
    }
299590
private function buildLevel(int $parent_id, array $placename, array &$places): void
    {
        $level = array_search('', $placename, true);

        $rows = DB::table('placelocation')
            ->where('pl_parent_id', '=', $parent_id)
            ->orderBy('pl_place')
            ->get();

        foreach ($rows as $row) {
            $index             = (int) $row->pl_id;
            $placename[$level] = $row->pl_place;
            $places[]          = array_merge(['pl_level' => $row->pl_level], $placename, ['pl_long' => $row->pl_long, 'pl_lati' => $row->pl_lati, 'pl_zoom' => $row->pl_zoom, 'pl_icon' => $row->pl_icon]);
            $this->buildLevel($index, $placename, $places);
        }
    }
667752
public void init(RecordOwnerParent parent, String strSourcePrefix)
    {
        beforePackage = "";
        foundComment = false;
        foundPackage = false;
        lineSeparator = (String) java.security.AccessController.doPrivileged(new sun.security.action.GetPropertyAction("line.separator"));;
        super.init(parent, strSourcePrefix);
    }
263025
public function setLocationType($locationType)
    {
        $allowed_values = array('station', 'structure');
        if (!is_null($locationType) && (!in_array($locationType, $allowed_values))) {
            throw new \InvalidArgumentException("Invalid value for 'locationType', must be one of 'station', 'structure'");
        }
        $this->container['locationType'] = $locationType;

        return $this;
    }
381243
public function removeChild(Location $location): void
    {
        if (!$this->hasChild($location)) {
            throw new InvalidArgumentException(
                'The Location is not a child and cannot be removed from there');
        }
        $location->setParent(null);
        $this->getChildren()->removeElement($location);
    }
653804
protected function addRegisteredLocation($theme, $parent)
    {
        if (! is_null($parent)) {
            $parentLocation = $this->path('resources/views');
            app('view.finder')->prependLocation($parentLocation);
        }

        $themeLocation = $this->path('resources/views');
        app('view.finder')->prependLocation($themeLocation);
    }
1351184
public function addLocation(Location $location): void
    {
        if ($this->locations->contains($location)) {
            throw new \InvalidArgumentException(
                    'The same Location cannot be added twice');
        }
        $location->setWarehouse($this);
        $this->locations->add($location);
    }
320149
@SuppressWarnings("unchecked")
   protected void publishWsdlImports(URL parentURL, Definition parentDefinition, List<String> published, String expLocation) throws Exception
   {
      @SuppressWarnings("rawtypes")
      Iterator it = parentDefinition.getImports().values().iterator();
      while (it.hasNext())
      {
         for (Import wsdlImport : (List<Import>)it.next())
         {
            String locationURI = wsdlImport.getLocationURI();
            // its an external import, don't publish locally
            if (locationURI.startsWith("http://") == false && locationURI.startsWith("https://") == false)
            {
               // infinity loops prevention
               if (published.contains(locationURI))
               {
                  continue;
               }
               else
               {
                  published.add(locationURI);
               }
               
               String baseURI = parentURL.toExternalForm();
               URL targetURL = new URL(baseURI.substring(0, baseURI.lastIndexOf("/") + 1) + locationURI);
               File targetFile = new File(targetURL.getFile()); //JBWS-3488
               createParentDir(targetFile);

               Definition subdef = wsdlImport.getDefinition();
               WSDLFactory wsdlFactory = WSDLFactory.newInstance();
               javax.wsdl.xml.WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
               BufferedOutputStream bfos = new BufferedOutputStream(new FileOutputStream(targetFile));
               OutputStreamWriter osw = new OutputStreamWriter(bfos, "UTF-8");
               try {
                  wsdlWriter.writeWSDL(subdef, osw);
               } finally {
                  osw.close();
               }

               DEPLOYMENT_LOGGER.wsdlImportPublishedTo(targetURL);

               // recursively publish imports
               publishWsdlImports(targetURL, subdef, published, expLocation);

               // Publish XMLSchema imports
               Element subdoc = DOMUtils.parse(targetURL.openStream(), getDocumentBuilder());
               publishSchemaImports(targetURL, subdoc, published, expLocation);
            }
         }
      }
   }