2015-05-05 01:00:01 +00:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
2015-03-08 14:02:59 -03:00
|
|
|
|
2016-01-11 23:18:20 -03:00
|
|
|
class Post extends Content {
|
|
|
|
|
2015-06-30 00:23:29 -03:00
|
|
|
function __construct($key)
|
2015-03-08 14:02:59 -03:00
|
|
|
{
|
2015-06-30 00:23:29 -03:00
|
|
|
// Database Key
|
|
|
|
$this->setField('key', $key);
|
2015-03-08 14:02:59 -03:00
|
|
|
|
2016-01-11 23:18:20 -03:00
|
|
|
// Set filterType
|
|
|
|
$this->setField('filterType', 'post');
|
2015-06-27 20:28:22 -03:00
|
|
|
|
2016-01-11 23:18:20 -03:00
|
|
|
parent::__construct(PATH_POSTS.$key.DS);
|
2015-03-08 14:02:59 -03:00
|
|
|
}
|
|
|
|
|
2015-05-05 01:00:01 +00:00
|
|
|
public function key()
|
2015-03-08 14:02:59 -03:00
|
|
|
{
|
2015-05-05 01:00:01 +00:00
|
|
|
return $this->getField('key');
|
2015-03-08 14:02:59 -03:00
|
|
|
}
|
|
|
|
|
2016-01-11 23:18:20 -03:00
|
|
|
public function slug()
|
2015-07-06 22:05:17 -03:00
|
|
|
{
|
2016-01-11 23:18:20 -03:00
|
|
|
return $this->getField('key');
|
2015-08-26 00:42:32 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Returns TRUE if the post is scheduled, FALSE otherwise.
|
|
|
|
public function scheduled()
|
|
|
|
{
|
2015-09-01 21:42:21 -03:00
|
|
|
return ($this->getField('status')==='scheduled');
|
2015-07-06 22:05:17 -03:00
|
|
|
}
|
2016-01-11 23:18:20 -03:00
|
|
|
}
|