Neos\Flow\Mvc\Routing\IdentityRoutePart::setObjectType PHP Method

setObjectType() public method

public setObjectType ( string $objectType ) : void
$objectType string
return void
    public function setObjectType($objectType)
    {
        $this->objectType = $objectType;
    }

Usage Example

 /**
  * @test
  * @expectedException \Neos\Flow\Mvc\Exception\InfiniteLoopException
  */
 public function resolveValueThrowsInfiniteLoopExceptionIfNoUniquePathSegmentCantBeFound()
 {
     $object = new \stdClass();
     $this->mockPersistenceManager->expects($this->atLeastOnce())->method('getIdentifierByObject')->with($object)->will($this->returnValue('TheIdentifier'));
     $this->mockPersistenceManager->expects($this->atLeastOnce())->method('getObjectByIdentifier')->with('TheIdentifier')->will($this->returnValue($object));
     $this->mockObjectPathMappingRepository->expects($this->once())->method('findOneByObjectTypeUriPatternAndIdentifier')->with('stdClass', 'SomeUriPattern', 'TheIdentifier')->will($this->returnValue(null));
     $existingObjectPathMapping = new ObjectPathMapping();
     $existingObjectPathMapping->setObjectType('stdClass');
     $existingObjectPathMapping->setUriPattern('SomeUriPattern');
     $existingObjectPathMapping->setPathSegment('The/Path/Segment');
     $existingObjectPathMapping->setIdentifier('AnotherIdentifier');
     $this->identityRoutePart->expects($this->once())->method('createPathSegmentForObject')->with($object)->will($this->returnValue('The/Path/Segment'));
     $this->mockObjectPathMappingRepository->expects($this->atLeastOnce())->method('findOneByObjectTypeUriPatternAndPathSegment')->will($this->returnValue($existingObjectPathMapping));
     $this->identityRoutePart->setObjectType('stdClass');
     $this->identityRoutePart->setUriPattern('SomeUriPattern');
     $this->identityRoutePart->_call('resolveValue', $object);
 }
All Usage Examples Of Neos\Flow\Mvc\Routing\IdentityRoutePart::setObjectType