yii\mongodb\rbac\MongoDbManager::addItem PHP Method

addItem() protected method

protected addItem ( $item )
    protected function addItem($item)
    {
        $time = time();
        if ($item->createdAt === null) {
            $item->createdAt = $time;
        }
        if ($item->updatedAt === null) {
            $item->updatedAt = $time;
        }
        $this->db->getCollection($this->itemCollection)->insert(['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]);
        $this->invalidateCache();
        return true;
    }