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


PHP Contact::all方法代码示例

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


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

示例1: showMemberContacts

 public function showMemberContacts()
 {
     $memberCollection = array();
     if (Auth::user()->isAdmin()) {
         $contacts = Contact::all();
     } else {
         $contacts = Contact::where('user_id', Auth::user()->id)->get();
         $memberCollection = MemberAPI::getmemberapiselect(Auth::user()->id);
         foreach ($memberCollection as $member) {
             if (!User::find($member->member_id)) {
                 $user = new User();
                 $user->id = $member->member_id;
                 $user->username = $member->username;
                 $user->name = $member->name;
                 $user->password = Hash::make(rand());
                 $user->active = 1;
                 $user->save();
             }
             $membercontacts = Contact::where('user_id', $member->member_id)->get();
             $contacts = $contacts->merge($membercontacts);
         }
         // return $contacts->toJson();
     }
     return View::make('contacts.member', compact('contacts', 'memberCollection'));
 }
开发者ID:arbuuuud,项目名称:gnt-aops,代码行数:25,代码来源:ContactsController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Contact::all();
 }
开发者ID:rashidul0405,项目名称:Test-Backbone,代码行数:9,代码来源:ContactsController.php

示例3: Contact

<?php

require APP_PATH . '/models/Contact.php';
$web = 'http://adsiar.com';
$contactTable = new Contact();
$contacts = $contactTable->all();
view('contacto', compact('web', 'contacts'));
开发者ID:danielromeroauk,项目名称:adsiarPHP,代码行数:7,代码来源:contacto.php

示例4: get_contacts

 public function get_contacts()
 {
     return Contact::all();
 }
开发者ID:graphem,项目名称:v1wrappers,代码行数:4,代码来源:vr_api_test.php

示例5: showcontacts

 public function showcontacts()
 {
     return View::make('contacts.showcontacts')->with('title', 'contacts')->with('contacts', Contact::all());
     // display contacts
 }
开发者ID:elahiabdul,项目名称:online,代码行数:5,代码来源:ContactsController.php

示例6: all

function all($request)
{
    $contact = new Contact();
    $list = $contact->all($contact);
    echo json_encode($list);
}
开发者ID:jhmachado,项目名称:tools,代码行数:6,代码来源:contact.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $fetchedContacts = Contact::all();
     return $fetchedContacts;
 }
开发者ID:NevDK91,项目名称:contacts_manager,代码行数:10,代码来源:ContactsController.php

示例8: _e

			</div>
			<div class="form-group">
		    	<button type="submit" name="submit" class="btn btn-primary"><?php 
        _e('main.save_changes');
        ?>
</button>
		    </div>
		</form>
		<br>
		<h4><?php 
        _e('main.contacts');
        ?>
</h4>
		<ul class="list-group contact-list">
			<?php 
        foreach (Contact::all(Auth::user()->id) as $contact) {
            ?>
				<li class="list-group-item <?php 
            echo empty($contact['accepted']) ? '' : 'contact-confirmed';
            ?>
" data-contact-id="<?php 
            echo $contact['id'];
            ?>
">
					<a href="<?php 
            echo App::url("profile.php?u={$contact['id']}");
            ?>
" target="_blank">
						<img src="<?php 
            echo $contact['avatar'];
            ?>
开发者ID:vladvoth,项目名称:productclash,代码行数:31,代码来源:settings.php

示例9: getManager

 public function getManager($section = null)
 {
     if (Auth::user()->level == 1) {
         if ($section == 'clients') {
             $clients = Client::findParentClients();
             $executive = new Client();
             $this->layout->content = View::make('pages.clients', array('clients' => $clients, 'users' => $executive->executiveList()));
         } elseif ($section == 'contacts') {
             $contacts = Contact::all();
             $contact = new Contact();
             $this->layout->content = View::make('pages.contacts', array('contacto' => $contact, 'contacts' => $contacts, 'clients' => $contact->clientList()));
         } elseif ($section == 'users') {
             $users = User::all();
             $this->layout->content = View::make('pages.users', array('users' => $users));
         } else {
             $status = Status::findStatus($_GET);
             $clientsList = Client::findClientsList();
             $executive = new Client();
             $magazine = Magazine::listMagazine();
             $edition = range(0, 200);
             $edition[0] = 'Edición';
             $stat = new Status();
             $this->layout->content = View::make('pages.statusManager', array('estatus' => $stat, 'status' => $status, 'magazine' => $magazine, 'edition' => $edition, 'clients' => $clientsList, 'executive' => $executive->executiveList()));
         }
     } else {
         return Redirect::to('home')->with('message', 'Debes iniciar sesión para continuar.');
     }
 }
开发者ID:josemujicap,项目名称:AveFenix-CRM,代码行数:28,代码来源:UsersController.php

示例10: listContactos

 /**
  * Muestra la lista de contactos
  */
 public function listContactos()
 {
     $contactos = Contact::all();
     return View::make('contactos.lista', array('contactos' => $contactos));
 }
开发者ID:soberanes,项目名称:dalecms,代码行数:8,代码来源:ContactosController.php

示例11: viewContacts

 public function viewContacts()
 {
     $allContacts = Contact::all();
     return View::make('contacts.view-contacts', array('contacts' => $allContacts));
 }
开发者ID:nimeshmora,项目名称:CRM-DMA-Recruitment,代码行数:5,代码来源:ContactsController.php

示例12: function

    $html = (require_once '../views/main.html');
    $response->write($html);
    return $response;
});
$app->post('/contacts', function ($request, $response, $args) {
    // add contact to db
    $newContact = $request->getParsedBody();
    $contact = new Contact();
    $contact->name = $newContact['name'];
    $contact->email = $newContact['email'];
    $contact->number = $newContact['number'];
    $contact->save();
    return $response;
});
$app->get('/contacts', function ($request, $response, $args) {
    $response->withJson(Contact::all());
    return $response;
});
$app->get('/contacts/{id}', function ($request, $response, $args) {
    $contact = Contact::find($args['id']);
    $response->write($contact->toJson());
    return $response;
});
$app->put('/contacts/{id}', function ($request, $response, $args) {
    $editedContact = $request->getParsedBody();
    $contact = Contact::find($args['id']);
    $contact->name = $editedContact['name'];
    $contact->email = $editedContact['email'];
    $contact->number = $editedContact['number'];
    $contact->save();
    return $response;
开发者ID:zgulde,项目名称:contacts-manager,代码行数:31,代码来源:index.php

示例13: array_map

    if (is_array($d)) {
        return array_map(__FUNCTION__, $d);
    } else {
        return $d;
    }
}
$contactList = new \Slim\Slim();
use Illuminate\Database\Capsule\Manager as Capsule;
$capsule = new Capsule();
$capsule->addConnection(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'contactList', 'username' => 'root', 'password' => 'root', 'charset' => 'utf8', 'collation' => 'utf8_general_ci'));
$capsule->bootEloquent();
$capsule->setAsGlobal();
$conn = $capsule->connection();
// Get all contacts
$contactList->get('/contacts', function () use($contactList) {
    $contacts = Contact::all();
    foreach ($contacts as $chave => $valor) {
        $dados[$chave] = json_decode($valor);
        $phones = Phone::where('contactId', '=', $dados[$chave]->id)->get();
        $dados[$chave]->phones = json_decode($phones);
        $addresses = Address::where('contactId', '=', $dados[$chave]->id)->get();
        $dados[$chave]->addresses = json_decode($addresses);
    }
    $contactList->response()->header('Content-Type', 'application/json');
    echo json_encode($dados);
});
// Get contacts page
$contactList->get('/contacts/page/:p/:rpp', function ($p, $rpp) use($contactList) {
    $pagina = $p - 1;
    $skip = $pagina * $rpp;
    $contacts = Contact::take($rpp)->skip($skip)->get();
开发者ID:vitorm11,项目名称:contactlist,代码行数:31,代码来源:index.php

示例14: showAll

 function showAll()
 {
     $contact = Contact::all();
     echo json_encode($contact);
 }
开发者ID:Jay-En,项目名称:BonePHP-starter,代码行数:5,代码来源:contactController.php

示例15: ajax_get_contacts

function ajax_get_contacts()
{
    if (Auth::guest()) {
        exit;
    }
    json_message(Contact::all(Auth::user()->id));
}
开发者ID:vladvoth,项目名称:productclash,代码行数:7,代码来源:ajax.php


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