public function cast($value)
    {
        if ($value === null) {
            return null;
        }

        $fn = 'cast' . ucfirst(gettype($value));

        switch (strtolower($this->class)) {
            case '':
                return $this->castToObject($value);
            case 'stdclass':
                return $this->castToStdClass($value);
            default:
                return $this->castToClass($value);
        }
    }
public function cast($value)
    {
        if ($value === null) {
            return null;
        }

        $fn = 'cast' . ucfirst(gettype($value));

        switch (strtolower($this->class)) {
            case '':
                return $this->castToObject($value);
            case 'stdclass':
                return $this->castToStdClass($value);
            default:
                return $this->castToClass($value);
        }
    }
public function cast ( $ value ) { if ( $ value === null ) { return null ; } $ fn = 'cast' . ucfirst ( gettype ( $ value ) ) ; switch ( strtolower ( $ this -> class ) ) { case '' : return $ this -> castToObject ( $ value ) ; case 'stdclass' : return $ this -> castToStdClass ( $ value ) ; default : return $ this -> castToClass ( $ value ) ; } }
Cast value to an object of a class

@param mixed $value
@return object|mixed
Cast value to an object of a class