original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Convert parameters to LocationCreateStruct and stores it on the ContentObject.
  
  @param Location|LocationObject|int $parentLocation
  
  @throws InvalidDataStructureException
docstring_tokens: Convert parameters to LocationCreateStruct and stores it on the ContentObject .