本文整理汇总了PHP中Supplier::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Supplier::getId方法的具体用法?PHP Supplier::getId怎么用?PHP Supplier::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Supplier
的用法示例。
在下文中一共展示了Supplier::getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterBySupplier
/**
* Filter the query by a related Supplier object
*
* @param Supplier|PropelObjectCollection $supplier The related object(s) to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return BarangMasukQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterBySupplier($supplier, $comparison = null)
{
if ($supplier instanceof Supplier) {
return $this->addUsingAlias(BarangMasukPeer::ID_SUPPLIER, $supplier->getId(), $comparison);
} elseif ($supplier instanceof PropelObjectCollection) {
if (null === $comparison) {
$comparison = Criteria::IN;
}
return $this->addUsingAlias(BarangMasukPeer::ID_SUPPLIER, $supplier->toKeyValue('PrimaryKey', 'Id'), $comparison);
} else {
throw new PropelException('filterBySupplier() only accepts arguments of type Supplier or PropelCollection');
}
}
示例2: setSupplier
/**
* Declares an association between this object and a Supplier object.
*
* @param Supplier $v
* @return BarangMasuk The current object (for fluent API support)
* @throws PropelException
*/
public function setSupplier(Supplier $v = null)
{
if ($v === null) {
$this->setIdSupplier(NULL);
} else {
$this->setIdSupplier($v->getId());
}
$this->aSupplier = $v;
// Add binding for other direction of this n:n relationship.
// If this object has already been added to the Supplier object, it will not be re-added.
if ($v !== null) {
$v->addBarangMasuk($this);
}
return $this;
}
示例3: create
/**
* Creating a supplier code
*
* @param Product $product
* @param Supplier $supplier
* @param string $code
*
* @return SupplierCode
*/
public static function create(Product $product, Supplier $supplier, $code, $canSupplyQty = 0)
{
$class = __CLASS__;
$objects = self::getAllByCriteria('productId = ? and supplierId = ? and code like ?', array($product->getId(), $supplier->getId(), trim($code)), true, 1, 1);
$obj = count($objects) > 0 ? $objects[0] : new $class();
return $obj->setProduct($product)->setSupplier($supplier)->setCode(trim($code))->save();
}
示例4: prune
/**
* Exclude object from result
*
* @param Supplier $supplier Object to remove from the list of results
*
* @return SupplierQuery The current query, for fluid interface
*/
public function prune($supplier = null)
{
if ($supplier) {
$this->addUsingAlias(SupplierPeer::ID, $supplier->getId(), Criteria::NOT_EQUAL);
}
return $this;
}
示例5: create
public static function create(Supplier $supplier, $manufacturer = null, $category = null, $priceMatchRule = null)
{
if ($manufacturer !== null && !$manufacturer instanceof Manufacturer) {
throw new Exception('Invalid manufacture passed in. It must be a null or instance of Manufacturer. "' . $manufacturer . '" passed in.');
}
if ($category !== null && !$category instanceof ProductCategory) {
throw new Exception('Invalid category passed in. It must be a null or instance of ProductCategory. "' . $category . '" passed in.');
}
if ($priceMatchRule !== null && !$priceMatchRule instanceof ProductPriceMatchRule) {
throw new Exception('Invalid priceMatchRule passed in. It must be a null or instance of ProductPriceMatchRule. "' . $priceMatchRule . '" passed in.');
}
$existObj = self::getAllByCriteria('supplierId = ? and manufacturerId = ? and categoryId = ?', array($supplier->getId(), $manufacturer instanceof Manufacturer ? $manufacturer->getId() : null, $priceMatchRule instanceof ProductPriceMatchRule ? $priceMatchRule->getId() : null), false, 1, 1, array('id' => 'desc'));
$obj = $existObj > 0 ? $existObj[0] : new self();
$obj->setSupplier($supplier)->setmanufacturer($manufacturer)->setCategory($category)->setpriceMatchRule($priceMatchRule)->setActive(true)->save();
return $obj;
}
示例6: removeSupplier
/**
* removing the suppler
*
* @param ProductPriceType $type
*
* @return Product
*/
public function removeSupplier(Supplier $supplier, $supplierCode = '')
{
$where = 'productId = ? and suplierId = ?';
$params = array($this->getId(), $supplier->getId());
if (trim($supplierCode) !== '') {
$where .= ' AND code like = ?';
$params[] = trim($supplierCode);
}
SupplierCode::updateByCriteria('active = 0', $where, $params);
return $this;
}
示例7: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param Supplier $obj A Supplier object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool($obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
SupplierPeer::$instances[$key] = $obj;
}
}