Download the PHP package devweyes/db-orm without Composer

On this page you can find all versions of the php package devweyes/db-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db-orm

ORM 模型关联

1.简介

2.定义关联

2.1.一对一

2.2.一对多

2.3.一对多(反向)

2.4.多对多

3.查询关联

3.1.存在关联

3.2.筛选关联

4.预加载

4.1.普通预加载

4.2.延迟预加载

5.插入 & 更新关联模型

5.1.save 方法

5.3.create 方法

5.3.更新 Belongs To 关联

5.4.多对多关联

1.简介

数据库表通常相互关联。例如,一篇博客文章可能有很多评论,或者一个订单对应一个下单用户。 ORM 让这些关联的管理和使用变得简单,并支持多种类型的关联

1.1 composer

1.2 实体需继承 Model

2 定义关联

一般只需定义两个注解,及Getter Setter。 @RelationPassive() 为切面注解,如需预加载,必不可缺。

2.1 一对一hasOne

字段 是否必填 描述
entity 目标实体
foreign 目标关联字段(xxx_id获取 xxx表示本实体转蛇形)
owner 本字段(keyName主键获取)
#### 2.2 一对多hasMany
字段 是否必填 描述
entity 目标实体
foreign 目标关联字段(xxx_id获取 xxx表示本实体转蛇形)
owner 本字段(keyName主键获取)
#### 2.3 一对多(反向)belongsTo
字段 是否必填 描述
entity 目标实体
owner 本表字段(xxx_id获取 xxx表示关系名,id表示目标主键)
foreign 目标表字段(keyName主键获取)
#### 2.4 多对多belongsToMany
字段 是否必填 描述
entity 目标实体
pointEntity 中间实体
foreignPivot 中间实体关联本字段的字段(xxx_id获取)
ownerPivot 中间实体关联目标字段的字段(xxx_id获取)
foreign 目标关联字段(id获取)
owner 本字段(id获取)
### 3.查询关联 #### 3.1 存在关联 当通过模型获取数据时,你可能希望限制在一个已存在的关系上。比如说,你想要获取至少包含一条评论的博客文章。你就应该这样做,使用针对关联关系的 has and orHas 方法: #### 3.2 筛选关联 如果你想要做更多特性,你还可以使用 whereHas 和 orWhereHas 方法,在方法中,你可以指定 「where」 条件在你的 has 语句之中。这些方法允许你在关联查询之中添加自定义的条件约束,比如检查评论的内容: ### 4.预加载 #### 4.1 普通预加载 #### 4.2 延迟预加载 有可能你还希望在模型加载完成后在进行预加载。举例来说,如果你想要动态的加载关联数据,那么 load 方法对你来说会非常有用:

All versions of db-orm with dependencies

PHP Build Version
Package Version
Requires php Version >7.1
swoft/framework Version ~2.0.0
swoft/db Version ~2.0.0
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command

The package devweyes/db-orm contains the following files

Loading the files please wait ....

© 2017 - 2025 Weber Informatics LLC