Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on a property that does not exist #1100

Open
flug opened this issue Dec 10, 2021 · 1 comment
Open

Error on a property that does not exist #1100

flug opened this issue Dec 10, 2021 · 1 comment

Comments

@flug
Copy link

flug commented Dec 10, 2021

I have a bound problem on a field that does not map but does not exist. It detects a "uid" but it is not present in the model. Any ideas where this could come from?

Yaml fixture :

App\Fixture\Model\ExamLocalData:
    exam-local-1:
        examDbId: <examDbId('1.2.840.113619.2.65.5.52240041440.54937.15115710984.6')>
        hostDbId: <hostDbId('WS-NEWYORK')>
        examLocalSize: 256
        examLocalNumSeries: 1
        examLocalLastModified: <dateTimeImmutableFromFormat('1970-01-01 00:00:00', 'Y-m-d H:i:s')>
        examLocalDateCreated: <dateTimeImmutableFromFormat('1970-01-01 00:00:00', 'Y-m-d H:i:s')>
        examLocalNumFiles: 10
        examLocalLastIndexed: <dateTimeImmutableFromFormat('1986-01-01 00:00:00', 'Y-m-d H:i:s')>
        examLocalLastQueried: <dateTimeImmutableFromFormat('1988-01-01 00:00:00', 'Y-m-d H:i:s')>
        examLocalCurrent: 0

PHP model :

class ExamLocalData
{
    private ?int $examDbId = null;
    private ?int $hostDbId = null;
    private ?int $examLocalSize = null;
    private ?int $examLocalNumSeries = null;
    private ?\DateTimeInterface $examLocalLastModified = null;
    private ?\DateTimeInterface $examLocalDateCreated = null;
    private ?int $examLocalNumFiles = null;
    private ?\DateTimeInterface $examLocalLastIndexed = null;
    private ?\DateTimeInterface $examLocalLastQueried = null;
    private ?bool $examLocalCurrent = null;

    public function setExamDbId(int $id)
    {
        $this->examDbId = $id;
    }

    public function getExamDbId(): int
    {
        return $this->examDbId; $objectSet = $this->aliceFilesLoader->loadFiles(
            [sprintf('%s/alice/%s', $this->fixtureDirectory, $fixtureFilename)]
        );

        $localDataCount = 0;
        foreach ($objectSet->getObjects() as $data) {
            $this->insertExamLocalData($data);
            ++$localDataCount;
        }
    }

    public function setHostDbId(int $id)
    {
        $this->hostDbId = $id;
    }

    public function getHostDbId(): int
    {
        return $this->hostDbId;
    }

    public function setExamLocalSize(int $size)
    {
        $this->examLocalSize = $size;
    }

    public function getExamLocalSize(): int
    {
        return $this->examLocalSize;
    }

    public function setExamLocalNumSeries(int $num)
    {
        $this->examLocalNumSeries = $num;
    }

    public function getExamLocalNumSeries(): int
    {
        return $this->examLocalNumSeries;
    }

    public function setExamLocalNumFiles(int $num)
    {
        $this->examLocalNumFiles = $num;
    }

    public function getExamLocalNumFiles(): int
    {
        return $this->examLocalNumFiles;
    }

    public function setExamLocalLastModified(\DateTimeInterface $date)
    {
        $this->examLocalLastModified = $date;
    }

    public function getExamLocalLastModified(): \DateTimeInterface
    {
        return $this->examLocalLastModified;
    }

    public function setExamLocalDateCreated(\DateTimeInterface $date)
    {
        $this->examLocalDateCreated = $date;
    }

    public function getExamLocalDateCreated(): \DateTimeInterface
    {
        return $this->examLocalDateCreated;
    }

    public function setExamLocalLastIndexed(\DateTimeInterface $date)
    {
        $this->examLocalLastIndexed = $date;
    }

    public function getExamLocalLastIndexed(): \DateTimeInterface
    {
        return $this->examLocalLastIndexed;
    }

    public function setExamLocalLastQueried(\DateTimeInterface $date)
    {
        $this->examLocalLastQueried = $date;
    }

    public function getExamLocalLastQueried(): \DateTimeInterface
    {
        return $this->examLocalLastQueried;
    }

    public function setExamLocalCurrent(bool $current)
    {
        $this->examLocalCurrent = $current;
    }

    public function getExamLocalCurrent(): bool
    {
        return $this->examLocalCurrent;
    }
}


Data loader :

 $objectSet = $this->aliceFilesLoader->loadFiles(
            [sprintf('%s/alice/%s', $this->fixtureDirectory, $fixtureFilename)]
        );

        $localDataCount = 0;
        foreach ($objectSet->getObjects() as $data) {
            $this->insertExamLocalData($data);
            ++$localDataCount;
        }

Term error :

In SimpleObjectGenerator.php line 112:
                                                                                                                                                                      
  An error occurred while generating the fixture "exam-local-1" (App\Fixture\Model\ExamLocalData): Named parameter "uid" does not have a bound value.  
                                                                                                                                                                      

In MissingNamedParameter.php line 17:
                                                      
  Named parameter "uid" does not have a bound value.  
@theofidry
Copy link
Member

I cannot tell. I can only recommend to put a breakpoint and see where this is coming from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants