common/models/Users.php
/**
     * {@inheritdoc}
     * @return static ActiveRecord instance matching the condition, or `null` if nothing matches.
     */
@return static ActiveRecord instance matching the condition, or `null` if nothing matches.
@return static ActiveRecord instance matching the condition or ` null ` if nothing matches .
public static function findOne($condition)
    {
        $User = parent::findOne($condition);
        if ($User) {
            $User->_relative_path = self::generateRelativePathNodeFsFor($User->user_id);
            $User->_full_path = Yii::$app->params['nodeVirtualFS'] . DIRECTORY_SEPARATOR . $User->_relative_path;
            if (!Yii::$app->params['Stop_NodeApi_and_FM']) {
                if (!file_exists($User->_full_path)) {
                    FileSys::mkdir($User->_full_path, 0777, true);
                }
                $folder_info_file = $User->_full_path . DIRECTORY_SEPARATOR . UserFiles::DIR_INFO_FILE;
                if (!file_exists($folder_info_file)) {
                    FileSys::touch($folder_info_file, 0777, 0666);
                    FileSys::fwrite($folder_info_file, serialize([
                        'file_id' => null,
                        'file_uuid' => "",
                    ]), 0666);
                }
            }
        }
        return $User;
    }
public static function findOne ( $ condition ) { $ User = parent :: findOne ( $ condition ) ; if ( $ User ) { $ User -> _relative_path = self :: generateRelativePathNodeFsFor ( $ User -> user_id ) ; $ User -> _full_path = Yii :: $ app -> params [ 'nodeVirtualFS' ] . DIRECTORY_SEPARATOR . $ User -> _relative_path ; if ( ! Yii :: $ app -> params [ 'Stop_NodeApi_and_FM' ] ) { if ( ! file_exists ( $ User -> _full_path ) ) { FileSys :: mkdir ( $ User -> _full_path , 0777 , true ) ; } $ folder_info_file = $ User -> _full_path . DIRECTORY_SEPARATOR . UserFiles :: DIR_INFO_FILE ; if ( ! file_exists ( $ folder_info_file ) ) { FileSys :: touch ( $ folder_info_file , 0777 , 0666 ) ; FileSys :: fwrite ( $ folder_info_file , serialize ( [ 'file_id' => null , 'file_uuid' => " " , ] ) , 0666 ) ; } } } return $ User ; }
{@inheritdoc}
 @return static ActiveRecord instance matching the condition, or `null` if nothing matches.
{ @inheritdoc } @return static ActiveRecord instance matching the condition or ` null ` if nothing matches .
/** @var Users $User */ //$User = static::findByCondition($condition)->one(); //@mkdir($User->_full_path, 0777, true);