1 package FS::queue_depend;
5 use FS::Record qw( qsearch qsearchs );
12 FS::queue_depend - Object methods for queue_depend records
18 $record = new FS::queue_depend \%hash;
19 $record = new FS::queue_depend { 'column' => 'value' };
21 $error = $record->insert;
23 $error = $new_record->replace($old_record);
25 $error = $record->delete;
27 $error = $record->check;
31 An FS::queue_depend object represents an job dependancy. FS::queue_depend
32 inherits from FS::Record. The following fields are currently supported:
36 =item dependnum - primary key
38 =item jobnum - source jobnum (see L<FS::queue>).
40 =item depend_jobnum - dependancy jobnum (see L<FS::queue>)
44 The job specified by B<jobnum> depends on the job specified B<depend_jobnum> -
45 the B<jobnum> job will not be run until the B<depend_jobnum> job has completed
46 successfully (or manually removed).
54 Creates a new dependancy. To add the dependancy to the database, see
57 Note that this stores the hash reference, not a distinct copy of the hash it
58 points to. You can ask the object for a copy with the I<hash> method.
62 # the new method can be inherited from FS::Record, if a table method is defined
64 sub table { 'queue_depend'; }
68 Adds this record to the database. If there is an error, returns the error,
69 otherwise returns false.
73 # the insert method can be inherited from FS::Record
77 Delete this record from the database.
81 # the delete method can be inherited from FS::Record
83 =item replace OLD_RECORD
85 Replaces the OLD_RECORD with this one in the database. If there is an error,
86 returns the error, otherwise returns false.
90 # the replace method can be inherited from FS::Record
94 Checks all fields to make sure this is a valid dependancy. If there is
95 an error, returns the error, otherwise returns false. Called by the insert
103 $self->ut_numbern('dependnum')
104 || $self->ut_foreign_key('jobnum', 'queue', 'jobnum')
105 || $self->ut_foreign_key('depend_jobnum', 'queue', 'jobnum')
106 || $self->SUPER::check
116 L<FS::queue>, L<FS::Record>, schema.html from the base documentation.