Created comment object

This commit is contained in:
Pierre
2018-04-21 14:48:02 +02:00
parent 217c6c4213
commit e20403e8ab
3 changed files with 138 additions and 19 deletions

View File

@ -0,0 +1,31 @@
<?php
/**
* Base object for any unique object
*
* @author Pierre HUBERT
*/
abstract class BaseUniqueObject {
//Private fields
private $id = 0;
//Set and get object ID
public function set_id(int $id){
$this->id = $id;
}
public function get_id() : int {
return $this->id;
}
/**
* Check wether this object is valid or not
*
* @return bool TRUE if this object is valid / FALSE else
*/
public function isValid() : bool {
return $this->id > 0;
}
}