Quote:
Originally Posted by cflsystems
That's tricky and related to Doctrine. While I am not 100% (almost 100% sure though) sure this is how XC determines which records are orders and which are not - is_order = 1 for placed orders
The Repo Order class when creating the query builder uses "placedOnly" parameter. Search the class fot it and you will see how it adds condition to select only records that are an instance of Order.
|
Well,
Code:
/**
* Create a new QueryBuilder instance that is prepopulated for this entity name
*
* @param string $alias Table alias OPTIONAL
* @param string $indexBy The index for the from. OPTIONAL
* @param boolean $placedOnly Use only orders or orders + carts OPTIONAL
*
* @return \XLite\Model\QueryBuilder\AQueryBuilder
*/
public function createQueryBuilder($alias = null, $indexBy = null, $placedOnly
= true)
{
$result = parent::createQueryBuilder($alias, $indexBy);
if ($placedOnly) {
$result->andWhere($result->getMainAlias() . ' NOT INSTANCE OF XLite\Mod
el\Cart');
}
return $result;
}
I didn't find the string "INSTANCE OF"... in any other class.
Are you implying that somehow because of
Code:
* @DiscriminatorColumn (name="is_order", type="integer", length=1)
* @DiscriminatorMap ({1 = "XLite\Model\Order", 0 = "XLite\Model\Cart"})
my "fake orders" become instance of XLite\Model\Cart so that get ignored
in the search? Thus if I wanted search including fake orders, I would somehow
need to use
Code:
createQueryBuilder(o,'','false);
or something like that?