library/Garp/Model/Behavior/Bitlyable.php
protected function _setBitlyUrl(array &$data) {
        if (!empty($data[$this->_column])) {
            $bitly = new Garp_Service_Bitly();
            $view = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view');
            $url = sprintf($this->_url, $data[$this->_column]);
            $response = $bitly->shorten(array(
                'longUrl' => $view->fullUrl($url)
            ));
            if ($response['status_code'] == 200) {
                $shortenedUrl = $response['data']['url'];
                $data[$this->_targetColumn] = $shortenedUrl;
            }
        }
    }
protected function _setBitlyUrl(array &$data) {
        if (!empty($data[$this->_column])) {
            $bitly = new Garp_Service_Bitly();
            $view = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view');
            $url = sprintf($this->_url, $data[$this->_column]);
            $response = $bitly->shorten(array(
                'longUrl' => $view->fullUrl($url)
            ));
            if ($response['status_code'] == 200) {
                $shortenedUrl = $response['data']['url'];
                $data[$this->_targetColumn] = $shortenedUrl;
            }
        }
    }
protected function _setBitlyUrl ( array & $ data ) { if ( ! empty ( $ data [ $ this -> _column ] ) ) { $ bitly = new Garp_Service_Bitly ( ) ; $ view = Zend_Controller_Front :: getInstance ( ) -> getParam ( 'bootstrap' ) -> getResource ( 'view' ) ; $ url = sprintf ( $ this -> _url , $ data [ $ this -> _column ] ) ; $ response = $ bitly -> shorten ( array ( 'longUrl' => $ view -> fullUrl ( $ url ) ) ) ; if ( $ response [ 'status_code' ] == 200 ) { $ shortenedUrl = $ response [ 'data' ] [ 'url' ] ; $ data [ $ this -> _targetColumn ] = $ shortenedUrl ; } } }
Set Bit.ly URL
@param Array $data Record data passed to an update or insert call
@return Void
Set Bit . ly URL