I have the following code in an existing application:
if(!($article = $this->memcached->get('article_'.$articleId))) {
$article = $this->model->ArticleManager()->getStoryById($articleId);
$this->memcached->set('article_'.$articleId, $article);
}
No, when $article is retrieved from the ArticleManager it's of the correct type, it's a namespaced object \Site\Articles\Article() to be exact. However, when this value is stored in memcached and returned on the next page load the object is of type __PHP_Incomplete_Class. Which I know means it can't find the original class, but why...?
The file this call is in is under the namespace \Site\index\default_Read_Controller().
autoloaddefined which can find it. (The class definition is not stored with the object data, you need to have that loaded or autoloadable on retrieval).