Completed
Push — develop ( d3d9b0...38be37 )
by
unknown
16:43
created

ViewModelTemplateFilterJob   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 4
dl 0
loc 69
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setJsonLdHelper() 0 6 1
A getJsonLdHelper() 0 4 1
B extract() 0 33 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
use Jobs\View\Helper\JsonLd;
14
15
/**
16
 * template ViewModel html
17
 *
18
 * Class ViewModelTemplateFilterJob
19
 * @package Jobs\Filter
20
 * @method fromRoute
21
 */
22
class ViewModelTemplateFilterJob extends ViewModelTemplateFilterAbstract
23
{
24
    /**
25
     *
26
     *
27
     * @var JsonLd
28
     */
29
    protected $jsonLdHelper;
30
31
    /**
32
     * @param \Jobs\View\Helper\JsonLd $jsonLdHelper
33
     *
34
     * @return self
35
     */
36
    public function setJsonLdHelper(JsonLd $jsonLdHelper)
37
    {
38
        $this->jsonLdHelper = $jsonLdHelper;
39
40
        return $this;
41
    }
42
43
    /**
44
     * @return \Jobs\View\Helper\JsonLd
45
     */
46
    public function getJsonLdHelper()
47
    {
48
        return $this->jsonLdHelper;
49
    }
50
51
52
    /**
53
     * assign the form-elements to the template
54
     * @param \Jobs\Entity\Job $job
55
     * @return $this
56
     */
57
    protected function extract($job)
58
    {
59
        $this->job = $job;
60
        $this->getJsonLdHelper()->setJob($job);
61
        $this->setApplyData();
62
        $this->setOrganizationInfo();
63
        $this->setLocation();
64
        $this->setDescription();
65
        $this->setTemplate();
66
        $this->setTemplateDefaultValues();
67
68
        $this->container['descriptionEditable'] = $job->getTemplateValues()->getDescription();
69
        $this->container['benefits'] = $job->getTemplateValues()->getBenefits();
70
        $this->container['requirements'] = $job->getTemplateValues()->getRequirements();
71
        $this->container['qualifications'] = $job->getTemplateValues()->getQualifications();
72
        $this->container['title'] = $job->getTemplateValues()->getTitle();
73
        $this->container['headTitle'] = strip_tags($job->getTemplateValues()->getTitle());
74
        $this->container['uriApply'] = $this->container['applyData']['uri'];
75
        $this->container['contactEmail'] = strip_tags($job->getContactEmail());
76
        $this->container['html'] = $job->getTemplateValues()->getHtml();
77
78
        $this->container['jobId'] = $job->getId();
79
        $this->container['uriJob'] = $this->urlPlugin->fromRoute(
80
            'lang/jobs/view',
81
            [],
82
            [
83
                'query' => [ 'id' => $job->getId() ],
84
                'force_canonical' => true
85
            ]
86
        );
87
88
        return $this;
89
    }
90
}
91