Removed type from Channel

This commit is contained in:
Kristian Løvstrøm 2015-02-03 19:05:45 +06:00 committed by michalmarcinkowski
parent 8f041078fd
commit 71da427644
11 changed files with 5 additions and 68 deletions

View file

@ -34,13 +34,6 @@ class ChannelType extends AbstractResourceType
->add('name', 'text', array(
'label' => 'sylius.form.channel.name'
))
->add('type', 'choice', array(
'choices' => array(
ChannelInterface::MOBILE => 'Mobile',
ChannelInterface::WEB => 'Web'
),
'label' => 'sylius.form.channel.type'
))
->add('description', 'text', array(
'label' => 'sylius.form.channel.description',
'required' => false,

View file

@ -24,7 +24,6 @@
<field name="code" type="string" unique="true" />
<field name="name" type="string" />
<field name="type" type="string" />
<field name="color" type="string" nullable="true"/>
<field name="description" type="text" nullable="true" />
<field name="enabled" type="boolean" />

View file

@ -6,5 +6,4 @@ sylius:
description: Description
url: URL
enabled: Enabled
type: Type
color: Color

View file

@ -50,12 +50,6 @@ class ChannelTypeSpec extends ObjectBehavior
->willReturn($builder)
;
$builder
->add('type', 'choice', Argument::any())
->shouldBeCalled()
->willReturn($builder)
;
$builder
->add('description', 'text', Argument::any())
->shouldBeCalled()

View file

@ -13,7 +13,6 @@ namespace Sylius\Bundle\FixturesBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Sylius\Bundle\FixturesBundle\DataFixtures\DataFixture;
use Sylius\Component\Addressing\Model\AddressInterface;
use Sylius\Component\Cart\SyliusCartEvents;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\OrderItemInterface;

View file

@ -43,11 +43,6 @@ class Channel implements ChannelInterface
*/
protected $url;
/**
* @var string
*/
protected $type = ChannelInterface::WEB;
/**
* @var string
*/
@ -161,24 +156,6 @@ class Channel implements ChannelInterface
return $this;
}
/**
* {@inheritdoc}
*/
public function getType()
{
return $this->type;
}
/**
* {@inheritdoc}
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* {@inheritdoc}
*/

View file

@ -20,9 +20,6 @@ use Sylius\Component\Resource\Model\TimestampableInterface;
*/
interface ChannelInterface extends TimestampableInterface
{
const WEB = 'web';
const MOBILE = 'mobile';
/**
* @return string
*/
@ -48,16 +45,6 @@ interface ChannelInterface extends TimestampableInterface
public function getUrl();
public function setUrl($url);
/**
* @return string
*/
public function getType();
/**
* @param string $type
*/
public function setType($type);
/**
* @return string
*/

View file

@ -22,10 +22,10 @@
"require": {
"php": ">=5.3.3",
"sylius/resource": "0.12.*@dev"
"sylius/resource": "0.13.*@dev"
},
"require-dev": {
"phpspec/phpspec": "~2.0"
"phpspec/phpspec": "~2.1"
},
"config": {
"bin-dir": "bin"

View file

@ -53,17 +53,6 @@ class ChannelSpec extends ObjectBehavior
$this->getName()->shouldReturn('Mobile Store');
}
function it_has_default_type()
{
$this->getType()->shouldReturn(ChannelInterface::WEB);
}
function its_type_is_mutable()
{
$this->setType(ChannelInterface::MOBILE);
$this->getType()->shouldReturn(ChannelInterface::MOBILE);
}
function it_has_no_color_by_default()
{
$this->getColor()->shouldReturn(null);

View file

@ -22,7 +22,7 @@ use Sylius\Component\Channel\Context\ChannelContextInterface as BaseChannelConte
interface ChannelContextInterface extends BaseChannelContextInterface
{
/**
* @inheritdoc
* {@inheritdoc}
*
* @return ChannelInterface
*/

View file

@ -81,7 +81,7 @@ class Order extends Cart implements OrderInterface
*
* @var float
*/
protected $exchangeRate = 1;
protected $exchangeRate = 1.0;
/**
* Promotion coupons.
@ -492,7 +492,7 @@ class Order extends Cart implements OrderInterface
*/
public function setExchangeRate($exchangeRate)
{
$this->exchangeRate = $exchangeRate;
$this->exchangeRate = (float) $exchangeRate;
return $this;
}