Created
July 3, 2012 13:54
-
-
Save msanroman/3039821 to your computer and use it in GitHub Desktop.
spike
This file contains hidden or 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
public function findMetasFor($photo = null) { | |
$locale = $this->localization->getCurrentLocale(); | |
if ($photo == null) { | |
if($this->category == null) | |
return $this->metainformation['all_'.$locale]; | |
else { | |
return $this->metainformation[$this->category]; | |
} | |
} else { | |
$metas = $this->metainformation['shots_'.$locale]; | |
$album = $this->galleries->findGalleryAlbumByCategoryAndAlbumPermalink($this->category, $this->permalink); | |
$cloned_metas = array(); | |
foreach ($metas as $key => $meta) { | |
$cloned = clone($meta); | |
if($key == 'og:image') | |
$cloned->setEntity($photo); | |
else $cloned->setEntity($album); | |
$cloned_metas[] = $cloned; | |
} | |
return $cloned_metas; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment