.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Rose::DB::Object::Metadata::Relationship::OneToOne 3pm" .TH Rose::DB::Object::Metadata::Relationship::OneToOne 3pm "2012-04-15" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Rose::DB::Object::Metadata::Relationship::OneToOne \- One to one table relationship metadata object. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Rose::DB::Object::Metadata::Relationship::OneToOne; \& \& $rel = Rose::DB::Object::Metadata::Relationship::OneToOne\->new(...); \& $rel\->make_methods(...); \& ... .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Objects of this class store and manipulate metadata for relationships in which a single row from one table refers to a single row in another table. .PP This class inherits from Rose::DB::Object::Metadata::Relationship. Inherited methods that are not overridden will not be documented a second time here. See the Rose::DB::Object::Metadata::Relationship documentation for more information. .SH "METHOD MAP" .IX Header "METHOD MAP" .ie n .IP """get_set""" 4 .el .IP "\f(CWget_set\fR" 4 .IX Item "get_set" Rose::DB::Object::MakeMethods::Generic, object_by_key, ... .ie n .IP """get_set_now""" 4 .el .IP "\f(CWget_set_now\fR" 4 .IX Item "get_set_now" Rose::DB::Object::MakeMethods::Generic, object_by_key, \f(CW\*(C`interface => \*(Aqget_set_now\*(Aq\*(C'\fR .ie n .IP """get_set_on_save""" 4 .el .IP "\f(CWget_set_on_save\fR" 4 .IX Item "get_set_on_save" Rose::DB::Object::MakeMethods::Generic, object_by_key, \f(CW\*(C`interface => \*(Aqget_set_on_save\*(Aq\*(C'\fR .ie n .IP """delete_now""" 4 .el .IP "\f(CWdelete_now\fR" 4 .IX Item "delete_now" Rose::DB::Object::MakeMethods::Generic, object_by_key, \f(CW\*(C`interface => \*(Aqdelete_now\*(Aq\*(C'\fR .ie n .IP """delete_on_save""" 4 .el .IP "\f(CWdelete_on_save\fR" 4 .IX Item "delete_on_save" Rose::DB::Object::MakeMethods::Generic, object_by_key, \f(CW\*(C`interface => \*(Aqdelete_on_save\*(Aq\*(C'\fR .PP See the Rose::DB::Object::Metadata::Relationship documentation for an explanation of this method map. .SH "CLASS METHODS" .IX Header "CLASS METHODS" .IP "\fBdefault_auto_method_types [\s-1TYPES\s0]\fR" 4 .IX Item "default_auto_method_types [TYPES]" Get or set the default list of auto_method_types. \s-1TYPES\s0 should 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 contains \*(L"get_set_on_save\*(R" and \*(L"delete_on_save\*(R". .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .IP "\fBcolumn_map [\s-1HASH\s0 | \s-1HASHREF\s0]\fR" 4 .IX Item "column_map [HASH | HASHREF]" Get or set a reference to a hash that maps local column names to foreign column names. .IP "\fBbuild_method_name_for_type \s-1TYPE\s0\fR" 4 .IX Item "build_method_name_for_type TYPE" Return a method name for the relationship method type \s-1TYPE\s0. .Sp For the method types \*(L"get_set\*(R", \*(L"get_set_now\*(R", and \*(L"get_set_on_save\*(R", the relationship's name is returned. .Sp For the method types \*(L"delete_now\*(R" and \*(L"delete_on_save\*(R", the relationship's name prefixed with \*(L"delete_\*(R" is returned. .Sp Otherwise, undef is returned. .IP "\fBis_singular\fR" 4 .IX Item "is_singular" Returns true. .IP "\fBforeign_key [\s-1FK\s0]\fR" 4 .IX Item "foreign_key [FK]" Get or set the Rose::DB::Object::Metadata::ForeignKey object to which this object delegates all responsibility. .Sp One to one relationships encapsulate essentially the same information as foreign keys. If a foreign key object is stored in this relationship object, then \fIall compatible operations are passed through to the foreign key object.\fR 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. .IP "\fBmanager_class [\s-1CLASS\s0]\fR" 4 .IX Item "manager_class [CLASS]" Get or set the name of the Rose::DB::Object::Manager\-derived class used to fetch the object. .IP "\fBmanager_method [\s-1METHOD\s0]\fR" 4 .IX Item "manager_method [METHOD]" Get or set the name of the manager_class class method to call when fetching the object. .IP "\fBmanager_args [\s-1HASHREF\s0]\fR" 4 .IX Item "manager_args [HASHREF]" Get or set a reference to a hash of name/value arguments to pass to the manager_method when fetching the object. See the documentation for Rose::DB::Object::Manager's get_objects method for a full list of valid arguments for use with the \f(CW\*(C`manager_args\*(C'\fR parameter. .Sp \&\fBNote:\fR when the name of a relationship that has \f(CW\*(C`manager_args\*(C'\fR is used in a Rose::DB::Object::Manager with_objects or require_objects parameter value, \fIonly\fR the sort_by argument will be copied from \f(CW\*(C`manager_args\*(C'\fR and incorporated into the query. .IP "\fBmap_column \s-1LOCAL\s0 [, \s-1FOREIGN\s0]\fR" 4 .IX Item "map_column LOCAL [, FOREIGN]" If passed a local column name \s-1LOCAL\s0, return the corresponding column name in the foreign table. If passed both a local column name \s-1LOCAL\s0 and a foreign column name \s-1FOREIGN\s0, set the local/foreign mapping and return the foreign column name. .IP "\fBoptional [\s-1BOOL\s0]\fR" 4 .IX Item "optional [BOOL]" This method is the mirror image of the required method. Passing a true value to this method is the same thing as setting required to false, and vice versa. Similarly, the return value is the logical negation of required. .IP "\fBquery_args [\s-1ARRAYREF\s0]\fR" 4 .IX Item "query_args [ARRAYREF]" Get or set a reference to an array of query arguments to add to the query passed to the manager_method when fetching the object. .IP "\fBrequired [\s-1BOOL\s0]\fR" 4 .IX Item "required [BOOL]" Get or set the boolean value that determines what happens when the local columns in the column_map have 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 return undef. .Sp 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. .IP "\fBtype\fR" 4 .IX Item "type" Returns \*(L"one to one\*(R". .SH "AUTHOR" .IX Header "AUTHOR" John C. Siracusa (siracusa@gmail.com) .SH "LICENSE" .IX Header "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.