yiisoft / yiisoft/active-record
Map table columns to model properties
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 119
- Forks
- 38
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 1
Description
Proposed new feature or change
CREATE TABLE "user" (
"id" INT PRIMARY KEY,
"first_name" VARCHAR NOT NULL,
"last_name" VARCHAR NOT NULL,
"created_at" INT NOT NULL,
);
final class User extends ActiveRecord
{
public int $id;
#[Column('first_name')]
public string $firstName;
#[Column('last_name')]
public string $lastName;
#[Column('created_at')]
public string $createdAt;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ActiveRecord model and the Column attributes shown in the issue, then trace how table columns and model properties are currently associated. Implement the proposed mapping for id, first_name, last_name, and created_at, and verify that the User example reads and writes the corresponding columns correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100