本文整理汇总了PHP中MatchaModel::__getTablePrimaryKeyColumnName方法的典型用法代码示例。如果您正苦于以下问题:PHP MatchaModel::__getTablePrimaryKeyColumnName方法的具体用法?PHP MatchaModel::__getTablePrimaryKeyColumnName怎么用?PHP MatchaModel::__getTablePrimaryKeyColumnName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatchaModel
的用法示例。
在下文中一共展示了MatchaModel::__getTablePrimaryKeyColumnName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setModel
/**
* function setModel($model):
* This method will set the model array as an object within MatchaCUP scope
*
* @param $model
*
* @return bool|\MatchaCUP
*/
public function setModel($model)
{
$this->model = is_array($model) ? MatchaUtils::__arrayToObject($model) : $model;
if (isset($this->model->table)) {
if (is_string($this->model->table)) {
$this->table = $this->model->table;
} else {
$this->table = $this->model->table->name;
}
} else {
$this->table = false;
}
$this->date = new DateTime();
$this->primaryKey = MatchaModel::__getTablePrimaryKeyColumnName($this->table);
$this->fields = MatchaModel::__getFields($this->model);
$this->encryptedFields = MatchaModel::__getEncryptedFields($this->model);
$this->phantomFields = MatchaModel::__getPhantomFields($this->model);
$this->arrayFields = MatchaModel::__getArrayFields($this->model);
$this->hasMany = isset($model['hasMany']) ? $model['hasMany'] : [];
$this->hasOne = isset($model['hasOne']) ? $model['hasOne'] : [];
}