Skip to content

Instantly share code, notes, and snippets.

@msanroman
Created July 3, 2012 13:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msanroman/3039821 to your computer and use it in GitHub Desktop.
Save msanroman/3039821 to your computer and use it in GitHub Desktop.
spike
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