本文整理汇总了PHP中Family::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::all方法的具体用法?PHP Family::all怎么用?PHP Family::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Family
的用法示例。
在下文中一共展示了Family::all方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findFamily
public static function findFamily($user)
{
$families = \Family::all(["user_id = ?" => $user->id], ["member_id", "relation"]);
$fs = array();
foreach ($families as $f) {
$u = \User::first(["id = ?" => $f->member_id], ["name"]);
$fs[(int) $f->member_id] = ArrayMethods::toObject(["name" => $u->name, "user_id" => $f->member_id, "relation" => $f->relation]);
}
return $fs;
}
示例2: family
/**
* @before _secure
*/
public function family($action = NULL, $id = NULL)
{
$this->seo(array("title" => "Family Added", "view" => $this->getLayoutView()));
$view = $this->getActionView();
if ($action == "delete") {
$family = Family::first(array("id = ?" => $id));
if ($family) {
$family->delete();
}
}
$members = Family::all(array("user_id = ?" => $this->user->id), array("member_id", "relation", "id"));
$view->set("members", $members);
}
示例3: admin_index
public function admin_index()
{
$family_laws = Family::all();
return View::make('families.admin_index', compact('family_laws'));
}