library/Garp/Model/Behavior/Vimeoable.php
protected function _fillFields(array $input) {
        $sourceApiKey = $this->_useVimeoPro ? 'advanced' : 'simple';
        if (!array_key_exists($this->_fields[$sourceApiKey]['url'], $input)) {
            throw new Garp_Model_Behavior_Exception(
                sprintf(self::EXCEPTION_MISSING_FIELD, $this->_fields['url'])
            );
        }
        $url = $input[$this->_fields[$sourceApiKey]['url']];
        if (empty($url)) {
            return $input;
        }

        $videoData = $this->_getVideo($url);
        if (!$videoData) {
            throw new Garp_Model_Behavior_Exception(sprintf(self::EXCEPTION_VIDEO_NOT_FOUND, $url));
        }

        $out = array();
        $source = $this->_fields[$sourceApiKey];
        foreach ($source as $vimeoKey => $garpKey) {
            $this->_addDataKey($out, $input, $videoData, $vimeoKey, $garpKey);
        }

        // if embedding is not allowed, hack our way around it.
        if (empty($out['player'])) {
            $out['player'] = 'https://player.vimeo.com/video/' . $videoData['id'];
        }
        return $out;
    }
protected function _fillFields(array $input) {
        $sourceApiKey = $this->_useVimeoPro ? 'advanced' : 'simple';
        if (!array_key_exists($this->_fields[$sourceApiKey]['url'], $input)) {
            throw new Garp_Model_Behavior_Exception(
                sprintf(self::EXCEPTION_MISSING_FIELD, $this->_fields['url'])
            );
        }
        $url = $input[$this->_fields[$sourceApiKey]['url']];
        if (empty($url)) {
            return $input;
        }

        $videoData = $this->_getVideo($url);
        if (!$videoData) {
            throw new Garp_Model_Behavior_Exception(sprintf(self::EXCEPTION_VIDEO_NOT_FOUND, $url));
        }

        $out = array();
        $source = $this->_fields[$sourceApiKey];
        foreach ($source as $vimeoKey => $garpKey) {
            $this->_addDataKey($out, $input, $videoData, $vimeoKey, $garpKey);
        }

        // if embedding is not allowed, hack our way around it.
        if (empty($out['player'])) {
            $out['player'] = 'https://player.vimeo.com/video/' . $videoData['id'];
        }
        return $out;
    }
protected function _fillFields ( array $ input ) { $ sourceApiKey = $ this -> _useVimeoPro ? 'advanced' : 'simple' ; if ( ! array_key_exists ( $ this -> _fields [ $ sourceApiKey ] [ 'url' ] , $ input ) ) { throw new Garp_Model_Behavior_Exception ( sprintf ( self :: EXCEPTION_MISSING_FIELD , $ this -> _fields [ 'url' ] ) ) ; } $ url = $ input [ $ this -> _fields [ $ sourceApiKey ] [ 'url' ] ] ; if ( empty ( $ url ) ) { return $ input ; } $ videoData = $ this -> _getVideo ( $ url ) ; if ( ! $ videoData ) { throw new Garp_Model_Behavior_Exception ( sprintf ( self :: EXCEPTION_VIDEO_NOT_FOUND , $ url ) ) ; } $ out = array ( ) ; $ source = $ this -> _fields [ $ sourceApiKey ] ; foreach ( $ source as $ vimeoKey => $ garpKey ) { $ this -> _addDataKey ( $ out , $ input , $ videoData , $ vimeoKey , $ garpKey ) ; } // if embedding is not allowed, hack our way around it. if ( empty ( $ out [ 'player' ] ) ) { $ out [ 'player' ] = 'https://player.vimeo.com/video/' . $ videoData [ 'id' ] ; } return $ out ; }
Retrieves additional data about the video corresponding with given input url from Vimeo,
or video id, and returns new data structure.

@param array $input New data
@return array
Retrieves additional data about the video corresponding with given input url from Vimeo or video id and returns new data structure .