Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Class Convert To Mysql Database Table

This artifact is class properties / database tables converter and the tables provide to use

have a class like below


class Message {
    protected $Id;
    protected $Name;
}

this class is implement with IEntitiy interface for will be a database object


class Message implements IEntity {
    protected $Id;
    protected $Name;
}

Create a class to access database and dress up


class ClassNameDal extends DatabaseTableDao implements IDatabaseTableDao{

    private $Column;

    public function __construct()
    {
        $this->Column = parent::CreateTable(Container::getInstance(new Message()));
    }

     public function getMessageToId($id)
        {
            if ($id) {
                return $this->select(
                    array(
                        'Id' => $id
                    )
                );
            } else
                return false;
        }


}

Columns returned from abstract class keep to $Column variable

$this->select(array("columnName => Value")) 

like this and you can use similar methods in DatabaseTableDao.php

also you can access to MysqliDb class methods in ClassNameDdal class

we used ThingEngineer's MysqliDb class Ref: https://github.com/ThingEngineer/PHP-MySQLi-Database-Class

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages