ipublikuj / doctrine-phone Goto Github PK
View Code? Open in Web Editor NEW:phone: Phone number entity field for Doctrine2 and Nette Framework (3.0+)
License: Other
:phone: Phone number entity field for Doctrine2 and Nette Framework (3.0+)
License: Other
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 :)
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;
}
...
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.