public function getService($name)
    {
        try {
            if (!$this->isRegisteredService($name)) {
                $this->registerService($name);
            }
            return $this->di->get($name);
        } catch (\Phalcon\DI\Exception $ex) {
            throw new Exception($ex->getMessage().', using: '.$name);
        }
    }
public function getService($name)
    {
        try {
            if (!$this->isRegisteredService($name)) {
                $this->registerService($name);
            }
            return $this->di->get($name);
        } catch (\Phalcon\DI\Exception $ex) {
            throw new Exception($ex->getMessage().', using: '.$name);
        }
    }
public function getService ( $ name ) { try { if ( ! $ this -> isRegisteredService ( $ name ) ) { $ this -> registerService ( $ name ) ; } return $ this -> di -> get ( $ name ) ; } catch ( \ Phalcon \ DI \ Exception $ ex ) { throw new Exception ( $ ex -> getMessage ( ) . ', using: ' . $ name ) ; } }
Try to register and return service.

@param $name
@return object
@throws Service\Exception
Try to register and return service .