Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何向doctrine 1.2模式文件中的列添加自定义属性_Php_Symfony 1.4_Doctrine 1.2_Schema.yml - Fatal编程技术网

Php 如何向doctrine 1.2模式文件中的列添加自定义属性

Php 如何向doctrine 1.2模式文件中的列添加自定义属性,php,symfony-1.4,doctrine-1.2,schema.yml,Php,Symfony 1.4,Doctrine 1.2,Schema.yml,我正在做一个symfony1.4项目,它使用了1.2条原则。我想为schema.yml中的字段添加一些自定义属性。其目的是在条令之外的其他地方重用schema.yml,以维护有关实体的一些元数据。我试图添加一个customproperty,如下面的示例所示 TestEntity: tableName: test_table columns: id: type: integer(4) primary: true autoincrement: tr

我正在做一个symfony1.4项目,它使用了1.2条原则。我想为schema.yml中的字段添加一些自定义属性。其目的是在条令之外的其他地方重用schema.yml,以维护有关实体的一些元数据。我试图添加一个customproperty,如下面的示例所示

TestEntity:
  tableName: test_table
  columns:
    id:
      type: integer(4)
      primary: true
      autoincrement: true
    name:
      type: string(200)
      customproperty: true
但当我尝试构建模型时,现在它失败了,错误如下

"Invalid schema element named "customproperty" at path "TestEntity->columns->name""
我检查了下面位置的schema.php文件以调试错误

symfony/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Schema.php
出现此错误是因为我们指定的自定义属性不在“$\u validation”数组中。一旦我将“customproperty”添加到该数组中,它就停止给出错误

symfony/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Import/Schema.php
但我所做的是对doctrine library的黑客攻击,有没有其他更好的方法来实现这一点而不涉及库文件