本文整理汇总了PHP中client::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP client::getAll方法的具体用法?PHP client::getAll怎么用?PHP client::getAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client
的用法示例。
在下文中一共展示了client::getAll方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find
static function find($search_id)
{
$found_client = null;
$clients = client::getAll();
foreach (clients as $client) {
$id = $client->getId();
if ($id == $search_id) {
$found_client = $client;
}
}
return $found_client;
}
示例2: test_save
function test_save()
{
//Arrange
$stylist_name = "Donna";
$id = null;
$test_stylist = new Stylist($stylist_name, $id);
$test_stylist->save();
$client_name = "Robin";
$stylist_id = $test_stylist->getId();
$test_client = new Client($client_name, $stylist_id);
$test_client->save();
//Act
$result = client::getAll();
//Assert
$this->assertEquals($test_client, $result[0]);
}
示例3: test_getAll
function test_getAll()
{
$name = "Megan";
$id = null;
$test_stylist = new Stylist($name, $id);
$test_stylist->save();
$client_name = "Shawnee";
$stylist_id = $test_stylist->getId();
$test_client = new Client($id, $client_name, $stylist_id);
$test_client->save();
$client_name2 = "Katie";
$stylist_id = $test_stylist->getId();
$test_client2 = new Client($id, $client_name, $stylist_id);
$test_client2->save();
$result = client::getAll();
$this->assertEquals([$test_client, $test_client2], $result);
$result = Client::getAll();
$this->assertEquals([$test_client, $test_client2], $result);
}
示例4: test_deleteClient
function test_deleteClient()
{
//Arrange
$name = "Tessa";
$id = null;
$test_stylist = new stylist($name, $id);
$test_stylist->save();
$test_stylist_id = $test_stylist->getId();
$name = "Mai";
$description = "Scary";
$visits = 3;
$name2 = "Doory";
$description2 = "Not worth it.";
$visits2 = 4;
$test_client = new client($name, $test_stylist_id, $id, $visits, $description);
$test_client2 = new client($name2, $test_stylist_id, $id, $visits2, $description2);
$test_client->save();
$test_client2->save();
//Act
$test_client->deleteClient();
//Assert
$this->assertEquals([$test_client2], client::getAll());
}
示例5:
<?php
include 'template/blankStart.php';
include_once '../model/profiles/client.php';
$clients = client::getAll();
?>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title"> </h3>
</div>
<div class="panel-body">
<?php
$index = 1;
foreach ($clients as $client) {
echo "<a href=\"client_info.php?client={$client['name']}\"> {$index}.{$client['name']}</a><br>";
$index++;
}
?>
</div>
</div>
</div>
</div>
<?php
include 'template/blankEnd.php';