src/Transfer/EzPlatform/Repository/Values/ContentObject.php
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;
    }
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;
    }
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 ; }
Convert parameters to LocationCreateStruct and stores it on the ContentObject.

@param Location|LocationObject|int $parentLocation

@throws InvalidDataStructureException
Convert parameters to LocationCreateStruct and stores it on the ContentObject .