PHP code example of alpineio / atlas

1. Go to this page and download the library: Download alpineio/atlas library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alpineio / atlas example snippets


namespace MyCRM;

use AlpineIO\Atlas\Contracts\SelfRegistration;
use AlpineIO\Atlas\Post;
use AlpineIO\Atlas\Traits\PiklistPostRegistration;
use AlpineIO\Atlas\Types\PostRelationFieldType;

/**
 * Class Contact
 * @package MyCRM
 * @property string $title Job Title
 * @property string $street_address Street Address
 * @property string $city City
 * @property string $state State
 * @property string $website Website URL
 * @property string $facebook Facebook URL
 * @property string $yelp Yelp URL
 */
class Contact extends Post implements SelfRegistration {

	use PiklistPostRegistration;

}

  use MyCRM\Contact;

  $contact = new Contact(get_the_ID());


lpineIO\Atlas\Services\RegisterWordPressTypes;
use MyCRM\Contact;
use MyCRM\Team;

// Create a filter to return the classes
function my_crm_object_types( $types = [] ) {
	return array_merge( $types, [
		Contact::class,
		Team::class
	] );
}
add_filter('alpineio_atlas_models', 'my_crm_object_types');

RegisterWordPressTypes::register();