I
I
Igor Braduloff2018-08-21 10:36:16
Yii
Igor Braduloff, 2018-08-21 10:36:16

Error Getting write-only property: app\models\RecipientPortalUser::password?

Good afternoon! Tell me how to overcome the error...
Invalid Call - yii\base\InvalidCallException Getting write-only property: app\models\RecipientPortalUser::password
// RecipientPortal_User table model in MSSQL

<?php
namespace app\models;
use yii\db\ActiveRecord;
use yii\web\IdentityInterface;
class RecipientPortalUser extends ActiveRecord implements IdentityInterface
{

    public static function tableName()
    {
        return 'dbo.RecipientPortal_User'; // {{%RecipientPortal_User}}
    }
    public function setPassword($password)
    {
        $this->password = sha1($password);

    }
    public function validatePass($password)
    {
        return $this->password === sha1($password);
    }
    //=============================================
    public static function findIdentity($id)
    {
        return self::findOne($id);
    }
    public function getId()
    {
        return $this->id;
    }
    public static function findIdentityByAccessToken($token, $type = null)
    {
    }
    public function getAuthKey()
    {
    }
    public function validateAuthKey($authKey)
    {
    }
    public function getAllRecords()
    {
        $findAll =  RecipientPortalUser::find()->all();
        return $findAll;
    }
    /*public function callProcedure($param1, $param2, $param3)
    {
        $resultProc = \Yii::$app->db->createCommand("CALL sp_GetRecipientPayments(:paramName1, :paramName2, :paramName3)")
            ->bindValue(':paramName1' , $param1)
            ->bindValue(':paramName2', $param2)
            ->bindValue(':paramName3', $param3)
            ->execute();
        return $resultProc;

    }*/

}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-08-21
@webinar

add to the model
But honestly I'm confused by what you came up with. Apparently it is yii. She has all this out of the box, why are you inventing a bicycle?
Pay attention to:
https://www.yiiframework.com/doc/guide/2.0/en/secu...
https://www.yiiframework.com/doc/api/2.0/yii-base-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question