2016-08-11 5 views
-1

でなければなりません。私はそれを以下の行う上でエンティティークラス引数1は、型の配列、オブジェクトを指定し、

<?php 
namespace EvolisClientRequest\Model\Entities; 

use Doctrine\ORM\Mapping as ORM; 

/** 
* @ORM\Entity 
*/ 
class Email 
{ 
    /** 
    * @var \Ramsey\Uuid\Uuid 
    * @ORM\Id 
    * @ORM\Column(type="uuid") 
    * @ORM\GeneratedValue(strategy="CUSTOM") 
    * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") 
    */ 
    protected $id; 

    /** 
    * @ORM\Column(type="string") 
    * @var string 
    */ 
    private $sender; 

    /** 
    * @ORM\Column(type="string") 
    * @var string 
    */ 
    private $subject; 

    /** 
    * @ORM\Column(type="string") 
    * @var string 
    */ 
    private $body; 

    /** 
    * @ORM\ManyToMany(targetEntity="Request", mappedBy="Email") 
    * @var Request 
    */ 

    private $request; 

    public function __construct(string $sender, string $subject, string $body,Request $request) 
    { 
     $this->sender = $expeditor; 
     $this->subject = $subject; 
     $this->body = $body; 
     $this->request = $request; 
    } 

} 

を次したエラーを与える:

エラーを与えた上で
$email = $this->email_dao->create ('[email protected]','fkj','sdfkdjhbf', new \Doctrine\Common\Collections\ArrayCollection($request_dao)); 

行は次のようになります。

$email = $this->email_dao->create ('[email protected]','fkj','sdfkdjhbf', new \Doctrine\Common\Collections\ArrayCollection($request_dao)); 

答えて

0

変数$request_daoがあると思われますオブジェクト。

ArrayCollectionは、コンストラクタ引数としてarrayのみを受け入れます。

関連する問題