szurubooru/src/Api/AbstractPostJob.php
2014-05-05 17:47:30 +02:00

18 lines
338 B
PHP

<?php
abstract class AbstractPostJob extends AbstractJob
{
protected $post;
public function prepare()
{
if ($this->hasArgument(self::POST_ENTITY))
{
$this->post = $this->getArgument(self::POST_ENTITY);
}
else
{
$postId = $this->getArgument(self::POST_ID);
$this->post = PostModel::findByIdOrName($postId);
}
}
}