*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Service / Delicious / SimplePost.php
blob420c7e665b470bfeff1e97e0b2be8a8bc7a64975
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
16 * @category Zend
17 * @package Zend_Service
18 * @subpackage Delicious
19 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id: SimplePost.php 16211 2009-06-21 19:23:55Z thomas $
25 /**
26 * Represents a publicly available post
28 * @category Zend
29 * @package Zend_Service
30 * @subpackage Delicious
31 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
32 * @license http://framework.zend.com/license/new-bsd New BSD License
34 class Zend_Service_Delicious_SimplePost
36 /**
37 * @var string Post url
39 protected $_url;
41 /**
42 * @var string Post title
44 protected $_title;
46 /**
47 * @var string Post notes
49 protected $_notes;
51 /**
52 * @var array Post tags
54 protected $_tags = array();
56 /**
57 * Constructor
59 * @param array $post Post data
60 * @return void
61 * @throws Zend_Service_Delicious_Exception
63 public function __construct(array $post)
65 if (!isset($post['u']) || !isset($post['d'])) {
66 /**
67 * @see Zend_Service_Delicious_Exception
69 require_once 'Zend/Service/Delicious/Exception.php';
70 throw new Zend_Service_Delicious_Exception('Title and URL not set.');
73 $this->_url = $post['u'];
74 $this->_title = $post['d'];
76 if (isset($post['t'])) {
77 $this->_tags = $post['t'];
79 if (isset($post['n'])) {
80 $this->_notes = $post['n'];
84 /**
85 * Getter for URL
87 * @return string
89 public function getUrl()
91 return $this->_url;
94 /**
95 * Getter for title
97 * @return string
99 public function getTitle()
101 return $this->_title;
105 * Getter for notes
107 * @return string
109 public function getNotes()
111 return $this->_notes;
115 * Getter for tags
117 * @return array
119 public function getTags()
121 return $this->_tags;