Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
SPOPS::Tool::ReadOnly(User Contributed Perl DocumentatSPOPS::Tool::ReadOnly(3)

NAME
       SPOPS::Tool::ReadOnly - Make a particular object	read-only

SYNOPSIS
	# Load information with	read-only rule

	my $spops = {
	   class	       => 'This::Class',
	   isa		       => [ 'SPOPS::DBI' ],
	   field	       => [ 'email', 'language', 'country' ],
	   id_field	       => 'email',
	   base_table	       => 'test_table',
	   rules_from	       => [ 'SPOPS::Tool::ReadOnly' ],
	};
	SPOPS::Initialize->process({ config => { test => $spops	} });

	# Fetch	an object, modify it...
	my $object = This::Class->fetch( 45 );
	$object->{foo} = "modification";

	# Trying to save the object throws an error:
	# "This::Class is read-only; no	changes	allowed"
	eval { $object->save };

DESCRIPTION
       This is a simple	rule to	ensure that "save()" and "remove()" calls to a
       particular class	do not actually	do any work. Instead they just result
       in a warning that the class is read-only.

METHODS
       behavior_factory()

       Installs	the behavior during the	class generation process.

       generate_persistence_methods()

       Generates "save()" and "remove()" methods that just throw exceptions.

BUGS
       None known.

TO DO
       Nothing known.

SEE ALSO
       SPOPS::Manual::ObjectRules

       SPOPS::ClassFactory

COPYRIGHT
       Copyright (c) 2001-2004 intes.net, inc..	All rights reserved.

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

AUTHORS
       Chris Winters <chris@cwinters.com>

perl v5.32.0			  2004-06-02	      SPOPS::Tool::ReadOnly(3)

NAME | SYNOPSIS | DESCRIPTION | METHODS | BUGS | TO DO | SEE ALSO | COPYRIGHT | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=SPOPS::Tool::ReadOnly&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help