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


PHP Part类代码示例

本文整理汇总了PHP中Part的典型用法代码示例。如果您正苦于以下问题:PHP Part类的具体用法?PHP Part怎么用?PHP Part使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Part类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: savePart

        private function savePart()
        {
            $form = 'frost.views.cms.part.text.TextAdd';
            $part = Part::addMediaToPart($form,'Text');
            
            // Add the 'preview' to the part 
            $part = new Part();
            $part->clauseSafe('part_id',Application::param('part_id')); 
            $part->parse(); 
            $part->save();

            //Part::setParttagsAndSave($part,Application::param('current_tags'));
    
            Application::setParam('module_id',Application::param('module_id'));
            Application::redirect('ModuleDetail');
        }
开发者ID:k7n4n5t3w4rt,项目名称:SeeingSystem,代码行数:16,代码来源:text_add.class.php

示例2: getTree

 private function getTree()
 {
     if ($root = Part::model()->find('alias="carclub"')) {
         $tree = $this->convertMenuTree($root->getNestedTree());
     }
     return $tree;
 }
开发者ID:BGCX261,项目名称:zoomtyre-svn-to-git,代码行数:7,代码来源:ajaxPartsAction.php

示例3: read_part

 public static function read_part($part)
 {
     // create temporary quote for one part
     $item = ['quote_id' => 0, 'quantity' => 1, 'override' => null];
     $item += Part::read_part($part);
     $item['annual_fee'] = $item['price'];
     $quote = ['id' => 0, 'created' => null, 'key' => null, 'company' => null, 'address' => null, 'country' => null, 'billing_name' => null, 'billing_email' => null, 'billing_phone' => null, 'technical_name' => null, 'technical_email' => null, 'discount' => null, 'discount_desc' => null, 'first_fee' => $item['annual_fee'], 'annual_fee' => $item['annual_fee'], 'items' => [$item]];
     return $quote;
 }
开发者ID:wileybenet,项目名称:mobile-docs,代码行数:9,代码来源:quote.php

示例4: doParseBoundary

 private function doParseBoundary($boundary)
 {
     $result = array();
     $prefix = "--" . $boundary;
     $this->consumeRegexp("/\n*/");
     $this->consumeTo($prefix);
     $this->consume($prefix);
     while ($this->expects("\n")) {
         $content = $this->consumeTo("\n" . $prefix);
         $part = new Part();
         $part->loadSource($content);
         if ($part->isMultipart()) {
             $result += $part->getParts();
         } else {
             $result[] = $part;
         }
         $this->consume("\n" . $prefix);
     }
     return $result;
 }
开发者ID:daviddel,项目名称:mailcatcher,代码行数:20,代码来源:Parser.php

示例5: execute

 public function execute($smarty, $params, $session)
 {
     $smarty->assign('name', $session['screen_name']);
     $artists = Artist::findAll();
     $smarty->assign('artists', $artists);
     $songs = Song::findAll();
     $smarty->assign('songs', $songs);
     $parts = Part::findAll();
     $smarty->assign('parts', $parts);
     $smarty->display('index.tpl');
 }
开发者ID:kenmaz,项目名称:www.kenmaz.net,代码行数:11,代码来源:IndexAction.class.php

示例6: read_items

 public static function read_items($quote_id)
 {
     $items = QuoteItem::read(['*'], FALSE, ['quote_id = ?', $quote_id]);
     for ($i = 0; $i < count($items); ++$i) {
         $part = Part::read_part($items[$i]['part']);
         unset($part['id']);
         $items[$i] += $part;
         if (!is_null($items[$i]['override'])) {
             $items[$i]['price'] = $items[$i]['override'];
         }
         $items[$i]['annual_fee'] = $items[$i]['price'] * $items[$i]['quantity'];
     }
     return $items;
 }
开发者ID:wileybenet,项目名称:mobile-docs,代码行数:14,代码来源:quote_item.php

示例7: draw

 public function draw()
 {
     $args = func_get_args();
     $clone = clone $this;
     $clone->set('name', $this->getFormName());
     $clone->set('id', $this->getId());
     $clone->curry($args);
     try {
         Part::drawArray($clone->partPath, $clone->args);
         return true;
     } catch (MissingRequiredInputException $e) {
         throw new MissingRequiredDrawArgumentsException($e->getMessage(), 1);
     }
 }
开发者ID:amitshukla30,项目名称:recess,代码行数:14,代码来源:Control.class.php

示例8: constructFromArray

 public static function constructFromArray($props)
 {
     $name = $props['name'];
     $parts = array();
     if (isset($props['parts'])) {
         foreach ($props['parts'] as $part) {
             if ($part instanceof Part) {
                 $parts[] = $part;
             } else {
                 $parts[] = Part::constructFromArray($part);
             }
         }
     }
     return new Score($name, $parts);
 }
开发者ID:ianring,项目名称:phpmusicxml,代码行数:15,代码来源:Score.php

示例9: __construct

 /**
  * Construct the object
  *
  * @access public
  * @param array $parts
  * @param array $classes
  * @param string $key
  * @param integer $priority
  * 
  * @throws \Zepi\Web\UserInterface\Exception Only Tab objects are allowd to add to a Tabs object.
  */
 public function __construct($parts = array(), $classes = array(), $key = '', $priority = 10)
 {
     parent::__construct(array(), $classes, $key, $priority);
     if (is_array($parts)) {
         foreach ($parts as $part) {
             if ($part instanceof \Zepi\Web\UserInterface\Layout\Tab) {
                 // Activate the first tab
                 if (count($this->parts) === 0) {
                     $part->setActive(true);
                 }
                 $this->addPart($part);
             } else {
                 throw new Exception('Only Tab objects are allowed to add to a Tabs object.');
             }
         }
     }
 }
开发者ID:zepi,项目名称:turbo-base,代码行数:28,代码来源:Tabs.php

示例10: order_custom

 public function order_custom($params = [])
 {
     $parts = Part::get_parts();
     $order = Record::allow($params, array_keys($parts));
     $key = Quote::get_unique_key([]);
     $model['`key`'] = $key;
     $fields = ['company', 'address', 'country', 'billing_name', 'billing_email', 'billing_phone', 'technical_name', 'technical_email', 'discount', 'discount_desc'];
     $model += Record::allow($params, $fields);
     $quote = Quote::create($model);
     $total = 0;
     foreach ($order as $name => $value) {
         if ($value) {
             $model = ['quote_id' => $quote['id'], 'part' => $name, 'override' => null, 'quantity' => $value];
             QuoteItem::create($model);
         }
     }
     return Render::json(['key' => $key]);
 }
开发者ID:wileybenet,项目名称:mobile-docs,代码行数:18,代码来源:product_ctrl.php

示例11: __construct

 /**
  * Public constructor
  *
  * In addition to the parameters of Part::__construct() this constructor supports:
  * - file  filename or file handle of a file with raw message content
  * - flags array with flags for message, keys are ignored, use constants defined in \Zend\Mail\Storage
  *
  * @param  string $rawMessage  full message with or without headers
  * @throws Exception
  */
 public function __construct(array $params)
 {
     if (isset($params['file'])) {
         if (!is_resource($params['file'])) {
             $params['raw'] = @file_get_contents($params['file']);
             if ($params['raw'] === false) {
                 throw new Exception\RuntimeException('could not open file');
             }
         } else {
             $params['raw'] = stream_get_contents($params['file']);
         }
     }
     if (!empty($params['flags'])) {
         // set key and value to the same value for easy lookup
         $this->_flags = array_combine($params['flags'], $params['flags']);
     }
     parent::__construct($params);
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:28,代码来源:Message.php

示例12: add

    public static function add($userId, $artistName, $songName, $partName)
    {
        $pdo = new PDO('mysql:host=localhost; dbname=twitter_band', 'root', '');
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $artist = Artist::insertAndGet($pdo, $artistName);
        $song = Song::insertAndGet($pdo, $songName, $artist);
        $part = Part::insertAndGet($pdo, $partName);
        $st = $pdo->prepare('
			select * from repertoire 
			where user_id = ? and artist_id = ? and song_id = ? and part_id = ?');
        $st->execute(array($userId, $artist->id, $song->id, $part->id));
        if ($row = $st->fetch()) {
            return true;
        } else {
            $st = $pdo->prepare('			
				insert into repertoire(user_id, artist_id, song_id, part_id) values(?,?,?,?)');
            $res = $st->execute(array($userId, $artist->id, $song->id, $part->id));
            return true;
        }
    }
开发者ID:kenmaz,项目名称:www.kenmaz.net,代码行数:20,代码来源:Repertoire.class.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store($story)
 {
     $input = $request->all();
     $story_id = $story;
     $chapter = new chapter();
     $part->story_id = $story_id;
     $part->title = $input['title'];
     $part->description = $input['description'];
     //place of part
     $position = 0;
     $current_position = Part::where('story_id', $story)->pluck('position');
     if (empty($current_positioncount)) {
         $current_position = 0;
     } else {
         $current_position;
     }
     //current_position = 1
     if ($position <= $current_position) {
         $position = $current_position + 1;
         //expect position to go to 2
     } else {
         $position = $current_position;
     }
     $part->position = $position;
     //setting position 2
     $part->save();
     //image
     $destinatonPath = '';
     $filename = '';
     $file = Input::file('image');
     $destinationPath = public_path() . '/images/parts';
     $filename = $part->id . '_' . $file->getClientOriginalName();
     $uploadSuccess = $file->move($destinationPath, $filename);
     $addimage = Part::find($part->id);
     $addimage->image = $filename;
     $addimage->save();
     return redirect('story/' . $story . '/edit');
 }
开发者ID:hannesverdoodt,项目名称:urbantell,代码行数:43,代码来源:ChapterController.php

示例14: switch

}
///end of selectlist class
if (isset($_GET['type'])) {
    switch ($_GET['type']) {
        case 'customer':
            $cust = new Customer();
            $cust->createCustomerList();
            if (isset($_GET['id'])) {
                $id = $_GET['id'];
            } else {
                $id = 'Customer_ID';
            }
            $sel = new selectlist($id, $cust->getCustomerList(), 'Select Customer', 'Customer_ID', 'Customer_Name_Short', 'class="required"', '', '1');
            break;
        case 'drawing':
            $part = new Part();
            $part->createPartList($_GET['cid']);
            if (isset($_GET['req'])) {
                $req = 'class=required';
            } else {
                $req = '';
            }
            if (isset($_GET['id'])) {
                $id = $_GET['id'];
            } else {
                $id = 'Drawing_ID';
            }
            $sel = new selectlist($id, $part->getPartList(), 'Select Part No', 'Drawing_ID', 'name', $req, '');
            break;
        case 'operator':
            $operator = new Operator();
开发者ID:sknagesh,项目名称:divyaeng2,代码行数:31,代码来源:class.selectlist.php

示例15: getpart

 private function getpart($type)
 {
     $items = Part::find(array("type=:type:", "bind" => array("type" => $type)));
     $parts = array();
     foreach ($items as $index => $item) {
         $parts[$index] = $item;
     }
     return $parts;
 }
开发者ID:sify21,项目名称:Question,代码行数:9,代码来源:IndexController.php


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