Current File : /home/k/a/r/karenpetzb/www/items/category/Simpy.tar
Watchlist.php000060400000010654150713303070007220 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: Watchlist.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @see Zend_Service_Simpy_WatchlistFilterSet
 */
require_once 'Zend/Service/Simpy/WatchlistFilterSet.php';


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_Watchlist
{
    /**
     * Identifier for the watchlist
     *
     * @var int
     */
    protected $_id;

    /**
     * Name of the watchlist
     *
     * @var string
     */
    protected $_name;

    /**
     * Description of the watchlist
     *
     * @var string
     */
    protected $_description;

    /**
     * Timestamp for when the watchlist was added
     *
     * @var string
     */
    protected $_addDate;

    /**
     * Number of new links in the watchlist
     *
     * @var int
     */
    protected $_newLinks;

    /**
     * List of usernames for users included in the watchlist
     *
     * @var array
     */
    protected $_users;

    /**
     * List of filters included in the watchlist
     *
     * @var Zend_Service_Simpy_WatchlistFilterSet
     */
    protected $_filters;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMNode $node Individual <watchlist> node from a parsed
     *                       response from a GetWatchlists or GetWatchlist
     *                       operation
     * @return void
     */
    public function __construct($node)
    {
        $map =& $node->attributes;

        $this->_id = $map->getNamedItem('id')->nodeValue;
        $this->_name = $map->getNamedItem('name')->nodeValue;
        $this->_description = $map->getNamedItem('description')->nodeValue;
        $this->_addDate = $map->getNamedItem('addDate')->nodeValue;
        $this->_newLinks = $map->getNamedItem('newLinks')->nodeValue;

        $this->_users = array();
        $this->_filters = new Zend_Service_Simpy_WatchlistFilterSet();

        $childNode = $node->firstChild;
        while (is_null($childNode) == false) {
            if ($childNode->nodeName == 'user') {
                $this->_users[] = $childNode->attributes->getNamedItem('username')->nodeValue;
            } elseif ($childNode->nodeName == 'filter') {
                $filter = new Zend_Service_Simpy_WatchlistFilter($childNode);
                $this->_filters->add($filter);
            }
            $childNode = $childNode->nextSibling;
        }
    }

    /**
     * Returns the identifier for the watchlist
     *
     * @return int
     */
    public function getId()
    {
        return $this->_id;
    }

    /**
     * Returns the name of the watchlist
     *
     * @return string
     */
    public function getName()
    {
        return $this->_name;
    }

    /**
     * Returns the description of the watchlist
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->_description;
    }

    /**
     * Returns a timestamp for when the watchlist was added
     *
     * @return string
     */
    public function getAddDate()
    {
        return $this->_addDate;
    }

    /**
     * Returns the number of new links in the watchlist
     *
     * @return int
     */
    public function getNewLinks()
    {
        return $this->_newLinks;
    }

    /**
     * Returns a list of usernames for users included in the watchlist
     *
     * @return array
     */
    public function getUsers()
    {
        return $this->_users;
    }

    /**
     * Returns a list of filters included in the watchlist
     *
     * @return Zend_Service_Simpy_WatchlistFilterSet
     */
    public function getFilters()
    {
        return $this->_filters;
    }
}
LinkQuery.php000060400000011264150713303070007177 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: LinkQuery.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_LinkQuery
{
    /**
     * Query string for the query
     *
     * @var string
     */
    protected $_query = null;

    /**
     * Maximum number of search results to return
     *
     * @var int
     */
    protected $_limit = null;

    /**
     * Date on which search results must have been added
     *
     * @var string
     */
    protected $_date = null;

    /**
     * Date after which search results must have been added
     *
     * @var string
     */
    protected $_afterDate = null;

    /**
     * Date before which search results must have been added
     *
     * @var string
     */
    protected $_beforeDate = null;

    /**
     * Sets the query string for the query
     *
     * @param  string $query Query string in valid Simpy syntax
     * @see    http://www.simpy.com/faq#searchSyntax
     * @see    http://www.simpy.com/faq#searchFieldsLinks
     * @return Zend_Service_Simpy_LinkQuery Provides a fluent interface
     */
    public function setQueryString($query)
    {
        $this->_query = $query;

        return $this;
    }

    /**
     * Returns the query string set for this query
     *
     * @return string
     */
    public function getQueryString()
    {
        return $this->_query;
    }

    /**
     * Sets the maximum number of search results to return
     *
     * @param  int $limit
     * @return Zend_Service_Simpy_LinkQuery Provides a fluent interface
     */
    public function setLimit($limit)
    {
        $this->_limit = intval($limit);

        if ($this->_limit == 0) {
            $this->_limit = null;
        }

        return $this;
    }

    /**
     * Returns the maximum number of search results to return
     *
     * @return int
     */
    public function getLimit()
    {
        return $this->_limit;
    }

    /**
     * Sets the date on which search results must have been added, which will
     * override any existing values set using setAfterDate() and setBeforeDate()
     *
     * @param  string $date
     * @see    setAfterDate()
     * @see    setBeforeDate()
     * @return Zend_Service_Simpy_LinkQuery Provides a fluent interface
     */
    public function setDate($date)
    {
        $this->_date = $date;
        $this->_afterDate = null;
        $this->_beforeDate = null;

        return $this;
    }

    /**
     * Returns the date on which search results must have been added
     *
     * @return string
     */
    public function getDate()
    {
        return $this->_date;
    }

    /**
     * Sets the date after which search results must have been added, which will
     * override any existing values set using setDate()
     *
     * @param  string $date
     * @see    setDate()
     * @return Zend_Service_Simpy_LinkQuery Provides a fluent interface
     */
    public function setAfterDate($date)
    {
        $this->_afterDate = $date;
        $this->_date = null;

        return $this;
    }

    /**
     * Returns the date after which search results must have been added
     *
     * @return string
     */
    public function getAfterDate()
    {
        return $this->_afterDate;
    }

    /**
     * Sets the date before which search results must have been added, which
     * will override any existing values set using setDate()
     *
     * @param  string $date
     * @see    setDate()
     * @return Zend_Service_Simpy_LinkQuery Provides a fluent interface
     */
    public function setBeforeDate($date)
    {
        $this->_beforeDate = $date;
        $this->_date = null;

        return $this;
    }

    /**
     * Returns the date before which search results must have been added
     *
     * @return string
     */
    public function getBeforeDate()
    {
        return $this->_beforeDate;
    }
}
Link.php000060400000011053150713303070006145 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: Link.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_Link
{
    /**
     * Private access type
     *
     * @var string
     */
    const ACCESSTYPE_PRIVATE = '0';

    /**
     * Public access type
     *
     * @var string
     */
    const ACCESSTYPE_PUBLIC  = '1';

    /**
     * Access type assigned to the link
     *
     * @var string
     */
    protected $_accessType;

    /**
     * URL of the link
     *
     * @var string
     */
    protected $_url;

    /**
     * Date of the last modification made to the link
     *
     * @var string
     */
    protected $_modDate;

    /**
     * Date the link was added
     *
     * @var string
     */
    protected $_addDate;

    /**
     * Title assigned to the link
     *
     * @var string
     */
    protected $_title;

    /**
     * Nickname assigned to the link
     *
     * @var string
     */
    protected $_nickname;

    /**
     * Tags assigned to the link
     *
     * @var array
     */
    protected $_tags;

    /**
     * Note assigned to the link
     *
     * @var string
     */
    protected $_note;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMNode $node Individual <link> node from a parsed response from
     *                       a GetLinks operation
     * @return void
     */
    public function __construct($node)
    {
        $this->_accessType = $node->attributes->getNamedItem('accessType')->nodeValue;

        $doc = new DOMDocument();
        $doc->appendChild($doc->importNode($node, true));
        $xpath = new DOMXPath($doc);

        $this->_url = $xpath->evaluate('/link/url')->item(0)->nodeValue;
        $this->_modDate = $xpath->evaluate('/link/modDate')->item(0)->nodeValue;
        $this->_addDate = $xpath->evaluate('/link/addDate')->item(0)->nodeValue;
        $this->_title = $xpath->evaluate('/link/title')->item(0)->nodeValue;
        $this->_nickname = $xpath->evaluate('/link/nickname')->item(0)->nodeValue;
        $this->_note = $xpath->evaluate('/link/note')->item(0)->nodeValue;

        $list = $xpath->query('/link/tags/tag');
        $this->_tags = array();

        for ($x = 0; $x < $list->length; $x++) {
            $this->_tags[$x] = $list->item($x)->nodeValue;
        }
    }

    /**
     * Returns the access type assigned to the link
     *
     * @see ACCESSTYPE_PRIVATE
     * @see ACCESSTYPE_PUBLIC
     * @return string
     */
    public function getAccessType()
    {
        return $this->_accessType;
    }

    /**
     * Returns the URL of the link
     *
     * @return string
     */
    public function getUrl()
    {
        return $this->_url;
    }

    /**
     * Returns the date of the last modification made to the link
     *
     * @return string
     */
    public function getModDate()
    {
        return $this->_modDate;
    }

    /**
     * Returns the date the link was added
     *
     * @return string
     */
    public function getAddDate()
    {
        return $this->_addDate;
    }

    /**
     * Returns the title assigned to the link
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->_title;
    }

    /**
     * Returns the nickname assigned to the link
     *
     * @return string
     */
    public function getNickname()
    {
        return $this->_nickname;
    }

    /**
     * Returns the tags assigned to the link
     *
     * @return array
     */
    public function getTags()
    {
        return $this->_tags;
    }

    /**
     * Returns the note assigned to the link
     *
     * @return string
     */
    public function getNote()
    {
        return $this->_note;
    }
}
WatchlistSet.php000060400000004221150713303070007665 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: WatchlistSet.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @see Zend_Service_Simpy_Watchlist
 */
require_once 'Zend/Service/Simpy/Watchlist.php';


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_WatchlistSet implements IteratorAggregate
{
    /**
     * List of watchlists
     *
     * @var array of Zend_Service_Simpy_Watchlist objects
     */
    protected $_watchlists = array();

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMDocument $doc Parsed response from a GetWatchlists operation
     * @return void
     */
    public function __construct(DOMDocument $doc)
    {
        $xpath = new DOMXPath($doc);
        $list = $xpath->query('//watchlists/watchlist');

        for ($x = 0; $x < $list->length; $x++) {
            $this->_watchlists[$x] = new Zend_Service_Simpy_Watchlist($list->item($x));
        }
    }

    /**
     * Returns an iterator for the watchlist set
     *
     * @return ArrayIterator
     */
    public function getIterator()
    {
        return new ArrayIterator($this->_watchlists);
    }

    /**
     * Returns the number of watchlists in the set
     *
     * @return int
     */
    public function getLength()
    {
        return count($this->_watchlists);
    }
}
LinkSet.php000060400000004130150713303070006617 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: LinkSet.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @see Zend_Service_Simpy_Link
 */
require_once 'Zend/Service/Simpy/Link.php';


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_LinkSet implements IteratorAggregate
{
    /**
     * List of links
     *
     * @var array of Zend_Service_Simpy_Link objects
     */
    protected $_links;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMDocument $doc Parsed response from a GetLinks operation
     * @return void
     */
    public function __construct(DOMDocument $doc)
    {
        $xpath = new DOMXPath($doc);
        $list = $xpath->query('//links/link');
        $this->_links = array();

        for ($x = 0; $x < $list->length; $x++) {
            $this->_links[$x] = new Zend_Service_Simpy_Link($list->item($x));
        }
    }

    /**
     * Returns an iterator for the link set
     *
     * @return ArrayIterator
     */
    public function getIterator()
    {
        return new ArrayIterator($this->_links);
    }

    /**
     * Returns the number of links in the set
     *
     * @return int
     */
    public function getLength()
    {
        return count($this->_links);
    }
}
Note.php000060400000011052150713303070006154 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: Note.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_Note
{
    /**
     * Private access type
     *
     * @var string
     */
    const ACCESSTYPE_PRIVATE = 'private';

    /**
     * Public access type
     *
     * @var string
     */
    const ACCESSTYPE_PUBLIC  = 'public';

    /**
     * Access type assigned to the note
     *
     * @var string
     */
    protected $_accessType;

    /**
     * ID of the note
     *
     * @var int
     */
    protected $_id;

    /**
     * URI of the note
     *
     * @var string
     */
    protected $_uri;

    /**
     * Date of the last modification made to the note
     *
     * @var string
     */
    protected $_modDate;

    /**
     * Date the note was added
     *
     * @var string
     */
    protected $_addDate;

    /**
     * Title of to the note
     *
     * @var string
     */
    protected $_title;

    /**
     * Tags assigned to the note
     *
     * @var array
     */
    protected $_tags;

    /**
     * Description of the note
     *
     * @var string
     */
    protected $_description;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMNode $node Individual <link> node from a parsed response from
     *                       a GetLinks operation
     * @return void
     */
    public function __construct($node)
    {
        $this->_accessType = $node->attributes->getNamedItem('accessType')->nodeValue;

        $doc = new DOMDocument();
        $doc->appendChild($doc->importNode($node, true));
        $xpath = new DOMXPath($doc);

        $this->_uri = $xpath->evaluate('/note/uri')->item(0)->nodeValue;
        $this->_id = substr($this->_uri, strrpos($this->_uri, '=') + 1);
        $this->_modDate = trim($xpath->evaluate('/note/modDate')->item(0)->nodeValue);
        $this->_addDate = trim($xpath->evaluate('/note/addDate')->item(0)->nodeValue);
        $this->_title = $xpath->evaluate('/note/title')->item(0)->nodeValue;
        $this->_description = $xpath->evaluate('/note/description')->item(0)->nodeValue;

        $list = $xpath->query('/note/tags/tag');
        $this->_tags = array();

        for ($x = 0; $x < $list->length; $x++) {
            $this->_tags[$x] = $list->item($x)->nodeValue;
        }
    }

    /**
     * Returns the access type assigned to the note
     *
     * @see    ACCESSTYPE_PRIVATE
     * @see    ACCESSTYPE_PUBLIC
     * @return string
     */
    public function getAccessType()
    {
        return $this->_accessType;
    }

    /**
     * Returns the ID of the note
     *
     * @return int
     */
    public function getId()
    {
        return $this->_id;
    }

    /**
     * Returns the URI of the note
     *
     * @return string
     */
    public function getUri()
    {
        return $this->_uri;
    }

    /**
     * Returns the date of the last modification made to the note
     *
     * @return string
     */
    public function getModDate()
    {
        return $this->_modDate;
    }

    /**
     * Returns the date the note was added
     *
     * @return string
     */
    public function getAddDate()
    {
        return $this->_addDate;
    }

    /**
     * Returns the title assigned to the note
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->_title;
    }

    /**
     * Returns the tags assigned to the note
     *
     * @return array
     */
    public function getTags()
    {
        return $this->_tags;
    }

    /**
     * Returns the description assigned to the note
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->_description;
    }
}
WatchlistFilterSet.php000060400000003737150713303070011046 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: WatchlistFilterSet.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @see Zend_Service_Simpy_WatchlistFilter
 */
require_once 'Zend/Service/Simpy/WatchlistFilter.php';


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_WatchlistFilterSet implements IteratorAggregate
{
    /**
     * List of filters in the set
     *
     * @var array of Zend_Service_Simpy_WatchlistFilter objects
     */
    protected $_filters = array();

    /**
     * Adds a filter to the set
     *
     * @param  Zend_Service_Simpy_WatchlistFilter $filter Filter to be added
     * @return void
     */
    public function add(Zend_Service_Simpy_WatchlistFilter $filter)
    {
        $this->_filters[] = $filter;
    }

    /**
     * Returns an iterator for the watchlist filter set
     *
     * @return ArrayIterator
     */
    public function getIterator()
    {
        return new ArrayIterator($this->_filters);
    }

    /**
     * Returns the number of filters in the set
     *
     * @return int
     */
    public function getLength()
    {
        return count($this->_filters);
    }
}
Tag.php000060400000003672150713303070005773 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: Tag.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_Tag
{
    /**
     * Name of the tag
     *
     * @var string
     */
    protected $_tag;

    /**
     * Number of links with the tag
     *
     * @var int
     */
    protected $_count;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMNode $node Individual <tag> node from a parsed response from
     *                       a GetTags operation
     * @return void
     */
    public function __construct($node)
    {
        $map =& $node->attributes;
        $this->_tag = $map->getNamedItem('name')->nodeValue;
        $this->_count = $map->getNamedItem('count')->nodeValue;
    }

    /**
     * Returns the name of the tag
     *
     * @return string
     */
    public function getTag()
    {
        return $this->_tag;
    }

    /**
     * Returns the number of links with the tag
     *
     * @return int
     */
    public function getCount()
    {
        return $this->_count;
    }
}
WatchlistFilter.php000060400000003753150713303070010370 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: WatchlistFilter.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_WatchlistFilter
{
    /**
     * Name of the filter
     *
     * @var string
     */
    protected $_name;

    /**
     * Query for the filter
     *
     * @var string
     */
    protected $_query;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMNode $node Individual <filter> node from a parsed response from
     *                       a GetWatchlists or GetWatchlist operation
     * @return void
     */
    public function __construct($node)
    {
        $map =& $node->attributes;
        $this->_name = $map->getNamedItem('name')->nodeValue;
        $this->_query = $map->getNamedItem('query')->nodeValue;
    }

    /**
     * Returns the name of the filter
     *
     * @return string
     */
    public function getName()
    {
        return $this->_name;
    }

    /**
     * Returns the query for the filter
     *
     * @return string
     */
    public function getQuery()
    {
        return $this->_query;
    }
}
NoteSet.php000060400000004130150713303070006627 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: NoteSet.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @see Zend_Service_Simpy_Note
 */
require_once 'Zend/Service/Simpy/Note.php';


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_NoteSet implements IteratorAggregate
{
    /**
     * List of notes
     *
     * @var array of Zend_Service_Simpy_Note objects
     */
    protected $_notes;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMDocument $doc Parsed response from a GetNotes operation
     * @return void
     */
    public function __construct(DOMDocument $doc)
    {
        $xpath = new DOMXPath($doc);
        $list = $xpath->query('//notes/note');
        $this->_notes = array();

        for ($x = 0; $x < $list->length; $x++) {
            $this->_notes[$x] = new Zend_Service_Simpy_Note($list->item($x));
        }
    }

    /**
     * Returns an iterator for the note set
     *
     * @return ArrayIterator
     */
    public function getIterator()
    {
        return new ArrayIterator($this->_notes);
    }

    /**
     * Returns the number of notes in the set
     *
     * @return int
     */
    public function getLength()
    {
        return count($this->_notes);
    }
}
TagSet.php000060400000004107150713303070006441 0ustar00<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: TagSet.php 8064 2008-02-16 10:58:39Z thomas $
 */


/**
 * @see Zend_Service_Simpy_Tag
 */
require_once 'Zend/Service/Simpy/Tag.php';


/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage Simpy
 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_Simpy_TagSet implements IteratorAggregate
{
    /**
     * List of tags
     *
     * @var array of Zend_Service_Simpy_Tag objects
     */
    protected $_tags;

    /**
     * Constructor to initialize the object with data
     *
     * @param  DOMDocument $doc Parsed response from a GetTags operation
     * @return void
     */
    public function __construct(DOMDocument $doc)
    {
        $xpath = new DOMXPath($doc);
        $list = $xpath->query('//tags/tag');
        $this->_tags = array();

        for ($x = 0; $x < $list->length; $x++) {
            $this->_tags[$x] = new Zend_Service_Simpy_Tag($list->item($x));
        }
    }

    /**
     * Returns an iterator for the tag set
     *
     * @return ArrayIterator
     */
    public function getIterator()
    {
        return new ArrayIterator($this->_tags);
    }

    /**
     * Returns the number of tags in the set
     *
     * @return int
     */
    public function getLength()
    {
        return count($this->_tags);
    }
}