Change isNewRecord flag on successful adding of record to arangodb
This commit is contained in:
@@ -44,7 +44,11 @@ class ArangoModel extends \yii\base\model {
|
|||||||
// добавляем запись
|
// добавляем запись
|
||||||
$this->_doc = Document::createFromArray($this->getAttributes());
|
$this->_doc = Document::createFromArray($this->getAttributes());
|
||||||
|
|
||||||
return intval(Yii::$app->arango->documentHandler()->add(static::class_to_collection(get_called_class()), $this->_doc)) > 0;
|
$result = intval(Yii::$app->arango->documentHandler()->add(static::class_to_collection(get_called_class()), $this->_doc)) > 0;
|
||||||
|
if ($result) {
|
||||||
|
$this->_isNewRecord = false;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
} else {
|
} else {
|
||||||
// патчим!
|
// патчим!
|
||||||
$doc_attributes = array_keys($this->_doc->getAll());
|
$doc_attributes = array_keys($this->_doc->getAll());
|
||||||
|
Reference in New Issue
Block a user