Custom attribute problems

Permalink
I'm creating an custom attribute "AddressExtended" attribute. I'm having problems with the AddressExtendedValue entity.

When I have this
use Doctrine\ORM\Mapping as ORM;
use Concrete\Core\Entity\Attribute\Value\Value\AbstractValue;
/**
 * @ORM\Entity
 * @ORM\Table(name="atAddressExtended")
 */
class AddressExtendedValue extends AbstractValue {


It tells me:
Class "Concrete\Package\SnefitInvoicing\Src\Entity\Attribute\Value\Value\AddressExtendedValue" sub class of "Concrete\Core\Entity\Attribute\Value\Value\AbstractValue" is not a valid entity or mapped super class.

When I use:
//use Doctrine\ORM\Mapping as ORM;
use Concrete\Core\Entity\Attribute\Value\Value\AbstractValue;
/**
 * @Entity
 * @Table(name="atAddressExtended")
 */
class AddressExtendedValue extends AbstractValue {


It tells me that the entity need an ID (but that is in the mapped AbstractValue.

When I look at this, it seems to go wrong with the @ORM part. But that is widely used in the core. I use other entities that do not have the @ORM part an they are working fine.

Almost have the custom attribute (type) working, but I can't seems to get this going.

SnefIT

SnefIT
View Replies:
SnefIT replied on at Permalink Reply
SnefIT
Anybody?
SnefIT replied on at Permalink Reply
SnefIT
Found it!

With C5.8 there is a new way for entities (with the @ORM\... stuff). Stupidly I had my package minimal version set to "5.8", so I got the legacy autoloaders.

When I changed the version to 8, it al worked well!

Please see documentation (search for entities) for this change. It can be important for autoloading, not just the attributes!