public function transform($entity)
    {
        if (null === $entity || '' === $entity) {
            return null;
        }

        if (!is_object($entity)) {
            throw new UnexpectedTypeException($entity, 'object');
        }

        //Here, do not put the result in the cache because we must check the value in
        //reverseTransform (by QueryBuilder)

        return $this->accessor->getValue($entity, $this->identifier);
    }
public function transform($entity)
    {
        if (null === $entity || '' === $entity) {
            return null;
        }

        if (!is_object($entity)) {
            throw new UnexpectedTypeException($entity, 'object');
        }

        //Here, do not put the result in the cache because we must check the value in
        //reverseTransform (by QueryBuilder)

        return $this->accessor->getValue($entity, $this->identifier);
    }
public function transform ( $ entity ) { if ( null === $ entity || '' === $ entity ) { return null ; } if ( ! is_object ( $ entity ) ) { throw new UnexpectedTypeException ( $ entity , 'object' ) ; } //Here, do not put the result in the cache because we must check the value in //reverseTransform (by QueryBuilder) return $ this -> accessor -> getValue ( $ entity , $ this -> identifier ) ; }
Transforms entity to id

@param Object $entity
@return string
Transforms entity to id