Pimcore 向模型中添加新定义

Pimcore 向模型中添加新定义,pimcore,Pimcore,我正在尝试添加一些字段,例如;现有对象的照片\u客户端类 当我编写一个保存照片的方法时: public function setPhoto ($photo) { $this->photo = $photo; return $this; } 我发现类没有保存它,我认识到这一点 当我把它扔掉的时候 public 'fieldDefinitions' => array (size=11) 'email' => object(Object_Clas

我正在尝试添加一些字段,例如;现有对象的照片\u客户端类

当我编写一个保存照片的方法时:

public function setPhoto ($photo) {
    $this->photo = $photo;
    return $this;
}
我发现类没有保存它,我认识到这一点

当我把它扔掉的时候

  public 'fieldDefinitions' => 
array (size=11)
  'email' => 
    object(Object_Class_Data_UniqueInput)[126]
      public 'fieldtype' => string 'uniqueInput' (length=11)
      public 'regex' => string '^([a-zA-Z0-9_-])+([.]?[a-zA-Z0-9_-]{1,})*@([a-zA-Z0-9-_.]{1,}[.])+[a-zA-Z]{2,4}$' (length=80)
      public 'width' => string '' (length=0)
      public 'queryColumnType' => string 'varchar' (length=7)
      public 'columnType' => string 'varchar' (length=7)
      public 'columnLength' => int 255
      public 'phpdocType' => string 'string' (length=6)
      public 'name' => string 'email' (length=5)
      public 'title' => string 'E-mail' (length=6)
      public 'tooltip' => string '' (length=0)
      public 'mandatory' => boolean true
      public 'noteditable' => boolean false
      public 'index' => boolean false
      public 'locked' => boolean false
      public 'style' => string '' (length=0)
      public 'permissions' => null
      public 'datatype' => string 'data' (length=4)
      public 'relationType' => boolean false
      public 'invisible' => boolean false
      public 'visibleGridView' => boolean false
      public 'visibleSearch' => boolean false
  'password' => 
    object(Object_Class_Data_Password)[127]
      public 'fieldtype' => string 'password' (length=8)
      public 'width' => string '' (length=0)
      public 'queryColumnType' => string 'varchar(32)' (length=11)
      public 'columnType' => string 'varchar(32)' (length=11)
      public 'phpdocType' => string 'string' (length=6)
      public 'name' => string 'password' (length=8)
      public 'title' => string 'Mot de passe' (length=12)
      public 'tooltip' => string '' (length=0)
      public 'mandatory' => boolean false
      public 'noteditable' => boolean false
      public 'index' => boolean false
      public 'locked' => boolean false
      public 'style' => string '' (length=0)
      public 'permissions' => null
      public 'datatype' => string 'data' (length=4)
      public 'relationType' => boolean false
      public 'invisible' => boolean false
      public 'visibleGridView' => boolean false
      public 'visibleSearch' => boolean false
  'civilite' => 
    object(Object_Class_Data_Select)[129]
      public 'fieldtype' => string 'select' (length=6)
      public 'options' => 
        array (size=3)
          ...

我是否需要以某种方式使照片可用,或为其创建一个定义???

我想问的问题是:如何为已创建的对象定义字段??只是为了澄清您的问题-目标是在不使用GUI的情况下更改对象的结构,GUI完成所有神奇的代码生成;对的我很好奇-你的用例是什么?