コード例 #1
0
ファイル: Category.php プロジェクト: Lebe1ge/JobeetForZF2
 public function exchangeArray($data)
 {
     $slugifyFilter = new Slugify();
     $this->id_category = isset($data['id_category']) ? $data['id_category'] : null;
     $this->name = isset($data['name']) ? $data['name'] : null;
     $this->slug = isset($data['slug']) ? $data['slug'] : $slugifyFilter->filter($this->name);
 }
コード例 #2
0
ファイル: JobSessions.php プロジェクト: Lebe1ge/JobeetForZF2
 public function __invoke()
 {
     $slug = new Slugify();
     $job_sessions = new Container('jobs');
     $html = '';
     if (isset($job_sessions->jobs)) {
         $html .= '<ul>';
         $jobTable = $this->serviceLocator->getServiceLocator()->get('Jobeet\\Model\\JobTable');
         $getUrl = $this->getView()->plugin('url');
         foreach ($job_sessions->jobs as $key => $idJob) {
             $currentJob = $jobTable->getJob((int) $idJob);
             if (!is_null($currentJob)) {
                 $url = $getUrl('home/get_job', array('company' => $slug->filter($currentJob->company), 'position' => $slug->filter($currentJob->position), 'location' => $slug->filter($currentJob->location), 'id' => $currentJob->id_job), false, false);
                 $html .= '<li><a href="' . $url . '">' . $currentJob->position . ' - ' . $currentJob->company . '</a></li>';
             }
         }
         $html .= '<ul>';
     }
     return $html;
 }