Updated Videotex frame to use Parser
This commit is contained in:
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Frame extends Model
|
||||
{
|
||||
public $cache_content = '';
|
||||
|
||||
public function cug()
|
||||
{
|
||||
return $this->belongsTo(CUG::class);
|
||||
@@ -32,9 +34,14 @@ class Frame extends Model
|
||||
*/
|
||||
public function getContentAttribute()
|
||||
{
|
||||
return is_resource($this->attributes['content'])
|
||||
? stream_get_contents($this->attributes['content'])
|
||||
: $this->attributes['content'];
|
||||
// For stream resources, we need to cache this result.
|
||||
if (! $this->cache_content) {
|
||||
$this->cache_content = is_resource($this->attributes['content'])
|
||||
? stream_get_contents($this->attributes['content'])
|
||||
: $this->attributes['content'];
|
||||
}
|
||||
|
||||
return $this->cache_content;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user