1 | <?php |
||
23 | class EntityToDocumentMapper implements EntityToDocumentMapperInterface { |
||
24 | |||
25 | /** |
||
26 | * |
||
27 | * @var SearchService |
||
28 | */ |
||
29 | protected $searchService; |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * @var string[string] |
||
34 | */ |
||
35 | protected $mapping = array(); |
||
36 | |||
37 | /** |
||
38 | * |
||
39 | * @var string[string] |
||
40 | */ |
||
41 | protected $cachedMapping = array(); |
||
42 | |||
43 | /** |
||
44 | * Constructor |
||
45 | * |
||
46 | * @param SearchService $searchService |
||
47 | */ |
||
48 | public function __construct(SearchService $searchService, array $mapping = array()) { |
||
68 | |||
69 | /** |
||
70 | * |
||
71 | * {@inheritDoc} |
||
72 | * |
||
73 | * @see \StingerSoft\EntitySearchBundle\Services\Mapping\EntityToDocumentMapperInterface::isIndexable() |
||
74 | */ |
||
75 | public function isIndexable($object) { |
||
84 | |||
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | * @see \StingerSoft\EntitySearchBundle\Services\Mapping\EntityToDocumentMapperInterface::createDocument() |
||
89 | */ |
||
90 | public function createDocument(ObjectManager $manager, $object) { |
||
100 | |||
101 | /** |
||
102 | * Fills the given document based on the object |
||
103 | * |
||
104 | * @param Document $document |
||
105 | * @param object $object |
||
106 | * @return boolean |
||
107 | */ |
||
108 | protected function fillDocument(Document &$document, $object) { |
||
119 | |||
120 | /** |
||
121 | * Fetches the mapping for the given object including the mapping of superclasses |
||
122 | * |
||
123 | * @param object $object |
||
124 | * @return \StingerSoft\EntitySearchBundle\Services\string[string] |
||
125 | */ |
||
126 | protected function getMapping($object) { |
||
145 | |||
146 | /** |
||
147 | * Returns the search service |
||
148 | * |
||
149 | * @return SearchService |
||
150 | */ |
||
151 | protected function getSearchService(ObjectManager $manager) { |
||
155 | } |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.