ktats****@users*****
ktats****@users*****
2011年 4月 29日 (金) 02:02:32 JST
Index: docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod diff -u docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod:1.1 docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod:1.2 --- docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod:1.1 Fri Apr 29 01:44:57 2011 +++ docs/modules/DBIx-Class-0.08127/lib/DBIx/Class/Manual/Component.pod Fri Apr 29 02:02:31 2011 @@ -1,50 +1,98 @@ +=encoding utf8 =head1 NAME -DBIx::Class::Manual::Component - Developing DBIx::Class Components +DBIx::Class::Manual::Component - DBIx::Class コンãƒãƒ¼ãƒãƒ³ãƒˆã‚’開発ã™ã‚‹ -=head1 WHAT IS A COMPONENT +=head1 コンãƒãƒ¼ãƒãƒ³ãƒˆã¨ã¯ä½•ã‹ + +=begin original A component is a module that can be added in to your DBIx::Class classes to provide extra functionality. A good example is the PK::Auto component which automatically retrieves primary keys that the database itself creates, after the insert has happened. -=head1 USING +=end original + +DBIx::Classã®ã‚¯ãƒ©ã‚¹ã«ä»˜åŠ çš„ãªæ©Ÿèƒ½ã‚’æä¾›ã™ã‚‹ãŸã‚ã«è¿½åŠ ã™ã‚‹ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã®ã“ã¨ã§ã™ã€‚ +好例ã¨ã—ã¦ã¯ã€PK::Autoコンãƒãƒ¼ãƒãƒ³ãƒˆãŒã‚ã‚Šã¾ã™ã€‚PK::Autoã¯ã€insertã®å¾Œã«ã€ +データベース自身ãŒã€ä½œã£ãŸãƒ—ライマリã‚ーをå–り出ã—ã¾ã™ã€‚ + +=head1 使ã„æ–¹ + +=begin original Components are loaded using the load_components() method within your DBIx::Class classes. +=end original + +コンãƒãƒ¼ãƒãƒ³ãƒˆã¯ã€è‡ªåˆ†ã®DBIx::Class クラスã®ä¸ã«ã€ load_components() +メソッドを使ã£ã¦ã€ãƒãƒ¼ãƒ‰ã—ã¾ã™ã€‚ + package My::Thing; use base qw( DBIx::Class::Core ); __PACKAGE__->load_components(qw/InflateColumn::DateTime TimeStamp/); +=begin original + Generally you do not want to specify the full package name of a component, instead take off the DBIx::Class:: part of it and just include the rest. If you do want to load a component outside of the normal namespace you can do so by prepending the component name with a +. +=end original + +ãŸã„ã¦ã„ã€ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã®å®Œå…¨ãªãƒ‘ッケージåを指定ã—ãŸãã¯ãªã„ã§ã—ょã†ã‹ã‚‰ã€ +ãã®ä»£ã‚ã‚Šã«ã€DBIx::Class:: ã®éƒ¨åˆ†ã‚’外ã—ã¦ã€æ®‹ã‚Šã®éƒ¨åˆ†ã ã‘ã‚’å«ã‚ã¾ã™ã€‚ +通常ã®åå‰ç©ºé–“以外ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’ãƒãƒ¼ãƒ‰ã—ãŸã„ãªã‚‰ã€ +コンãƒãƒ¼ãƒãƒ³ãƒˆåã®å‰ã« + を付ã‘ã¦ãã ã•ã„。 + __PACKAGE__->load_components(qw/ +My::Component /); +=begin original + Once a component is loaded all of it's methods, or otherwise, that it provides will be available in your class. +=end original + +コンãƒãƒ¼ãƒãƒ³ãƒˆãŒãƒãƒ¼ãƒ‰ã•ã‚Œã‚‹ã¨ã€å…¨ã¦ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆãŒæä¾›ã™ã‚‹ +メソッドãŒè‡ªåˆ†ã®ã‚¯ãƒ©ã‚¹ã§æœ‰åŠ¹ã«ãªã‚Šã¾ã™ã€‚ + +=begin original + The order in which is you load the components may be very important, depending on the component. If you are not sure, then read the docs for the components you are using and see if they mention anything about the order in which you should load them. -=head1 CREATING COMPONENTS +=end original + +コンãƒãƒ¼ãƒãƒ³ãƒˆã‚’ãƒãƒ¼ãƒ‰ã™ã‚‹é †ç•ªã¯éžå¸¸ã«é‡è¦ã§ã™ã€‚コンãƒãƒ¼ãƒãƒ³ãƒˆã«ä¾å˜ã—ã¾ã™ã€‚ +よãã‚ã‹ã‚‰ãªã‘ã‚Œã°ã€ä½¿ã£ã¦ã„るコンãƒãƒ¼ãƒãƒ³ãƒˆã®ãƒ‰ã‚ュメントをèªã¿ã€ +ãƒãƒ¼ãƒ‰ã™ã¹ãé †ç•ªã«ã¤ã„ã¦ä½•ã‹æ›¸ã‹ã‚Œã¦ã„ã‚‹ã‹ã‚’見ã¦ãã ã•ã„。 + +=head1 コンãƒãƒ¼ãƒãƒ³ãƒˆã‚’作る + +=begin original Making your own component is very easy. +=end original + +自分自身ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’作るã®ã¯ã¨ã¦ã‚‚ç°¡å˜ã§ã™ã€‚ + package DBIx::Class::MyComp; use base qw(DBIx::Class); # Create methods, accessors, load other components, etc. 1; +=begin original + When a component is loaded it is included in the calling class' inheritance chain using L<Class::C3>. As well as providing custom utility methods, a component may also @@ -52,6 +100,16 @@ L<DBIx::Class::Row> and others. For example, you could override the insert and delete methods. +=end original + +コンãƒãƒ¼ãƒãƒ³ãƒˆãŒãƒãƒ¼ãƒ‰ã•ã‚Œã‚‹ã¨ã€å‘¼ã³å‡ºã—ã¦ã„るクラスã®ã€ +L<Class::C3>を使ã£ãŸã€ç¶™æ‰¿ãƒã‚§ãƒ¼ãƒ³ã«å«ã¾ã‚Œã¾ã™ã€‚ +カスタムユーティリティメソッドをæä¾›ã™ã‚‹ã®ã¨åŒæ§˜ã«ã€ +コンãƒãƒ¼ãƒãƒ³ãƒˆãŒã€ä»–ã®ã‚³ã‚¢ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã§æä¾›ã•ã‚Œã¦ã„ã‚‹ +メソッドを上書ãã™ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。L<DBIx::Class::Row>ã‚„ +ãã®ä»–ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã®ã‚ˆã†ã«ã€‚ +例ãˆã°ã€insert 㨠delete メソッドをオーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã§ãã¾ã™ã€‚ + sub insert { my $self = shift; # Do stuff with $self, like set default values. @@ -64,6 +122,8 @@ return $self->next::method( @_ ); } +=begin original + Now, the order that a component is loaded is very important. Components that are loaded first are the first ones in the inheritance stack. So, if you override insert() but the DBIx::Class::Row component is loaded first @@ -71,65 +131,200 @@ will be called first. If you are unsure as to why a given method is not being called try printing out the Class::C3 inheritance stack. +=end original + +ã“ã†ãªã‚‹ã¨ã€ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’ãƒãƒ¼ãƒ‰ã™ã‚‹é †ç•ªã¯ã¨ã¦ã‚‚é‡è¦ã§ã™ã€‚ +最åˆã«ãƒãƒ¼ãƒ‰ã•ã‚Œã‚‹ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã¯ã€ç¶™æ‰¿ã‚¹ã‚¿ãƒƒã‚¯ã®æœ€åˆã®ã‚‚ã®ã§ã™ã€‚ãã®ãŸã‚〠+insert() をオーãƒãƒ¼ãƒ©ã‚¤ãƒ‰ã—ãŸã¨ã—ã¦ã€DBIx::Class::Rowコンãƒãƒ¼ãƒãƒ³ãƒˆãŒæœ€åˆã« +ãƒãƒ¼ãƒ‰ã•ã‚Œã‚‹ã¨ã€è‡ªåˆ†ã®insert()ã¯ã€æ±ºã—ã¦å‘¼ã°ã‚Œã¾ã›ã‚“。DBIx::Class::Row insert() +ãŒæœ€åˆã«å‘¼ã°ã‚Œã¦ã—ã¾ã„ã¾ã™ã€‚ã‚ãŸãˆãŸãƒ¡ã‚½ãƒƒãƒ‰ãŒå‘¼ã°ã‚Œãªã„ã‹ã‚ˆãã‚ã‹ã‚‰ãªã‘ã‚Œã°ã€ +Class::C3 ã®ç¶™æ‰¿ã‚¹ã‚¿ãƒƒã‚¯ã‚’出力ã—ã¦ã¿ã¦ãã ã•ã„。 + print join ', ' => Class::C3::calculateMRO('YourClass::Name'); +=begin original + Check out the L<Class::C3> docs for more information about inheritance. -=head1 EXISTING COMPONENTS +=end original + +継承ã«ã¤ã„ã¦ã‚ˆã‚Šè©³ã—ãã¯ã€L<Class::C3>ã®ãƒ‰ã‚ュメントをãƒã‚§ãƒƒã‚¯ã—ã¦ãã ã•ã„。 -=head2 Extra +=head1 å˜åœ¨ã™ã‚‹ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆ + +=head2 ä»˜åŠ çš„ãªã‚‚ã® + +=begin original These components provide extra functionality beyond basic functionality that you can't live without. +=end original + +下記ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã¯åŸºæœ¬çš„ãªæ©Ÿèƒ½ã‚’越ãˆãŸã€ +ã“れ無ã—ã§ã¯ç”Ÿãã¦ã„ã‘ãªã„よã†ãªã€ä»˜åŠ çš„ãªæ©Ÿèƒ½ã‚’æä¾›ã—ã¾ã™ã€‚ + +=begin original + L<DBIx::Class::CDBICompat> - Class::DBI Compatibility layer. +=end original + +L<DBIx::Class::CDBICompat> - Class::DBI 互æ›ãƒ¬ã‚¤ãƒ¤ã€‚ + +=begin original + L<DBIx::Class::FormTools> - Build forms with multiple interconnected objects. +=end original + +L<DBIx::Class::FormTools> - 複数ã®é–¢é€£ã™ã‚‹ã‚ªãƒ–ジェクトã§ãƒ•ã‚©ãƒ¼ãƒ を作る。 + +=begin original + L<DBIx::Class::HTMLWidget> - Like FromForm but with DBIx::Class and HTML::Widget. +=end original + +L<DBIx::Class::HTMLWidget> - FromFormã¨ä¼¼ã¦ã„ã¾ã™ãŒã€DBIx::Class ã¨HTML::Widget。 + +=begin original + L<DBIx::Class::Ordered> - Modify the position of objects in an ordered list. +=end original + +L<DBIx::Class::Ordered> - 整列ã•ã‚ŒãŸãƒªã‚¹ãƒˆå†…ã®ã‚ªãƒ–ジェクトã®ä½ç½®ã‚’ä¿®æ£ã™ã‚‹ã€‚ + +=begin original + L<DBIx::Class::PK::Auto> - Retrieve automatically created primary keys upon insert. +=end original + +L<DBIx::Class::PK::Auto> - insert ã§ã€è‡ªå‹•çš„ã«ä½œã‚‰ã‚ŒãŸãƒ—ライマリã‚ーをå–å¾—ã™ã‚‹ã€‚ + +=begin original + L<DBIx::Class::QueriesTime> - Display the amount of time it takes to run queries. +=end original + +L<DBIx::Class::QueriesTime> - クエリを実行ã™ã‚‹ã®ã«ã‹ã‹ã£ãŸæ™‚間を表示ã™ã‚‹ã€‚ + +=begin original + L<DBIx::Class::RandomStringColumns> - Declare virtual columns that return random strings. +=end original + +L<DBIx::Class::RandomStringColumns> - ランダムãªæ–‡å—列を返ã™ä»®æƒ³ã‚«ãƒ©ãƒ を宣言ã™ã‚‹ã€‚ + L<DBIx::Class::UUIDColumns> - Implicit UUID columns. +=begin original + L<DBIx::Class::WebForm> - CRUD methods. -=head2 Experimental +=end original + +L<DBIx::Class::WebForm> - CRUD メソッド。 + +=head2 実験的 These components are under development, their interfaces may change, they may not work, etc. So, use them if you want, but be warned. +下記ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã¯é–‹ç™ºä¸ã§ã™ã€‚インターフェースã¯ä»£ã‚ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“ã—〠+å‹•ã‹ãªã‹ã£ãŸã‚Šã™ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。ãŠæœ›ã¿ãªã‚‰ä½¿ã£ã¦ãã ã•ã„〠+ãŸã ã—ã€æ³¨æ„ã—ã¦ãã ã•ã„。 + +=begin original + L<DBIx::Class::Validation> - Validate all data before submitting to your database. -=head2 Core +=end original + +L<DBIx::Class::Validation> - データベースã«å…¥ã‚Œã‚‹å‰ã«å…¨ã¦ã®ãƒ‡ãƒ¼ã‚¿ãŒæ£ã—ã„ã‹ç¢ºèªã™ã‚‹ã€‚ + +=head2 コア + +=begin original These are the components that all, or nearly all, people will use without even knowing it. These components provide most of DBIx::Class' functionality. +=end original + +下記ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã¯å…¨ã¦ã®ã€ã»ã¨ã‚“ã©å…¨ã¦ã®ã€äººãŒãれを知らãªãã¦ã‚‚使ã†ã§ã—ょã†ã€‚ +下記ã®ã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã¯DBIx::Classã®æ©Ÿèƒ½ã®ã»ã¨ã‚“ã©ã‚’æä¾›ã—ã¾ã™ã€‚ + +=begin original + L<DBIx::Class::Core> - Loads various components that "most people" would want. +=end original + +L<DBIx::Class::Core> - "ã»ã¨ã‚“ã©ã®äºº"ãŒæ¬²ã—ã„様々ãªã‚³ãƒ³ãƒãƒ¼ãƒãƒ³ãƒˆã‚’ãƒãƒ¼ãƒ‰ã—ã¾ã™ã€‚ + +=begin original + L<DBIx::Class::AccessorGroup> - Lets you build groups of accessors. +=end original + +L<DBIx::Class::AccessorGroup> - アクセサã®ã‚°ãƒ«ãƒ¼ã‚’作りã¾ã™ã€‚ + +=begin original + L<DBIx::Class::DB> - Non-recommended classdata schema component. +=end original + +L<DBIx::Class::DB> - éžæŽ¨å¥¨ã®ã‚¯ãƒ©ã‚¹ãƒ‡ãƒ¼ã‚¿ã‚¹ã‚ーマコンãƒãƒ¼ãƒãƒ³ãƒˆã€‚ + +=begin original + L<DBIx::Class::InflateColumn> - Automatically create objects from column data. +=end original + +L<DBIx::Class::InflateColumn> - カラムデータã‹ã‚‰è‡ªå‹•çš„ã«ã‚ªãƒ–ジェクトを作る。 + +=begin original + L<DBIx::Class::PK> - This class contains methods for handling primary keys and methods depending on them. +=end original + +L<DBIx::Class::PK> - ã“ã®ã‚¯ãƒ©ã‚¹ã¯ãƒ—ライマリã‚ーを扱ã†ãƒ¡ã‚½ãƒƒãƒ‰ã¨ãã‚Œã«ä¾å˜ã™ã‚‹ãƒ¡ã‚½ãƒƒãƒ‰ã‚’å«ã¿ã¾ã™ã€‚ + +=begin original + L<DBIx::Class::Relationship> - Inter-table relationships. +=end original + +L<DBIx::Class::Relationship> - テーブル間ã®ãƒªãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã‚·ãƒƒãƒ—。 + +=begin original + L<DBIx::Class::ResultSourceProxy::Table> - Provides a classdata table object and method proxies. +=end original + +L<DBIx::Class::ResultSourceProxy::Table> - クラスデータテーブルオブジェクトã¨ãƒ¡ã‚½ãƒƒãƒ‰ãƒ—ãƒã‚ã‚·ã‚’æä¾›ã—ã¾ã™ã€‚ + +=begin original + L<DBIx::Class::Row> - Basic row methods. +=end original + +L<DBIx::Class::Row> - 基本的ãªåˆ—ã®ãƒ¡ã‚½ãƒƒãƒ‰ã€‚ + =head1 SEE ALSO L<DBIx::Class::Manual::Cookbook> @@ -137,3 +332,18 @@ =head1 AUTHOR Aran Clary Deltac <bluef****@cpan*****> + + +=head1 翻訳ã«ã¤ã„㦠+ +ç¿»è¨³è€…ï¼šåŠ è—¤æ•¦ (ktat.****@gmail*****) + +Perlドã‚ュメント日本語訳 Project ã«ã¦ã€ +Perlモジュールã€ãƒ‰ã‚ュメントã®ç¿»è¨³ã‚’è¡Œã£ã¦ãŠã‚Šã¾ã™ã€‚ + + http://perldocjp.sourceforge.jp/ + http://sourceforge.jp/projects/perldocjp/ + http://www.freeml.com/perldocjp/ + http://www.perldoc.jp + +=cut