は、私は次のエラーを提示されています:不明な列タイプ「varchar型」
[2016-09-14 21:24:44] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\DBALException: "Unknown column type "varchar" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypeMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information." at /var/www/project/apps/ProjectName/trunk/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php line 114 {"exception":"[object] (Doctrine\\DBAL\\DBALException(code: 0): Unknown column type \"varchar\" requested. Any Doctrine type that you use has to be registered with \\Doctrine\\DBAL\\Types\\Type::addType(). You can get a list of all the known types with \\Doctrine\\DBAL\\Types\\Type::getTypeMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information. at /var/www/project/apps/ProjectName/trunk/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:114)"} []
関連するクラスが上記のクラスおよびアノテーション定義されたマッピングでは、このような
<?php
namespace Project\DBALBundle\Entity\Url;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as JMSS;
/**
* Profile
*
* @ORM\Table(name="Profile")
* @ORM\Entity(repositoryClass="Project\DBALBundle\Entity\Url\ProfileRepository")
*/
class ProfileRepository {
/**
* @var string $id
*
* @ORM\Column(name="id", type="integer", length=11, nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string $label
*
* @ORM\Column(name="label", type="string", length=50, nullable=false)
*/
private $label;
/**
* @return string
*/
public function getId()
{
return $this->id;
}
/**
* @param string $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* @param string $label
*/
public function setLabel($label)
{
$this->label = $label;
}
public function __toString()
{
return $this->label;
}
}
ように見えますが、私はエラーを受け取ります。ただし、フィールドprivate $label
をprivate $labelField
に変更して関連する参照を更新すると、すべて正常に動作し、データは期待どおりにアクセスされます。
私が検索することができる限り、フィールドprivate $label
には特別なものはありません。これは予約されたキーワードではなく、PHP自体やDoctrineを使って特別なことについて何も言及していません。それでなぜこれが壊れてしまうのですか?
Symfonyがキャッシュしていることを認識していない、または少なくともそれ以外の変更が多数あっても、そのファイルが完全にキャッシュ内で更新されていることを前提としていました。また、はい、それは近い将来に置き換えられる予定のレガシーな内部ツールなので、2.3に固執しています。 –