PHP Classes

File: examples/blog/app/blog/models/categoriesModel.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/blog/app/blog/models/categoriesModel.php   Download  
File: examples/blog/app/blog/models/categoriesModel.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 507 bytes
 

Contents

Class file image Download
<?php

class categoriesModel extends A_Model {
   
    protected
$dbh = null;
   
    public function
__construct($db){
       
$this->dbh = $db;
       
$this->addField(new A_Model_Field('id'));
       
$this->addField(new A_Model_Field('name'));
       
$this->addField(new A_Model_Field('parent'));
    }
   
    public function
save(){
       
// if doesn't exist yet create
       
if(!$this->get('id')){
           
// insert new
       
} else {
           
// update
       
}
    }
   
    public function
find($id){}
    public function
findBy($someArgs){}
    public function
delete($id){}
   
}