public function byParent($id, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->Account->setConnection($databaseConnectionName)
      ->where('parent_account_id', '=', $id)
      ->orderBy('key', 'asc')
      ->get();
  }
public function byParent($id, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->Account->setConnection($databaseConnectionName)
      ->where('parent_account_id', '=', $id)
      ->orderBy('key', 'asc')
      ->get();
  }
public function byParent ( $ id , $ databaseConnectionName = null ) { if ( empty ( $ databaseConnectionName ) ) { $ databaseConnectionName = $ this -> databaseConnectionName ; } return $ this -> Account -> setConnection ( $ databaseConnectionName ) -> where ( 'parent_account_id' , '=' , $ id ) -> orderBy ( 'key' , 'asc' ) -> get ( ) ; }
Retrieve accounts by parent

@param  int $id Organization id

@return Illuminate\Database\Eloquent\Collection
Retrieve accounts by parent