本文整理汇总了PHP中ActiveRecordModel::getNewInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecordModel::getNewInstance方法的具体用法?PHP ActiveRecordModel::getNewInstance怎么用?PHP ActiveRecordModel::getNewInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActiveRecordModel
的用法示例。
在下文中一共展示了ActiveRecordModel::getNewInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNewInstance
public static function getNewInstance(ProductList $productList, Product $product)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->productList->set($productList);
$instance->product->set($product);
return $instance;
}
示例2: getNewInstance
public static function getNewInstance(OrderedItem $item, ProductFile $file)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->orderedItem->set($item);
$instance->productFile->set($file);
return $instance;
}
示例3: setUp
public function setUp()
{
parent::setUp();
ActiveRecordModel::executeUpdate('DELETE FROM ClonedStore');
$this->usd = ActiveRecordModel::getNewInstance('Currency');
$this->usd->setID('ZZZ');
$this->usd->save(ActiveRecord::PERFORM_INSERT);
@unlink(ClonedStoreUpdater::getTimestampFile());
@unlink(ClonedStoreUpdater::getIDFile());
// create stores
for ($k = 0; $k <= 0; $k++) {
$this->stores[$k] = ClonedStore::getNewInstance();
$this->stores[$k]->domain->set($k);
$this->stores[$k]->save();
echo $this->stores[$k]->lastImport->get();
}
// create categories
$root = Category::getRootNode();
for ($k = 0; $k <= 5; $k++) {
$this->categories[] = $this->createCategory($root, $k);
}
$this->categories['1.1'] = $this->createCategory($this->categories[1], '1.1');
$this->categories['1.2'] = $this->createCategory($this->categories[1], '1.2');
$this->categories['1.2.1'] = $this->createCategory($this->categories['1.2'], '1.2.1');
$this->categories['1.2.2'] = $this->createCategory($this->categories['1.2'], '1.2.2');
usleep(1500000);
}
示例4: getNewInstance
public static function getNewInstance(OrderedItem $item, ProductOptionChoice $choice)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->orderedItem->set($item);
$instance->choice->set($choice);
return $instance;
}
示例5: getNewInstance
public static function getNewInstance($className, User $user, UserAddress $userAddress)
{
$instance = parent::getNewInstance($className);
$instance->user->set($user);
$instance->userAddress->set($userAddress);
return $instance;
}
示例6: getNewInstance
public static function getNewInstance(CustomerOrder $order, $code)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->order->set($order);
$instance->couponCode->set($code);
return $instance;
}
示例7: getNewInstance
public static function getNewInstance($keywords, $ipAddress)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->keywords->set($keywords);
$instance->ip->set(ip2long($ipAddress));
return $instance;
}
示例8: getNewInstance
public static function getNewInstance(CustomerOrder $order, User $user)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->order->set($order);
$instance->user->set($user);
return $instance;
}
示例9: getInstanceByIdentifier
public static function getInstanceByIdentifier($stringIdentifier)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->classID->set(0);
$instance->setStringIdentifier($stringIdentifier);
return $instance;
}
示例10: getNewInstanceByUser
public static function getNewInstanceByUser(NewsletterMessage $message, User $user)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->message->set($message);
$instance->user->set($user);
return $instance;
}
示例11: getNewInstance
/**
* Create new campaign
*/
public static function getNewInstance(Category $category, ClonedStore $store)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->category->set($category);
$instance->store->set($store);
return $instance;
}
示例12: getNewInstance
public static function getNewInstance(Product $product, ProductVariation $variation)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->product->set($product);
$instance->variation->set($variation);
return $instance;
}
示例13: getNewInstance
public static function getNewInstance(DiscountCondition $condition, $className = 'RuleActionPercentageDiscount')
{
$instance = parent::getNewInstance(__CLASS__);
$instance->condition->set($condition);
$instance->actionClass->set($className);
return $instance;
}
示例14: getNewInstance
public static function getNewInstance(Category $category, Category $relatedCategory)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->category->set($category);
$instance->relatedCategory->set($relatedCategory);
return $instance;
}
示例15: getNewInstance
/**
* Create new advertiser
*/
public static function getNewInstance(ClonedStore $store, $type)
{
$instance = parent::getNewInstance(__CLASS__);
$instance->store->set($store);
$instance->type->set($type);
return $instance;
}