Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/lisk/LiskDAO.php
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | |||||
* = Queries = | * = Queries = | ||||
* | * | ||||
* Often, you want to load a bunch of objects, or execute a more specialized | * Often, you want to load a bunch of objects, or execute a more specialized | ||||
* query. Use @{method:loadAllWhere} or @{method:loadOneWhere} to do this: | * query. Use @{method:loadAllWhere} or @{method:loadOneWhere} to do this: | ||||
* | * | ||||
* $pugs = $dog->loadAllWhere('breed = %s', 'Pug'); | * $pugs = $dog->loadAllWhere('breed = %s', 'Pug'); | ||||
* $sawyer = $dog->loadOneWhere('name = %s', 'Sawyer'); | * $sawyer = $dog->loadOneWhere('name = %s', 'Sawyer'); | ||||
* | * | ||||
* These methods work like @{function@libphutil:queryfx}, but only take half of | * These methods work like @{function@arcanist:queryfx}, but only take half of | ||||
* a query (the part after the WHERE keyword). Lisk will handle the connection, | * a query (the part after the WHERE keyword). Lisk will handle the connection, | ||||
* columns, and object construction; you are responsible for the rest of it. | * columns, and object construction; you are responsible for the rest of it. | ||||
* @{method:loadAllWhere} returns a list of objects, while | * @{method:loadAllWhere} returns a list of objects, while | ||||
* @{method:loadOneWhere} returns a single object (or `null`). | * @{method:loadOneWhere} returns a single object (or `null`). | ||||
* | * | ||||
* There's also a @{method:loadRelatives} method which helps to prevent the 1+N | * There's also a @{method:loadRelatives} method which helps to prevent the 1+N | ||||
* queries problem. | * queries problem. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,785 Lines • Show Last 20 Lines |