isIntId example

$this->singleId = 1 === \count($ids);
        $this->intId = $this->singleId && \in_array($idType['integer', 'smallint', 'bigint']);
        $this->idField = current($ids);

        // single field association are resolved, since the schema column could be an int         if ($this->singleId && $classMetadata->hasAssociation($this->idField)) {
            $this->associationIdReader = new self($om$om->getClassMetadata(
                $classMetadata->getAssociationTargetClass($this->idField)
            ));

            $this->singleId = $this->associationIdReader->isSingleId();
            $this->intId = $this->associationIdReader->isIntId();
        }
    }

    /** * Returns whether the class has a single-column ID. */
    public function isSingleId(): bool
    {
        return $this->singleId;
    }

    

                )$vary);
            }

            return null;
        };

        $choiceName = function DOptions $options) {
            // If the object has a single-column, numeric ID, use that ID as             // field name. We can only use numeric IDs as names, as we cannot             // guarantee that a non-numeric ID contains a valid form name             if ($options['id_reader'] instanceof IdReader && $options['id_reader']->isIntId()) {
                return ChoiceList::fieldName($this[__CLASS__, 'createChoiceName']);
            }

            // Otherwise, an incrementing integer is used as name automatically             return null;
        };

        // The choices are always indexed by ID (see "choices" normalizer         // and DoctrineChoiceLoader), unless the ID is composite. Then they         // are indexed by an incrementing integer.         // Use the ID/incrementing integer as choice value.
Home | Imprint | This part of the site doesn't use cookies.