Public Member Functions | Protected Member Functions | Protected Attributes

Robo47_Application_Resource_Service_Akismet Class Reference

List of all members.

Public Member Functions

 getService ()
 Get Akismet.
 init ()

Protected Member Functions

 _setupService ($options)
 Setup Akismet.

Protected Attributes

 $_service = null

Detailed Description

Definition at line 31 of file Akismet.php.


Member Function Documentation

Robo47_Application_Resource_Service_Akismet::_setupService ( options  )  [protected]

Setup Akismet.

Parameters:
array $options
Returns:
Zend_Service_Akismet

Definition at line 57 of file Akismet.php.

Referenced by init().

    {
        if (!isset($options['apiKey'])) {
            $message = 'option "apiKey" not found for Service_Akismet';
            throw new Robo47_Application_Resource_Exception($message);
        }
        if (!isset($options['blog'])) {
            $message = 'option "blog" not found for Service_Akismet';
            throw new Robo47_Application_Resource_Exception($message);
        }

        $akismet = new Zend_Service_Akismet(
            $options['apiKey'],
            $options['blog']
        );

        if (isset($options['charset'])) {
            $akismet->setCharset($options['charset']);
        }

        if (isset($options['userAgent'])) {
            $akismet->setUserAgent($options['userAgent']);
        }

        if (isset($options['port'])) {
            // casting needed because of is_int in Zend_Service_Akismet::setPort
            $akismet->setPort((int) $options['port']);
        }

        if (isset($options['registryKey'])) {
            Zend_Registry::set($options['registryKey'], $akismet);
        }

        return $akismet;
    }

Here is the caller graph for this function:

Robo47_Application_Resource_Service_Akismet::getService (  ) 

Get Akismet.

Returns:
Zend_Service_Akismet

Definition at line 98 of file Akismet.php.

    {
        return $this->_service;
    }

Robo47_Application_Resource_Service_Akismet::init (  ) 

Definition at line 40 of file Akismet.php.

References _setupService().

    {
        if (!empty($this->_options)) {
            $this->_service = $this->_setupService($this->_options);
        } else {
            $message = 'Empty options in resource ' .
                'Robo47_Application_Resource_Service_Akismet.';
            throw new Robo47_Application_Resource_Exception($message);
        }
    }

Here is the call graph for this function:


Member Data Documentation

Robo47_Application_Resource_Service_Akismet::$_service = null [protected]

Definition at line 38 of file Akismet.php.


The documentation for this class was generated from the following file: