خرید بک لینک

Vote count: 0

I have Some field in my documents type of "Collection". So when I am trying to save document I am getting following error.
Collection type requires value of type array or null, DoctrineCommon CollectionsArrayCollection given. even All the field which are collection types are defined as : $byLedgersArrays = array(0=>112,1=>566);
$document->addToLedgers($byLedgersArrays);

//My Document is this:
/**
 * @var array $byLedgers
 *
 * @ODMField(name="byLedgers", type="collection")
 */
protected $byLedgers;
public function __construct()
{
    $this->setIsDeleted(false);       
    $this->byLedgers = new ArrayCollection();
}
//Controller:
$document = new Voucher();
$document->addByLedgers($byLedgersArrays);

Please help what is missing in this.

asked 21 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 13 مرداد 1395 ساعت: 12:11

صفحه بندی