SuperdeskWebPublisher/SWPUpdaterBundle

View on GitHub
Model/UpdatePackage.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

/**
 * This file is part of the Superdesk Web Publisher Updater Bundle.
 *
 * Copyright 2015 Sourcefabric z.u. and contributors.
 *
 * For the full copyright and license information, please see the
 * AUTHORS and LICENSE files distributed with this source code.
 *
 * @copyright 2015 Sourcefabric z.รบ.
 * @license http://www.superdesk.org/license
 */

namespace SWP\UpdaterBundle\Model;

use Updater\Package\Package;

/**
 * Update package model class.
 */
class UpdatePackage extends Package
{
    /**
     * Construct method for class.
     *
     * @param array $data
     */
    public function __construct(array $data = array())
    {
        foreach ($data as $key => $value) {
            $this->$key = $value;
        }
    }

    /**
     * Get property from object.
     *
     * @param string $property Property name
     *
     * @return mixed Property value
     */
    public function __get($property)
    {
        if (property_exists($this, $property)) {
            return $this->$property;
        }
    }
}