當前位置: 首頁>>代碼示例>>PHP>>正文


PHP client::getAll方法代碼示例

本文整理匯總了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;
 }
開發者ID:jschold,項目名稱:Hair_Salon,代碼行數:12,代碼來源:Client.php

示例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]);
 }
開發者ID:bdspen,項目名稱:hair_salon,代碼行數:16,代碼來源:ClientTest.php

示例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);
 }
開發者ID:jschold,項目名稱:Hair_Salon,代碼行數:19,代碼來源:ClientTest.php

示例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());
 }
開發者ID:alexMcosta,項目名稱:Salon_Assesment,代碼行數:23,代碼來源:ClientTest.php

示例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';
開發者ID:n-sakib,項目名稱:juierp,代碼行數:28,代碼來源:clients.php


注:本文中的client::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。