1
votes

I have class country and this in my constructor

public function __construct()
    {
        $this->createdAt = new \DateTime();
        $this->setUpdatedAt(new \DateTime());
        $this->isActive = true;
        $this->isDeleted = false;

        $this->setLastUpdatedBy(99);
        $this->setCreatedBy(99);

    }

But when i fill the form then i get this error

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'createdAt' cannot be null

IS there anything lese i need to do to make that field default date time

1

1 Answers

0
votes

Make sure that you're using php 5.3+