public function set(array $data)
    {
        $build = $this->build($data);

        if (empty($build['asset'])) {
            return false;
        }

        if (!empty($build['merge']) && is_array($build['asset'])) {
            if (isset($this->assets[$build['type']][$build['position']][$build['merge']])) {
                $existing = $this->assets[$build['type']][$build['position']][$build['merge']]['asset'];
                $this->assets[$build['type']][$build['position']][$build['merge']]['asset'] = array_merge($existing, $build['asset']);
            }
        }

        if (isset($this->assets[$build['type']][$build['position']][$build['key']])) {
            return false;
        }

        $this->assets[$build['type']][$build['position']][$build['key']] = $build;
        return $this->assets[$build['type']];
    }
public function set(array $data)
    {
        $build = $this->build($data);

        if (empty($build['asset'])) {
            return false;
        }

        if (!empty($build['merge']) && is_array($build['asset'])) {
            if (isset($this->assets[$build['type']][$build['position']][$build['merge']])) {
                $existing = $this->assets[$build['type']][$build['position']][$build['merge']]['asset'];
                $this->assets[$build['type']][$build['position']][$build['merge']]['asset'] = array_merge($existing, $build['asset']);
            }
        }

        if (isset($this->assets[$build['type']][$build['position']][$build['key']])) {
            return false;
        }

        $this->assets[$build['type']][$build['position']][$build['key']] = $build;
        return $this->assets[$build['type']];
    }
public function set ( array $ data ) { $ build = $ this -> build ( $ data ) ; if ( empty ( $ build [ 'asset' ] ) ) { return false ; } if ( ! empty ( $ build [ 'merge' ] ) && is_array ( $ build [ 'asset' ] ) ) { if ( isset ( $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'merge' ] ] ) ) { $ existing = $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'merge' ] ] [ 'asset' ] ; $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'merge' ] ] [ 'asset' ] = array_merge ( $ existing , $ build [ 'asset' ] ) ; } } if ( isset ( $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'key' ] ] ) ) { return false ; } $ this -> assets [ $ build [ 'type' ] ] [ $ build [ 'position' ] ] [ $ build [ 'key' ] ] = $ build ; return $ this -> assets [ $ build [ 'type' ] ] ; }
Sets an asset
@param array $data
@return bool|array
Sets an asset