Skip to content

Commit 8b8326f

Browse files
committed
Rename R::also to R::loadJoined().
1 parent 9a6961a commit 8b8326f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: RedBeanPHP/Facade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ public static function genSlots( $array, $template = NULL )
19671967
*
19681968
* <code>
19691969
* $users = R::find('user');
1970-
* $users = R::also( $users, 'country' );
1970+
* $users = R::loadJoined( $users, 'country' );
19711971
* </code>
19721972
*
19731973
* This is an alternative for:
@@ -1987,7 +1987,7 @@ public static function genSlots( $array, $template = NULL )
19871987
*
19881988
* @return array
19891989
*/
1990-
public static function also( $beans, $type, $sqlTemplate = 'SELECT %s.* FROM %s WHERE id IN (%s)' )
1990+
public static function loadJoined( $beans, $type, $sqlTemplate = 'SELECT %s.* FROM %s WHERE id IN (%s)' )
19911991
{
19921992
if (!count($beans)) return array();
19931993
$ids = array();

Diff for: RedBeanPHP/Finder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public static function nmMap( $parentName, $childName )
159159
*
160160
* For your convenience, an even shorter notation has been added:
161161
*
162-
* $countries = R::also( $users, 'country' );
162+
* $countries = R::loadJoined( $users, 'country' );
163163
*
164164
* @param string $parentName name of the parent bean
165165
* @param string|array $childName name of the child bean

Diff for: testing/RedUNIT/Base/Finding.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ public function testPreloadUsingFindMulti()
186186
}
187187
//Yet, even more compact
188188
$gebruikers = R::find('gebruiker'); //imagine some difficult query here
189-
$gebruikers = R::also( $gebruikers, 'country' );
190-
$gebruikers = R::also( $gebruikers, 'language' );
189+
$gebruikers = R::loadJoined( $gebruikers, 'country' );
190+
$gebruikers = R::loadJoined( $gebruikers, 'language' );
191191
asrt(count($gebruikers), 3);
192192
foreach($gebruikers as $gebruiker) {
193193
asrt( $gebruiker->noLoad()->country instanceof OODBBean, TRUE );

0 commit comments

Comments
 (0)