How can I set the default value in field.
In my document I need to set default value false for field emailnotify In mogodb th default value should be zero.
Check my document
namespace xxx\xxxBundle\Document;
use FOS\UserBundle\Document\User as BaseUser;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
/**
* @MongoDB\Document
*/
class User extends BaseUser
{
/**
* @MongoDB\Id(strategy="auto")
*/
protected $id;
/**
* @MongoDB\Boolean
*/
protected $emailnotify;
/**
* Sets the emailnotify.
*
* @param boolean $emailnotify
*
* @return User
*/
public function setEmailnotify($emailnotify)
{
$this->emailnotify = (Boolean) $emailnotify;
return $this;
}
/**
* @return boolean
*/
public function isEmailnotify()
{
return $this->emailnotify;
}
}