public function it_gets_the_latest_issue_for_current_publication(Issue $issue, Publication $publication) { $pub = new Publication(); $pub->setId(1); $issue = new Issue(1, $pub); $issue->setWorkflowStatus('Y'); $publication->getIssues()->willReturn(new ArrayCollection(array($issue))); $this->getLatestPublishedIssue()->shouldReturn($issue); }
public function getCount(array $p_params = array(), array $cols = array()) { $search = $this->getSearchObject(); $p_params = (object) $p_params; if (isset($p_params->search)) { if (@trim($p_params->search[$this->_pubColFilterIdx]) != "") { $p = new Publication(); $p->setId(intval($p_params->search[$this->_pubColFilterIdx])); try { return $this->_service->getCountThemes($p, $search); } catch (\Exception $e) { return 0; } } $this->search($p_params->search); } try { return $this->_service->getCountUnassignedThemes($search); } catch (\Exception $e) { return 0; } }