E
E
EVOSandru62015-01-21 10:28:02
Yii
EVOSandru6, 2015-01-21 10:28:02

Why are boolean values ​​not stored in Yii NestedSet?

Good afternoon,
Can the behavior of NestedSet change the algorithm for saving to a table so that it does not accept boolean values ​​(1.0 logical, as well as one)?
Before I connected NestedSet , everything was saved for me without problems, the key point in actionCreate / actionUpdate :

$model->attributes = $_POST['Product'];
$model->save;

Now, in order for boolean data to be accepted, I need to use this notation:
$model->attributes = $_POST['Product'];

            $model->CODE_PAR = (int)$code_par;
            $model->CAT = (int)$_POST['Product']['CAT'];
            $model->SALE = (int)$_POST['Product']['SALE'];
            $model->EXIST = (int)$_POST['Product']['EXIST'];
            $model->TEMPLATE = (int)$_POST['Product']['TEMPLATE'];

Which is not very convenient, but otherwise the values ​​​​are not saved. How to be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question