예제 #1
0
 public function __construct(PDO $oDatabase)
 {
     parent::__construct($oDatabase);
     $this->idField = new Field(Field::TYPE_PRIMARY_KEY, "id", "category_id");
     $this->nameField = new Field(Field::TYPE_STRING, "name", "category_name");
     $this->descriptionField = new Field(Field::TYPE_STRING, "description", "category_description");
 }
예제 #2
0
 public function __construct(PDO $database)
 {
     parent::__construct($database);
     $this->linkIdField = new Field(Field::TYPE_PRIMARY_KEY, "id", "link_id");
     $this->linkTextField = new Field(Field::TYPE_STRING, "text", "link_text");
     $this->linkUrlField = new Field(Field::TYPE_URI, "url", "link_url");
     $this->menuIdField = new Field(Field::TYPE_INT, "menuId", "menu_id");
 }
예제 #3
0
 public function __construct(Website $website)
 {
     parent::__construct($website->getDatabase());
     $this->widgetDirectory = $website->getUriWidgets();
     $this->documentIdField = new Field(Field::TYPE_INT, "documentId", "sidebar_id");
     $this->widgetDataField = new Field(Field::TYPE_JSON, "widgetData", "widget_data");
     $this->widgetIdField = new Field(Field::TYPE_PRIMARY_KEY, "id", "widget_id");
     $this->widgetNameField = new Field(Field::TYPE_STRING, "widgetName", "widget_naam");
     $this->widgetPriorityField = new Field(Field::TYPE_INT, "priority", "widget_priority");
 }
예제 #4
0
 /**
  * Creates a new document repository.
  * @param PDO $pdo Database to get documents from.
  * @param boolean $showHiddenDocuments True if documents flagged as hidden
  * must be shown anyways, false otherwise.
  */
 public function __construct(PDO $pdo, $showHiddenDocuments)
 {
     parent::__construct($pdo);
     $this->primaryField = new Field(Field::TYPE_PRIMARY_KEY, "id", "document_id");
     $this->titleField = new Field(Field::TYPE_STRING, "title", "document_title");
     $this->introField = new Field(Field::TYPE_STRING, "intro", "document_intro");
     $this->hiddenField = new Field(Field::TYPE_BOOLEAN, "hidden", "document_hidden");
     $this->createdField = new Field(Field::TYPE_DATE, "created", "document_created");
     $this->editedField = new Field(Field::TYPE_DATE, "edited", "document_edited");
     $this->userIdField = new Field(Field::TYPE_INT, "userId", "user_id");
     $this->parentIdField = new Field(Field::TYPE_INT, "parentId", "document_parent_id");
     $this->showHiddenDocuments = (bool) $showHiddenDocuments;
 }
예제 #5
0
 public function __construct(PDO $database)
 {
     parent::__construct($database);
     $this->usernameField = new Field(Field::TYPE_STRING_LOWERCASE, "username", "user_login");
     $this->displayNameField = new Field(Field::TYPE_STRING, "displayName", "user_display_name");
     $this->passwordHashedField = new Field(Field::TYPE_STRING, "passwordHashed", "user_password");
     $this->idField = new Field(Field::TYPE_PRIMARY_KEY, "id", "user_id");
     $this->emailField = new Field(Field::TYPE_STRING, "email", "user_email");
     $this->rankField = new Field(Field::TYPE_INT, "rank", "user_rank");
     $this->joinedField = new Field(Field::TYPE_DATE, "joined", "user_joined");
     $this->lastLoginField = new Field(Field::TYPE_DATE, "lastLogin", "user_last_login");
     $this->statusField = new Field(Field::TYPE_INT, "status", "user_status");
     $this->statusTextField = new Field(Field::TYPE_STRING, "statusText", "user_status_text");
     $this->extraDataField = new Field(Field::TYPE_JSON, "extraData", "user_extra_data");
 }
예제 #6
0
 /**
  * Constructs a new comment repository.
  * @param PDO The database to retrieve comments from, and save comments to.
  */
 public function __construct(PDO $database)
 {
     parent::__construct($database);
     $this->primaryField = new Field(Field::TYPE_PRIMARY_KEY, "id", "comment_id");
     $this->articleIdField = new Field(Field::TYPE_INT, "articleId", "article_id");
     $this->userIdField = new Field(Field::TYPE_INT, "userId", "user_id");
     $this->userDisplayNameField = new Field(Field::TYPE_STRING, "userDisplayName", "user_display_name");
     $this->userDisplayNameField->createLink(UserRepository::TABLE_NAME, $this->userIdField);
     $this->userNameField = new Field(Field::TYPE_STRING, "userName", "user_login");
     $this->userNameField->createLink(UserRepository::TABLE_NAME, $this->userIdField);
     $this->userEmailField = new Field(Field::TYPE_STRING, "userEmail", "user_email");
     $this->userEmailField->createLink(UserRepository::TABLE_NAME, $this->userIdField);
     $this->userRankField = new Field(Field::TYPE_STRING, "userName", "user_rank");
     $this->userRankField->createLink(UserRepository::TABLE_NAME, $this->userIdField);
     $this->commentUserNameField = new Field(Field::TYPE_STRING, "commentName", "comment_name");
     $this->commentEmailField = new Field(Field::TYPE_STRING, "commentEmail", "comment_email");
     $this->createdField = new Field(Field::TYPE_DATE, "created", "comment_created");
     $this->lastEditedField = new Field(Field::TYPE_DATE, "lastEdited", "comment_last_edited");
     $this->bodyField = new Field(Field::TYPE_STRING, "body", "comment_body");
     $this->statusField = new Field(Field::TYPE_INT, "status", "comment_status");
 }
예제 #7
0
 /**
  * Constructs the article displayer.
  * @param Website $website The website to use.
  */
 public function __construct(Website $website)
 {
     parent::__construct($website->getDatabase());
     $this->website = $website;
     $this->primaryField = new Field(Field::TYPE_PRIMARY_KEY, "id", "artikel_id");
     $this->titleField = new Field(Field::TYPE_STRING, "title", "artikel_titel");
     $this->createdField = new Field(Field::TYPE_DATE, "created", "artikel_gemaakt");
     $this->editedField = new Field(Field::TYPE_DATE, "lastEdited", "artikel_bewerkt");
     $this->introField = new Field(Field::TYPE_STRING, "intro", "artikel_intro");
     $this->bodyField = new Field(Field::TYPE_STRING, "body", "artikel_inhoud");
     $this->featuredImageField = new Field(Field::TYPE_STRING, "featuredImage", "artikel_afbeelding");
     $this->categoryIdField = new Field(Field::TYPE_INT, "categoryId", "categorie_id");
     $this->categoryNameField = new Field(Field::TYPE_STRING, "category", "category_name");
     $categoryIdInCategoryTable = new Field(Field::TYPE_INT, "category", "category_id");
     $this->categoryNameField->createLink(CategoryRepository::TABLE_NAME, $this->categoryIdField, $categoryIdInCategoryTable);
     $this->authorIdField = new Field(Field::TYPE_INT, "authorId", "gebruiker_id");
     $this->authorNameField = new Field(Field::TYPE_STRING, "author", "user_display_name");
     $authorIdInUsersTable = new Field(Field::TYPE_INT, "authorId", "user_id");
     $this->authorNameField->createLink(UserRepository::TABLE_NAME, $this->authorIdField, $authorIdInUsersTable);
     $this->pinnedField = new Field(Field::TYPE_BOOLEAN, "pinned", "artikel_gepind");
     $this->hiddenField = new Field(Field::TYPE_BOOLEAN, "hidden", "artikel_verborgen");
     $this->showCommentsField = new Field(Field::TYPE_BOOLEAN, "showComments", "artikel_reacties");
     $this->calendarField = new Field(Field::TYPE_DATE, "onCalendar", "artikel_verwijsdatum");
 }
예제 #8
0
 public function __construct(PDO $database)
 {
     parent::__construct($database);
     $this->menuIdField = new Field(Field::TYPE_PRIMARY_KEY, "id", "menu_id");
     $this->menuNameField = new Field(Field::TYPE_STRING, "name", "menu_name");
 }