Answer the question
In order to leave comments, you need to log in
Can you please tell me how to delete a model instance in Yii 2 after performing all operations with it?
Let's say I declare a model instance:
And I get some data from the user that I need to save:$customer = new Customer();
$customer->last_name = $post['last_name'];
$customer->fist_name = $post['first_name'];
$customer->patronymic = $post['patronymic'];
$customer->birth_date = $post['birth_date'];
if (!$customer->save()) {
echo "Ошибка добавления клиента ";
} else {
echo "Клиент успешно добавлен";
}
unset($customer); //не помогает
ini_set('memory_limit', '3076M')
Answer the question
In order to leave comments, you need to log in
If 3GB is not enough, then it's definitely not the model, apparently the cycle is endless somewhere.
In general, you can always overwrite a variable:
Why did you even decide that it was in it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question