ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
sape_project_api_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| get_projects ()
| get_placements_new_prices ($ProjectId=0, $Days=30)
| placements_delete ($LinkIds)
| get_urls ($ProjectId)
| get_url_links ($URLId)
| url_add ($ProjectId, $URL, $Name)
| url_update ($URLId, $Params)
| url_delete ($URLId)
| get_url_anchors ($URLId)
| url_anchors_delete ($URLId, $AnchorIds)
| url_set_autoseo ($URLId, $Auto=true, $RequireConfirm=false)
| filter_auto_create ($FilterId, $URLId, $Quant, $Price, $DailyQuota=0)
| filter_auto_update ($FilterAutoId, $Quant, $Price, $DailyQuota=0)
| filter_auto_delete ($FilterAutoId, $Quant, $Price, $DailyQuota=0)
| get_filters_auto ($URLId)

## Data Fields
| $SapeCommonApi = false
| $SapeUtilities = false
| $Security = false

## Detailed Description

Class provides integration with the Sape system.

Author
  Dodonov A.A.

Definition at line 26 of file sape_project_api.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 56 of file sape_project_api.php.

{
try
{
$this->SapeCommonApi = get_package( 'sape::sape_common_api' , 'last' , __FILE__ );
$this->SapeUtilities = get_package( 'sape::sape_utilities' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

filter_auto_create | ( |  | $FilterId,
|  |  | $URLId,
|  |  | $Quant,
|  |  | $Price,
|  |  | $DailyQuota = `0`
| ) |  |

Function sets filter.

Parameters

  $FilterId | - Filter's id.
  $URLId | - URL's id.
  $Quant | - Links quantity.
  $Price | - Sum.
  $DailyQuota | - Daily quota.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 666 of file sape_project_api.php.

{
try
{
$Parameters = $this->filter_auto_create_parameters(
$FilterId , $URLId , $Quant , $Price , $DailyQuota
);
$this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.filter_auto_create' , $Parameters , 'Can\'t create auto filter'
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

filter_auto_delete | ( |  | $FilterAutoId,
|  |  | $Quant,
|  |  | $Price,
|  |  | $DailyQuota = `0`
| ) |  |

Function deletes auto-filter.

Parameters

  $FilterAutoId | - Auto-filter's id.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 805 of file sape_project_api.php.

{
try
{
$FilterAutoId = $this->Security->get( $FilterAutoId , 'integer' );
$Parameters = array( new xmlrpcval( $FilterAutoId , 'int' ) );
$this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.filter_auto_delete' , $Parameters , 'Can\'t delete auto filter'
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

filter_auto_update | ( |  | $FilterAutoId,
|  |  | $Quant,
|  |  | $Price,
|  |  | $DailyQuota = `0`
| ) |  |

Function updates auto-filter.

Parameters

  $FilterAutoId | - Auto-filter's id.
  $Quant | - Links quantity.
  $Price | - Sum.
  $DailyQuota | - Daily quota.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 771 of file sape_project_api.php.

{
try
{
$Parameters = $this->filter_auto_update_parameters( $FilterAutoId , $Quant , $Price , $DailyQuota );
$this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.filter_auto_update' , $Parameters , 'Can\'t update auto filter'
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_filters_auto | ( |  | $URLId | ) |

Function deletes auto-filter.

Parameters

  $FilterAutoId | - Auto-filter's id.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 841 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$Parameters = array( new xmlrpcval( $URLId , 'int' ) , new xmlrpcval( true , 'boolean' ) );
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.get_filters_auto' , $Parameters , 'Can\'t get auto filters'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_placements_new_prices | ( |  | $ProjectId = `0`,
|  |  | $Days = `30`
| ) |  |

Function returns a list of URLs with changed prices.

Parameters

  $ProjectId | - Project's id.
  $Days | - Count of days.

Returns
  A list of URLs.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 130 of file sape_project_api.php.

{
try
{
$ProjectId = $this->Security->get( $ProjectId , 'integer' );
$Days = $this->Security->get( $Days , 'integer' );
$Parameters = array( new xmlrpcval( $ProjectId , 'int' ) , new xmlrpcval( $Days , 'string' ) );
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.get_placements_new_prices' ,
$Parameters , 'Can\'t get placements'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_projects | ( |  | ) |

Function returns a list of packages.

Returns
  A list of projects.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 88 of file sape_project_api.php.

{
try
{
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.get_projects' , array() , 'Can\'t get projects'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_url_anchors | ( |  | $URLId | ) |

Function returns URL's anchors.

Parameters

  $URLId | - URL's id.

Returns
  A list of anchors.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 449 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$Parameters = array( new xmlrpcval( $URLId , 'int' ) );
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.get_url_anchors' , $Parameters , 'Can\'t get url anchors'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_url_links | ( |  | $URLId | ) |

Function returns URLs for the specified project.

Parameters

  $URLId | - URL's id.

Returns
  A list of links.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 266 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$Parameters = array(
new xmlrpcval( $URLId , 'int' ) , new xmlrpcval( '' , 'string' ) ,
new xmlrpcval( '' , 'string' ) , new xmlrpcval( '' , 'string' ) , new xmlrpcval( 0 , 'int' )
);
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.get_url_links' , $Parameters , 'Can\'t get links'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_urls | ( |  | $ProjectId | ) |

Function returns URLs for the specified project.

Parameters

  $ProjectId | - Project's id.

Returns
  A list of projects.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 224 of file sape_project_api.php.

{
try
{
$ProjectId = $this->Security->get( $ProjectId , 'integer' );
$Parameters = array( new xmlrpcval( $ProjectId , 'int' ) , new xmlrpcval( false , 'boolean' ) );
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.get_urls' , $Parameters , 'Can\'t get URLs'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

placements_delete | ( |  | $LinkIds | ) |

Function delete links.

Parameters

  $LinkIds | - Ids of the deleting links.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 170 of file sape_project_api.php.

{
try
{
if( isset( $LinkIds[ 0 ] ) === false )
{
return( array() );
}
$LinkIds = $this->Security->get( $LinkIds , 'integer' );
$LinksToDelete = array();
foreach( $LinkIds as $i => $id )
{
$LinksToDelete [] = new xmlrpcval( $id , 'string' );
}
$Parameters = array( new xmlrpcval( $LinksToDelete , 'array' ) );
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.placements_delete' , $Parameters , 'Can\'t delete links'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

url_add | ( |  | $ProjectId,
|  |  | $URL,
|  |  | $Name
| ) |  |

Function adds URL.

Parameters

  $ProjectId | - Project's id.
  $URL | - URL.
  $Name | - URL's name.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 315 of file sape_project_api.php.

{
try
{
$ProjectId = $this->Security->get( $ProjectId , 'integer' );
$URL = $this->Security->get( $URL , 'string' );
$Name = $this->Security->get( $Name , 'string' );
$Parameters = array(
new xmlrpcval( $ProjectId , 'int' ) , new xmlrpcval( $URL , 'string' ) ,
new xmlrpcval( $Name , 'string' )
);
$this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.url_add' , $Parameters , 'Can\'t add URL'
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

url_anchors_delete | ( |  | $URLId,
|  |  | $AnchorIds
| ) |  |

Function deletes URL's anchors.

Parameters

  $URLId | - URL's id.
  $AnchorIds | - Anchor ids.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 491 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$AnchorIds = $this->Security->get( $URLId , 'AnchorIds' );
$Anchors = array();
foreach( $AnchorIds as $i => $Anchor )
{
$Anchors [] = new xmlrpcval( $Anchor , 'int' );
}
$Parameters = array( new xmlrpcval( $URLId , 'int' ) , new xmlrpcval( $Anchors , 'array' ) );
$this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.url_anchors_delete' , $Parameters , 'Can\'t delete anchors'
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

url_delete | ( |  | $URLId | ) |

Function deletes URL.

Parameters

  $URLId | - URL's id.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 409 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$Parameters = array( new xmlrpcval( $URLId , 'int' ) );
$this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.url_delete' , $Parameters , 'Can\'t delete URL'
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

url_set_autoseo | ( |  | $URLId,
|  |  | $Auto = `true`,
|  |  | $RequireConfirm = `false`
| ) |  |

Function sets moderation mode.

Parameters

  $URLId | - URL's id.
  $Auto | - Auto moderation.
  $RequireConfirm | - Confirm links.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 544 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$Auto = $Auto ? true : false;
$RequireConfirm = $RequireConfirm ? true : false;
$Parameters = array(
new xmlrpcval( $URLId , 'int' ) , new xmlrpcval( $Auto , 'boolean' ) ,
new xmlrpcval( $RequireConfirm , 'boolean' )
);
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.url_set_autoseo' , $Parameters , 'Can\'t set auto mode'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

url_update | ( |  | $URLId,
|  |  | $Params
| ) |  |

Function updates URL.

Parameters

  $URLId | - URL.
  $Params | - Update parameters.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 362 of file sape_project_api.php.

{
try
{
$URLId = $this->Security->get( $URLId , 'integer' );
$Params = $this->Security->get( $Params , 'string' );
$ParamsHash = array();
foreach( $Params as $Key => $Value )
{
$ParamsHash[ $Key ] = new xmlrpcval( $Value , 'string' );
}
$Parameters = array( new xmlrpcval( $URLId , 'int' ) , new xmlrpcval( $ParamsHash , 'array' ) );
$Response = $this->SapeUtilities->call_method(
$this->SapeCommonApi->Client , 'sape.url_update' , $Parameters , 'Can\'t update URL'
);
return( php_xmlrpc_decode( $Response->value() ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$SapeCommonApi = false

Cached packages.

Author
  Dodonov A.A.

Definition at line 38 of file sape_project_api.php.

$SapeUtilities = false

Definition at line 39 of file sape_project_api.php.

$Security = false

Definition at line 40 of file sape_project_api.php.

The documentation for this class was generated from the following file:

- packages/sape/packages/sape_project_api/sape_project_api.php