Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archiviable don't uses all the required namespaces #293

Closed
alphalemon opened this issue Feb 14, 2012 · 1 comment
Closed

Archiviable don't uses all the required namespaces #293

alphalemon opened this issue Feb 14, 2012 · 1 comment

Comments

@alphalemon
Copy link

Hello,
I'm trying to use the archivable behavior for my schema, so I've updated it, rebuild the model and inserted the sql. To try it I used the following code:

   $content = AlContentQuery::create()->findPk(28);
   $newContent = new AlContent();
   $values = $content->toArray();
   unset($values['Id']);
   unset($values['CreatedAt']);
   $values['HtmlContent'] = "fake";
   $newContent->fromArray($values);
   $newContent->save();
   $newContent->delete();

So I created a new content from an existing one and saved it but I've got the following error:

PHP Fatal error: Class
'AlphaLemon\AlphaLemonCmsBundle\Model\om\AlContentArchiveQuery' not found
in
/home/laptop/www/alphaLemon/vendor/bundles/AlphaLemon/AlphaLemonCmsBundle/Model/om/BaseAlContent.php
on line 1678

Digging the om created classes, I noticed that this code:

public function getArchive(PropelPDO $con = null)
{
if ($this->isNew()) {
return null;
}
$archive = AlContentArchiveQuery::create()
->filterByPrimaryKey($this->getPrimaryKey())
->findOne($con);

           return $archive;
   }

refers to the AlContentArchiveQuery object but there is any

use AlphaLemon\AlphaLemonCmsBundle\Model\AlContentArchiveQuery;

directive (the class is under om). The AlContentArchive is required in another method but is never declared.

use AlphaLemon\AlphaLemonCmsBundle\Model\AlContentArchive;

@fzaninotto
Copy link
Member

Duplicate of #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants