<?php
namespace Tpg\ExtjsBundle\Annotation;

use Doctrine\ORM\Mapping\Annotation;

/**
 * @Annotation
 * @Target("CLASS")
 */
final class ModelProxy implements Annotation {
    public $name = 'memory';
    public $option = array();
    public $reader = array();
    public $writer = array();

    public function __construct($values) {
        if (isset($values['value'])) {
            $this->name = "rest";
            $this->option = array(
                "url"=>$values['value'],
                "format"=>"json",
            );
            $this->writer = array(
                "type"=>"json",
                "writeRecordId"=>false,
            );
        } else {
            if (isset($values['name'])) $this->name = $values['name'];
            if (isset($values['option'])) $this->option = $values['option'];
            if (isset($values['reader'])) $this->reader = $values['reader'];
            if (isset($values['writer'])) $this->writer = $values['writer'];
        }
    }
}
<?php
namespace Tpg\ExtjsBundle\Annotation;

use Doctrine\ORM\Mapping\Annotation;

/**
 * @Annotation
 * @Target("CLASS")
 */
final class ModelProxy implements Annotation {
    public $name = 'memory';
    public $option = array();
    public $reader = array();
    public $writer = array();

    public function __construct($values) {
        if (isset($values['value'])) {
            $this->name = "rest";
            $this->option = array(
                "url"=>$values['value'],
                "format"=>"json",
            );
            $this->writer = array(
                "type"=>"json",
                "writeRecordId"=>false,
            );
        } else {
            if (isset($values['name'])) $this->name = $values['name'];
        }
        if (isset($values['option'])) $this->option = array_merge($this->option, $values['option']);
        if (isset($values['writer'])) $this->writer = array_merge($this->writer, $values['writer']);
        if (isset($values['reader'])) $this->reader = $values['reader'];
    }
}
Fix bug option, reader and writer parameters was not being apply if value is set.
Fix bug option, reader and writer parameters was not being apply if value is set.
