Wrapper method for MongoCursor::slaveOkay().

@see \Doctrine\MongoDB\Cursor::slaveOkay()
@see http://php.net/manual/en/mongocursor.slaveokay.php
@param boolean $ok
@return self
487438
public function slaveOkay($ok = true)
    {
        $ok = (boolean) $ok;
        $this->baseCursor->slaveOkay($ok);
        $this->unitOfWorkHints[Query::HINT_SLAVE_OKAY] = $ok;
        return $this;
    }
1146814
public function slaveOkay($okay = true)
    {
        if (null !== $okay) {
            if (!is_bool($okay)) {
                throw new \InvalidArgumentException('The slave okay is not a boolean.');
            }
        }

        $this->slaveOkay = $okay;

        return $this;
    }
771155
final public function distinct($boolean = TRUE)
    {
        $this->arrayDistinct = (is_bool($boolean)) ? $boolean : TRUE;
        return $this;
    }
884031
public function asJoined(bool $joined = true)
    {
        $node = clone $this;
        $node->joined = $joined;

        return $node;
    }
1197799
public function lock($locked = true)
    {
        $this->_locked = $locked === false ? false : true;
        return $this;
    }
754054
public function with(JWK $jwk): self
    {
        $clone = clone $this;

        if ($jwk->has('kid')) {
            $clone->keys[$jwk->get('kid')] = $jwk;
        } else {
            $clone->keys[] = $jwk;
        }

        return $clone;
    }
885252
protected function setJoin($query = null)
    {
        $query = $query ?: $this->query;

        $baseTable = $this->related->getTable();

        $key = $baseTable.'.'.$this->related->getKeyName();

        $query->join($this->table, $key, '=', $this->getOtherKey());

        return $this;
    }
1143708
public function hasMany($entity, string $related, string $foreignKey = null, string $localKey = null): HasMany
    {
        $foreignKey = $foreignKey ?: $this->getForeignKey();

        $relatedMapper = Manager::getInstance()->mapper($related);

        $localKey = $localKey ?: $this->getKeyName();

        // Add the relation to the definition in map
        list(, $caller) = debug_backtrace(false);
        $relation = $caller['function'];
        $this->relatedClasses[$relation] = $related;

        $this->addManyRelation($relation);
        $this->addForeignRelation($relation);

        return new HasMany($relatedMapper, $entity, $foreignKey, $localKey);
    }
105309
public function orHaving(string $key, string $operator, $value): SelectQueryBuilder
    {
        $this->addHaving($key, $operator, $value, 'OR');
        return $this;
    }
353282
public function merge($collection, $preserveKeys = false)
    {
        foreach($collection as $key => $value) {
            $preserveKeys ? $this[$key] = $value : $this[] = $value;
        }
        return $this;
    }
1264811
static function TableKeyHasMany($table, $tablePKey, $foreignRef, $foreignKey = false, $foreignClass = 'ADODB_Active_Record')
	{
		if (!is_array($tablePKey)) {
			$tablePKey = array($tablePKey);
		}
		$ar = new ADODB_Active_Record($table,$tablePKey);
		$ar->hasMany($foreignRef, $foreignKey, $foreignClass);
	}
1224044
private function slaveQueryBuilder()
    {
        /** @var Connection $connection */
        $connection = $this->getEntityManager()->getConnection();
        if ($connection instanceof MasterSlaveConnection) {
            // Prefer a slave connection if available.
            $connection->connect('slave');
        }

        return new QueryBuilder($connection);
    }
440900
public function hasOne($related, $foreignKey = null, $otherKey = null, $relation = null)
    {
        // We will use Relationship as a class
        $foreignKey = new $foreignKey;

        $instance = new $related;

        $otherKey = $otherKey ?: $this->getKeyName();

        return new HasOne($instance->newQuery(), $this, $foreignKey, $otherKey, $relation);
    }
1129536
public function with(array $related)
    {

        $relations = $this->getEntityObject()->getRelations();
        foreach ($relations as $fk => $target) {
            $table = strstr($target, '.', true);

            if (in_array($table, $related)) {

                $this->sql(" ,$table.*");
                $this->join($table, "$this->oosql_table.$fk = $target");
            } elseif (isset($related[$table])) {

                foreach ($related[$table] as $field) {
                    $this->sql(" ,$table.$field");
                }
                $this->join($table, "$this->oosql_table.$fk = $target");
            }
        }
        return $this;
    }
427697
public function andHaving($_)
    {
        RecursiveArgs::each(func_get_args(), function ($arg) {
            $this->havingClauses[] = $arg;
        });

        return $this;
    }
335353
public function force(bool $master = true): self
    {
        if ($master) {
            $this->node = Pool::MASTER;
        }

        return $this;
    }
1152872
public function sort($key = null, $rule = "", $save_key = true)
    {
        $this->sortArray($key, $rule, 'asc', $save_key);
        return $this;
    }