本文整理汇总了PHP中Item::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::getName方法的具体用法?PHP Item::getName怎么用?PHP Item::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_accessors
public function test_accessors()
{
/** === Test Data === */
$NAME = 'name';
$LEVEL = 'level';
/** === Setup Mocks === */
/** === Call and asserts === */
$this->obj->setName($NAME);
$this->obj->setLevel($LEVEL);
$this->assertEquals($NAME, $this->obj->getName());
$this->assertEquals($LEVEL, $this->obj->getLevel());
}
示例2: testGetName
public function testGetName()
{
$item = new Item('key', $this->storage);
$this->assertEquals('key', $item->getName());
$item = new Item('collection/item', $this->storage);
$this->assertEquals('item', $item->getName());
}
示例3: Item
function test_getName()
{
$name = "Gold Liberty Dollar";
$test_Item = new Item(null, $name);
$result = $test_Item->getName();
$this->assertEquals($name, $result);
}
示例4: testSetGetName
public function testSetGetName()
{
// Arrange
$item = new Item();
$item->setName('john');
$expectedResult = 'john';
// Act
$result = $item->getName();
// Assert
$this->assertEquals($result, $expectedResult);
}
示例5: testNewItem
public function testNewItem()
{
$type = "test type";
$name = "test name";
$number = "test number";
$quantity = "test quantity";
$item = new Item($type, $name, $number, $quantity);
$this->assertEquals($name, $item->getName());
$this->assertEquals($number, $item->getNumber());
$this->assertEquals($type, $item->getType());
$this->assertEquals($quantity, $item->getQuantity());
}
示例6: generate
function generate()
{
global $smarty;
$this->toplist->generate();
while ($row = $this->toplist->getRow()) {
$item = new Item($row['itm_id']);
$rows[] = array('rank' => false, 'name' => $item->getName(), 'uri' => edkURI::build(array('a', 'invtype', true), array('id', $item->getID(), true)), 'icon' => $item->getIcon(32), 'count' => $row['cnt']);
}
$smarty->assign('tl_name', Language::get('weapon'));
$smarty->assign('tl_type', Language::get('kills'));
$smarty->assignByRef('tl_rows', $rows);
return $smarty->fetch(get_tpl('toplisttable'));
}
示例7: getItemData
private function getItemData(Item $itemInformation)
{
$information = new Information();
$information->set('name', $itemInformation->getName());
$information->set('agi', $itemInformation->getAgility());
$information->set('str', $itemInformation->getStrength());
$information->set('int', $itemInformation->getIntelligence());
$information->set('minDamage', $itemInformation->getDamage());
$information->set('maxDamage', $itemInformation->getDamage());
$information->set('hp', $itemInformation->getHp());
$information->set('mana', $itemInformation->getMana());
return $information;
}
示例8: updateItem
/**
*
* @param Item $item
* @return type
* @throws DaoException
*/
public function updateItem(Item $item)
{
try {
$query = Doctrine_Query::create()->update('Item i');
$query->set('i.name', '?', $item->getName());
$query->set('i.sales_unit_price', '?', $item->getSalesUnitPrice());
$query->set('i.purchase_unit_price', '?', $item->getPurchaseUnitPrice());
$query->set('i.description', '?', $item->getDescription());
$query->set('i.stock_available', '?', $item->getStockAvailable());
$query->where('i.id = ?', $item->getId());
return $query->execute();
} catch (Exception $e) {
throw new DaoException($e->getMessage(), $e->getCode(), $e);
}
}
示例9: insertItem
public function insertItem(Item $item)
{
$con = self::openConnection();
mysqli_begin_transaction($con);
$code = $item->getCode();
$name = $item->getName();
$parent = $item->getParent() == null ? '' : $item->getParent()->getCode();
$sql = "INSERT INTO category (code, name, parent_category_id) VALUE ('{$code}', '{$name}', '{$parent}')";
mysqli_query($con, $sql);
$affected = mysqli_affected_rows($con);
if ($affected == 1) {
mysqli_commit($con);
} else {
mysqli_rollback($con);
}
return $affected;
}
示例10: create
/**
* @param Subcategory $subcategory
* @param $name
* @param $descr
* @param $short_descr
* @param $price
* @param $stock
* @return array
* @throws Exception
*/
public function create(Subcategory $subcategory, $name, $descr, $short_descr, $price, $stock)
{
$errors = array();
$item = new Item($this->db);
try {
$item->setName($name);
$item->setDescription($descr);
$item->setShortDescription($short_descr);
$item->setPrice($price);
$item->setStock($stock);
} catch (Exception $e) {
$errors[] = $e->getMessage();
}
if (count($errors) == 0) {
$name = $this->db->quote($item->getName());
$description = $this->db->quote($item->getDescription());
$shortDescription = $this->db->quote($item->getShortDescription());
$price = $this->db->quote($item->getPrice());
$stock = $this->db->quote($item->getStock());
$query = " INSERT INTO item(id_subcategory, name, descr, short_descr, price, stock)\n VALUES(" . $subcategory->getId() . ", " . $name . ", " . $description . ", " . $shortDescription . ", " . $price . ", " . $stock . ")";
$data = $this->db->exec($query);
if ($data) {
$id = $this->db->lastInsertId();
if ($id) {
try {
return $this->findById($id);
} catch (Exception $e) {
$errors[] = $e->getMessage();
return $errors;
}
} else {
throw new Exception('Last insert error');
}
} else {
throw new Exception('Db error');
}
} else {
return $errors;
}
}
示例11: setTDPilotName
function setTDPilotName($tdpilotname)
{
$npc = strpos($tdpilotname, "#");
if ($npc === false) {
$this->tdpilotname = $tdpilotname;
} else {
$name = explode("#", $tdpilotname);
$plt = new Item($name[2]);
$this->tdpilotname = $plt->getName();
}
}
示例12:
</ul>
</div><br/>
<span>Total towards your cause: <span style="color:#2CBB76;font-weight:bold;text-decoration:underline;">$<?php
echo $amt * 0.05;
?>
!</span></span>
</div>
<div class="col-lg-4" id="item_info">
<h3>Congratulations!</h3>
<img style="margin-right:1em;margin-bottom:1em;" width="200px" height="150px" src="<?php
echo $product->getImage();
?>
" alt="profile_pic"/><br/>
<span><p>You Bought this <?php
echo $product->getName();
?>
for <span style="color:#2CBB76;font-weight:bold;text-decoration:underline;">$<?php
echo $amt;
?>
!</span></p></span>
<span><p>5% is taken as a Service Charge - <span style="color:red;">$<?php
echo $amt * 0.05;
?>
</span></p></span>
</div>
<div class="col-lg-4" id="seller_info">
<img style="margin-right:1em;margin-bottom:1em;" width="200px" height="250px" src="<?php
echo $seller->getImage();
?>
" alt="profile_pic"/><br/>
示例13: Item
// trieda aktualneho uzivatela
global $aktivny_sklad;
//trieda aktivne zvoleneho skladu
// stranka zobrazi sa len ked uzivatel JE prihlaseny, inak presmeruje na zakladny index.php
if (!is_registered()) {
global $page;
$page->redirect();
}
$vyrobok_id = $_REQUEST["vyrobok_id"];
$vyrobok = new Item();
//deklaracia tovaru
$vyrobok->loadItem($vyrobok_id);
//nahratie informacii z databazy o tovare
?>
<h1>Definovanie výrobku:<?php
echo $vyrobok->getName();
?>
</h1>
<ul id="zoznam_skladov">
<?php
//nacitame sklady na prepinac, prednastaveny bude aktivny sklad
$query = $database->select("SELECT * FROM sklad WHERE organizacia_id = '" . $uzivatel->getIdOrganizacie() . "'");
while ($vysl = $database->fetch_array($query)) {
//prebehne vsetky nacitane sklady uzivatela
//kontrola na aktualnost skladu
if ($aktivny_sklad->getId() == $vysl["id"]) {
// pri aktivnom sklade vypiseme len nazov
echo "<li>" . $vysl["name"] . "</li>";
} else {
echo "<li><form><input type='submit' name='submit' value='" . $vysl["name"] . "' >\r\n <input type='hidden' name='sklad_id' value='" . $vysl["id"] . "' >\r\n <input type='hidden' name='vyrobok_id' value='" . $vyrobok->getId() . "' > \r\n <input type='hidden' name='action' value='aktivuj_sklad' > \r\n <input type='hidden' name='pageaction' value='definuj_vyrobok'>\r\n </form></li>";
}
示例14: update
public function update(Item $item)
{
$idCategory = $item->getCategory()->getId();
$id = intval($id);
$name = $this->db->quote($item->getName());
$price = $this->db->quote($item->getPrice());
$stock = $this->db->quote($item->getStock());
$image = $this->db->quote($item->getImage());
$description = $this->db->quote($item->getDescription());
$query = ' UPDATE item
SET name=' . $name . ',
price=' . $price . ',
stock=' . $stock . ',
image=' . $image . ',
description=' . $description . ',
id_category=' . $idCategory . '
WHERE id=' . $id;
$res = $this->db->exec($query);
if ($res) {
$id = $this->db->lastInsertId();
if ($id) {
return $this->findByID($id);
} else {
throw new Exception('Internal server Error');
}
}
}
示例15: TestPilotName
function TestPilotName($fbpilotname)
{
$npc = strpos($fbpilotname, "#");
if ($npc === false) {
$PilotName = $fbpilotname;
} else {
$name = explode("#", $fbpilotname);
$plt = new Item($name[2]);
$PilotName = $plt->getName();
}
return $PilotName;
}