Craft\NeoService::saveGroup PHP Method

saveGroup() public method

Saves a group to the database.
public saveGroup ( Neo_GroupModel $group ) : boolean
$group Neo_GroupModel
return boolean
    public function saveGroup(Neo_GroupModel $group)
    {
        $transaction = $this->beginTransaction();
        try {
            $groupRecord = new Neo_GroupRecord();
            $groupRecord->fieldId = $group->fieldId;
            $groupRecord->name = $group->name;
            $groupRecord->sortOrder = $group->sortOrder;
            $groupRecord->save(false);
            $group->id = $groupRecord->id;
            $this->commitTransaction($transaction);
        } catch (\Exception $e) {
            $this->rollbackTransaction($transaction);
            throw $e;
        }
        return true;
    }