| author | ymh <ymh.work@gmail.com> |
| Thu, 08 Dec 2011 23:48:55 +0100 | |
| changeset 58 | 87bf6ec8af90 |
| parent 27 | 8551d844b4f3 |
| child 62 | 10be6b9e55e7 |
| permissions | -rwxr-xr-x |
| 2 | 1 |
<?php |
2 |
/* |
|
3 |
* This file is part of the WikiTagBundle package. |
|
4 |
* |
|
5 |
* (c) IRI <http://www.iri.centrepompidou.fr/> |
|
6 |
* |
|
7 |
* For the full copyright and license information, please view the LICENSE |
|
8 |
* file that was distributed with this source code. |
|
9 |
*/ |
|
10 |
||
11 |
namespace IRI\Bundle\WikiTagBundle\Model; |
|
12 |
||
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
13 |
use Doctrine\Common\Collections\ArrayCollection; |
| 27 | 14 |
use Doctrine\Common\Util\Debug; |
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
15 |
|
|
17
81962874e172
First implementation of dynamic fields
ymh <ymh.work@gmail.com>
parents:
3
diff
changeset
|
16 |
abstract class Document implements DocumentInterface { |
| 2 | 17 |
|
18 |
/** |
|
19 |
* @var integer $id |
|
20 |
*/ |
|
21 |
protected $id; |
|
22 |
||
23 |
||
24 |
/** |
|
25 |
* @var boolean $manualOrder |
|
26 |
*/ |
|
| 3 | 27 |
protected $manualOrder = false; |
28 |
||
29 |
/** |
|
30 |
* @var string $externalId |
|
31 |
*/ |
|
32 |
protected $externalId; |
|
| 2 | 33 |
|
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
34 |
/** |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
35 |
* @var ArrayCollection $tags |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
36 |
*/ |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
37 |
protected $tags; |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
38 |
|
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
39 |
/** |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
40 |
* @var string tagsStr |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
41 |
*/ |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
42 |
protected $tagsStr; |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
43 |
|
| 2 | 44 |
|
45 |
/** |
|
46 |
* Get id |
|
47 |
* |
|
48 |
* @return integer |
|
49 |
*/ |
|
50 |
public function getId() |
|
51 |
{ |
|
52 |
return $this->id; |
|
53 |
} |
|
54 |
||
55 |
||
56 |
/** |
|
57 |
* Set manualOrder |
|
58 |
* |
|
59 |
* @param boolean $manualOrder |
|
60 |
*/ |
|
61 |
function setManualOrder($manualOrder) |
|
62 |
{ |
|
63 |
$this->manualOrder = $manualOrder; |
|
64 |
} |
|
65 |
||
66 |
/** |
|
67 |
* Get manualOrder |
|
68 |
* |
|
69 |
* @return boolean |
|
70 |
*/ |
|
71 |
function getManualOrder() |
|
72 |
{ |
|
73 |
return $this->manualOrder; |
|
74 |
} |
|
75 |
||
| 3 | 76 |
/** |
| 58 | 77 |
* (non-PHPdoc) |
| 3 | 78 |
* @see IRI\Bundle\WikiTagBundle\Model.BaseDocumentInterface::setExternalId() |
79 |
*/ |
|
80 |
function setExternalId($externalId) |
|
81 |
{ |
|
82 |
$this->externalId = $externalId; |
|
83 |
} |
|
84 |
||
85 |
/** |
|
| 58 | 86 |
* (non-PHPdoc) |
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
87 |
* @see IRI\Bundle\WikiTagBundle\Model.DocumentInterface::getExternalId() |
| 3 | 88 |
*/ |
89 |
function getExternalId() |
|
90 |
{ |
|
91 |
return $this->externalId; |
|
92 |
} |
|
| 2 | 93 |
|
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
94 |
/** |
| 58 | 95 |
* (non-PHPdoc) |
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
96 |
* @see IRI\Bundle\WikiTagBundle\Model.DocumentInterface::getTags() |
|
14
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
97 |
*/ |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
98 |
function getTags() |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
99 |
{ |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
100 |
return $this->tags; |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
101 |
} |
|
673b2766024e
Update ORM configuration to allow JOIN between Tag and DocumentTag. TagList template has now the number of documents by tag.
cavaliet
parents:
3
diff
changeset
|
102 |
|
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
103 |
/** |
| 58 | 104 |
* (non-PHPdoc) |
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
105 |
* @see IRI\Bundle\WikiTagBundle\Model.DocumentInterface::setTagsStr() |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
106 |
*/ |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
107 |
function setTagsStr($tagsStr) |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
108 |
{ |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
109 |
$this->tagsStr = $tagsStr; |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
110 |
} |
| 58 | 111 |
|
112 |
/** |
|
113 |
* (non-PHPdoc) |
|
114 |
* @see IRI\Bundle\WikiTagBundle\Model.DocumentInterface::getTagsStr() |
|
115 |
*/ |
|
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
116 |
function getTagsStr() |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
117 |
{ |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
118 |
return $this->tagsStr; |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
119 |
} |
|
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
120 |
|
| 27 | 121 |
public function __toString() |
122 |
{ |
|
123 |
return print_r(Debug::export($this, 3),true); |
|
124 |
} |
|
|
23
b435f8055cb4
improve dynamic docs. create and lad class dynamically
ymh <ymh.work@gmail.com>
parents:
20
diff
changeset
|
125 |
|
| 2 | 126 |
} |