Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
Chapter.inc.php
1 <?php
2 
17 class Chapter extends DataObject {
21  function Chapter() {
22  parent::DataObject();
23  }
24 
25  //
26  // Get/set methods
27  //
32  function getMonographId() {
33  return $this->getData('monographId');
34  }
35 
40  function setMonographId($monographId) {
41  return $this->setData('monographId', $monographId);
42  }
43 
48  function getLocalizedFullTitle() {
49 
50  $fullTitle = $this->getLocalizedTitle();
51 
52  if ($subtitle = $this->getLocalizedSubtitle()) {
53  $fullTitle = String::concatTitleFields(array($fullTitle, $subtitle));
54  }
55 
56  return $fullTitle;
57  }
58 
62  function getLocalizedTitle() {
63  return $this->getLocalizedData('title');
64  }
65 
71  function getTitle($locale = null) {
72  return $this->getData('title', $locale);
73  }
74 
80  function setTitle($title, $locale = null) {
81  return $this->setData('title', $title, $locale);
82  }
83 
87  function getLocalizedSubtitle() {
88  return $this->getLocalizedData('subtitle');
89  }
90 
96  function getSubtitle($locale = null) {
97  return $this->getData('subtitle', $locale);
98  }
99 
105  function setSubtitle($subtitle, $locale = null) {
106  return $this->setData('subtitle', $subtitle, $locale);
107  }
108 
113  function getSequence() {
114  return $this->getData('sequence');
115  }
116 
121  function setSequence($sequence) {
122  return $this->setData('sequence', $sequence);
123  }
124 
129  function getAuthors() {
130  $chapterAuthorDao = DAORegistry::getDAO('ChapterAuthorDAO'); /* @var $chapterAuthorDao ChapterAuthorDAO */
131  return $chapterAuthorDao->getAuthors($this->getMonographId(), $this->getId());
132  }
133 
139  $authors = $this->getAuthors();
140  while ($author = $authors->next()) {
141  $authorNames[] = $author->getFullName();
142  }
143  return join(', ', $authorNames);
144  }
145 }
146 
147 ?>
getSubtitle($locale=null)
Definition: Chapter.inc.php:96
static & getDAO($name, $dbconn=null)
getLocalizedFullTitle()
Definition: Chapter.inc.php:48
& getLocalizedData($key)
& getData($key, $locale=null)
getMonographId()
Definition: Chapter.inc.php:32
setSequence($sequence)
getAuthorNamesAsString()
getTitle($locale=null)
Definition: Chapter.inc.php:71
Any class with an associated DAO should extend this class.
setSubtitle($subtitle, $locale=null)
static concatTitleFields($fields)
Definition: String.inc.php:717
setData($key, $value, $locale=null)
setTitle($title, $locale=null)
Definition: Chapter.inc.php:80
setMonographId($monographId)
Definition: Chapter.inc.php:40
getLocalizedTitle()
Definition: Chapter.inc.php:62
Describes a monograph chapter (or section)
Definition: Chapter.inc.php:17
getLocalizedSubtitle()
Definition: Chapter.inc.php:87