当前位置: 首页>>代码示例>>PHP>>正文


PHP Item::getName方法代码示例

本文整理汇总了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());
 }
开发者ID:praxigento,项目名称:mobi_mod_mage2_core,代码行数:12,代码来源:Item_Test.php

示例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());
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:7,代码来源:ItemTest.php

示例3: Item

 function test_getName()
 {
     $name = "Gold Liberty Dollar";
     $test_Item = new Item(null, $name);
     $result = $test_Item->getName();
     $this->assertEquals($name, $result);
 }
开发者ID:bdspen,项目名称:Inventory_Database,代码行数:7,代码来源:ItemTest.php

示例4: testSetGetName

 public function testSetGetName()
 {
     // Arrange
     $item = new Item();
     $item->setName('john');
     $expectedResult = 'john';
     // Act
     $result = $item->getName();
     // Assert
     $this->assertEquals($result, $expectedResult);
 }
开发者ID:Owen66,项目名称:KBK-WebSite,代码行数:11,代码来源:ItemTest.php

示例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());
 }
开发者ID:robertzx,项目名称:phpIPN,代码行数:12,代码来源:ItemTest.php

示例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'));
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:13,代码来源:class.weapon.php

示例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;
 }
开发者ID:nashlesigon,项目名称:project-dota,代码行数:13,代码来源:DotaResourceData.php

示例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);
     }
 }
开发者ID:GarraouiMarwen,项目名称:open-stock-management,代码行数:21,代码来源:ItemDao.php

示例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;
 }
开发者ID:Voww,项目名称:PHP_test_tasks,代码行数:17,代码来源:CategoryDAO.php

示例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;
     }
 }
开发者ID:CreepingPanda,项目名称:FennecPlusUltra,代码行数:50,代码来源:ItemManager.class.php

示例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();
     }
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:11,代码来源:class.killwrapper.php

示例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/>
开发者ID:emrickgarrett,项目名称:Donorbidv2,代码行数:31,代码来源:winner.php

示例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>";
    }
开发者ID:vbelco,项目名称:iqsklad,代码行数:31,代码来源:definuj_vyrobok.php

示例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');
            }
        }
    }
开发者ID:dispxxx,项目名称:leshop,代码行数:27,代码来源:ItemManager.class.php

示例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;
}
开发者ID:Salvoxia,项目名称:fleet_battles_mod,代码行数:12,代码来源:class.killlisttable.php


注:本文中的Item::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。