Checks whether a pair of beans is related N-M. This function does not
check whether the beans are related in N:1 way.

@param RedBean_OODBBean $bean1 first bean
@param RedBean_OODBBean $bean2 second bean

@return bool $yesNo whether they are related
499030
public static function areRelated( RedBean_OODBBean $bean1, RedBean_OODBBean $bean2) {
		return self::$associationManager->areRelated($bean1,$bean2);
	}
65214
public static function syncSchema($database1,$database2) {
		if (!isset(RedBean_Facade::$toolboxes[$database1])) throw new RedBean_Exception_Security('No database for this key: '.$database1);
		if (!isset(RedBean_Facade::$toolboxes[$database2])) throw new RedBean_Exception_Security('No database for this key: '.$database2);
		$db1 = RedBean_Facade::$toolboxes[$database1];
		$db2 = RedBean_Facade::$toolboxes[$database2];
		$sync = new self;
		$sync->doSync($db1, $db2);
	}
1263201
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', $callback = null)
    {
        $entity = $this->mapper->newInstance();

        $relation = $this->getHasRelationQuery($relation, $entity);

        $query = $relation->getRelationCountQuery($relation->getRelatedMapper()->getQuery(), $this);

        if ($callback) {
            call_user_func($callback, $query);
        }

        return $this->addHasWhere($query, $relation, $operator, $count, $boolean);
    }
743181
public function belongsTo($related, $foreignKey = '')
    {
        if (!$foreignKey && $related instanceof Model) {
            $column = $related->getTable();
        } else {
            $column = $foreignKey;
        }

        if (empty($related)) {
            unset($this->bean->$column);
        } elseif ($related instanceof Model) {
            $this->bean->$column = $related->getBean();
        } else {
            $this->bean->$column = $related;
        }
    }
698058
public function isAssociationWithSingleJoinColumn($fieldName)
    {
        return (
            isset($this->associationMappings[$fieldName]) &&
            isset($this->associationMappings[$fieldName]['joinColumns'][0]) &&
            !isset($this->associationMappings[$fieldName]['joinColumns'][1])
        );
    }
1263606
@Override
  public boolean isConnectedInDirection(N n1, N n2) {
    return isConnectedInDirection(n1, Predicates.<E>alwaysTrue(), n2);
  }
364841
public function __isset(string $name)
	{
		if(isset($this->columns[$name]) || isset($this->related[$name]))
		{
			return true;
		}

		return $this->isRelation($name) && $this->getValue($name) !== null;
	}
813495
public function is_related($query) {
        if (parent::is_related($query)) {
            return true;
        }

        $protocols = core_component::get_plugin_list('webservice');
        foreach ($protocols as $protocol=>$location) {
            if (strpos($protocol, $query) !== false) {
                return true;
            }
            $protocolstr = get_string('pluginname', 'webservice_'.$protocol);
            if (strpos(core_text::strtolower($protocolstr), $query) !== false) {
                return true;
            }
        }
        return false;
    }
525807
public static function count( $beanType, $addSQL = '', $params = array() ) {
		return RedBean_Facade::$redbean->count($beanType,$addSQL,$params);
	}
1316641
protected function isMemberOf($member, $relation)
    {
        if (!$member || !$member->exists()) {
            return false;
        }

        if ($relation instanceof UnsavedRelationList) {
            return in_array($member->ID, $relation->getIDList());
        }

        return $relation->byID($member->ID) !== null;
    }
720906
public function is_related($query) {
        if (parent::is_related($query)) {
            return true;
        }

        $repositories= core_component::get_plugin_list('repository');
        foreach ($repositories as $p => $dir) {
            if (strpos($p, $query) !== false) {
                return true;
            }
        }
        foreach (repository::get_types() as $instance) {
            $title = $instance->get_typename();
            if (strpos(core_text::strtolower($title), $query) !== false) {
                return true;
            }
        }
        return false;
    }
1226062
public final <A extends NodeInterface, B extends NodeInterface, S extends Source, T extends Target> boolean hasRelationship(final Class<? extends Relation<A, B, S, T>> type) {
		return this.getRelationships(type).iterator().hasNext();
	}
804544
protected function isRelationAttr($attr)
    {
        $relation = Db::parseName($attr, 1, false);

        if (method_exists($this, $relation) && !method_exists('think\Model', $relation)) {
            return $relation;
        }

        return false;
    }
242025
public function hasMany(Model $related)
    {
        $table = ucfirst($related->getTable());
        $column = "shared{$table}List";
        $this->bean->$column[] = $related->getBean();
    }
20020
function( relation ) {
			if ( relation.instance instanceof this.relatedModel && this.reverseRelation.key === relation.key
					&&	this.key === relation.reverseRelation.key ) {
				return true;
			}
			return false;
		}
1077907
public function hasRelationshipInput(
        ResourceTransformer $transformer,
        &$input,
        RelationshipField $field,
        Context $context
    ) : bool {
        return $this->hasPropertyInput($transformer, $input, $field, $context);
    }
774682
public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', $callback = null)
	{
		$relation = $this->getHasRelationQuery($relation);

		$query = $relation->getRelationCountQuery($relation->getRelated()->newQuery(), $this);

		if ($callback) call_user_func($callback, $query);

		return $this->addHasWhere($query, $relation, $operator, $count, $boolean);
	}