Skip to content

Instantly share code, notes, and snippets.

@njh
Created April 14, 2011 10:31
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 njh/919232 to your computer and use it in GitHub Desktop.
Save njh/919232 to your computer and use it in GitHub Desktop.
<?php
public function getFeedMapping()
{
$type = Zend_Uri::factory('http://purl.org/ontology/po/Programme');
$image_uri = Zend_Uri::factory($this->image->getUrl(512, 288));
if ($this->display_buzz) {
$hash_tags = $this->hash_tags;
$articles = $this->articles;
$discussions = $this->discussions;
} else {
$hash_tags = null;
$articles = null;
$discussions = null;
}
if (!empty($this->products)) {
$products = array_slice($this->products, 0, 2);
} else {
$products = array();
}
return array(
'urimap' => array(
'this' => '/programmes/' . $this->pid . '#programme',
'brand' => 'http://purl.org/ontology/po/Brand',
'series' => 'http://purl.org/ontology/po/Series',
'episode' => 'http://purl.org/ontology/po/Episode',
'clip' => 'http://purl.org/ontology/po/Clip',
),
'entity' => 'programme',
'@rdf:type' => array($type, $this->type),
'po:pid' => $this->pid,
'po:position' => $this->position,
'dc:title' => $this->title,
'po:short_synopsis' => $this->short_synopsis,
'po:medium_synopsis' => $this->medium_synopsis,
'po:long_synopsis' => $this->long_synopsis,
'po:duration' => $this->play_version_duration,
'po:display_titles' => $this->display_titles,
'foaf:depiction' => $image_uri,
'po:ownership!' => $this->service,
'po:expected_child_count' => $this->expected_child_count,
'[po:genre/genres]' => $this->genres,
'[po:format/formats]' => $this->formats,
'[po:version/versions]'=> $this->versions,
'po:parent' => $this->parent,
'po:available_until' => $this->available_until,
'[po:hash_tag/hash_tags]' => $hash_tags,
'[foaf:page/articles]' => $articles,
'[foaf:page/discussions]' => $discussions,
// Disabling products for now - need to make better
// use of good relations
// '[po:product/products]' => $products,
'[po:credit/credits]' => $this->contributors,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment