public function sql()
    {
        if ($this->active()) {
            switch ($this->mode()) {
                case self::MODE_RANDOM:
                    return $this->byRandom();

                case self::MODE_CUSTOM:
                    return $this->byCondition();

                case self::MODE_VALUES:
                    return $this->byValues();
            }

            if ($this->hasCondition()) {
                return $this->byCondition();
            }

            if ($this->hasValues()) {
                return $this->byValues();
            }

            if ($this->hasProperty()) {
                return $this->byProperty();
            }
        }

        return '';
    }