Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add salutation to Employee #171

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading