I have a class variable that I need to have available without an instance of the class. Something like
$size = Image::getSize('original');
Here's my attempt, but it getSize returns null.
class Image extends Model {
protected $sizes =
['original'=>['w'=>'2048','h'=>'1536','f'=>'1'],
'originalSquare'=>['w'=>'2048','h'=>'1536','f'=>'1'],
'thumb'=>['w'=>'120','h'=>'120','f'=>'1'],
'overview'=>['w'=>'554','h'=>'415','f'=>'3'],
'category'=>['w'=>'260','h'=>'195','f'=>'2'],
'medium'=>['w'=>'554','h'=>'415','f'=>'1']];
public static function getSize($size)
{
return(self::$sizes[$size]);
}
}
Is there a better way to accomplish this? $sizes is also used internally by an instance of this class.
protected static $sizes = array('original' =>?