Get a related rowset.

@param  string $binding The alias for the related rowset
@return Garp_Db_Table_Row|Garp_Db_Table_Rowset
558105
public function getRelated($binding = null) {
        if (is_null($binding)) {
            return $this->_related;
        }
        return $this->_related[$binding];
    }
363904
public function getRelatedTable()
    {
        if ($this->relatedTableName) {
            return $this->table->getDatabaseMap()->getTable($this->relatedTableName);
        } else {
            throw new PropelException("Cannot fetch RelatedTable for column with no foreign key: " . $this->columnName);
        }
    }
419625
private function inferType($binding)
	{
		if (is_bool($binding))
		{
			$type = \PDO::PARAM_BOOL;
		}
		elseif (is_null($binding))
		{
			$type = \PDO::PARAM_NULL;
		}
		elseif (is_int($binding))
		{
			$type = \PDO::PARAM_INT;
		}
		else
		{
			$type = \PDO::PARAM_STR;
		}

		return $type;
	}
933278
public function values(array $bindings) {
        $references = array();
        foreach ($bindings as $k => $v) {
            $references[] = ":$k";
        }

        $this->sql .= 'VALUES (' . implode(', ', $references) . ') ';
        $this->params = array_merge($this->params, array_combine($references, array_values($bindings)));
        return $this;
    }
1311058
public function getRaw($binding)
    {
        if (isset($this->bindings[$binding])) {
            return $this->bindings[$binding];
        } elseif (isset($this->parent)) {
            return $this->parent->getRaw($binding);
        }

        return null;
    }
192915
public function channel($bind = [])
    {
        if (!is_array($bind)) {
            $bind = func_get_args();
        }
        return $this->bunny->connect()
            ->flatMap(function () {
                return $this->bunny->channel();
            })
            ->map(function (Channel $channel) use ($bind) {
                foreach ($bind as $obj) {
                    $obj->setChannel($channel);
                }
                return $channel;
            });
    }
135859
public function bind($dataset)
    {
        if ($dataset === null) {
            return $this;
        }

        if ($dataset instanceof \Traversable) {
            $dataset = iterator_to_array($dataset);
        } elseif (is_object($dataset)) {
            $dataset = [$dataset];
        } elseif (!is_array($dataset)) {
            throw new \InvalidArgumentException('Need an array or object');
        }

        foreach ($dataset as $k => $data) {
            $this[$k] = $data;
        }

        return $this;
    }
272198
public final function fetchRow($sql, array $bind = [])
    {
        return $this->query($sql, $bind)->fetch(\PDO::FETCH_NAMED);
    }
1018379
public function getSet($set)
    {
        if (isset($this->sets[$set])) {
            return $this->sets[$set];
        }
        return null;
    }
214301
protected function getRelations(&$resultSet,$name='') {
        // 获取记录集的主键列表
        foreach($resultSet as $key=>$val) {
            $val  = $this->getRelation($val,$name);
            $resultSet[$key]    =   $val;
        }
        return $resultSet;
    }
292893
private function prepareQueryBinding(array $binding)
    {
        $value = $binding['value'];

        list ($type, $val) = $this->toGrpcValue($value);

        $binding['value'][$type] = $val;

        return $binding;
    }
98763
public function getQuery()
    {
        $query = $this->database->getSelectQuery()->from($this->table);

        foreach ($this->join as $join) {
            if (!is_array($join[2])) {
                $join[2] = [$join[2]];
            }

            $where = array_shift($join[2]);
            if (!empty($join[2])) {
                foreach ($join[2] as $i => $value) {
                    $join[2][$i] = $this->database->bind($value);
                }

                $where = vsprintf($where, $join[2]);
            }

            $query->join($join[0], $join[1], $where, $join[3]);
        }

        foreach ($this->filter as $i => $filter) {
            //array('post_id=%s AND post_title IN %s', 123, array('asd'));
            $where = array_shift($filter);
            if (!empty($filter)) {
                foreach ($filter as $i => $value) {
                    $filter[$i] = $this->database->bind($value);
                }

                $where = vsprintf($where, $filter);
            }

            $query->where($where);
        }

        return $query;
    }
980872
public final function fetchAll($sql, array $bind = [])
    {
        return $this->query($sql, $bind)->fetchAll(\PDO::FETCH_NAMED);
    }
891698
public function getBatchQuery($query, array $bindings) {
        return new BatchQuery($this->getClient(), $query, $this->prepareBindings($bindings));
    }
1155606
public function getChildren()
    {
        $result = null;

        if($this->hasChildren())
        {
            $parent = $this->id;

            if(!$this->__children[$parent] instanceof DatabaseRowsetInterface)
            {
                $this->__children[$parent] = $this->getTable()->createRowset(array(
                    'data' => $this->__children[$parent]
                ));
            }

            $result = $this->__children[$parent];
        }

        return $result;
    }
13119
public function query(string $sql, $bind = []): Result
    {
        $result = parent::query($sql, $bind);
        return new Result($this->tableName, $result);
    }
1334384
public static function getRow($query)
    {
        $ret = null;

        $res = self::query($query);
        if ($res) {
            if ($row = self::connection()->sql_fetch_assoc($res)) {
                $ret = $row;
            }
            self::free($res);
        }

        return $ret;
    }