内核函数
mage_core_model_abstract
mage_core_model_mysql4_abstract
mage_core_model_mysql4_collection_abstract
使用mage::getmodel(core/abstract)的时候会指定$this->_resourceName和$this->_resourceCollectionName。
对于使用,已经做好文档,
下面这些是介绍上面三个系统类功能:
1.
mage_core_model_abstract
extends Varien_Object
1.1
//Set resource names
function _setResourceModel
1.2
//Get resource instance @return Mage_Core_Model_Mysql4_Abstract
public function _getResource()
1.3
//Retrieve identifier field name for model @return string
public function getIdFieldName()
1.4
//Retrieve model object identifier @return mixed
public function getId()
1.5
//Declare model object identifier value @return Mage_Core_Model_Abstract
public function setId($id)
1.6
//Retrieve model resource name @return string
public function getResourceName()
1.7
//Get collection instance @return object
public function getResourceCollection()
1.8
//
public function getCollection() ---->return $this->getResourceCollection();
1.9
// * Load object data @return Mage_Core_Model_Abstract
public function load($id, $field=null)
1.10
//Save object data @return Mage_Core_Model_Abstract
public function save()
1.11
//Remove model onject related cache @return Mage_Core_Model_Abstract
public function cleanModelCache()
1.12
//Delete object from database @return Mage_Core_Model_Abstract
public function delete()
1.13
public function getResource()
{
return $this->_getResource();
}
故:mage_core_model_abstract
1.1
只能处理一些简单的关于数据库的操作。
在操作的时候,数据保存在自身的变量里面,只能进行save,delete,load等这些简单的操作。
1.2
得到mage_core_model_mysql4_abstract
mage_core_model_mysql4_collection_abstract的实例化对象。
1.3
得到id方面的函数
1.4
内存方面的函数
1.5
before,after,地球人都知道。
总体来说,作为一个入口,又能做一些简单的操作
2
mage_core_model_mysql4_abstract
extends Mage_Core_Model_Resource_Abstract
2.1
初始化
//
protected function _init($mainTable, $idFieldName)
{
$this->_setMainTable($mainTable, $idFieldName);
}
2.1
//* Initialize connections and tables for this resource model
protected function _setResource($connections, $tables=null)
2.2
//Set main entity table name and primary key field name @return Mage_Core_Model_Mysql4_Abstract
protected function _setMainTable($mainTable, $idFieldName=null)
2.3
//Get primary key field name
public function getIdFieldName()
2.4
//* Get main table name
public function getMainTable()
2.5
// * Get table name for the entity
public function getTable($entityName)
2.6
//Retrieve table name for the entity separated value
public function getValueTable($entityName, $valueType)
2.7
//* Get connection by name or type
protected function _getConnection($connectionName)
2.8
// * Retrieve connection for read data @return Zend_Db_Adapter_Abstract
protected function _getReadAdapter()
2.9
//* Retrieve connection for read data @return Varien_Db_Adapter_Pdo_Mysql
protected function _getReadAdapter()
2.10
Retrieve connection for write data @return Varien_Db_Adapter_Pdo_Mysql
protected function _getWriteAdapter()
2.11
//Temporary resolving collection compatibility
@return Varien_Db_Adapter_Pdo_Mysql
public function getReadConnection()
2.12
//* Load an object @return Mage_Core_Model_Mysql4_Abstract
public function load(Mage_Core_Model_Abstract $object, $value, $field=null)
2.13
//Retrieve select object for load object data @return Zend_Db_Select
protected function _getLoadSelect($field, $value, $object)
2.14
// * Save object object data
@param Mage_Core_Model_Abstract $object
@return Mage_Core_Model_Mysql4_Abstract
public function save(Mage_Core_Model_Abstract $object)
2.15
//Delete the object
@param Varien_Object $object
@return Mage_Core_Model_Mysql4_Abstract
public function delete(Mage_Core_Model_Abstract $object)
2.16
// * Add unique field restriction
public function addUniqueField($field)
2.17
//* Unserialize serializeable object fields
public function unserializeFields(Mage_Core_Model_Abstract $object)
2.18
// Serialize serializeable fields of the object
protected function _serializeFields(Mage_Core_Model_Abstract $object)
2.19
2.1
字段序列化
2.2
唯一字段值的一系列操作
2.3
表,id,资源的初始化,以及操作
2.4
读写适配器的得到
2.5
对Mage_Core_Model_Abstract $object的save,delete快速操作。
Mage_Core_Model_mysql4_Abstract是数据操作的前序工作的实现,比如得到connection,readAdapter,table等的得到。
3
mage_core_model_mysql4_collection_abstract
3.1
//* Get Zend_Db_Select instance and applies fields to select if needed @return Varien_Db_Select
public function getSelect()
3.2
//Retrieve initial fields to select like id field
@return array
protected function _getInitialFieldsToSelect()
3.3
protected function _initInitialFieldsToSelect()
3.4
public function addFieldToSelect($field, $alias = null)
3.5
public function removeFieldFromSelect($field, $isAlias = false)
3.6
//* @return Mage_Core_Model_Mysql4_Collection_Abstract
public function removeAllFieldsFromSelect()
3.7
Get resource instance
@return Mage_Core_Model_Mysql4_Abstract
public function getResource()
3.8
public function getTable($table)
3.9
//Retrive all ids for collection
@return array
public function getAllIds()
3.10
public function join($table, $cond, $cols='*')
3.11
public function save()
3.1
内存方面的操作
3.2
分享到:
相关推荐
4: 4_Class-Singleton 5: 5_DateTime-TimeZone 6: 6_DateTime-Locale 7: 7_DateTime 8: 8_AppConfig 9: 9_Template-Toolkit 10: 10_Email-Address 11: 11_Email-Simple 12: 12_Return-Value 13: 13_Email-Send 14: ...
Abstract This is the MySQL™ Reference Manual. It documents MySQL 5.6 through 5.6.15, as well as MySQL Cluster releases based on version 7.3 of NDBCLUSTER through 5.6.11-ndb-7.3.3. MySQL 5.6 ...
Abstract This is the MySQL Cluster NDB 7.5 extract from the MySQL 5.7 Reference Manual. For legal information, see the Legal Notices. For help with using MySQL, please visit the MySQL Forums, where ...
这个是mysql8.0的官方文档,非常全面,包含目录跳转,英文原版。
ABSTRACT 3 第一章 概述. 1 1.1 推荐系统开发背景. 1 1.2 开发目标. 2 1.3 本章小结. 3 第二章 推荐系统的开发分析. 3 2.1 推荐系统的定义. 3 2.2 推荐系统的体系结构. 4 2.3 推荐系统的评价. 4 2.4 ...
Abstract II 1 前言 3 1.1 课题背景及意义 3 1.2 课题研究内容 3 1.3 系统的设计思路 3 1.4 系统的研究方法 4 2 开发技术简介 5 2.1 SSM框架 5 2.2 B/S架构介绍 5 2.3 Mysql数据库 5 2.4 Eclipse工具 6 3 ...
1.7 MySQL数据库 4 2 系统需求设计 5 2.1 系统需求 5 2.2 可行性分析 5 2.3数据流程分析 5 3 系统设计 7 3.1系统结构设计 7 3.2 数据库设计 8 3.1.1 数据库实体 8 3.1.2 数据库表设计 9 4 系统的实现 11 4.1 登录...
Abstract IV 绪 论. 1 1.1毕业设计主要任务. 1 1.2目前图书管理系统存在的问题. 1 1.3课题意义. 1 1.4论文的工作和安排. 2 2.图书借阅管理需求分析. 3 2.1 可行性分析. 3 2.1.1.技术可行性. 3 2.1.2.经济可行性. 3 ...
Abstract 3 1 绪论 1 1.课题背景 1 2.目的和意义 1 2系统开发环境 3 2.1bs体系结构 3 2.2 jsp语言 3 2.3 mysql数据库 3 2.4运行环境 4 3 系统分析 5 3.1 可行性分析 5 3.1.1 技术可行性 5 3.1.2操作可行性 5 3.1.3 ...
本毕业设计的内容是设计并且实现一个基于web技术的毕业生就业信息管理系统,故而系统主要以j2EE作为开发基础,主要使用了struts2+spring+hibernate等多种框架的结合使用,用myeclipse作为开发工具,以MYSQL作为数据库...
本系统前台主要使用JSP作为开发语言,后台使用MySql作为数据库管理系统,开发环境是MyEclipse,服务器采用tomcat,开发出的一个B/S结构的教师工资管理系统。 关键词:教师;JSP;B/S结构 Teacher salary ...
Abstract III 绪论 1 1 需求分析 1 1.1实际背景 1 现行系统目前仍然是人工手动计算,整理,查询医院门诊,药房,病房等各项工作,执行效率非常低,不方便,给医务人员带来了不少麻烦。 1 1.2系统的功能需求和性能需求 1 ...
Abstract II 引言 6 1绪论 7 1.1研究背景 7 1.2研究意义 7 1.3 国内外研究现状 8 1.3.1 国内研究现状 8 1.3.2 国外研究现状 8 2相关理论阐述 8 2.1开发工具及技术 8 2.1.1MySQL数据库简介 8 2.1.2 B/S体系结构 9 ...
Abstract This is the MySQL™ Reference Manual. It documents MySQL 5.6 through 5.6.42, as well as NDB Cluster releases based on versions 7.3 and 7.4 of NDB through 5.6.41-ndb-7.3.23 and 5.6.41-ndb-7.4...
Abstract II 前 言 1 1 网站分析 1 1.1 总体需求 1 1.2 功能需求 2 1.3 相关支持 2 1.3.1硬件设备 2 1.3.2支撑技术 2 2 系统总体设计 3 2.1 模型设计 3 2.2 功能设计简介 3 3 相关技术 5 3.1 项目框架技术 5 3.2 三...
MysqlpdoSystem_Mysqlpdo类封装了pdo_mysql的操作接口::bind::bindmore::query::lastInsertId::column::row::singleSystem_LogSystem_Log类封装了日志处理类System_SortSystem_Sort类封装了一些经典得排序算法::...
Mysql Abstract With the rapid development of network information, computers gradually attract people's attention, and network media are also favored by more and more companies. Among them, websites ...
Abstract This is the MySQL™ Reference Manual. It documents MySQL 8.0 through 8.0.13. It may include documentation of features of MySQL versions that have not yet been released. For information about ...
Abstract This is the MySQL™ Reference Manual. It documents MySQL 5.6 through 5.6.42, as well as NDB Cluster releases based on versions 7.3 and 7.4 of NDB through 5.6.41-ndb-7.3.23 and 5.6.41-ndb-7.4...