Completed
Push — develop ( 38be37...f8baa2 )
by
unknown
07:07
created

ViewModelTemplateFilterJob::setJsonLdHelper()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Jobs\Filter;
12
13
14
/**
15
 * template ViewModel html
16
 *
17
 * Class ViewModelTemplateFilterJob
18
 * @package Jobs\Filter
19
 * @method fromRoute
20
 */
21
class ViewModelTemplateFilterJob extends ViewModelTemplateFilterAbstract
22
{
23
    /**
24
     * assign the form-elements to the template
25
     * @param \Jobs\Entity\Job $job
26
     * @return $this
27
     */
28
    protected function extract($job)
29
    {
30
        $this->job = $job;
31
        $this->getJsonLdHelper()->setJob($job);
32
        $this->setApplyData();
33
        $this->setOrganizationInfo();
34
        $this->setLocation();
35
        $this->setDescription();
36
        $this->setTemplate();
37
        $this->setTemplateDefaultValues();
38
39
        $this->container['descriptionEditable'] = $job->getTemplateValues()->getDescription();
40
        $this->container['benefits'] = $job->getTemplateValues()->getBenefits();
41
        $this->container['requirements'] = $job->getTemplateValues()->getRequirements();
42
        $this->container['qualifications'] = $job->getTemplateValues()->getQualifications();
43
        $this->container['title'] = $job->getTemplateValues()->getTitle();
44
        $this->container['headTitle'] = strip_tags($job->getTemplateValues()->getTitle());
45
        $this->container['uriApply'] = $this->container['applyData']['uri'];
46
        $this->container['contactEmail'] = strip_tags($job->getContactEmail());
47
        $this->container['html'] = $job->getTemplateValues()->getHtml();
48
49
        $this->container['jobId'] = $job->getId();
50
        $this->container['uriJob'] = $this->urlPlugin->fromRoute(
51
            'lang/jobs/view',
52
            [],
53
            [
54
                'query' => [ 'id' => $job->getId() ],
55
                'force_canonical' => true
56
            ]
57
        );
58
59
        return $this;
60
    }
61
}
62