本文整理汇总了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'));
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return Contact::all();
}
示例3: Contact
<?php
require APP_PATH . '/models/Contact.php';
$web = 'http://adsiar.com';
$contactTable = new Contact();
$contacts = $contactTable->all();
view('contacto', compact('web', 'contacts'));
示例4: get_contacts
public function get_contacts()
{
return Contact::all();
}
示例5: showcontacts
public function showcontacts()
{
return View::make('contacts.showcontacts')->with('title', 'contacts')->with('contacts', Contact::all());
// display contacts
}
示例6: all
function all($request)
{
$contact = new Contact();
$list = $contact->all($contact);
echo json_encode($list);
}
示例7: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$fetchedContacts = Contact::all();
return $fetchedContacts;
}
示例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'];
?>
示例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.');
}
}
示例10: listContactos
/**
* Muestra la lista de contactos
*/
public function listContactos()
{
$contactos = Contact::all();
return View::make('contactos.lista', array('contactos' => $contactos));
}
示例11: viewContacts
public function viewContacts()
{
$allContacts = Contact::all();
return View::make('contacts.view-contacts', array('contacts' => $allContacts));
}
示例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;
示例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();
示例14: showAll
function showAll()
{
$contact = Contact::all();
echo json_encode($contact);
}
示例15: ajax_get_contacts
function ajax_get_contacts()
{
if (Auth::guest()) {
exit;
}
json_message(Contact::all(Auth::user()->id));
}