mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-14 09:16:05 -06:00
33 lines
819 B
PHP
33 lines
819 B
PHP
<?php namespace Visiosoft\ProfileModule\Adress;
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Visiosoft\ProfileModule\Adress\Contract\AdressInterface;
|
|
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
|
|
|
|
class AdressModel extends ProfileAdressEntryModel implements AdressInterface
|
|
{
|
|
public function getAdress($id = null) {
|
|
if($id == null)
|
|
{
|
|
return AdressModel::query();
|
|
}
|
|
return AdressModel::query()->where('id',$id);
|
|
}
|
|
|
|
public function getAdressFirst($id) {
|
|
return $this->getAdress($id)->first();
|
|
}
|
|
|
|
public function getUserAdress($id = null)
|
|
{
|
|
if($id != null)
|
|
{
|
|
return $this->query()->where('user_id',$id)->get();
|
|
}
|
|
return $this->query()->where('user_id',Auth::id())->get();
|
|
|
|
}
|
|
|
|
|
|
}
|