Created
May 18, 2015 19:06
-
-
Save aurimasniekis/a5b6311ad8c643f9d75a 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 | |
use EPWT\DataMapper\DataMap; | |
use Symfony\Component\Validator\Constraints as Assert; | |
class dataMapBooksFullBookInfo extend DataMap | |
{ | |
/** | |
* @var stirng | |
*/ | |
protected $groupName = 'books'; | |
/** | |
* @var stirng | |
*/ | |
protected $mapname = 'full_book_info'; | |
/** | |
* @var stirng | |
*/ | |
protected $properties = [ | |
'title', | |
'author', | |
'release_data' | |
]; | |
/** | |
* @var stirng | |
*/ | |
protected $requiredProperties = [ | |
'title', | |
'author' | |
]; | |
public function getAssertCollection() | |
{ | |
return new Assert\Collection( | |
[ | |
'title' => new Assert\NotBlack(), | |
'author' => new Assert\NotBlack(), | |
'date' => new Assert\NotBlack(), | |
] | |
) | |
} | |
} | |
class dataMapperContainer extend DataMapperContainer | |
{ | |
protected $dataMaps = [ | |
'books.full_book_info' => 'dataMapBooksFullBookInfo' | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment