Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created August 27, 2014 15:21
Show Gist options
  • Save alnutile/14f9801eb6d206ab4efb to your computer and use it in GitHub Desktop.
Save alnutile/14f9801eb6d206ab4efb to your computer and use it in GitHub Desktop.
<?php
/**
* Created by PhpStorm.
* User: alfrednutile
* Date: 8/27/14
* Time: 11:04 AM
*/
namespace BehatEditor;
use BehatEditor\Models\Browser;
trait BrowsersTrait {
protected $browsers;
public function getBrowsers()
{
if($this->browsers == null)
{
$this->setBrowsers();
}
return $this->browsers;
}
public function setBrowsers(array $browsers = array())
{
if($browsers == null)
{
$browsers = new Browser();
$results = $browsers->all();
return $results->toArray();
}
return $browsers;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment