Rose::...nyToOne(3pm)
π¦ NAME π¦
okay bestie, welcome to the Rose::DB::Object::Metadata::Relationship::ManyToOne page from the User Contributed Perl Documentation β yep, it's a 3pm manual, and it's giving metadata object for a many-to-one table relationship π
. Translation: this class stores and manipulates metadata for relationships where many rows in one table may refer to a single row in another table. iconic.
β¨ SYNOPSIS β¨
use Rose::DB::Object::Metadata::Relationship::ManyToOne;
$rel = Rose::DB::Object::Metadata::Relationship::ManyToOne->new(...);
$rel->make_methods(...);
...
Like, that's the whole vibe: you load it, you make a relationship object, you call make_methods, and there are more ...s because this is a manpage and we love an ellipsis π«Ά.
πΈ DESCRIPTION πΈ
Objects of this class store and manipulate metadata for relationships in which many rows in one table may refer to a single row in another table. That's the many-to-one fantasy, no cap.
This class inherits from Rose::DB::Object::Metadata::Relationship. Inherited methods that are not overridden will not be documented a second time here β because duplicating docs is not the move. See the Rose::DB::Object::Metadata::Relationship documentation for more information. iykyk β¨.
π§ METHOD MAP π§
Here's the method map, bestie. Keep these exact:
get_setβRose::DB::Object::MakeMethods::Generic,object_by_key, ...get_set_nowβRose::DB::Object::MakeMethods::Generic,object_by_key,"interface => 'get_set_now'"get_set_on_saveβRose::DB::Object::MakeMethods::Generic,object_by_key,"interface => 'get_set_on_save'"delete_nowβRose::DB::Object::MakeMethods::Generic,object_by_key,"interface => 'delete_now'"delete_on_saveβRose::DB::Object::MakeMethods::Generic,object_by_key,"interface => 'delete_on_save'"
See the Rose::DB::Object::Metadata::Relationship documentation for an explanation of this method map. It's all connected, bestie π.
π CLASS METHODS π
default_auto_method_types [TYPES]β Get or set the default list ofauto_method_types.TYPESshould be a list of relationship method types. Returns the list of default relationship method types (in list context) or a reference to an array of the default relationship method types (in scalar context). The default list containsget_set_on_saveanddelete_on_save. periodt.
π OBJECT METHODS π
column_map [HASH | HASHREF]β Get or set a reference to a hash that maps local column names to foreign column names.build_method_name_for_type TYPEβ Return a method name for the relationship method typeTYPE.
For the method types get_set, get_set_now, and get_set_on_save, the relationship's name is returned.
For the method types delete_now and delete_on_save, the relationship's name prefixed with delete_ is returned.
Otherwise, undef is returned.
foreign_key [FK]β Get or set theRose::DB::Object::Metadata::ForeignKeyobject to which this object delegates all responsibility.
Many-to-one relationships encapsulate essentially the same information as foreign keys. If a foreign key object is stored in this relationship object, then all compatible operations are passed through to the foreign key object. This includes making object method(s) and adding or modifying the local-to-foreign column map. In other words, if a foreign_key is set, the relationship object simply acts as a proxy for the foreign key object. cute little proxy moment π«Ά.
is_singularβ Returns true. that's it, that's the method β¨.manager_class [CLASS]β Get or set the name of theRose::DB::Object::Manager-derived class used to fetch the object.manager_method [METHOD]β Get or set the name of themanager_classclass method to call when fetching the object.manager_count_method [METHOD]β Get or set the name of themanager_classclass method to call when counting objects. Themake_methodsmethod will useget_objects_countif this value is left undefined.manager_iterator_method [METHOD]β Get or set the name of themanager_classclass method to call when creating an iterator. Themake_methodsmethod will useget_objects_iteratorif this value is left undefined.manager_delete_method [METHOD]β Get or set the name of themanager_classclass method to call when deleting objects. Themake_methodsmethod will usedelete_objectsif this value is left undefined.manager_args [HASHREF]β Get or set a reference to a hash of name/value arguments to pass to themanager_methodwhen fetching the object. See the documentation forRose::DB::Object::Manager'sget_objectsmethod for a full list of valid arguments for use with themanager_argsparameter.
Note: when the name of a relationship that hasmanager_argsis used in aRose::DB::Object::Managerwith_objectsorrequire_objectsparameter value, only thesort_byargument will be copied frommanager_argsand incorporated into the query. lowkey important, bestie.
map_column LOCAL [, FOREIGN]β If passed a local column nameLOCAL, return the corresponding column name in the foreign table. If passed both a local column nameLOCALand a foreign column nameFOREIGN, set the local/foreign mapping and return the foreign column name.object_args [HASHREF]β Get or set a reference to a hash of name/value pairs to pass to thenewmethod when constructing the related object. This attribute conflicts with any use of themanager_*orquery_argsattributes. β οΈ conflict vibes.optional [BOOL]β This method is the mirror image of therequiredmethod. Passing a true value to this method is the same thing as settingrequiredto false, and vice versa. Similarly, the return value is the logical negation ofrequired.query_args [ARRAYREF]β Get or set a reference to an array of query arguments to add to the query passed to themanager_methodwhen fetching the object.required [BOOL]β Get or set the boolean value that determines what happens when the local columns in thecolumn_maphave defined values, but the object they relate to is not found. If true, a fatal error will occur when the methods that fetch objects through this relationship are called. If false, then the methods will simply returnundef.
The default is false if one or more of the local columns allow null values or if the local columns in the column map are the same as the primary key columns, true otherwise.
typeβ Returnsmany to one.with_column_triggers [BOOL]β Get or set a boolean value that indicates whether or not triggers should be added to the local columns in the column map in an attempt to keep related objects and local columns in sync. Defaults to false.
π AUTHOR π
John C. Siracusa (siracusa@gmail.com) β the icon who wrote this π.
π LICENSE π
Copyright (c) 2010 by John C. Siracusa. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page, bestie π. This one's from perl v5.40.1, dated 2025-08-21, and the footer is giving Rose::...nyToOne(3pm) β slay, bye π
β¨.
π¦ where this page comes from
- ubuntu resolute: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: librose-db-object-perl 1:0.822-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms