forked from 2amigos/yii2-google-maps-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptionsTrait.php
More file actions
35 lines (32 loc) · 747 Bytes
/
OptionsTrait.php
File metadata and controls
35 lines (32 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/*
*
* @copyright Copyright (c) 2013-2019 2amigos
* @link http://2amigos.us
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License
*
*/
namespace dosamigos\google\maps;
/**
* OptionsTrait
*
* Contains common functions for option classes.
*
* @author Antonio Ramirez <hola@2amigos.us>
*
* @link http://www.2amigos.us/
* @package dosamigos\google\maps
*/
trait OptionsTrait
{
/**
* @return string the js constructor of the object
*/
public function getJs()
{
$name = $this->getName(false) ? "var {$this->getName()} = " : "";
$end = $this->getName(false) ? ";" : "";
$options = $this->getEncodedOptions();
return "{$name}{$options}{$end}";
}
}