| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- namespace internship\bo;
- use n2n\reflection\ObjectAdapter;
- use n2n\reflection\annotation\AnnoInit;
- use n2n\persistence\orm\annotation\AnnoOneToMany;
- use n2n\persistence\orm\CascadeType;
- use internship\bo\NewsItem;
- class NewsCategory extends ObjectAdapter {
- private static function _annos(AnnoInit $ai) {
- $ai->p('newsItems', new AnnoOneToMany(NewsItem::getClass(), 'category', CascadeType::ALL));
- }
- private int $id;
- private string $title;
- private string $lead;
- private string $content;
- private ?string $imageFile;
- private string $urlPart;
- private $newsItems;
- /**
- * @return int
- */
- public function getId(): int {
- return $this->id;
- }
- /**
- * @return string
- */
- public function getTitle(): string {
- return $this->title;
- }
- /**
- * @param string $title
- */
- public function setTitle(string $title): void {
- $this->title = $title;
- }
- /**
- * @return string
- */
- public function getContent(): string {
- return $this->content;
- }
- /**
- * @param string $content
- */
- public function setContent(string $content): void {
- $this->content = $content;
- }
- /**
- * @return string
- */
- public function getLead(): string {
- return $this->lead;
- }
- /**
- * @param string $lead
- */
- public function setLead(string $lead): void {
- $this->lead = $lead;
- }
- /**
- * @return string
- */
- public function getImageFile(): string {
- return $this->imageFile;
- }
- /**
- * @param string $imageFile
- */
- public function setImageFile(?string $imageFile): void {
- $this->imageFile = $imageFile;
- }
- /**
- * @return string
- */
- public function getUrlPart() {
- return $this->urlPart;
- }
- /**
- * @param string $urlPart
- */
- public function setUrlPart($urlPart) {
- $this->urlPart = $urlPart;
- }
- /**
- * @return mixed
- */
- public function getNewsItems() {
- return $this->newsItems;
- }
- /**
- * @param mixed $newsItems
- */
- public function setNewsItems(\ArrayObject $newsItems): void {
- $this->newsItems = $newsItems;
- }
- }
|