-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix #44] Add support for last_ad_referral in UserResponse
- Loading branch information
Romain Monteil
committed
Apr 23, 2017
1 parent
4e5fa53
commit d9b0035
Showing
19 changed files
with
164 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
namespace Kerox\Messenger\Model; | ||
|
||
class Referral | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $source; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $type; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $adId; | ||
|
||
/** | ||
* @var null|string | ||
*/ | ||
protected $ref; | ||
|
||
/** | ||
* Referral constructor. | ||
* | ||
* @param string $source | ||
* @param string $type | ||
* @param string $adId | ||
*/ | ||
public function __construct(string $source, string $type, string $adId) | ||
{ | ||
$this->source = $source; | ||
$this->type = $type; | ||
$this->adId = $adId; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSource(): string | ||
{ | ||
return $this->source; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType(): string | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getAdId(): string | ||
{ | ||
return $this->adId; | ||
} | ||
|
||
/** | ||
* @return null|string | ||
*/ | ||
public function getRef() | ||
{ | ||
return $this->ref; | ||
} | ||
|
||
/** | ||
* @param string $ref | ||
* @return \Kerox\Messenger\Model\Referral | ||
*/ | ||
public function setRef(string $ref): Referral | ||
{ | ||
$this->ref = $ref; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param array $referral | ||
* @return \Kerox\Messenger\Model\Referral | ||
*/ | ||
public static function create(array $referral): Referral | ||
{ | ||
$self = new static($referral['source'], $referral['type'], $referral['ad_id']); | ||
if (isset($referral['ref'])) { | ||
$self->setRef($referral['ref']); | ||
} | ||
|
||
return $self; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters