More code optimisation

This commit is contained in:
Deon George
2018-12-06 14:09:43 +11:00
parent 9c2304869d
commit 0eaaa57e8a
2 changed files with 246 additions and 288 deletions

View File

@@ -60,7 +60,6 @@ class Frame
public function __construct(\App\Models\Frame $o,string $msg=NULL)
{
dump(__METHOD__);
$this->frame = $o;
$this->output = $this->hasFlag('clear') ? CLS : HOME;
@@ -94,6 +93,25 @@ class Frame
return $this->output;
}
/**
* Return a list of alternative versions of this frame.
*/
public function alts()
{
return \App\Models\Frame::where('frame',$this->frame())
->where('index',$this->index())
->where('id','<>',$this->frame->id)
->limit(9);
}
/**
* Frame Created Date
*/
public function created()
{
return $this->frame->created_at;
}
/**
* Convert the frame from Binary to Output
* Look for fields within the frame.
@@ -385,7 +403,7 @@ class Frame
* @param $text
* @return int
*/
function strlenv($text) {
function strlenv($text):int {
return strlen($text)-substr_count($text,ESC);
}