src/aws/ImageSelectCollectionActiveWindow.php
public function callbackAddImageToIndex($fileId)
    {
        $image = Yii::$app->storage->addImage($fileId);
        
        if (!$image) {
            return $this->sendError("Unable to create image from given file Id.");
        }

        Yii::$app->db->createCommand()->insert($this->refTableName, $this->prepareInsertFields([
            $this->imageIdFieldName => (int) $image->id,
            $this->refFieldName => (int) $this->itemId,
        ]))->execute();

        return $this->getImageArray($image->id);
    }
public function callbackAddImageToIndex($fileId)
    {
        $image = Yii::$app->storage->addImage($fileId);
        
        if (!$image) {
            return $this->sendError("Unable to create image from given file Id.");
        }

        Yii::$app->db->createCommand()->insert($this->refTableName, $this->prepareInsertFields([
            $this->imageIdFieldName => (int) $image->id,
            $this->refFieldName => (int) $this->itemId,
        ]))->execute();

        return $this->getImageArray($image->id);
    }
public function callbackAddImageToIndex ( $ fileId ) { $ image = Yii :: $ app -> storage -> addImage ( $ fileId ) ; if ( ! $ image ) { return $ this -> sendError ( "Unable to create image from given file Id." ) ; } Yii :: $ app -> db -> createCommand ( ) -> insert ( $ this -> refTableName , $ this -> prepareInsertFields ( [ $ this -> imageIdFieldName => ( int ) $ image -> id , $ this -> refFieldName => ( int ) $ this -> itemId , ] ) ) -> execute ( ) ; return $ this -> getImageArray ( $ image -> id ) ; }
Generate an image for a given file id and store the image in the index.

@param integer $fileId The file id to create the image from and store the image id in the database.
@return array
Generate an image for a given file id and store the image in the index .