So, I have a categories entity set up with a parent_id
being self-references. But for some reason when I save the entry in the form I get this error.
Fatal error: Cannot inherit previously-inherited or override constant MARKER from interface Doctrine\Common\Persistence\Proxy in /var/www/html/project/vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/Proxy.php on line 30
Can't figure out what it might be. I set the relationship up according to the Doctrine documentation.
/**
* Set parent
*
* @param string $parent
* @return Category
*/
public function setParent($parent)
{
$this->parent = $parent;
return $this;
}
/**
* Get parent
*
* @return string
*/
public function getParent()
{
return $this->parent;
}
Any help would be much appreciated.
Restarting the server solved the problem for me.
(Using PHP 5.4.15, APC 3.1.13, Apache2.4.4, Doctrine2.2)
I have also encountered this problem with php-fpm 5.4.19, nginx 1.4 and APC 3.1.15 (?) on Centos6-64. As Mark was also mentioning, the use of the Remi repository which I used as well. It seems like the 3.1.15 isn't officially released yet. There isn't even a tag for it on the pecl page! It looks like Remi was trying to fix something to get it work and named it 3.1.15, but can't figure out exactly what it was that he was trying to fix.
Anyway I yum removed the package and installed the current release with the pecl command (now @ 3.1.13), which resolved my problem.
Apparently it was a bug in
Doctrine-bundle
. Updating it to version 1.2.* (and subsequently updating dependent packages) fixed the issue.I encountered the exact same problem today after doing a change that should not affect Doctrine in any way (I altered a Twig template). After some time I realized that since it's a strange compile error on a strange moment, probably
restarting php-fpm
would do the trick. And it did.Maybe restarting Apache does the same if you're on
mod_php
.Please understand that APC is dead, unmaintained, no stable version exists for PHP 5.4 (or greater).
I recommend you to switch to: