2725 search results for Doctrine

... full control (and there isn't any magic you don't know about). But, I *do* think that some users will need/want something like this. The best example is probably a OneToOne relationship in Doctrine (which I admit, I don't ...
weaverryan
weaverryan
Read Full Comment
... /doctrine/registration_form.html and make:registration-form has produced exactly the same files and code. But when I submit registration form the $form in controller action is ALWAYS invalid. I.e. false === $form->isValid(). As ...
... skip trying to do in Doctrine? I've been driving myself a little crazy. I'm also guilty of over optimizing as well, I know.
Jonathan Keen
Jonathan Keen
Read Full Comment
... /0b7bdbefd3d166def27928dcd62ab67c11c8f172/lib/Gedmo/Sluggable/Util/Urlizer.php - so you can use that manually to do it. You could *even* do this in a Doctrine listener, if you wanted it to be automatic. Let me know if this makes sense! It ...
weaverryan
weaverryan
Read Full Comment
... cat.name May it be a difference with DB engine or something on Doctrine. I got something very similar on the screen cast before this one, so I changed it to: return $this->createQueryBuilder('fc') ->andWhere ...
danresmejia
danresmejia
Read Full Comment
... things during development too early :) P.S. You can also enable caching for Doctrine queries in production, so you don't need to make up a custom caching, see metadata_cache_driver, query_cache_driver, and result_cache_driver in doctrine.orm config path. Cheers!
Hi Diego the doctrine connection had the access to database and in symfony profiler there are two queries that were executed #▼ Time Info 2 1.00 ms SELECT t0.id AS id_1, t0.author_name AS author_name_2, t0.content ...
... /reflectionclass.getmethods.php) to get all the methods. 3) For each method, it it is public (if it's not public, just "continue"), use the annotations reader (autowireable by type-hinting the argument with `Doctrine\Common ...
weaverryan
weaverryan
Read Full Comment
... You join directly from the FortuneCookie's "tags" property over to the Tag entity - leftJoin('fc.tags', 'tags'). In the background, Doctrine actually joins to the join table AND then from the join table to the tag table ...
weaverryan
weaverryan
Read Full Comment
... NULL, CHANGE longitude longitude VARCHAR(32) DEFAULT NULL; ``` The initial migration created the fields in the ALTER TABLE statements above just the same way (identical). It seems that those changes remained stuck somehow and they constantly appear as new for doctrine. Am I doing something wrong?
... PersistetCollection Doctrine object. In your situation, you have a ManyToMany. So, ran will not contain one Rank object. And, on the other side, inside Rank, your "members" property will not contain just a single Members ...
weaverryan
weaverryan
Read Full Comment
Hey! I like it just fine! I don't usually type-hint, because Doctrine will eventually cast (for example) a string to an int. But technically, this is more strict - since your object will *always* (for example) have an ...
weaverryan
weaverryan
Read Full Comment
... \Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver ...
... and reading more information I have it more clear, I mean that for example I had created a service "Menu" that saved the Main menu and Footer menu of a website, of course this Entity uses the Nested system with Doctrine ...
Jose carlos C.
Jose carlos C.
Read Full Comment
... term "FileSystem." 3- In the QueryBuilder from Doctrine I see that we have the options of being able to use Cache with the methods: ``` ->useQueryCache(true) ->useResultCache(true, 3600, 'cache_my_key') ``` Are these ...
Jose carlos C.
Jose carlos C.
Read Full Comment
... extend the Fixture class from the bundle (https://github.com/doctrine/DoctrineFixturesBundle/blob/master/Fixture.php) - or more specifically, as long as your fixture class implements the ORMFixtureInterface, the ...
weaverryan
weaverryan
Read Full Comment
... will cause extra queries to be made, but this can avoid that with the strategy shown here: https://knpuniversity.com/screencast/doctrine-queries/joins-reduce-queries 3) Make multiple queries - query for the User object, and then its applications, etc. Always a good fallback option if things get tricky. Cheers!
weaverryan
weaverryan
Read Full Comment
... what exactly relations do you need by explaining each possible relations. Btw, we're talking about this command here: https://knpuniversity.com/screencast/doctrine-relations/many-to-many I hope this helps! Cheers!
101 lines | src/Entity/User.php
// ... lines 1 - 2
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
*/
class User implements UserInterface
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=180, unique=true)
*/
private $email;
/**
* @ORM\Column(type="json")
*/
private $roles = [];
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
/**
* A visual identifier that represents this user.
*
* @see UserInterface
*/
public function getUsername(): string
{
return (string) $this->email;
}
/**
* @see UserInterface
*/
public function getRoles(): array
{
$roles = $this->roles;
// guarantee every user at least has ROLE_USER
$roles[] = 'ROLE_USER';
return array_unique($roles);
}
public function setRoles(array $roles): self
{
$this->roles = $roles;
return $this;
}
/**
* @see UserInterface
*/
public function getPassword()
{
// not needed for apps that do not check user passwords
}
/**
* @see UserInterface
*/
public function getSalt()
{
// not needed for apps that do not check user passwords
}
/**
* @see UserInterface
*/
public function eraseCredentials()
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
}
See Code Block in Script
Trying to update operation with many to many: I have two entites PromoCode Entity ``` namespace App\Entity; use App\Repository\PromoCodeRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine ...
Dhrubajyoti D.
Dhrubajyoti D.
Read Full Comment