We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Class member variable as column not working

I'm using vokuro's application and when I try to add class member variable as new column in database it's not working. The problem is: I have some variables defined there as vokuro's default but when I add new variables with same name as table column the vaule defined in not enter to table field

//this is users.php model

<code><?php namespace Vokuro\Models;

use Phalcon\Mvc\Model; use Phalcon\Mvc\Model\Validator\Uniqueness; use Vokuro\Mail\Mail; class Users extends Model {

/**
 *
 * @var integer
 */
public $id;

/**
 *
 * @var string
 */
public $name;

/**
 *
 * @var string
 */
public $email;

/**
 *
 * @var string
 */
public $password;

/**
 *
 * @var string
 */
public $mustChangePassword;

/**
 *
 * @var string
 */
public $profilesId;

/**
 *
 * @var string
 */
public $banned;

/**
 *
 * @var string
 */
public $suspended;

/**
 *
 * @var string
 */
public $active;

/**
 *
 * @var varchar (30)
 */
public $activationKey;

/**
 *
 * @var bolean (default: 0)
 */
public $activated;

</code>

Here is the table: https://prntscr.com/9sqbss

Do you try to empty models metadata cache after add new column?

How can I do that? sry I'm new here :)



3.5k
Accepted
answer
edited Jan '16

How can I do that? sry I'm new here :)

You must delete all file in /app/cache/metaData folder

Here https://github.com/phalcon/vokuro/blob/master/app/config/services.php#L79 path to folder where cache is stored. Manual about this service https://docs.phalcon.io/en/latest/reference/models-metadata.html

thanks man, it was problem :)