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


PHP Note::create方法代码示例

本文整理汇总了PHP中Note::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Note::create方法的具体用法?PHP Note::create怎么用?PHP Note::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Note的用法示例。


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

示例1: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Note::create([]);
     }
 }
开发者ID:waldenylson,项目名称:alfredapp,代码行数:7,代码来源:NotesTableSeeder.php

示例2: store

 /**
  * Store a newly created note in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Note::$rules);
     if (Request::ajax()) {
         $note = Note::create($data);
         return View::make('notes.panels.show', compact('note'));
     } else {
         if ($validator->fails()) {
             return Redirect::back()->withErrors($validator)->withInput();
         }
         return View::make('notes.create');
     }
     return Redirect::route('notes.index');
 }
开发者ID:waldenylson,项目名称:alfredapp,代码行数:19,代码来源:NotesController.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $extensions = array('jpg', 'gif');
     $links = array();
     $input = Input::all();
     for ($i = 0; $i < count(Input::get('link')); $i++) {
         array_push($links, $input['link'][$i]);
     }
     Note::create(['user' => Input::get('user'), 'note' => Input::get('note'), 'tbd' => Input::get('tbd'), 'link' => serialize($links)]);
     if (isset($input['image'])) {
         if (getimagesize($input['image']) != 0) {
             $ext = Input::file('image')->getClientOriginalExtension();
             if (in_array($ext, $extensions)) {
                 $image = file_get_contents($input['image']);
                 Image::create(['image_name' => Input::file('image')->getClientOriginalName(), 'user' => Input::get('user'), 'image' => $image, 'ext' => $ext]);
             } else {
                 return View::make('sessions.try_again');
             }
         } else {
             return View::make('sessions.try_again');
         }
     }
     return Redirect::route('home.index');
 }
开发者ID:Kpatena,项目名称:notestomyself,代码行数:29,代码来源:HomeController.php

示例4: Note

<?php

require_once '../models/note.php';
require_once '../models/item.php';
require_once '../util/database.php';
if (isset($_SESSION['id'])) {
    $session_user_id = $_SESSION['id'];
    $note = new Note();
    if (isset($_POST['note_content']) && rtrim($_POST['note_content']) != "") {
        $item = new Item();
        $item_id = $_POST['item_id'];
        $content = rtrim($_POST['note_content']);
        $user_id = $item->getUserId('item_id', $item_id);
        $note->create($item_id, $user_id['user_id'], $content);
        $note->save();
    }
}
开发者ID:Adrian268,项目名称:comp296,代码行数:17,代码来源:NoteController.php

示例5:

$key = array_shift($path);
if (!$note->UID) {
    set_status(403, $STR["missing_uid"]);
}
/* Flippling switches */
switch ($method) {
    //Create a new note
    case "POST":
        if (!expect_parameters("title", "content", "private")) {
            set_status(403, $STR["missing_required_param"]);
        } else {
            $note->title = $data["title"];
            $note->content = $data["content"];
            $note->private = (bool) $data["private"];
            $author_id = $SESSION_STARTED ? $CURRENT_USER->user_id : -1;
            $key = $note->create($author_id);
            set_status(201, $STR["note_created"]);
            $response["note"] = get_note_data($note);
            $response["note"]["key"] = $key;
        }
        break;
        //Fetch a note
    //Fetch a note
    case "GET":
        if ($note->fetch_data()) {
            $response["note"] = get_note_data($note);
        } else {
            set_status(404, $STR["note_404"]);
        }
        break;
        //Delete note from database
开发者ID:hrn4n,项目名称:argon,代码行数:31,代码来源:note.php

示例6: create

 /**
  * Factory method to create a Contact object from an array
  * @param array $props - Associative array of initial properties to set
  * @return Contact
  */
 public static function create(array $props)
 {
     $contact = new Contact();
     $contact->id = parent::getValue($props, "id");
     $contact->status = parent::getValue($props, "status");
     $contact->first_name = parent::getValue($props, "first_name");
     $contact->middle_name = parent::getValue($props, "middle_name");
     $contact->last_name = parent::getValue($props, "last_name");
     $contact->confirmed = parent::getValue($props, "confirmed");
     $contact->source = parent::getValue($props, "source");
     foreach ($props['email_addresses'] as $email_address) {
         $contact->email_addresses[] = EmailAddress::create($email_address);
     }
     $contact->prefix_name = parent::getValue($props, "prefix_name");
     $contact->job_title = parent::getValue($props, "job_title");
     foreach ($props['addresses'] as $address) {
         $contact->addresses[] = Address::create($address);
     }
     foreach ($props['notes'] as $note) {
         $contact->notes[] = Note::create($note);
     }
     $contact->company_name = parent::getValue($props, "company_name");
     $contact->home_phone = parent::getValue($props, "home_phone");
     $contact->work_phone = parent::getValue($props, "work_phone");
     $contact->cell_phone = parent::getValue($props, "cell_phone");
     $contact->fax = parent::getValue($props, "fax");
     foreach ($props['custom_fields'] as $custom_field) {
         $contact->custom_fields[] = CustomField::create($custom_field);
     }
     foreach ($props['lists'] as $contact_list) {
         $contact->lists[] = ContactList::create($contact_list);
     }
     $contact->source_details = parent::getValue($props, "source_details");
     return $contact;
 }
开发者ID:CreatrixeNew,项目名称:carparking,代码行数:40,代码来源:Contact.php

示例7: addNote

 function addNote($vars, &$errors)
 {
     //Add ticket Id.
     $vars['ticketId'] = $this->getTicketId();
     return Note::create($vars, $errors);
 }
开发者ID:CarlosAvilesMx,项目名称:CarlosAviles.Mx,代码行数:6,代码来源:class.thread.php

示例8: addNote

 function addNote($vars, &$errors)
 {
     //Add ticket Id.
     $vars['ticketId'] = $this->getTicketId();
     // DELME: When HTML / rich-text is supported
     $vars['title'] = Format::htmlchars($vars['title']);
     $vars['note'] = Format::htmlchars($vars['note']);
     return Note::create($vars, $errors);
 }
开发者ID:pkdevboxy,项目名称:osTicket-1.7,代码行数:9,代码来源:class.thread.php

示例9: saveComment

 public function saveComment()
 {
     $data = array();
     if ($_POST['comment']) {
         try {
             $note = Note::create(array('ticketNumber' => $_POST['ticketNumber'], 'note' => $_POST['comment']));
             $time = $note->getAttributes();
             $note->save();
             $data['time'] = $time["created_at"];
             $data['comment'] = $_POST['comment'];
         } catch (Exception $e) {
             $response['info'] = "fail";
             $boolean = false;
             echo $e;
         }
     }
     echo json_encode($data);
 }
开发者ID:YuxiangRose,项目名称:CavaTravel,代码行数:18,代码来源:TicketsController.php

示例10: store

 /**
  * Store a newly created resource in storage.
  * POST /notes
  *
  * @return Response
  */
 public function store()
 {
     Note::create(['note' => Input::get('note')]);
     return Response::json(array('success' => true));
 }
开发者ID:calebdre,项目名称:Mark-It-Down,代码行数:11,代码来源:NotesController.php

示例11: addNote

function addNote($item_id, $user_id, $content)
{
    $note = new Note();
    $note->create($item_id, $user_id, $content);
    $note->save();
}
开发者ID:Adrian268,项目名称:comp296,代码行数:6,代码来源:ItemController.php


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