The ENCY model is responsible for handling data related to the ENCY controller. It includes several methods, each of which performs a specific task.
The 'get_reference_by_id' method is responsible for fetching a reference by its id. It takes an id as an argument, fetches the corresponding reference from the database, and returns the reference.
The 'create_reference' method is responsible for creating a new reference. It takes the necessary data as arguments, creates a new reference in the database, and returns the new reference.
The 'get_category_by_id' method is responsible for fetching a category by its id. It takes an id as an argument, fetches the corresponding category from the database, and returns the category.
The 'create_category' method is responsible for creating a new category. It takes the necessary data as arguments, creates a new category in the database, and returns the new category.
Each of these methods is used by the ENCY controller to perform its tasks. The ENCY model is defined in the 'Comserv::Model::ENCY' package, which is located in the 'lib/Comserv/Model' directory.
package Comserv::Model::Schema::Forager::Result::Herb;
use strict;
use warnings;
use base 'DBIx::Class::Core';
__PACKAGE__->load_components('InflateColumn::DateTime', 'TimeStamp', 'EncodedColumn');
__PACKAGE__->table('ency_herb_tb');
__PACKAGE__->add_columns(
'therapeutic_action',
'record_id',
'apis',
'botanical_name',
'common_names',
'key_name',
'parts_used',
'comments',
'medical_uses',
'homiopathic',
'ident_character',
'image',
'stem',
'nectar',
'pollinator',
'pollen',
'leaves',
'flowers',
'fruit',
'taste',
'odour',
'distribution',
'url',
'root',
'constituents',
'solvents',
'chinese',
'culinary',
'contra_indications',
'dosage',
'administration',
'formulas',
'vetrinary',
'cultivation',
'sister_plants',
'harvest',
'non_med',
'history',
'reference',
'username_of_poster',
'group_of_poster',
'date_time_posted',
'share' => { data_type => 'integer', default_value => 0, is_nullable => 0 },
'should_display' => { data_type => 'integer', default_value => 0, is_nullable => 0 },
'preperation' => { data_type => 'varchar', size => 150, is_nullable => 0 },
'pollennotes' => { data_type => 'text', is_nullable => 0 },
'nectarnotes' => { data_type => 'text', is_nullable => 0 },
'apis' => { data_type => 'varchar', size => 100, is_nullable => 0 },
);
__PACKAGE__->set_primary_key('record_id');
1;