📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
otogaleriscripti.demodesign.com.tr
/
includes
/
models
📝
Cities.php
← Geri Dön
<? class City{ public $id,$name; public function __construct($id,$name) { $this->id=$id; $this->name=$name; } public function get($id) { global $dbh; $sth = $dbh->prepare("select * from cities where id=:id"); $sth->execute(array("id"=>$id)); $city = $sth->fetch(PDO::FETCH_OBJ); /** @var City $city */ $this->id=$city->id; $this->name=$city->name; return $this; } } class Cities{ private $CitiesObj=[]; public function getAll(){ global $dbh; $sth = $dbh->prepare("select * from cities"); $sth->execute(); $cities = $sth->fetchAll(PDO::FETCH_OBJ); $this->CitiesObj =[]; foreach ($cities as $city) { /** @var City $city */ $this->CitiesObj[] = new City($city->id,$city->name); } return $this; } public function asJson(){ return json_encode($this->CitiesObj); } public function asObj(){ return ($this->CitiesObj); } } ?>
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula