/** * @return Customer */ public static function createShoppingFluxCustomer() { $shoppingFluxCustomer = CustomerQuery::create()->findOneByRef("ShoppingFlux"); if (null === $shoppingFluxCustomer) { $shoppingFluxCustomer = new Customer(); $shoppingFluxCustomer->setRef("ShoppingFlux")->setCustomerTitle(CustomerTitleQuery::create()->findOne())->setLastname("ShoppingFlux")->setFirstname("ShoppingFlux")->save(); } return $shoppingFluxCustomer; }