src/models/StaticValue.php
public function beforeSave($insert)
    {
        if (!$this->sort_order) {
            $property = Property::findById($this->property_id);
            $this->sort_order = count(static::valuesForProperty($property));
        }
        return parent::beforeSave($insert);
    }
public function beforeSave($insert)
    {
        if (!$this->sort_order) {
            $property = Property::findById($this->property_id);
            $this->sort_order = count(static::valuesForProperty($property));
        }
        return parent::beforeSave($insert);
    }
public function beforeSave ( $ insert ) { if ( ! $ this -> sort_order ) { $ property = Property :: findById ( $ this -> property_id ) ; $ this -> sort_order = count ( static :: valuesForProperty ( $ property ) ) ; } return parent :: beforeSave ( $ insert ) ; }
Performs beforeSave event

@param bool $insert

@return bool
Performs beforeSave event