X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FComponent.pod;fp=lib%2FDBIx%2FClass%2FManual%2FComponent.pod;h=2a762f83edb46a2a489955f23e7882455ce52a9e;hb=d88ecca6486a2b1c4b6e2f0440165b186aab39bc;hp=b8da6f7b8e749ffa73343b21ce14510069204bf3;hpb=237e9af389b2342587971cb8be5d56fb2bc4c355;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Component.pod b/lib/DBIx/Class/Manual/Component.pod index b8da6f7..2a762f8 100644 --- a/lib/DBIx/Class/Manual/Component.pod +++ b/lib/DBIx/Class/Manual/Component.pod @@ -12,31 +12,29 @@ itself creates, after the insert has happened. =head1 USING -Components are loaded using the load_components() method within your +Components are loaded using the load_components() method within your DBIx::Class classes. package My::Thing; - use base qw( DBIx::Class ); - __PACKAGE__->load_components(qw/ PK::Auto Core /); + use base qw( DBIx::Class::Core ); + __PACKAGE__->load_components(qw/InflateColumn::DateTime TimeStamp/); -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 +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 +. __PACKAGE__->load_components(qw/ +My::Component /); -Once a component is loaded all of it's methods, or otherwise, +Once a component is loaded all of it's methods, or otherwise, that it provides will be available in your class. -The order in which is you load the components may be -very important, depending on the component. The general -rule of thumb is to first load extra components and then -load core ones last. 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. +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 @@ -47,11 +45,11 @@ Making your own component is very easy. # Create methods, accessors, load other components, etc. 1; -When a component is loaded it is included in the calling -class' inheritance chain using L. As well as -providing custom utility methods, a component may also -override methods provided by other core components, like -L and others. For example, you +When a component is loaded it is included in the calling +class' inheritance chain using L. As well as +providing custom utility methods, a component may also +override methods provided by other core components, like +L and others. For example, you could override the insert and delete methods. sub insert { @@ -108,22 +106,22 @@ L - CRUD methods. =head2 Experimental -These components are under development, there interfaces may -change, they may not work, etc. So, use them if you want, but +These components are under development, there interfaces may +change, they may not work, etc. So, use them if you want, but be warned. L - Validate all data before submitting to your database. =head2 Core -These are the components that all, or nearly all, people will use -without even knowing it. These components provide most of +These are the components that all, or nearly all, people will use +without even knowing it. These components provide most of DBIx::Class' functionality. -L - Lets you build groups of accessors. - L - Loads various components that "most people" would want. +L - Lets you build groups of accessors. + L - Non-recommended classdata schema component. L - Automatically create objects from column data.