GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  ROSE::DB::OBJECT::METADATA::RELATIONSHIP::MANYTOONE (3)

.ds Aq ’

NAME

Rose::DB::Object::Metadata::Relationship::ManyToOne - Many to one table relationship metadata object.

CONTENTS

SYNOPSIS



  use Rose::DB::Object::Metadata::Relationship::ManyToOne;

  $rel = Rose::DB::Object::Metadata::Relationship::ManyToOne->new(...);
  $rel->make_methods(...);
  ...



DESCRIPTION

Objects of this class store and manipulate metadata for relationships in which a many rows in one table may refer to a single row in another table.

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.

METHOD MAP

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.

CLASS METHODS

<B>default_auto_method_types [TYPES]B> Get or set the default list of auto_method_types. TYPES 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 get_set_on_save and delete_on_save.

OBJECT METHODS

<B>column_map [HASH | HASHREF]B> Get or set a reference to a hash that maps local column names to foreign column names.
<B>build_method_name_for_type TYPEB> Return a method name for the relationship method type TYPE.

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.

<B>foreign_key [FK]B> Get or set the Rose::DB::Object::Metadata::ForeignKey object 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.

<B>is_singularB> Returns true.
<B>manager_class [CLASS]B> Get or set the name of the Rose::DB::Object::Manager-derived class used to fetch the object.
<B>manager_method [METHOD]B> Get or set the name of the manager_class class method to call when fetching the object.
<B>manager_count_method [METHOD]B> Get or set the name of the manager_class class method to call when counting objects. The make_methods method will use get_objects_count if this value is left undefined.
<B>manager_iterator_method [METHOD]B> Get or set the name of the manager_class class method to call when creating an iterator. The make_methods method will use get_objects_iterator if this value is left undefined.
<B>manager_delete_method [METHOD]B> Get or set the name of the manager_class class method to call when deleting objects. The make_methods method will use delete_objects if this value is left undefined.
<B>manager_args [HASHREF]B> 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 manager_args parameter.

<B>Note:B> when the name of a relationship that has manager_args is used in a Rose::DB::Object::Manager with_objects or require_objects parameter value, only the sort_by argument will be copied from manager_args and incorporated into the query.

<B>map_column LOCAL [, FOREIGN]B> If passed a local column name LOCAL, return the corresponding column name in the foreign table. If passed both a local column name LOCAL and a foreign column name FOREIGN, set the local/foreign mapping and return the foreign column name.
<B>object_args [HASHREF]B> Get or set a reference to a hash of name/value pairs to pass to the new method when constructing the related object. This attribute conflicts with any use of the manager_* or query_args attributes.
<B>optional [BOOL]B> 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.
<B>query_args [ARRAYREF]B> 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.
<B>required [BOOL]B> 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.

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.

<B>typeB> Returns many to one.
<B>with_column_triggers [BOOL]B> 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)

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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ROSE::DB::OBJECT::METADATA::RELATIONSHIP::MANYTOONE (3) 2015-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.