public function transform($object)
    {
        if (is_object($object) && $object instanceof RestfulModel) {
            $transformed = $this->transformRestfulModel($object);
        } elseif (is_object($object) && $object instanceof \stdClass) {
            $transformed = $this->transformStdClass($object);
        } else {
            throw new \Exception('Unexpected object type encountered in transformer');
        }

        return $transformed;
    }
public function transform($object)
    {
        if (is_object($object) && $object instanceof RestfulModel) {
            $transformed = $this->transformRestfulModel($object);
        } elseif (is_object($object) && $object instanceof \stdClass) {
            $transformed = $this->transformStdClass($object);
        } else {
            throw new \Exception('Unexpected object type encountered in transformer');
        }

        return $transformed;
    }
public function transform ( $ object ) { if ( is_object ( $ object ) && $ object instanceof RestfulModel ) { $ transformed = $ this -> transformRestfulModel ( $ object ) ; } elseif ( is_object ( $ object ) && $ object instanceof \ stdClass ) { $ transformed = $ this -> transformStdClass ( $ object ) ; } else { throw new \ Exception ( 'Unexpected object type encountered in transformer' ) ; } return $ transformed ; }
Transform an object into a jsonable array

@param mixed $model
@return array
@throws \Exception
Transform an object into a jsonable array