Skip to content

Commit

Permalink
Merge pull request #171 from justimmo/task/employee-salutation
Browse files Browse the repository at this point in the history
Add salutation to Employee
  • Loading branch information
maxgrundnig authored Nov 19, 2024
2 parents e5cd03c + 8f2aee2 commit e61dda8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Justimmo/Model/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ class Employee
*/
protected $url = null;

/**
* @var null|string
*/
protected $salutation = null;

/**
* @param array $attachments
*
Expand Down Expand Up @@ -517,4 +522,20 @@ public function setUrl($url)
{
$this->url = $url;
}

/**
* @return null|string
*/
public function getSalutation()
{
return $this->salutation;
}

/**
* @param null|string $salutation
*/
public function setSalutation($salutation)
{
$this->salutation = $salutation;
}
}
3 changes: 3 additions & 0 deletions src/Justimmo/Model/Mapper/V1/EmployeeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ protected function getMapping()
'url' => array(
'property' => 'url',
),
'anrede' => array(
'property' => 'salutation',
),
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Justimmo/Model/Wrapper/V1/EmployeeWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class EmployeeWrapper extends AbstractWrapper
'plz',
'ort',
'url',
'anrede',
);

public function transformSingle($data)
Expand Down
1 change: 1 addition & 0 deletions tests/Fixtures/v1/employee_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<plz>1070</plz>
<ort>Wien</ort>
<url>https://www.justimmo.at</url>
<anrede>Herr</anrede>
<anhaenge>
<anhang location="REMOTE">
<anhangtitel>81.jpeg</anhangtitel>
Expand Down
1 change: 1 addition & 0 deletions tests/Justimmo/Tests/Wrapper/V1/EmployeeWrapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function testTransform()
$this->assertEquals('1070', $entry->getPostal());
$this->assertEquals('Wien', $entry->getCity());
$this->assertEquals('https://www.justimmo.at', $entry->getUrl());
$this->assertEquals('Herr', $entry->getSalutation());

$this->assertInstanceOf('\Justimmo\Model\Attachment', $entry->getProfilePicture());
$this->assertEquals('http://files.justimmo.at/public/pic/user_medium/ABVB1fBrug.png', $entry->getProfilePicture()->getUrl('medium'));
Expand Down

0 comments on commit e61dda8

Please sign in to comment.