/** * Gets the first child of the item * @param LayoutContent $item The item * @return LayoutContent Returns the first child */ public function FirstChildOf($item) { if ($item) { $sql = Access::SqlBuilder(); $tbl = LayoutContent::Schema()->Table(); $where = $sql->Equals($tbl->Field('Parent'), $sql->Value($item->GetID()))->And_($sql->IsNull($tbl->Field('Previous'))); return LayoutContent::Schema()->First($where); } else { return $this->TopMost(); } }