You are here

public function TagView::getBreakpoints in Doubleclick for Publishers (DFP) 8

Gets the breakpoints.

Return value

array[] Each value is a array containing two keys: 'browser_size' and 'ad_sizes'. The 'browser_size' is a value such as '[1024,768]'. The 'ad_sizes' value contains a list of ad sizes to be be used at this 'browser_size' such as '[[300,600],[300,250]]'.

See also

\Drupal\dfp\View\TagView::formatSize()

File

src/View/TagView.php, line 294
Contains \Drupal\dfp\View\TagView.

Class

TagView
A value object to combine a DFP tag with global settings for display.

Namespace

Drupal\dfp\View

Code

public function getBreakpoints() {
  if (is_null($this->breakpoints)) {
    $this->breakpoints = array_map(function ($breakpoint) {
      return [
        'browser_size' => self::formatSize($breakpoint['browser_size']),
        'ad_sizes' => self::formatSize($breakpoint['ad_sizes']),
      ];
    }, $this->tag
      ->breakpoints());
  }
  return $this->breakpoints;
}