It extends JPlugin. It seems that $table is just a variable of function. Here is the copymuduleassignment.php
<?php
/**
* @package Joomla.Plugin
* @subpackage Content.CopyAssignments
*
* @copyright Copyright (C) 2016 Aleksandar Jovanović (
him...@alexxandar.me). All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Copy Module Assignments Plugin
*/
class PlgContentCopymoduleassignments extends JPlugin
{
/**
* Database object
*
* @var JDatabaseDriver
* @since 3.3
*/
protected $db;
/**
* Plugin that copies module assignments from original to new menu item when using "Save as copy"
*
* @param string $context The context of the content being passed to the plugin.
* @param mixed &$row An object with a "text" property
* @param mixed $params Additional parameters. See {@see PlgContentContent()}.
* @param integer $page Optional page number. Unused. Defaults to zero.
*
* @return boolean True on success.
*/
public function onContentAfterSave( $context, &$table, $isNew )
{
// Return if invalid context
if ( $context != 'com_menus.item' )
return true;
// Return if items is not a product of "Save as copy"
if ( !( $table->get( '_location_id' ) > 1 && $isNew == false ) )
return true;