1 package FS::queue_depend;
2 use base qw(FS::Record);
8 FS::queue_depend - Object methods for queue_depend records
14 $record = new FS::queue_depend \%hash;
15 $record = new FS::queue_depend { 'column' => 'value' };
17 $error = $record->insert;
19 $error = $new_record->replace($old_record);
21 $error = $record->delete;
23 $error = $record->check;
27 An FS::queue_depend object represents an job dependancy. FS::queue_depend
28 inherits from FS::Record. The following fields are currently supported:
32 =item dependnum - primary key
34 =item jobnum - source jobnum (see L<FS::queue>).
36 =item depend_jobnum - dependancy jobnum (see L<FS::queue>)
40 The job specified by B<jobnum> depends on the job specified B<depend_jobnum> -
41 the B<jobnum> job will not be run until the B<depend_jobnum> job has completed
42 successfully (or manually removed).
50 Creates a new dependancy. To add the dependancy to the database, see
53 Note that this stores the hash reference, not a distinct copy of the hash it
54 points to. You can ask the object for a copy with the I<hash> method.
58 # the new method can be inherited from FS::Record, if a table method is defined
60 sub table { 'queue_depend'; }
64 Adds this record to the database. If there is an error, returns the error,
65 otherwise returns false.
69 # the insert method can be inherited from FS::Record
73 Delete this record from the database.
77 # the delete method can be inherited from FS::Record
79 =item replace OLD_RECORD
81 Replaces the OLD_RECORD with this one in the database. If there is an error,
82 returns the error, otherwise returns false.
86 # the replace method can be inherited from FS::Record
90 Checks all fields to make sure this is a valid dependancy. If there is
91 an error, returns the error, otherwise returns false. Called by the insert
99 $self->ut_numbern('dependnum')
100 || $self->ut_foreign_key('jobnum', 'queue', 'jobnum')
101 || $self->ut_foreign_key('depend_jobnum', 'queue', 'jobnum')
102 || $self->SUPER::check
112 L<FS::queue>, L<FS::Record>, schema.html from the base documentation.