Summary Files Commits Branches @commit @diff @stats
path: root / src / models / JobOffer.php
diff options
context:
space:
mode:
Commit83bb68e766bf12c5c48350bd6d9f8237e301882c (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-04-01 11:22:04 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2021-04-01 11:22:04 +0300
Filesfd9490a434b8cf7916921280c3903339414192f1 /src/models/JobOffer.php
devrix-job-board-83bb68e766bf12c5c48350bd6d9f8237e301882c.tar
devrix-job-board-83bb68e766bf12c5c48350bd6d9f8237e301882c.tar.gz
devrix-job-board-83bb68e766bf12c5c48350bd6d9f8237e301882c.zip
Parent852e91a3da52a478c942bf7a664df8d8798b0641 (diff)
Added and improved existing phpdocumentator documentation
1 files changed, 15 insertions, 0 deletions
-rw-r--r--src/models/JobOffer.php15
diff --git a/src/models/JobOffer.php b/src/models/JobOffer.php
index 5d89048..4a53b8d 100644
--- a/src/models/JobOffer.php
+++ b/src/models/JobOffer.php
@@ -1,6 +1,9 @@
<?php
include_once("DBModel.php");
+/**
+ * Model that contains the required JobOffer properties. It also contains the request methods to the job_offers table.
+ */
class JobOffer extends DBModel {
public const TABLE_NAME = "job_offers";
public const TABLE_COLUMNS = array("title " . DB::STRING_TYPE, "description " . DB::STRING_TYPE, "company " . DB::STRING_TYPE, "salary " . DB::FLOAT_TYPE);
@@ -22,6 +25,8 @@ class JobOffer extends DBModel {
/* Create */
/**
+ * Inserts the giveb JobOffer into the databse. The id is automatically generated in the database.
+ *
* @param JobOffer $jb
*/
static function insertIntoDB($jb) {
@@ -31,6 +36,8 @@ class JobOffer extends DBModel {
/* Read */
/**
+ * Returns the JobOffer with the given id from the database.
+ *
* @return JobOffer
*/
static function getFromDBById(int $id) {
@@ -38,6 +45,8 @@ class JobOffer extends DBModel {
}
/**
+ * Returns all JobOffers from the database.
+ *
* @return JobOffer[]
*/
static function getAllFromDB() {
@@ -47,6 +56,9 @@ class JobOffer extends DBModel {
/* Update */
/**
+ * Updates the given JobOffer from the database.
+ * **WARNING**: the JobOffer **MUST** have it's database id.
+ *
* @param JobOffer $jb
*/
static function updateFromDB($jb) {
@@ -55,6 +67,9 @@ class JobOffer extends DBModel {
/* Delete */
+ /**
+ * Deletes the JobOffer with the given id from the database.
+ */
static function deleteFromDB(int $id) {
self::$DB->deleteById(self::TABLE_NAME, $id);
}