Catalyst::Model::LDAP::Entry man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Catalyst::Model::LDAP:UserrContributed Perl DocCatalyst::Model::LDAP::Entry(3)

NAME
       Catalyst::Model::LDAP::Entry - Convenience methods for Net::LDAP::Entry

SYNOPSIS
	   # In your controller
	   my $mesg = $c->model('Person')->search('(cn=Lou Rhodes)');
	   my $entry = $mesg->shift_entry;
	   print $entry->title;

DESCRIPTION
       This module simplifies use of Net::LDAP::Entry objects in your
       application.  It makes accessors and mutators for all attributes on an
       entry.  For example:

	   print $entry->cn;

       It also stores a reference to the parent LDAP connection, simplifying
       updates to the entry:

	   $entry->title('Folk singer');
	   $entry->update;

ADDING ENTRY METHODS
       If you want to provide your own methods on an LDAP entry, you can use
       the "entry_class" configuration variable.  For example:

	   # In lib/MyApp/Model/LDAP.pm
	   package MyApp::Model::LDAP;
	   use base qw/Catalyst::Model::LDAP/;

	   __PACKAGE__->config(
	       # ...
	       entry_class => 'MyApp::LDAP::Entry',
	   );

	   1;

	   # In lib/MyApp/LDAP/Entry.pm
	   package MyApp::LDAP::Entry;
	   use base qw/Catalyst::Model::LDAP::Entry/;
	   use DateTime::Format::Strptime;

	   sub get_date {
	       my ($self, $attribute) = @_;

	       my ($datetime) = ($self->get_value($attribute) =~ /^(\d{14})/);

	       my $parser = DateTime::Format::Strptime->new(
		   pattern     => '%Y%m%d%H%M%S',
		   locale      => 'en_US',
		   time_zone   => 'UTC'
	       );

	       return $parser->parse_datetime($datetime);
	   }

	   1;

METHODS
   new
       Override the Net::LDAP::Entry object constructor to take an optional
       LDAP handle.  If provided this will be used automatically on "update".

   update
       Override "update" to default to the optional LDAP handle provided to
       the constructor.

   can
       Override "can" to declare existence of the LDAP entry attribute methods
       from "AUTOLOAD".

SEE ALSO
       ·   Catalyst::Model::LDAP

       ·   Catalyst::Model::LDAP::Search

AUTHORS
       ·   Marcus Ramberg

LICENSE
       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.14.1			  2008-02-19   Catalyst::Model::LDAP::Entry(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net