Git Product home page Git Product logo

doctrine-phone's People

Contributors

akadlec avatar jiripudil avatar tg666 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

fvesely tg666

doctrine-phone's Issues

Extra code in generated migrations

I'm starting to use this extension and currently writing migrations for my database schema, and migrations:diff command is generating this piece of code:

$this->addSql('ALTER TABLE users ALTER telephone TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE users ALTER telephone DROP DEFAULT');

This is in my opinion wrong, as the targeted column is already VARCHAR(255) and it has NULL set as a default value. I'm using postgresql. The column is defined as follows:

/**
 * @var Phone
 * @ORM\Column(type="phone", unique=true, nullable=true)
 */
private $telephone;

I think the code shouldn't be generated at all, because the type definition is, if I recall correctly, compatible with normal string type, which was set at this column before.

No PR because I haven't had time to dig into this deeper, sorry. Feel free to prove me wrong though, I may be just a bit too sleepy to think straight :)

Problem with DI

Hi, I have a problem with DI in my Nette app. I tried to implement your doctine-phone, but when I use your solution from documentation something gone wrong. Is it any way how to inject missing $phoneHelper or ..?

Service 'doctrinePhone.subscriber' (type of IPub\DoctrinePhone\Events\PhoneObjectSubscriber): Service of type IPub\Phone\Phone needed by $phoneHelper in IPub\DoctrinePhone\Events\PhoneObjectSubscriber::__construct() not found. Did you register it in configuration file?

config.neon
extensions: ... doctrinePhone: IPub\DoctrinePhone\DI\DoctrinePhoneExtension

My user entity (I using MagicAccessors instead of BaseEntity)

use Kdyby\Doctrine\Entities\MagicAccessors;
class User {
    use Identifier;
    use MagicAccessors;
    /**
     * Telefonní číslo
     * @ORM\Column(type="phone")
     * @var Phone\Entities\Phone
     */
    protected $phone;
    /**
     * @var $phone IPub\Phone\Entities\Phone
     */
    public function setPhone($phone)
    {
        $this->phone = $phone;
    }
    /**
     * @return IPub\Phone\Entities\Phone
     */
    public function getPhone()
    {
        return $this->phone;
    }
...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.