public static function hasManyForeignKey($attr)
    {
        if (!self::hasHasMany($attr)) {
            return null;
        }

        $cls     = get_called_class();
        $configs = self::$_has_many[$cls][$attr];
        $key     = is_array($configs) && array_key_exists("foreign_key", $configs) ? $configs["foreign_key"] : (self::isIgnoringCase() ? strtolower($cls)."_id" : $cls."_id");
        return $key;
    }
public static function hasManyForeignKey($attr)
    {
        if (!self::hasHasMany($attr)) {
            return null;
        }

        $cls     = get_called_class();
        $configs = self::$_has_many[$cls][$attr];
        $key     = is_array($configs) && array_key_exists("foreign_key", $configs) ? $configs["foreign_key"] : (self::isIgnoringCase() ? strtolower($cls)."_id" : $cls."_id");
        return $key;
    }
public static function hasManyForeignKey ( $ attr ) { if ( ! self :: hasHasMany ( $ attr ) ) { return null ; } $ cls = get_called_class ( ) ; $ configs = self :: $ _has_many [ $ cls ] [ $ attr ] ; $ key = is_array ( $ configs ) && array_key_exists ( "foreign_key" , $ configs ) ? $ configs [ "foreign_key" ] : ( self :: isIgnoringCase ( ) ? strtolower ( $ cls ) . "_id" : $ cls . "_id" ) ; return $ key ; }
Check if there is a has many foreign key

@param string $attr attribute

@return string foreign key
Check if there is a has many foreign key