Scalr\Model\Entity\Farm::lock PHP Method

lock() public method

Locks this farm
public lock ( User $user, string $comment, boolean $restrict = false ) : Farm
$user Scalr\Model\Entity\Account\User The User on whose behalf the lock set
$comment string Comment describing the reason and/or purpose of the lock
$restrict boolean optional Strict lock flag (I have no idea what that means [author's note])
return Farm
    public function lock(User $user, $comment, $restrict = false)
    {
        $this->_settings->saveSettings([FarmSetting::LOCK => 1, FarmSetting::LOCK_BY => $user->id, FarmSetting::LOCK_COMMENT => $comment, FarmSetting::LOCK_UNLOCK_BY => '', FarmSetting::LOCK_RESTRICT => $restrict]);
        return $this;
    }