Created frames table with migration
This commit is contained in:
@@ -13,25 +13,14 @@ class Frame extends Model
|
||||
* @param string $frame
|
||||
* @return mixed
|
||||
*/
|
||||
public function fetch(int $page,string $frame): \App\Classes\Frame
|
||||
public function fetch(int $frame,string $index): \App\Classes\Frame
|
||||
{
|
||||
if ($page == '999' and $frame == 'a')
|
||||
if ($frame == '999' and $index == 'a')
|
||||
{
|
||||
return new \App\Classes\Frame(\App\Classes\Frame::testFrame());
|
||||
}
|
||||
|
||||
return new \App\Classes\Frame($this->where('frame_id',$page)->where('subframe_id',$frame)->firstOrFail());
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the frame cost
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getCostAttribute()
|
||||
{
|
||||
// @todo NOT in DB
|
||||
return rand(0,999);
|
||||
return new \App\Classes\Frame($this->where('frame',$frame)->where('index',$index)->firstOrFail());
|
||||
}
|
||||
|
||||
public function hasFlag(string $flag)
|
||||
@@ -45,7 +34,6 @@ class Frame extends Model
|
||||
*/
|
||||
public function type()
|
||||
{
|
||||
// @todo in DB
|
||||
return isset($this->frametype) ? $this->frametype : 'i';
|
||||
return $this->type ?: 'i';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user