Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
enyeli committed Nov 21, 2016
1 parent 465b566 commit e44b544
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Model/Behavior/MetataggableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ public function findMetatagged(Query $query, array $options)
;
}

public function mapResults(CollectionInterface $results) {
public function mapResults(CollectionInterface $results)
{
$this->metatags = $results->first()->metataggeds;
return $results->map(function($entity) {
return $this->mapEntity($entity);
});
}

public function mapEntity(Entity $entity) {
public function mapEntity(Entity $entity)
{
foreach ($this->metatags as $metatags) {
if ($metatags->metatag['name'] == 'title') {
$entity['_title'] = $metatags->value;
Expand Down

0 comments on commit e44b544

Please sign in to comment.