/** * Get method to return the value of feed[$name]. * * @param string $name * @return mixed */ public function __get($name) { $value = null; $alias = null; $aliases = array('entry', 'entries', 'images', 'posts', 'statuses', 'tweets', 'updates', 'videos'); if (in_array($name, $aliases)) { $alias = 'items'; } $feed = $this->adapter->getFeed(); // If the called property exists in the $feed array if (isset($feed[$name])) { $value = $feed[$name]; // Else, if the alias to the called property exists in the $feed array } else { if (null !== $alias && isset($feed[$alias])) { $value = $feed[$alias]; } } return $value; }