Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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: http://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.3k
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.phalconphp.com/en/latest/reference/models-metadata.html

thanks man, it was problem :)