<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * @property int $id
 * @property string $name
 * @property int $position
 * @property boolean $is_user_defined
 * @property AttributeGroupMapping[] $attributeGroupMappings
 */
class AttributeGroup extends Model
{
    /**
     * @var array
     */
    protected $fillable = ['name', 'position', 'is_user_defined'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function attributeGroupMappings()
    {
        return $this->hasMany('App\AttributeGroupMapping')->orderBy('position','asc');
    }
}
