Skip this migration (but not the next ones) if condition evalutes to TRUE.

@param bool   $condition
@param string $message

@throws AntiMattr\MongoDB\Migrations\Exception\SkipException
344185
public function skipIf($condition, $message = '')
    {
        $message = (strlen($message)) ? $message : 'Unknown Reason';

        if (true === $condition) {
            throw new SkipException($message);
        }
    }
324036
public function delete($condition, $check = true)
    {
        $result = null;
        $this->hook->attach('file.delete.before', $condition, $check, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if (!is_array($condition)) {
            $condition = array('file_id' => $condition);
        }

        if ($check && isset($condition['file_id']) && !$this->canDelete($condition['file_id'])) {
            return false;
        }

        $result = (bool) $this->db->delete('file', $condition);

        if ($result && isset($condition['file_id'])) {
            $this->deleteLinked($condition['file_id']);
        }

        $this->hook->attach('file.delete.after', $condition, $check, $result, $this);
        return (bool) $result;
    }
793012
protected function _buildCondition($property, $condition, $value) {
		switch ($condition) {
			// var = ?
			case self::COND_EQUAL:
				return [$property => $value];
			
			// var in(?)
			case self::COND_IN:
				return [$property => [
					self::MONGO_IN => (array) $value
				]];
			
			// var not in(?)
			case self::COND_NOT_IN:
				return [$property => [
					self::MONGO_NOT_IN => (array) $value
				]];
			
			// var < ?
			case self::COND_LESS:
				return [$property => [
					self::MONGO_LESS => $value
				]];
			
			// var > ?
			case self::COND_MORE:
				return [$property => [
					self::MONGO_MORE => $value
				]];
			
			// var <= ?
			case self::COND_LESS_EQUAL:
				return array($property => array(
					self::MONGO_LESS_EQUAL => $value
				));
			
			// var >= ?
			case self::COND_MORE_EQUAL:
				return [$property => [
					self::MONGO_MORE_EQUAL => $value
				]];
			
			// var != ?
			case self::COND_NOT_EQUAL:
			case self::COND_NOT_EQUAL_ALT:
				return [$property => [
					self::MONGO_NOT_EQUAL => $value
				]];
			
			// var in array(?)
			case self::COND_IN_ARRAY:
				return [$property => [
					self::MONGO_IN_ARRAY => (array) $value
				]];
			
			// var exists(?)
			case self::COND_EXISTS:
				return [$property => [
					self::MONGO_EXISTS => $value
				]];
			
			// var type(?)
			case self::COND_TYPE:
				return [$property => [
					self::MONGO_TYPE => $value
				]];
				
			// var is array()
			case self::COND_IS_ARRAY:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_ARRAY
				]];
			
			// var is int()
			case self::COND_IS_INT:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_INT32
				]];
			
			// var is string()
			case self::COND_IS_STRING:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_STRING
				]];
			
			// var is bool()
			case self::COND_IS_BOOL:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_BOOLEAN
				]];
			
			// var is null()
			case self::COND_IS_NULL:
				return [$property => [
					self::MONGO_TYPE => self::MONGO_TYPE_NULL
				]];
			
			// var regexp(?)
			case self::COND_REGEXP:
				return [$property => new MongoRegex($value)];
			
			// var like ?
			case self::COND_LIKE:
				$regex = preg_quote(trim($value, '%'));
				
				if ($value[0] !== '%') {
					$regex = '^' . $regex;
				}
				
				if ($value[strlen($value) - 1] !== '%') {
					$regex .= '$';
				}
				
				return [$property => new MongoRegex('/' . $regex . '/')];
				
			// var array size ?
			case self::COND_ARRAY_COUNT:
			case self::COND_ARRAY_COUNT_ALT:
				return [$property => [
					self::MONGO_SIZE => $value
				]];
			
			default:
				throw new Exception('Uncnown condition: "' . $condition . '"');
		}
	}
1117837
public static function addMessageIfNotEmpty($message,$condition,$label='INFO'){
		if ( empty($condition)===false ) {
			self::debugbar()->addMessage($message,$label);
		}
	}
483600
public function reject( $condition ) {
		return $this->filter( function ( $v, $k ) use ( $condition ) {
			return ! call_user_func( $condition, $v, $k );
		} );
	}
559373
public function push($handler, $condition = '*')
    {
        list($handler, $condition) = $this->resolveHandlerAndCondition($handler, $condition);

        if (!isset($this->handlers[$condition])) {
            $this->handlers[$condition] = [];
        }

        array_push($this->handlers[$condition], $handler);

        return $this->newClause($handler);
    }
254828
public static function addMessageIfFalse($message,$condition,$label='INFO'){
		if ( $condition===false ) {
			self::debugbar()->addMessage($message,$label);
		}
	}
1022478
public function deleteBy($condition = null)
	{
		if( !is_null($condition) )
		{
			$this->filterBy($condition);
		}
		$matched = $this->load();
		array_each(
			$matched,
			function($model)
			{ /** @var Lib_Model_Db $model */
				$model->delete();
			}
		);
		return !empty($matched);
	}
547372
public function assertIsArrayAndNotEmpty($value, $message='%s must not be an empty Array', $exception='Asserts')
    {
        if (isset($value) === false || is_array($value) === false || (is_array($value) && count($value) <= 0)) {
            $this->throwException($exception, $message, $value);
        }
    }
590525
public function addCondition( $condition )
	{
		if( is_array( $condition ) )
			return $this->addConditions( $condition );
		if( in_array( $condition, $this->conditions ) )
			return FALSE;
		$this->conditions[] = $condition;
		return TRUE;
	}
30265
public static function addMessageIfTrue($message,$condition,$label='INFO'){
		if ( $condition===true ) {
			self::debugbar()->addMessage($message,$label);
		}
	}
383040
public function warnIf($condition, $message = '')
    {
        $message = (strlen($message)) ? $message : 'Unknown Reason';

        if (true === $condition) {
            $this->outputWriter->write('    <warning>Warning during ' . $this->version->getExecutionState() . ': ' . $message . '</warning>');
        }
    }
500055
public function checkEngineProperties(array $properties, string $message) : void
    {
        if (array_key_exists('RenderingEngine_Name', $properties)
            || array_key_exists('RenderingEngine_Version', $properties)
            || array_key_exists('RenderingEngine_Description', $properties)
            || array_key_exists('RenderingEngine_Maker', $properties)
            || array_key_exists('VBScript', $properties)
            || array_key_exists('ActiveXControls', $properties)
            || array_key_exists('BackgroundSounds', $properties)
        ) {
            throw new \LogicException($message);
        }
    }
281730
public function drop_while( $condition ) {
		$count = $this->count_while_true( $condition );
		return $count ? $this->drop( $count ) : $this;
	}
40961
public function logWarn($message, bool $separate = false): ?bool
    {
        return $this->log(self::WARN, $message, $separate);
    }
532932
public static function isNullOrBoolean($value, $message = null)
    {
        if (!is_null($value) && !is_bool($value)) {
            throw new InvalidArgumentException(sprintf(
                $message ?: 'Expected null or boolean, but got %s',
                Helper::typeToString($value)
            ));
        }
    }
747332
protected function validateCondition($condition)
    {
        $condition = trim(strtolower($condition));

        if ('and' !== $condition && 'or' !== $condition) {
            throw new \Exception("Condition can only be one of: 'and', 'or'.");
        }

        return $condition;
    }