mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge remote-tracking branch 'origin/3.0'
This commit is contained in:
commit
0dba1485a5
@ -260,6 +260,22 @@ use case could be when you want to find all the members that does not exist in a
|
||||
// ... Finding all members that does not belong to $group.
|
||||
$otherMembers = Member::get()->subtract($group->Members());
|
||||
|
||||
### Limit
|
||||
|
||||
You can limit the amount of records returned in a DataList by using the `limit()` method.
|
||||
|
||||
:::php
|
||||
// Returning the first 5 members, sorted alphabetically by Surname
|
||||
$members = Member::get()->sort('Surname')->limit(5);
|
||||
|
||||
`limit()` accepts two arguments, the first being the amount of results you want returned, with an optional second
|
||||
parameter to specify the offset, which allows you to tell the system where to start getting the results from. The
|
||||
offset, if not provided as an argument, will default to 0.
|
||||
|
||||
:::php
|
||||
// Return 5 members starting from the 5th result
|
||||
$members = Member::get()->sort('Surname')->limit(5, 4);
|
||||
|
||||
### Raw SQL options for advanced users
|
||||
|
||||
Occasionally, the system described above won't let you do exactly what you need to do. In these situations, we have
|
||||
|
@ -1,9 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
### USAGE: before_script <base-folder> <travis-branch>
|
||||
|
||||
BUILD_DIR=$1
|
||||
git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-installer.git $BUILD_DIR
|
||||
|
||||
# Fetch all dependencies
|
||||
# TODO Replace with different composer.json variations
|
||||
|
||||
echo "Checking out installer@$TRAVIS_BRANCH"
|
||||
git clone --depth=100 --quiet -b $TRAVIS_BRANCH git://github.com/silverstripe/silverstripe-installer.git $BUILD_DIR
|
||||
|
||||
echo "Checking out sqlite3@master"
|
||||
git clone --depth=100 --quiet git://github.com/silverstripe-labs/silverstripe-sqlite3.git $BUILD_DIR/sqlite3
|
||||
|
||||
echo "Checking out postgresql@master"
|
||||
git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-postgresql.git $BUILD_DIR/postgresql
|
||||
|
||||
# Copy setup files
|
||||
cp ./tests/travis/_ss_environment.php $BUILD_DIR
|
||||
cp ./tests/travis/_config.php $BUILD_DIR/mysite
|
||||
|
||||
# Copy actual project code into build directory (checked out by travis)
|
||||
cp -r . $BUILD_DIR/framework
|
||||
|
||||
cd $BUILD_DIR
|
||||
|
Loading…
x
Reference in New Issue
Block a user