向模型添加新定义

时间:2015-05-19 16:14:06

标签: pimcore

我正在尝试将一些字段(例如照片)添加到现有的Object_Client类中。

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

public function setPhoto ($photo) {
    $this->photo = $photo;
    return $this;
}

我发现班级没有保存,我认识到这个

当我var_dump它

  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)
          ...

我是否需要以某种方式提供照片,或为其创建定义?

0 个答案:

没有答案