GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DBIx::Custom::Model(3) User Contributed Perl Documentation DBIx::Custom::Model(3)

DBIx::Custom::Model - Model object

use DBIx::Custom::Model;

my $model = DBIx::Custom::Model->new(table => 'books');

  my $name = $model->name;
  $model = $model->name('book');

Model name.

  my $table = $model->table;
  $model = $model->table('book');

Table name, this is passed to "insert", "update", "update_all", "delete", "delete_all", "select" method.

  my $join = $model->join;
  $model = $model->join(
    ['left outer join company on book.company_id = company.id']
  );

Join clause, this value is passed to "select" method.

  my $dbi = $model->dbi;
  $model = $model->dbi($dbi);

DBIx::Custom object.

  my $type = $model->bind_type;
  $model = $model->bind_type(['image' => DBI::SQL_BLOB]);

Database data type, this is used as type option of "insert", "update", "update_all", "delete", "delete_all", and "select" method

  my $mtime = $model->mtime;
  $model = $model->mtime('modified_time');

Updated timestamp column, this is passed to "update" method.

  my $ctime = $model->ctime;
  $model = $model->ctime('created_time');

Create timestamp column, this is passed to "insert" or "update" method.

  my $primary_key = $model->primary_key;
  $model = $model->primary_key(['id', 'number']);

Primary key,this is passed to "insert", "update", "delete", and "select" method.

DBIx::Custom::Model inherits all methods from Object::Simple, and you can use all methods of DBIx::Custom and DBI and implements the following new ones.

  $model->delete(...);

Same as "delete" of DBIx::Custom except that you don't have to specify options if you set attribute in model.

  $model->delete_all(...);

Same as "delete_all" of DBIx::Custom except that you don't have to specify options if you set attribute in model.

  $model->insert(...);

Same as "insert" of DBIx::Custom except that you don't have to specify options if you set attribute in model.

  my $column = $self->mycolumn;
  my $column = $self->mycolumn(book => ['author', 'title']);
  my $column = $self->mycolumn(['author', 'title']);

Create column clause for myself. The following column clause is created.

  book.author as author,
  book.title as title

If table name is omitted, "table" attribute of the model is used. If column names is omitted, "columns" attribute of the model is used.

  my $model = DBIx::Custom::Model->new;

Create a DBIx::Custom::Model object.

  $model->select(...);

Same as "select" of DBIx::Custom except that you don't have to specify options if you set attribute in model.

  $model->update(...);

Same as "update" of DBIx::Custom except that you don't have to specify options if you set attribute in model.

  $model->update_all(\%param);

Same as "update_all" of DBIx::Custom except that you don't have to specify options if you set attribute in model.

2017-03-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.