public function getHasManyReference($table, $targetTable = NULL)
{
$this->needStructure();
$table = $this->resolveFQTableName($table);
if ($targetTable) {
$targetTable = $this->resolveFQTableName($targetTable);
foreach ($this->structure['hasMany'][$table] as $key => $value) {
if (strtolower($key) === $targetTable) {
return $this->structure['hasMany'][$table][$key];
}
}
return NULL;
} else {
if (!isset($this->structure['hasMany'][$table])) {
return [];
}
return $this->structure['hasMany'][$table];
}
}