Exemplo n.º 1
0
 /**
  * Check completion status
  *
  * @return  object
  */
 public function getStatus($pub = NULL, $manifest = NULL, $elementId = NULL)
 {
     // Start status
     $status = new \Components\Publications\Models\Status();
     $tagsHelper = new \Components\Publications\Helpers\Tags($this->_parent->_db);
     // Required?
     $required = $manifest->params->required;
     $count = $tagsHelper->countTags($pub->id);
     $status->status = $required && $count == 0 ? 0 : 1;
     $status->status = !$required && $count == 0 ? 2 : $status->status;
     return $status;
 }