Skip to content

Instantly share code, notes, and snippets.

@aurimasniekis
Created May 18, 2015 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aurimasniekis/a5b6311ad8c643f9d75a to your computer and use it in GitHub Desktop.
Save aurimasniekis/a5b6311ad8c643f9d75a to your computer and use it in GitHub Desktop.
<?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