Academia
Academia

Reputation: 4124

Is it possible to know the action in the class form (Symfony)?

Is it possible to know the action performed by the user (New, Update) at the form class level (Form.class.php)? Thanks in advance.

Upvotes: 1

Views: 48

Answers (1)

ilanco
ilanco

Reputation: 9957

You can check if the underlying object is new or exists in the database:

$this->getObject()->isNew()

Upvotes: 2

Related Questions