本文整理汇总了PHP中self::fill方法的典型用法代码示例。如果您正苦于以下问题:PHP self::fill方法的具体用法?PHP self::fill怎么用?PHP self::fill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::fill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newUser
public static function newUser($dbc, $fn, $ln, $email, $pwd, $sa, $pc, $DOB, $gender)
{
$instance = new self($email, $pwd);
$instance->fill($fn, $ln, $sa, $pc, $DOB, $gender);
$instance->insertUser($dbc);
return $instance;
}
示例2: instantiate
public static function instantiate(User $admin, array $data)
{
$instance = new self();
$instance->author()->associate($admin);
$instance->fill($data)->save();
return $instance;
}
示例3: fromRow
public static function fromRow(array $row)
{
// 'constructor' using db query row
$instance = new self();
$instance->fill($row);
return $instance;
}
示例4: instantiate
public static function instantiate($seller, array $data)
{
$instance = new self();
$instance->seller()->associate($seller);
$instance->fill($data)->save();
return $instance;
}
示例5: order
/**
* Create an Order
*
* @param array $items
* @param $user_id
*
* @return Order
*/
public function order($user_id, $data = null)
{
$order = new self();
$order->user_id = $user_id;
$order->items_number = 0;
$order->items_total = 0;
if ($data) {
$order->fill($data);
}
$order->state = config("shop.status_init");
$order->save();
return $order;
}
示例6: loadById
/**
* Load the material type by the given id.
*
* @param integer $id
*
* @return \self
*/
public static function loadById($id)
{
$sql = '
SELECT
`materialTypeId`,
`name`
FROM materialTypes
WHERE `materialTypeId` = ' . \sqlval($id) . '
AND !deleted
';
$materialType = \query($sql);
$obj = new self();
$obj->fill($materialType);
return $obj;
}
示例7: loadById
/**
* Load a material by ID
*
* @param integer $id
*
* @return \self
*/
public static function loadById($id)
{
$sql = '
SELECT
`materialId`,
`materialTypeId`,
`name`,
additional
FROM materials
WHERE `materialId` = ' . \sqlval($id) . '
AND !deleted
';
$material = \query($sql);
$obj = new self();
$obj->fill($material);
$obj->loadMaterialAssets();
return $obj;
}
示例8: loadById
/**
* Load an item type by its id.
*
* @param integer $id
*
* @return \self
*/
public static function loadById($id)
{
$sql = '
SELECT
`itemTypeId`,
`name`,
`type`,
`talentPoints`,
`time`
FROM itemTypes
WHERE `itemTypeId` = ' . \sqlval($id) . '
AND !deleted
';
$itemType = query($sql);
$obj = new self();
$obj->fill($itemType);
return $obj;
}
示例9: order
/**
* Create an Order
*
* @param array $items
* @param $user_id
*
* @return Order
*/
public function order($user_id, $data = null, $draft = FALSE)
{
$order = new self();
$order->user_id = $user_id;
$order->items_number = 0;
$order->items_total = 0;
if ($data) {
$order->fill($data);
}
if (!$draft) {
$order = $this->removeInvalidAttributes($order);
$order->state = config("order.init");
$order->save();
} else {
//Allocate fake id
$order->state = 'draft';
$order->id = 0;
}
return $order;
}
示例10: loadById
/**
* Load a technique by the given id.
*
* @param integer $id
*
* @return \self
*/
public static function loadById($id)
{
$sql = '
SELECT
`techniqueId`,
`name`,
`timeFactor`,
`priceFactor`,
proof,
`breakFactor`,
`hitPoints`,
`noOtherAllowed`,
unsellable
FROM techniques
WHERE `techniqueId` = ' . \sqlval($id) . '
AND !deleted
';
$technique = query($sql);
$obj = new self();
$obj->fill($technique);
return $obj;
}
示例11: instantiate
public static function instantiate(User $user, array $data, array $tags = [])
{
$instance = new self();
$instance->author()->associate($user);
$instance->fill($data)->save();
if ($tags) {
$instance->tags()->attach($tags);
}
return $instance;
}
示例12: withDetails
public static function withDetails($aUserLogin, $aUserFirstName, $aUserLastName, $aUserEmail, $aUserPhone, $aCampName, $aCampDescription, $aCampConstruction, $aCampParticipants, $aCampShortDesc, $aWorkshop1, $aWorkshop2, $aWorkshop3, $aWorkshop4)
{
$instance = new self();
$instance->fill($aUserLogin, $aUserFirstName, $aUserLastName, $aUserEmail, $aUserPhone, $aCampName, $aCampDescription, $aCampConstruction, $aCampParticipants, $aCampShortDesc, $aWorkshop1, $aWorkshop2, $aWorkshop3, $aWorkshop4);
return $instance;
}
示例13: opacity
/**
* Set opacity of current image
*
* @param integer $transparency
* @return Image
*/
public function opacity($transparency)
{
if ($transparency >= 0 && $transparency <= 100) {
$transparency = intval($transparency) / 100;
} else {
throw new Exception('Opacity must be between 0 and 100');
}
// create alpha mask
$alpha = new self(null, $this->width, $this->height);
$alpha->fill(sprintf('rgba(0, 0, 0, %.1f)', $transparency));
// apply alpha mask
$this->mask($alpha, true);
return $this;
}
示例14: loadById
/**
* Load an item by its id.
*
* @param integer $id
*
* @return \self
*/
public static function loadById($id)
{
$sql = '
SELECT
`itemId`,
`name`,
`itemType`,
`price`,
`twoHanded`,
`improvisational`,
`privileged`,
`hitPointsDice`,
`hitPointsDiceType`,
`hitPoints`,
`damageType`,
`breakFactor`,
`initiative`,
`weaponModificator`,
`weight`,
`physicalStrengthRequirement`
FROM items
WHERE `itemId` = ' . \sqlval($id) . '
AND !deleted
';
$item = query($sql);
$obj = new self();
$obj->fill($item);
return $obj;
}
示例15: instantiate
public static function instantiate(array $data)
{
$instance = new self();
$instance->fill($data)->save();
return $instance;
}