Skip to content

Instantly share code, notes, and snippets.

@aaronmu
Last active August 28, 2017 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronmu/98f82fdcd6b2c324e8a95186d6ca3ba2 to your computer and use it in GitHub Desktop.
Save aaronmu/98f82fdcd6b2c324e8a95186d6ca3ba2 to your computer and use it in GitHub Desktop.
// F is a doctrine entity.
class F {
private $foo, $bar; // all strings \o/
}
// I have a native query that returns the following resultset:
$rs = [
['foo' => 'hello', 'bar' => 'world', 'trueOrFalse' => true],
//..
];
// I want to map it to the following object:
// X is not a doctrine entity.
class X {
private $f; // instance of F which is a doctrine entity
private $trueOrFalse; // boolean
}
// Is this possible using native query and ResultSetMappingBuilder?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment