src/Onetomany.php
public function read($bean, $property) {

		// NOTE: We're not executing the read method for each bean. Before I implement this I want to check potential performance issues.
		//return  $bean->{ 'own'.ucfirst($property['name']).'List' };

		// Set up child model to read properties
		$model_name = '\Lagan\Model\\' . ucfirst($property['name']);
		$child = new $model_name();

		// All beans with this parent
		// Oder by position(s) if exits
		// NOTE: We're not executing the read method for each bean. Before I implement this I want to check potential performance issues.
		$add_to_query = '';
		foreach($child->properties as $p) {
			if ( $p['type'] === '\\Lagan\\Property\\Position' ) {
				$add_to_query = $p['name'].' ASC, ';
			}
		}
		return \R::find( $property['name'], $bean->getMeta('type').'_id = :id ORDER BY '.$add_to_query.'title ASC ', [ ':id' => $bean->id ] );

	}
public function read($bean, $property) {

		// NOTE: We're not executing the read method for each bean. Before I implement this I want to check potential performance issues.
		//return  $bean->{ 'own'.ucfirst($property['name']).'List' };

		// Set up child model to read properties
		$model_name = '\Lagan\Model\\' . ucfirst($property['name']);
		$child = new $model_name();

		// All beans with this parent
		// Oder by position(s) if exits
		// NOTE: We're not executing the read method for each bean. Before I implement this I want to check potential performance issues.
		$add_to_query = '';
		foreach($child->properties as $p) {
			if ( $p['type'] === '\\Lagan\\Property\\Position' ) {
				$add_to_query = $p['name'].' ASC, ';
			}
		}
		return \R::find( $property['name'], $bean->getMeta('type').'_id = :id ORDER BY '.$add_to_query.'title ASC ', [ ':id' => $bean->id ] );

	}
public function read ( $ bean , $ property ) { // NOTE: We're not executing the read method for each bean. Before I implement this I want to check potential performance issues. //return  $bean->{ 'own'.ucfirst($property['name']).'List' }; // Set up child model to read properties $ model_name = '\Lagan\Model\\' . ucfirst ( $ property [ 'name' ] ) ; $ child = new $ model_name ( ) ; // All beans with this parent // Oder by position(s) if exits // NOTE: We're not executing the read method for each bean. Before I implement this I want to check potential performance issues. $ add_to_query = '' ; foreach ( $ child -> properties as $ p ) { if ( $ p [ 'type' ] === '\\Lagan\\Property\\Position' ) { $ add_to_query = $ p [ 'name' ] . ' ASC, ' ; } } return \ R :: find ( $ property [ 'name' ] , $ bean -> getMeta ( 'type' ) . '_id = :id ORDER BY ' . $ add_to_query . 'title ASC ' , [ ':id' => $ bean -> id ] ) ; }
The read method is executed each time a property with this type is read.

@param bean		$bean		The Readbean bean object with this property.
@param string[]		$property	Lagan model property arrray.

@return bean[]	Array with Redbean beans with a many-to-one relation with the object with this property.
The read method is executed each time a property with this type is read .