infoweb\cms\behaviors\HomepageBehavior::checkValue PHP Method

checkValue() public method

public checkValue ( $event )
    public function checkValue($event)
    {
        $node = $this->owner;
        // If the item is set as the homepage and the maximum allowed amount is
        // 1, change the value of this attribute for all other items
        if ($this->maxItems == 1 && $node->show_on_homepage == 1) {
            $node::updateAll(['show_on_homepage' => 0]);
        }
    }
HomepageBehavior