protected function addItem($item) { $time = time(); if ($item->createdAt === null) { $item->createdAt = $time; } if ($item->updatedAt === null) { $item->updatedAt = $time; } $this->db->createCommand() ->insert($this->itemTable, [ //auth_item 'name' => $item->name, 'type' => $item->type, 'description' => $item->description, 'rule_name' => $item->ruleName, 'data' => $item->data === null ? null : serialize($item->data), 'created_at' => $item->createdAt, 'updated_at' => $item->updatedAt, ])->execute(); $this->invalidateCache(); return true; }