Welcome Guest, Not a member yet? Register   Sign In
Help on entities
#1

Hello, everyone.

I am looking to use the entities in CI4. But I have some doubts.

I would add the entities and pass the Model to Repositorie as recommended in the documentation.

For example, I would like to type information directly into Entity, is that possible?

PHP Code:
<?php namespace App\Entities;

use 
CodeIgniter\Entity;

class 
User extends Entity
{
    protected $attributes = [
        'id' => null,
        'name' => null,        // Represents a username
        'email' => null,
        'password' => null,
        'created_at' => null,
        'updated_at' => null,
    ];


Is it only necessary to implement this above to use $user->name for example to help intellisense?

I checked Lonnie's myth-auth user, but it still wasn't clear to me.

I'm a little lost in implementing the entities. If anyone has any interesting material, they would be grateful.
Reply


Messages In This Thread
Help on entities - by MatheusCastro - 06-24-2020, 05:37 AM
RE: Help on entities - by Leo - 06-25-2020, 02:41 PM
RE: Help on entities - by vinezof2 - 06-25-2020, 03:14 PM
RE: Help on entities - by Leo - 06-25-2020, 10:04 PM
RE: Help on entities - by vinezof2 - 06-26-2020, 04:25 AM
RE: Help on entities - by Leo - 06-26-2020, 07:02 AM
RE: Help on entities - by vinezof2 - 06-26-2020, 10:24 AM
RE: Help on entities - by Leo - 06-26-2020, 01:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB