Created
February 19, 2019 11:42
-
-
Save BerezhniyDmitro/97027d4512974803fcc8872d3176ff36 to your computer and use it in GitHub Desktop.
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
<?php | |
namespace App\Models\ServiceOffer\DTO; | |
/** | |
* Class ServiceOfferDTO обьект DTO | |
*/ | |
class ServiceOfferDTO implements IServiceOfferDTO | |
{ | |
/** | |
* @var string | |
*/ | |
private $url; | |
/** | |
* @var string | |
*/ | |
private $title; | |
/** | |
* @var string | |
*/ | |
private $text; | |
/** | |
* ServiceOfferDTO constructor. | |
* | |
* @param array $data | |
*/ | |
private function __construct(array $data) | |
{ | |
$this->url = $data['url']; | |
$this->title = $data['url']; | |
$this->text = $data['url']; | |
} | |
/** | |
* Создаем ДТО с массива данных | |
* | |
* @param array $data | |
* @return ServiceOfferDTO | |
*/ | |
public static function createFromPostData(array $data) | |
{ | |
return new self($data); | |
} | |
/** | |
* @return string | |
*/ | |
public function getText() | |
{ | |
return $this->text; | |
} | |
/** | |
* @return string | |
*/ | |
public function getUrl() | |
{ | |
return $this->url; | |
} | |
/** | |
* @return string | |
*/ | |
public function getTitle() | |
{ | |
return $this->title; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment