![]() ![]() The purpose of documenting the method map is to answer the question, ``What kind of method(s) will be created by this foreign key object for a given method type?'' Given the method map, it's possible to read the documentation for each method maker class to determine how methods of the specified type behave when passed the listed arguments. Arguments that are common to all foreign key method types are routinely omitted from the method map for the sake of brevity. The ``.'' in the method maker arguments is meant to indicate that arguments have been omitted. For each foreign key method type, the method maker class, the method maker method type, and the ``interesting'' method maker arguments are listed, in that order. Įach item in the map is a foreign key method type. ![]() ![]() Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface => 'delete_on_save'". Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface => 'delete_now'". Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface => 'get_set_on_save'". Rose::DB::Object::MakeMethods::Generic, object_by_key, "interface => 'get_set_now'". Rose::DB::Object::MakeMethods::Generic, object_by_key, The default method map for Rose::DB::Object::Metadata::ForeignKey is: This information can be organized conceptually into a ``method map'' that connects a foreign key method type to a method maker class and, finally, to one particular method type within that class, and its arguments. The method maker arguments (e.g., "interface => 'get_set'") The method maker method type (e.g., object_by_key) The method maker class (e.g., Rose::DB::Object::MakeMethods::Generic) ![]() The foreign key method type (e.g., "get_set") Using this system, four pieces of information are needed to create a method on behalf of a Rose::DB::Object::Metadata::ForeignKey-derived object: Each Rose::Object::MakeMethods-derived class has its own set of method types, each of which takes it own set of arguments. (The word ``protected'' is used here in a vaguely C ++ sense, meaning ``accessible to subclasses, but not to the public.'') Subclasses will probably find it easier to override and/or call these protected methods in order to influence the behavior of the ``public'' method maker methods.Ī Rose::DB::Object::Metadata::ForeignKey object delegates method creation to a Rose::Object::MakeMethods-derived class. There are, however, several ``protected'' methods which are used internally to implement the methods described above. These methods make up the ``public'' interface to foreign key method creation. A list of all possible method types is available through the available_method_types method. If absent, the list of method types is determined by the auto_method_types method. A list of method types can be passed to the call to make_methods. Methods are created by calling make_methods. The default list of foreign key method types contains only one type:Ī method that returns the object referenced by the foreign key. A foreign key method type describes the purpose of a method. Each foreign key object can make zero or more methods for each available foreign key method type. Nested boolean logic is possible using the special keywords and and or (case insensitive).A Rose::DB::Object::Metadata::ForeignKey-derived object is responsible for creating object methods that manipulate objects referenced by a foreign key. (title LIKE '%million%' OR title LIKE '%resident%') The above returns an SQL statement something like this: SELECT id, title FROM articles WHERE SYNOPSIS use Rose::DB::Object::QueryBuilder qw(build_select) Ĭolumns => , Rose::DB::Object::QueryBuilder - Build SQL queries on behalf of Rose::DB::Object::Manager. ![]()
0 Comments
Leave a Reply. |