0 votes

I have the feeling doctrine needs a fqcn as value, while 'point' is more, uh, to the point in the context of the popup.

When I use the FQCN as value Doctrine is able to generate entities with correct type hinting.

in Solved by (220 points)
recategorized by

1 Answer

0 votes

Can you please describe more in details what exactly is wrong, or what you need to help?

Unfortunately I don't understand your question what exactly you need or what isn't working for you.

The best would be if you can post working schema example and schema exported from Skipper.

by Skipper developer (141k points)

I've registered a custom doctrine type (point) which I can select in the skipper field interface with the the following.

<data-types>
  <data-type name="point"/>
</data-types>

This will generate xml such as

<field name="geoPoint" type="point" nullable="true" column="geo_point"/>

Whenever I run

vendor/bin/doctrine orm:generate:entities .

Entities are create with these methods/property/signature;

/**
 * @var point
 */
private $geoPoint;

/**
 * Set geoPoint
 *
 * @param point $geoPoint
 *
 * @return Address
 */
public function setGeoPoint($geoPoint)
{
    $this->geoPoint = $geoPoint;

    return $this;
}

/**
 * Get geoPoint
 *
 * @return point
 */
public function getGeoPoint()
{
    return $this->geoPoint;
}

I've been fiddling with the doctrine settings (doctrinetypemappings and types) but I can't get it to generate correct type hinting. Therefore I experimented with placing the fun class name in the type=attribute as that seems to end up as is in the entities. However in the Skipper interface 'point' is simpler then a FQCN in the type popup. So I was hoping that xml tag would have support for an label attribute. (Something Skipper uses in the interface, but uses the name attribute as value in the generated arm xml.

But,... This might just as wel be a bug/issue with the doctrine entity generator as that seems to work weirdly. Anyway I now use zend-code to rewrite the entities after they have been generated.

Sorry for the rant... :-)

So if I understand correctly, you're looking for a way how to define something like this:

 <data-type name="Full::Namespace::Type::Point" label ="Point"/>

right?

It shouldn't be hard to implement it but before that it would be great to know if it is really necessary or not ;-).

What is the FQCN you're referring? And when Skipper will export it, how will change the Doctrine2 export?

Closed because of lack of information