本文整理汇总了PHP中Type::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::getAll方法的具体用法?PHP Type::getAll怎么用?PHP Type::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
//$searchModel = new Type;
//$dataProvider = $searchModel->pageAll(Yii::$app->request->queryParams);
//return $this->render('index', [
// 'dataProvider' => $dataProvider,
//]);
$model = new Type();
$arr['obj'] = $model->getAll();
$arr['f_name'] = $model->getAll(['f_id' => "0"]);
return $this->renderPartial('index', $arr);
}
示例2: find
static function find($search_id)
{
$found_type = null;
$types = Type::getAll();
foreach ($types as $type) {
$type_id = $type->getId();
if ($type_id == $search_id) {
$found_type = $type;
}
}
return $found_type;
}
示例3: test_deleteAll
function test_deleteAll()
{
//Arrange
$descript = "Event Keepsakes";
$descript2 = "Antiques";
$test_Type = new Type($descript);
$test_Type->save();
$test_Type2 = new Type($descript2);
$test_Type2->save();
//Act
Type::deleteAll();
$result = Type::getAll();
//Assert
$this->assertEquals([], $result);
}
示例4: function
});
$app->get('/trainers/:id/badges', function ($id) use($app) {
$trainer = Trainer::getById($id);
sendResponse($trainer->getBadges());
});
$app->get('/gyms', function () use($app) {
sendResponse(Gym::getAll());
});
$app->get('/gyms/:id', function ($id) use($app) {
$gym = Gym::getById($id);
sendResponse($gym->serialize());
});
$app->get('/gyms/:id/leader', function ($id) use($app) {
$gym = Gym::getById($id);
sendResponse($gym->getLeader()->serialize());
});
$app->get('/types', function () use($app) {
sendResponse(Type::getAll());
});
$app->get('/types/:id', function ($id) use($app) {
$type = Type::getById($id);
sendResponse($type->serialize());
});
$app->get('/badges', function () use($app) {
sendResponse(Badge::getAll());
});
$app->get('/badges/:id', function ($id) use($app) {
$badge = Badge::getById($id);
sendResponse($badge->serialize());
});
$app->run();
示例5: function
});
$app->get("/types", function () use($app) {
return $app['twig']->render('types.html.twig', array('types' => Type::getAll()));
});
$app->get("/searches", function () use($app) {
return $app['twig']->render('searches.html.twig', array('searches' => Search::getAll()));
});
$app->post("/collections", function () use($app) {
$collection = new Collection($_POST['thing']);
$collection->save();
return $app['twig']->render('collections.html.twig', array('collections' => Collection::getAll()));
});
$app->post("/types", function () use($app) {
$type = new Type($_POST['descript']);
$type->save();
return $app['twig']->render('types.html.twig', array('types' => Type::getAll()));
});
$app->post("/searches", function () use($app) {
$search = new Search($_POST['find']);
$search->save();
return $app['twig']->render('searches.html.twig', array('searches' => Search::getAll()));
});
$app->post("/delete_collections", function () use($app) {
Collection::deleteAll();
return $app['twig']->render('delete_collections.html.twig');
});
$app->post("/delete_types", function () use($app) {
Type::deleteAll();
return $app['twig']->render('delete_types.html.twig');
});
return $app;
示例6: getSelect
function getSelect()
{
$results = Type::getAll("title");
foreach ($results as $row) {
$temp[] = array("value" => $row['id'], "label" => stripslashes($row['title']));
}
return $temp;
}