1Rose::DB::Object::MetadUasteRaro:s:CeRo:en:ltDarBti:ib:ouOntbsejhdeicpPt:e::r:MlMaenDtyoaTcdouaOmtneaen:(t:3aR)teiloantionship::ManyToOne(3)
2
3
4
6 Rose::DB::Object::Metadata::Relationship::ManyToOne - Many to one table
7 relationship metadata object.
8
10 use Rose::DB::Object::Metadata::Relationship::ManyToOne;
11
12 $rel = Rose::DB::Object::Metadata::Relationship::ManyToOne->new(...);
13 $rel->make_methods(...);
14 ...
15
17 Objects of this class store and manipulate metadata for relationships
18 in which a many rows in one table may refer to a single row in another
19 table.
20
21 This class inherits from Rose::DB::Object::Metadata::Relationship.
22 Inherited methods that are not overridden will not be documented a
23 second time here. See the Rose::DB::Object::Metadata::Relationship
24 documentation for more information.
25
27 "get_set"
28 Rose::DB::Object::MakeMethods::Generic, object_by_key, ...
29
30 "get_set_now"
31 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
32 => 'get_set_now'"
33
34 "get_set_on_save"
35 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
36 => 'get_set_on_save'"
37
38 "delete_now"
39 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
40 => 'delete_now'"
41
42 "delete_on_save"
43 Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface
44 => 'delete_on_save'"
45
46 See the Rose::DB::Object::Metadata::Relationship documentation for an
47 explanation of this method map.
48
50 default_auto_method_types [TYPES]
51 Get or set the default list of auto_method_types. TYPES should be
52 a list of relationship method types. Returns the list of default
53 relationship method types (in list context) or a reference to an
54 array of the default relationship method types (in scalar context).
55 The default list contains "get_set_on_save" and "delete_on_save".
56
58 column_map [HASH | HASHREF]
59 Get or set a reference to a hash that maps local column names to
60 foreign column names.
61
62 build_method_name_for_type TYPE
63 Return a method name for the relationship method type TYPE.
64
65 For the method types "get_set", "get_set_now", and
66 "get_set_on_save", the relationship's name is returned.
67
68 For the method types "delete_now" and "delete_on_save", the
69 relationship's name prefixed with "delete_" is returned.
70
71 Otherwise, undef is returned.
72
73 foreign_key [FK]
74 Get or set the Rose::DB::Object::Metadata::ForeignKey object to
75 which this object delegates all responsibility.
76
77 Many to one relationships encapsulate essentially the same
78 information as foreign keys. If a foreign key object is stored in
79 this relationship object, then all compatible operations are passed
80 through to the foreign key object. This includes making object
81 method(s) and adding or modifying the local-to-foreign column map.
82 In other words, if a foreign_key is set, the relationship object
83 simply acts as a proxy for the foreign key object.
84
85 is_singular
86 Returns true.
87
88 manager_class [CLASS]
89 Get or set the name of the Rose::DB::Object::Manager-derived class
90 used to fetch the object.
91
92 manager_method [METHOD]
93 Get or set the name of the manager_class class method to call when
94 fetching the object.
95
96 manager_count_method [METHOD]
97 Get or set the name of the manager_class class method to call when
98 counting objects. The make_methods method will use
99 get_objects_count if this value is left undefined.
100
101 manager_iterator_method [METHOD]
102 Get or set the name of the manager_class class method to call when
103 creating an iterator. The make_methods method will use
104 get_objects_iterator if this value is left undefined.
105
106 manager_delete_method [METHOD]
107 Get or set the name of the manager_class class method to call when
108 deleting objects. The make_methods method will use delete_objects
109 if this value is left undefined.
110
111 manager_args [HASHREF]
112 Get or set a reference to a hash of name/value arguments to pass to
113 the manager_method when fetching the object. See the documentation
114 for Rose::DB::Object::Manager's get_objects method for a full list
115 of valid arguments for use with the "manager_args" parameter.
116
117 Note: when the name of a relationship that has "manager_args" is
118 used in a Rose::DB::Object::Manager with_objects or require_objects
119 parameter value, only the sort_by argument will be copied from
120 "manager_args" and incorporated into the query.
121
122 map_column LOCAL [, FOREIGN]
123 If passed a local column name LOCAL, return the corresponding
124 column name in the foreign table. If passed both a local column
125 name LOCAL and a foreign column name FOREIGN, set the local/foreign
126 mapping and return the foreign column name.
127
128 object_args [HASHREF]
129 Get or set a reference to a hash of name/value pairs to pass to the
130 new method when constructing the related object. This attribute
131 conflicts with any use of the "manager_*" or "query_args"
132 attributes.
133
134 optional [BOOL]
135 This method is the mirror image of the required method. Passing a
136 true value to this method is the same thing as setting required to
137 false, and vice versa. Similarly, the return value is the logical
138 negation of required.
139
140 query_args [ARRAYREF]
141 Get or set a reference to an array of query arguments to add to the
142 query passed to the manager_method when fetching the object.
143
144 required [BOOL]
145 Get or set the boolean value that determines what happens when the
146 local columns in the column_map have defined values, but the object
147 they relate to is not found. If true, a fatal error will occur
148 when the methods that fetch objects through this relationship are
149 called. If false, then the methods will simply return undef.
150
151 The default is false if one or more of the local columns allow null
152 values or if the local columns in the column map are the same as
153 the primary key columns, true otherwise.
154
155 type
156 Returns "many to one".
157
158 with_column_triggers [BOOL]
159 Get or set a boolean value that indicates whether or not triggers
160 should be added to the local columns in the column map in an
161 attempt to keep related objects and local columns in sync.
162 Defaults to false.
163
165 John C. Siracusa (siracusa@gmail.com)
166
168 Copyright (c) 2010 by John C. Siracusa. All rights reserved. This
169 program is free software; you can redistribute it and/or modify it
170 under the same terms as Perl itself.
171
172
173
174perl v5.34.0 Rose::DB::2O0b2j2e-c0t1:-:2M1etadata::Relationship::ManyToOne(3)