|
|
@@ -4,6 +4,8 @@ namespace internship\bo;
|
|
|
|
|
|
use n2n\reflection\ObjectAdapter;
|
|
|
use n2n\persistence\orm\attribute\Table;
|
|
|
+use nql\bo\Member;
|
|
|
+use n2n\io\managed\FileManager;
|
|
|
use n2n\persistence\orm\attribute\Inheritance;
|
|
|
use n2n\persistence\orm\InheritanceType;
|
|
|
use n2n\persistence\orm\attribute\DiscriminatorValue;
|
|
|
@@ -12,12 +14,10 @@ use n2n\persistence\orm\attribute\EntityListeners;
|
|
|
use n2n\persistence\orm\attribute\AttributeOverrides;
|
|
|
use n2n\persistence\orm\attribute\MappedSuperclass;
|
|
|
use n2n\persistence\orm\attribute\ManagedFile;
|
|
|
-use nql\bo\Member;
|
|
|
use n2n\persistence\orm\attribute\ManyToOne;
|
|
|
use n2n\persistence\orm\attribute\Embedded;
|
|
|
use n2n\persistence\orm\attribute\Column;
|
|
|
use n2n\persistence\orm\attribute\Id;
|
|
|
-use n2n\io\managed\FileManager;
|
|
|
use n2n\persistence\orm\attribute\AssociationOverrides;
|
|
|
use n2n\persistence\orm\attribute\JoinColumn;
|
|
|
use n2n\persistence\orm\CascadeType;
|
|
|
@@ -26,8 +26,10 @@ use n2n\persistence\orm\attribute\JoinTable;
|
|
|
use n2n\persistence\orm\attribute\OrderBy;
|
|
|
use n2n\persistence\orm\attribute\OneToOne;
|
|
|
use n2n\persistence\orm\attribute\ManyToMany;
|
|
|
+use internship\listeners\LastModListener;
|
|
|
+use n2n\persistence\orm\attribute\File;
|
|
|
+use n2n\web\http\controller\impl\mock\StringValueObjectMock;
|
|
|
|
|
|
-#[Table('newsarticle')]
|
|
|
/* #[Inheritance(InheritanceType::TABLE_PER_CLASS)] */
|
|
|
/* #[DiscriminatorValue('textItem')] */
|
|
|
/* #[DiscriminatorColumn('type')] */
|
|
|
@@ -43,26 +45,38 @@ use n2n\persistence\orm\attribute\ManyToMany;
|
|
|
/* #[ManyToMany('articles', Article::class)] */
|
|
|
/* #[OneToMany('assignement.assignementGroup', Member::class)]*/
|
|
|
/* #[ManyToOne(targetEntity: BlogArticle::class, cascade: null, cascadeType: CascadeType::ALL, fetch: FetchType::EAGER)] */
|
|
|
+
|
|
|
+#[Table('newsarticle')]
|
|
|
+#[AttributeOverrides(
|
|
|
+ ['text_finished' => 'text',
|
|
|
+ 'description_finished' => 'description']
|
|
|
+)]
|
|
|
+#[EntityListeners(LastModListener::class)]
|
|
|
+#[Inheritance(InheritanceType::SINGLE_TABLE)]
|
|
|
+#[DiscriminatorColumn('type')]
|
|
|
+#[DiscriminatorValue('news')]
|
|
|
class News extends ObjectAdapter implements \JsonSerializable {
|
|
|
public int $id;
|
|
|
/* #[OrderBy(array('name' => 'ASC'))]
|
|
|
#[Embedded(Address::class)]
|
|
|
- #[AttributeOverrides(['forename' => 'bill_forename',
|
|
|
- 'surname' => 'bill_surname'])]
|
|
|
#[Column('firstname')]
|
|
|
*/
|
|
|
/* #[ManagedFile(FileManager::TYPE_PUBLIC)] */
|
|
|
/* #[AssociationOverrides(array( 'assignementGroup' => new JoinColumn('group_id')))] */
|
|
|
/* #[JoinColumn('article_id')] */
|
|
|
- public string $title;
|
|
|
|
|
|
- public string $description;
|
|
|
+ public \DateTime $lastMod;
|
|
|
+
|
|
|
+ #[Column('title')]
|
|
|
+ public string $title2;
|
|
|
+
|
|
|
+ public string $description_finished;
|
|
|
|
|
|
- public string $text;
|
|
|
+ public string $text_finished;
|
|
|
|
|
|
public function jsonSerialize(): mixed {
|
|
|
- return ['title' => $this->title,
|
|
|
- 'description' => $this->description,
|
|
|
- 'text' => $this->text ];
|
|
|
+ return ['title' => $this->title2,
|
|
|
+ 'description' => $this->description_finished,
|
|
|
+ 'text' => $this->text_finished];
|
|
|
}
|
|
|
}
|