prismo-smartpro/datalayer
最新稳定版本:2.9
Composer 安装命令:
composer require prismo-smartpro/datalayer
包简介
PDO Datalayer Abstract
README 文档
README
INSTALAÇÃO
run
composer require prismo-smartpro/datalayer
MYSQL CONNECT
<?php const MYSQL = [ "host" => "", "username" => "", "password" => "", "db" => "" ];
DOCUMENTAÇÃO
PHP Class
<?php namespace SmartPRO\Technology; class Settings extends DataLayer { public function __construct() { parent::__construct("settings", "id", $required = [], $unique = [], true); } }
Usage examples
<?php require "Mysql_Config.php"; require "vendor/autoload.php"; use SmartPRO\Technology\Settings; // Returns all data from the table $results = (new Settings())->fetchAll(); // Returns data starting from a specific id $byId = (new Settings())->findById(17); // Edit the data that returns and saves the data if (!empty($byId)) { $byId->empresa = "My Business"; $byId->save(); } // Deletes the returned query from the database if (!empty($byId)) { $byId->destroy(); } // Makes a search query using the LIKE parameter $search = (new Settings())->search("empresa like :empresa", ":empresa=My Business"); // Query with custom data $results = (new Settings())->find("empresa = :empresa", ":empresa=My Business", "*") ->limite(5) ->order("id DESC") ->gruopBy("site") ->offset(0) ->fetch(true); foreach ($results as $result){ //... }
PERSONALIZED
<?php namespace SmartPRO\Technology; class Settings extends DataLayer { public function __construct() { parent::__construct("settings", "id", $required = [], $unique = [], true); } public function fidByEmail($email){ return $this->find("email = :email", ":email={$email}")->fetch(); } }
统计信息
- 总下载量: 77
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2022-11-27